/** * Returns the shared color for the given RGB. * * @param rgb the RGB * @return the shared color for the given RGB */ private Color getColor(RGB rgb) { return fSharedTextColors.getColor(rgb); }
/** * Returns the shared color for the given RGB. * * @param rgb the RGB * @return the shared color for the given RGB */ private Color getColor(RGB rgb) { return fSharedTextColors.getColor(rgb); }
/** * Returns the shared color for the given RGB. * * @param rgb the RGB * @return the shared color for the given RGB */ private Color getColor(RGB rgb) { return fSharedTextColors.getColor(rgb); }
/** * Looks up the color for a certain revision. * * @param revision the revision to get the color for * @param focus <code>true</code> if it is the focus revision * @return the color for the revision */ private Color lookupColor(Revision revision, boolean focus) { return fSharedColors.getColor(fColorTool.getColor(revision, focus)); }
/** * Looks up the color for a certain revision. * * @param revision the revision to get the color for * @param focus <code>true</code> if it is the focus revision * @return the color for the revision */ private Color lookupColor(Revision revision, boolean focus) { return fSharedColors.getColor(fColorTool.getColor(revision, focus)); }
private void updateChangedColor(AnnotationPreference pref, IPreferenceStore store, IVerticalRulerColumn column) { if (pref != null && column instanceof IChangeRulerColumn) { RGB rgb= getColorFromAnnotationPreference(store, pref); ((IChangeRulerColumn) column).setChangedColor(getSharedColors().getColor(rgb)); } }
private void updateChangedColor(AnnotationPreference pref, IPreferenceStore store, IVerticalRulerColumn column) { if (pref != null && column instanceof IChangeRulerColumn) { RGB rgb= getColorFromAnnotationPreference(store, pref); ((IChangeRulerColumn) column).setChangedColor(getSharedColors().getColor(rgb)); } }
private void updateDeletedColor(AnnotationPreference pref, IPreferenceStore store, IVerticalRulerColumn column) { if (pref != null && column instanceof IChangeRulerColumn) { RGB rgb= getColorFromAnnotationPreference(store, pref); ((IChangeRulerColumn) column).setDeletedColor(getSharedColors().getColor(rgb)); } }
private void updateAddedColor(AnnotationPreference pref, IPreferenceStore store, IVerticalRulerColumn column) { if (pref != null && column instanceof IChangeRulerColumn) { RGB rgb= getColorFromAnnotationPreference(store, pref); ((IChangeRulerColumn) column).setAddedColor(getSharedColors().getColor(rgb)); } }
private void updateDeletedColor(AnnotationPreference pref, IPreferenceStore store, IVerticalRulerColumn column) { if (pref != null && column instanceof IChangeRulerColumn) { RGB rgb= getColorFromAnnotationPreference(store, pref); ((IChangeRulerColumn) column).setDeletedColor(getSharedColors().getColor(rgb)); } }
private void updateAddedColor(AnnotationPreference pref, IPreferenceStore store, IVerticalRulerColumn column) { if (pref != null && column instanceof IChangeRulerColumn) { RGB rgb= getColorFromAnnotationPreference(store, pref); ((IChangeRulerColumn) column).setAddedColor(getSharedColors().getColor(rgb)); } }
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)); }
private void updateBackgroundColor(IPreferenceStore store, IVerticalRulerColumn column) { // background color: same as editor, or system default RGB rgb; if (store.getBoolean(USE_DEFAULT_BG_KEY)) rgb= null; else rgb= getColorFromStore(store, BG_COLOR_KEY); ISharedTextColors sharedColors= getSharedColors(); if (column instanceof LineNumberRulerColumn) ((LineNumberRulerColumn) column).setBackground(sharedColors.getColor(rgb)); }
private void updateBackgroundColor(IPreferenceStore store, IVerticalRulerColumn column) { // background color: same as editor, or system default RGB rgb; if (store.getBoolean(USE_DEFAULT_BG_KEY)) rgb= null; else rgb= getColorFromStore(store, BG_COLOR_KEY); ISharedTextColors sharedColors= getSharedColors(); if (column instanceof LineNumberRulerColumn) ((LineNumberRulerColumn) column).setBackground(sharedColors.getColor(rgb)); }
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)); }
public Color getBackground(Object element) { String key= ((ListItem) element).highlightKey; if (key != null && fStore.getBoolean(key)) { RGB color= PreferenceConverter.getColor(fStore, ((ListItem)element).colorKey); color= interpolate(color, new RGB(255, 255, 255), 0.6); return EditorsPlugin.getDefault().getSharedTextColors().getColor(color); } return null; }
private void updateLineNumberColumnPresentation(boolean refresh) { if (fLineNumberColumn == null) return; RGB rgb= getColorFromStore(EditorsUI.getPreferenceStore(), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR); if (rgb == null) rgb= new RGB(0, 0, 0); ISharedTextColors sharedColors= getSharedColors(); fLineNumberColumn.setForeground(sharedColors.getColor(rgb)); if (refresh) { fLineNumberColumn.redraw(); } }
private void updateLineNumberColumnPresentation(boolean refresh) { if (fLineNumberColumn == null) return; RGB rgb= getColorFromStore(EditorsUI.getPreferenceStore(), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR); if (rgb == null) rgb= new RGB(0, 0, 0); ISharedTextColors sharedColors= getSharedColors(); fLineNumberColumn.setForeground(sharedColors.getColor(rgb)); if (refresh) { fLineNumberColumn.redraw(); } }
public BndSourceViewerConfiguration(ISharedTextColors colors) { this.colors = colors; T_DEFAULT = new Token(new TextAttribute(colors.getColor(new RGB(0, 0, 0)))); T_MACRO = new Token(new TextAttribute(colors.getColor(new RGB(0, 255, 0)), null, SWT.BOLD)); T_ERROR = new Token(new TextAttribute(colors.getColor(new RGB(255, 0, 0)), null, SWT.BOLD)); T_COMMENT = new Token(new TextAttribute(colors.getColor(new RGB(128, 0, 0)))); T_INSTRUCTION = new Token(new TextAttribute(colors.getColor(new RGB(0, 0, 255)), null, SWT.BOLD)); T_OPTION = new Token(new TextAttribute(colors.getColor(new RGB(0, 0, 255)))); T_DIRECTIVE = new Token(new TextAttribute(colors.getColor(new RGB(60, 60, 255)), null, SWT.BOLD)); T_PROPERTY = new Token(new TextAttribute(colors.getColor(new RGB(60, 60, 255)), null, SWT.BOLD)); T_COMPONENT = new Token(new TextAttribute(colors.getColor(new RGB(60, 60, 255)), null, SWT.BOLD)); }
/** * Returns a color based on the color configured for the given annotation type and the given scale factor. * * @param annotationType the annotation type * @param scale the scale factor * @return the computed color */ private Color getColor(Object annotationType, double scale) { Color base= findColor(annotationType); if (base == null) return null; RGB baseRGB= base.getRGB(); RGB background= fCanvas.getBackground().getRGB(); boolean darkBase= isDark(baseRGB); boolean darkBackground= isDark(background); if (darkBase && darkBackground) background= new RGB(255, 255, 255); else if (!darkBase && !darkBackground) background= new RGB(0, 0, 0); return fSharedTextColors.getColor(interpolate(baseRGB, background, scale)); }