use of org.eclipse.swt.graphics.TextStyle in project KaiZen-OpenAPI-Editor by RepreZen.
the class JsonContentAssistProcessor method getTemplateLabel.
protected StyledString getTemplateLabel(Template template) {
Styler nameStyle = new StyledString.Styler() {
@Override
public void applyStyles(TextStyle textStyle) {
textStyle.foreground = new Color(Display.getCurrent(), new RGB(80, 80, 255));
}
};
Styler descriptionStyle = new StyledString.Styler() {
@Override
public void applyStyles(TextStyle textStyle) {
textStyle.foreground = new Color(Display.getCurrent(), new RGB(120, 120, 120));
}
};
return new StyledString(template.getName(), nameStyle).append(": ", descriptionStyle).append(template.getDescription(), descriptionStyle);
}
use of org.eclipse.swt.graphics.TextStyle in project eclipse.platform.text by eclipse.
the class BrowserInformationControl method createTextLayout.
/**
* Creates and initializes the text layout used
* to compute the size hint.
*
* @since 3.2
*/
private void createTextLayout() {
fTextLayout = new TextLayout(fBrowser.getDisplay());
// Initialize fonts
String symbolicFontName = fSymbolicFontName == null ? JFaceResources.DIALOG_FONT : fSymbolicFontName;
Font font = JFaceResources.getFont(symbolicFontName);
fTextLayout.setFont(font);
fTextLayout.setWidth(-1);
font = JFaceResources.getFontRegistry().getBold(symbolicFontName);
fBoldStyle = new TextStyle(font, null, null);
// Compute and set tab width
// $NON-NLS-1$
fTextLayout.setText(" ");
int tabWidth = fTextLayout.getBounds().width;
fTextLayout.setTabs(new int[] { tabWidth });
// $NON-NLS-1$
fTextLayout.setText("");
}
use of org.eclipse.swt.graphics.TextStyle in project yamcs-studio by yamcs.
the class RCPSSTextLayout method addStyle.
/**
* {@inheritDoc}
*/
@Override
public void addStyle(Font font, Color color, int x, int y) {
TextStyle textStyle = new TextStyle(font, color, null);
textLayout.setStyle(textStyle, x, y);
}
use of org.eclipse.swt.graphics.TextStyle in project eclipse-integration-commons by spring-projects.
the class Stylers method boldColoured.
public Styler boldColoured(int foregroundColour) {
final Color foreGround = getSystemColor(foregroundColour);
return new Styler() {
public void applyStyles(TextStyle textStyle) {
textStyle.font = getBoldFont();
textStyle.foreground = foreGround;
}
};
}
use of org.eclipse.swt.graphics.TextStyle in project jbosstools-openshift by jbosstools.
the class OpenShiftExplorerLabelProvider method getStyledText.
private StyledString getStyledText(NewProjectLinkNode node) {
StyledString value = new StyledString();
value.append(node.toString(), new StyledString.Styler() {
@Override
public void applyStyles(TextStyle textStyle) {
textStyle.underline = true;
textStyle.foreground = Display.getDefault().getSystemColor(SWT.COLOR_BLUE);
}
});
return value;
}
Aggregations