use of org.eclipse.jface.text.source.ISharedTextColors in project eclipse.platform.text by eclipse.
the class LineNumberColumn method updateForegroundColor.
private void updateForegroundColor(IPreferenceStore store, IVerticalRulerColumn column) {
RGB rgb = getColorFromStore(store, FG_COLOR_KEY);
if (rgb == null)
rgb = new RGB(0, 0, 0);
ISharedTextColors sharedColors = getSharedColors();
if (column instanceof LineNumberRulerColumn)
((LineNumberRulerColumn) column).setForeground(sharedColors.getColor(rgb));
}
use of org.eclipse.jface.text.source.ISharedTextColors in project egit by eclipse.
the class SpellcheckableMessageArea method configureAnnotationPreferences.
private SourceViewerDecorationSupport configureAnnotationPreferences() {
ISharedTextColors textColors = EditorsUI.getSharedTextColors();
IAnnotationAccess annotationAccess = new DefaultMarkerAnnotationAccess();
final SourceViewerDecorationSupport support = new SourceViewerDecorationSupport(sourceViewer, null, annotationAccess, textColors);
List annotationPreferences = new MarkerAnnotationPreferences().getAnnotationPreferences();
Iterator e = annotationPreferences.iterator();
while (e.hasNext()) support.setAnnotationPreference((AnnotationPreference) e.next());
support.install(EditorsUI.getPreferenceStore());
return support;
}
use of org.eclipse.jface.text.source.ISharedTextColors in project dbeaver by serge-rider.
the class TabbedFolderList method initColours.
/**
* Initialize the colours used in the list.
*/
private void initColours() {
Display display = Display.getCurrent();
ISharedTextColors sharedColors = UIUtils.getSharedTextColors();
listBackground = UIStyles.getDefaultTextBackground();
Color widgetBackground;
if (UIStyles.isDarkTheme()) {
// By some reason E4 sets white background in dark theme.
widgetBackground = UIStyles.getDefaultTextBackground();
super.setBackground(widgetBackground);
topNavigationElement.setBackground(widgetBackground);
bottomNavigationElement.setBackground(widgetBackground);
} else {
widgetBackground = getBackground();
}
widgetForeground = UIStyles.getDefaultTextForeground();
widgetDarkShadow = display.getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW);
widgetNormalShadow = display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
RGB white = display.getSystemColor(SWT.COLOR_WHITE).getRGB();
RGB black = display.getSystemColor(SWT.COLOR_BLACK).getRGB();
/*
defaultGradientStart = sharedColors.getColor(
UIUtils.blend(infoBackground,
UIUtils.blend(white, widgetNormalShadow.getRGB(), 20), 60)
);
defaultGradientEnd = sharedColors.getColor(UIUtils.blend(infoBackground, widgetNormalShadow.getRGB(), 40));
*/
if (widgetNormalShadow.hashCode() < widgetBackground.hashCode()) {
// Foreground darker than background - make element background darker
elementBackground = sharedColors.getColor(UIUtils.blend(black, widgetBackground.getRGB(), 15));
} else {
// Make element background lighter
elementBackground = sharedColors.getColor(UIUtils.blend(white, widgetBackground.getRGB(), 15));
}
navigationElementShadowStroke = sharedColors.getColor(UIUtils.blend(white, widgetNormalShadow.getRGB(), 55));
bottomNavigationElementShadowStroke1 = sharedColors.getColor(UIUtils.blend(black, widgetBackground.getRGB(), 10));
bottomNavigationElementShadowStroke2 = sharedColors.getColor(UIUtils.blend(black, widgetBackground.getRGB(), 5));
/*
* gradient in the hover tab: start colour WIDGET_BACKGROUND 100% +
* white 20% end colour WIDGET_BACKGROUND 100% + WIDGET_NORMAL_SHADOW
* 10%
*/
hoverGradientStart = sharedColors.getColor(UIUtils.blend(white, widgetBackground.getRGB(), 20));
hoverGradientEnd = sharedColors.getColor(UIUtils.blend(widgetNormalShadow.getRGB(), widgetBackground.getRGB(), 10));
indentedDefaultBackground = sharedColors.getColor(UIUtils.blend(white, widgetBackground.getRGB(), 10));
indentedHoverBackground = sharedColors.getColor(UIUtils.blend(white, widgetBackground.getRGB(), 75));
}
use of org.eclipse.jface.text.source.ISharedTextColors in project dbeaver by dbeaver.
the class TabbedFolderList method initColours.
/**
* Initialize the colours used in the list.
*/
private void initColours() {
Display display = Display.getCurrent();
ISharedTextColors sharedColors = UIUtils.getSharedTextColors();
listBackground = UIStyles.getDefaultTextBackground();
Color widgetBackground;
if (UIStyles.isDarkTheme()) {
// By some reason E4 sets white background in dark theme.
widgetBackground = UIStyles.getDefaultTextBackground();
super.setBackground(widgetBackground);
topNavigationElement.setBackground(widgetBackground);
bottomNavigationElement.setBackground(widgetBackground);
} else {
widgetBackground = getBackground();
}
widgetForeground = UIStyles.getDefaultTextForeground();
widgetDarkShadow = display.getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW);
widgetNormalShadow = display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
RGB white = display.getSystemColor(SWT.COLOR_WHITE).getRGB();
RGB black = display.getSystemColor(SWT.COLOR_BLACK).getRGB();
/*
defaultGradientStart = sharedColors.getColor(
UIUtils.blend(infoBackground,
UIUtils.blend(white, widgetNormalShadow.getRGB(), 20), 60)
);
defaultGradientEnd = sharedColors.getColor(UIUtils.blend(infoBackground, widgetNormalShadow.getRGB(), 40));
*/
if (widgetNormalShadow.hashCode() < widgetBackground.hashCode()) {
// Foreground darker than background - make element background darker
elementBackground = sharedColors.getColor(UIUtils.blend(black, widgetBackground.getRGB(), 15));
} else {
// Make element background lighter
elementBackground = sharedColors.getColor(UIUtils.blend(white, widgetBackground.getRGB(), 15));
}
navigationElementShadowStroke = sharedColors.getColor(UIUtils.blend(white, widgetNormalShadow.getRGB(), 55));
bottomNavigationElementShadowStroke1 = sharedColors.getColor(UIUtils.blend(black, widgetBackground.getRGB(), 10));
bottomNavigationElementShadowStroke2 = sharedColors.getColor(UIUtils.blend(black, widgetBackground.getRGB(), 5));
/*
* gradient in the hover tab: start colour WIDGET_BACKGROUND 100% +
* white 20% end colour WIDGET_BACKGROUND 100% + WIDGET_NORMAL_SHADOW
* 10%
*/
hoverGradientStart = sharedColors.getColor(UIUtils.blend(white, widgetBackground.getRGB(), 20));
hoverGradientEnd = sharedColors.getColor(UIUtils.blend(widgetNormalShadow.getRGB(), widgetBackground.getRGB(), 10));
indentedDefaultBackground = sharedColors.getColor(UIUtils.blend(white, widgetBackground.getRGB(), 10));
indentedHoverBackground = sharedColors.getColor(UIUtils.blend(white, widgetBackground.getRGB(), 75));
}
use of org.eclipse.jface.text.source.ISharedTextColors in project tdi-studio-se by Talend.
the class TalendJavaSourceViewer method initializeViewer.
private static ReconcilerViewer initializeViewer(Composite composite, int styles, boolean checkCode, IDocument document, int visibleOffset) {
IAnnotationAccess annotationAccess = new DefaultMarkerAnnotationAccess();
ISharedTextColors sharedColors = JavaPlugin.getDefault().getJavaTextTools().getColorManager();
IOverviewRuler overviewRuler = null;
IVerticalRuler verticalRuler = null;
if (checkCode) {
overviewRuler = new OverviewRuler(annotationAccess, 12, sharedColors);
Iterator e = EditorsPlugin.getDefault().getMarkerAnnotationPreferences().getAnnotationPreferences().iterator();
while (e.hasNext()) {
AnnotationPreference preference = (AnnotationPreference) e.next();
if (preference.contributesToHeader()) {
overviewRuler.addHeaderAnnotationType(preference.getAnnotationType());
}
}
}
verticalRuler = new CompositeRuler(12);
ReconcilerViewer viewer = new TalendJavaSourceViewer(composite, verticalRuler, overviewRuler, checkCode, styles, annotationAccess, sharedColors, checkCode, document);
if (visibleOffset != -1) {
viewer.setVisibleRegion(visibleOffset, 0);
}
return viewer;
}
Aggregations