How to change the style of String in SWT? - eclipse

I develop some features based on Eclispe GEF.
I want to create a label with some string.
for example:
new Label("This is a good test stensece")
Now, I want to get these effects "good" is in Bold font, and "test" is in italic.
It looks like can use some HTML way to implement that
So,is there any one knows that?
Thank you very much!

If you don't want to use StyledText, you could create multiple labels based on substrings of the original string, then use
labelName.setFont(Font font);
on each label to create different fonts for each portion.

StyledText! http://www.eclipse.org/articles/StyledText%201/article1.html

Related

Is it possible to have different styles in one element in Jaspersoft?

Let's say I need to print the full name of a person. What I originally did was to separate the first name and last name into two elements and placed them side by side since they needed different styling (this is just an example):
Lastname, Firstname
However, I found out after that I can't actually make their width dynamic because the developers made an effort not to allow it. So now I'm wondering if I can present the name with two different styles inside one element. Is this possible? How would I accomplish that? I hope you can help, thanks!
Okay so apparently you can. All you need to do is setup the markup attribute on the text field.
Refer here for more details: http://jasperreports.sourceforge.net/sample.reference/markup/

Flutter-Conditional formatting based on unique characters within a string. Is it possible?

I am new to flutter and have an application that uses a realtime database composed of long text strings. I am unable to separate the string itself into different sections and am wondering if it would be possible to apply conditional formatting with RichText(). I have seen that package of easy_rich_text and wanted to do something similar, but don't see an option to modify the string after the target text has been identified.
For example, if I had a string with "Apples are /red/ fruit", I could have flutter detect the string within the // and have font color red, while the remainder is black. Is this possible? And if so, How should I go about writing code for this?
Thanks in advance
Using the package flutter_html is probably the easiest way:
Widget widget = Html(data: 'Apples are <span style="color: #ff0000">red</span> fruits');
https://api.flutter.dev/flutter/widgets/RichText-class.html
Try this. It sounds like it should do the trick.
To be clear you need to parse the string yourself and thei render the results into the widget.

Can i add more colors in tx_gridelements

i want to add more backend colors in Typo3 Gridelements.
Under Typo3 -> List -> CE Backend Layout is an Option "Frame" with 4 colors and i want to add more colors.
Is there a way for it?
Best Regards
You probably want to use something like this in your pageTS:
TCEFORM.tx_gridelements_backend_layout{
frame{
addItems{
10 = unicorn-pink
}
}
}
You can change every field from every table with this method.
See https://docs.typo3.org/typo3cms/TSconfigReference/PageTsconfig/TCEform/Index.html for further information about this.
Just adding the value in TCEFORM might not be enough, since you will need to add CSS to get the colors assigned to those new classes.
So you will at least need to have a small extension providing the items, a basic folder structure as in the usual sitepackages and the CSS embedded via ext_tables.php and/or ext_localconf.php

How to prevent writing before prefix in GWT valuebox

I am using GWT ValeBox with GWT Renderer to show amount with $ as prefix.
Now I want not to allow user to type any thing before dollar sign. I tried various GWT event handlers like ValueChangeHandler and some others but unable to achieve goal.
Still struggling for it. If anybody know good solution for it, please share here.
Regards,
The easiest would be to not include the currency as part of the value, but next to the field.
Alternatively, you could replace the value with a numeric-only value on focus, and reformat it as a currency on blur.
Couple of solutions:
Use a label before the valuebox. Label value will be $ and valuebox will contain the numeric value.
You can use empty text in the valuebox. Empty text will specify user to enter $ value.

zend form - Element Label in two line

I am extremely new to Zend Framework, In registration form, i need label text in two line. For Example:- In the case First name, I need to display like below:
First
Name:
How can i implement this? Please anyone help me!!!
By default, input fields labels are being escaped by Zend_View_Helper_FormLabel. However, you can easy switch this off:
$yourTextInputElement->getDecorator('label')->setOption('escape', false);
This way you can use labels as e.g. $yourTextInputElement->setLabel('First <br/> name');.
What about this nifty solution ?
http://jsfiddle.net/J67GD/
The best way is probably to use Description decorator, or subclass one of other standard ZF decorators.
Yanick's CSS solution might be a good choice too, depending what are you trying to do.