Refine search
void initializeColors() { Display display = Display.getDefault(); colors = new Color[] { new Color( display, new RGB( 0, 0, 0 ) ), // black new Color( display, new RGB( 63, 127, 95 ) ), // red new Color( display, new RGB( 0, 0, 192 ) ), // green new Color( display, new RGB( 127, 0, 85 ) ), // blue new Color( display, new RGB( 255, 102, 0 ) ) // Kettle Functions / Orange }; tokenColors = new int[MAXIMUM_TOKEN]; tokenColors[WORD] = 0; tokenColors[WHITE] = 0; tokenColors[KEY] = 3; tokenColors[COMMENT] = 1; tokenColors[STRING] = 2; tokenColors[OTHER] = 0; tokenColors[NUMBER] = 0; tokenColors[FUNCTIONS] = 4; }
private void computeReverseVideoColors(Display display) { Color background = toolkit.getColors().getBackground(); RGB white = new RGB(255, 255, 255); // Create new colors, they will get disposed RGB rgb = background.getRGB(); activeColor = new Color(display, rgb ); rgb = FormColors.blend(rgb, white, 85); inactiveColor1 = new Color(display, rgb); rgb = FormColors.blend(rgb, white, 85); inactiveColor2 = new Color(display, rgb ); introColor = new Color(display, rgb ); }
@Override public void runSupport() { if (!colorDefault.isDisposed()) AllocateColor.this.rgbDefault = colorDefault.getRGB(); else AllocateColor.this.rgbDefault = new RGB(0, 0, 0); } }, false);
private boolean setForeground(final RGB rgb) { Color colorFG = getForeground(); boolean changed = colorFG == null || colorFG.isDisposed() || !colorFG.getRGB().equals(rgb); if (changed) { Utils.execSWTThread(new AERunnable() { @Override public void runSupport() { setForeground(ColorCache.getColor(Display.getCurrent(), rgb)); } }); } return changed; }
public ResultLabelProvider(ResultContentProvider contentProvider) { Color searchColor = JFaceResources.getColorRegistry().get(ECLIPSE_SEARCH_UI_MATCH_HIGHLIGHT); JFaceResources.getColorRegistry().put(HIGHLIGHT_COLOR_NAME, (searchColor!=null?searchColor.getRGB():new RGB(206, 204, 247))); this.labelProvider = new WorkbenchLabelProvider(); this.highlightStyle = StyledString.createColorRegistryStyler(null, HIGHLIGHT_COLOR_NAME); this.contentProvider = contentProvider; this.matchImage = InstaSearchUI.getSharedImage(IMG_OBJ_TEXT_SEARCH_LINE); imageRegistry.put(DOWN_ARROW_IMG_KEY, InstaSearchPlugin.getImageDescriptor(DOWN_ARROW_IMG_KEY)); this.showMatchCount = InstaSearchPlugin.getBoolPref(PreferenceConstants.P_SHOW_MATCH_COUNT); this.showFullPath = InstaSearchPlugin.getBoolPref(PreferenceConstants.P_SHOW_FULL_PATH); InstaSearchPlugin.addPreferenceChangeListener(this); }
/** * Returns an <code>RGB</code> representing the receiver. * * @return the RGB for the color * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public RGB getRGB () { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); return new RGB(handle & 0xFF, (handle & 0xFF00) >> 8, (handle & 0xFF0000) >> 16); }
public boolean setColor(RGB color) { RGB oldColor= fIndicatorColor; fIndicatorColor= color; if (color == null) return oldColor != null; if (oldColor != null) return !color.equals(oldColor); return true; }
@Override public int hashCode() { int hash = 0; for (RGB fRGB : fRGBs) hash = hash * 7 + fRGB.hashCode(); hash = hash * 7 + fLength; return hash; } }
void initializeColors() { Display display = Display.getDefault(); colors = new Color[] { new Color( display, new RGB( 0, 0, 0 ) ), // black new Color( display, new RGB( 255, 0, 0 ) ), // red new Color( display, new RGB( 63, 127, 95 ) ), // green new Color( display, new RGB( 0, 0, 255 ) ), // blue new Color( display, new RGB( 255, 0, 255 ) ) // SQL Functions / Rose }; tokenColors = new int[MAXIMUM_TOKEN]; tokenColors[WORD] = 0; tokenColors[WHITE] = 0; tokenColors[KEY] = 3; tokenColors[COMMENT] = 2; tokenColors[STRING] = 1; tokenColors[OTHER] = 0; tokenColors[NUMBER] = 0; tokenColors[VALUESNAME] = 4; }
/** * Returns an <code>RGB</code> representing the receiver. * * @return the RGB for the color * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public RGB getRGB () { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); return new RGB(getRed(), getGreen(), getBlue()); }
private boolean setForeground(final RGB rgb) { Color colorFG = getForegroundSWT(); boolean changed = colorFG == null || colorFG.isDisposed() || !colorFG.getRGB().equals(rgb); if (changed) { Utils.execSWTThread(new SWTRunnable() { @Override public void runWithDisplay(Display display) { setForeground(ColorCache.getColor(Display.getCurrent(), rgb)); } }); } return changed; }
@Override public boolean equals(Object obj) { if (obj instanceof RGBColorDescriptor) { RGBColorDescriptor other = (RGBColorDescriptor) obj; return other.color.equals(color) && other.originalColor == originalColor; } return false; }
@Override public int hashCode() { int hash = 0; for (RGB fRGB : fRGBs) hash = hash * 7 + fRGB.hashCode(); hash = hash * 7 + fLength; return hash; } }