use of org.eclipse.jface.viewers.StyledString in project che by eclipse.
the class GetterSetterCompletionProposal method getDisplayName.
private static StyledString getDisplayName(IField field, boolean isGetter) throws JavaModelException {
StyledString buf = new StyledString();
String fieldTypeName = Signature.toString(field.getTypeSignature());
String fieldNameLabel = BasicElementLabels.getJavaElementName(field.getElementName());
if (isGetter) {
buf.append(BasicElementLabels.getJavaElementName(//$NON-NLS-1$
GetterSetterUtil.getGetterName(field, null) + "() : " + fieldTypeName));
//$NON-NLS-1$
buf.append(" - ", StyledString.QUALIFIER_STYLER);
buf.append(Messages.format(JavaTextMessages.GetterSetterCompletionProposal_getter_label, fieldNameLabel), StyledString.QUALIFIER_STYLER);
} else {
buf.append(BasicElementLabels.getJavaElementName(//$NON-NLS-1$
GetterSetterUtil.getSetterName(field, null) + '(' + fieldTypeName + ") : void"));
//$NON-NLS-1$
buf.append(" - ", StyledString.QUALIFIER_STYLER);
buf.append(Messages.format(JavaTextMessages.GetterSetterCompletionProposal_setter_label, fieldNameLabel), StyledString.QUALIFIER_STYLER);
}
return buf;
}
use of org.eclipse.jface.viewers.StyledString in project che by eclipse.
the class Strings method markLTR.
/**
* Adds special marks so that that the given styled string is readable in a BiDi environment.
*
* @param styledString the styled string
* @return the processed styled string
* @since 3.4
*/
public static StyledString markLTR(StyledString styledString) {
if (!USE_TEXT_PROCESSOR)
return styledString;
String inputString = styledString.getString();
String string = TextProcessor.process(inputString);
if (string != inputString)
insertMarks(styledString, inputString, string);
return styledString;
}
use of org.eclipse.jface.viewers.StyledString in project translationstudio8 by heartsome.
the class WorkbenchLabelProvider method getStyledText.
/**
* The default implementation of this returns the styled text label for the given element.
* @param element
* the element to evaluate the styled string for
* @return the styled string.
* @since 3.7
*/
public StyledString getStyledText(Object element) {
IWorkbenchAdapter3 adapter = getAdapter3(element);
if (adapter == null) {
// here.
return new StyledString(getText(element));
}
StyledString styledString = adapter.getStyledText(element);
// Now, re-use any existing decorateText implementation, to decorate
// this styledString.
String decorated = decorateText(styledString.getString(), element);
Styler styler = getDecorationStyle(element);
return StyledCellLabelProvider.styleDecoratedString(decorated, styler, styledString);
}
use of org.eclipse.jface.viewers.StyledString in project ow by vtst.
the class LessLabelProvider method text.
StyledString text(ImportStatement obj) {
StyledString ss = new StyledString("@import ", atKeywordStyler);
ss.append(obj.getUri(), italicStyler);
return ss;
}
use of org.eclipse.jface.viewers.StyledString in project ow by vtst.
the class LessLabelProvider method text.
StyledString text(MediaStatement obj) {
StyledString ss = new StyledString("@media", atKeywordStyler);
EList<MediaQuery> medias = obj.getMedia_queries().getMedia_query();
boolean first = true;
for (MediaQuery mediaQuery : medias) {
if (first)
first = false;
else
ss.append(",");
if (mediaQuery.getKeyword() != null) {
ss.append(" ");
ss.append(mediaQuery.getKeyword());
}
ss.append(" ");
ss.append(mediaQuery.getMedia_type());
}
return ss;
}
Aggregations