private Color getDisabledColor() { Device device = Display.getCurrent(); return new Color( device, 188, 188, 188 ); }
private Color getDisabledColor() { Device device = Display.getCurrent(); return new Color( device, 188, 188, 188 ); }
@Override public InputStream getPerspectiveIcon() { return ImageUtil.getImageInputStream( Display.getCurrent(), "ui/images/transformation.png" ); }
protected void doWithBusyIndicator( final Runnable r ) { BusyIndicator.showWhile( Display.getCurrent() != null ? Display.getCurrent() : Display.getDefault(), r ); }
/** * Returns the system {@link Color} matching the specific ID. * * @param systemColorID * the ID value for the color * @return the system {@link Color} matching the specific ID */ public static Color getColor(int systemColorID) { Display display = Display.getCurrent(); return display.getSystemColor(systemColorID); } /**
/** * build icon cell */ protected void buildIconCell() { Image icon = Display.getCurrent().getSystemImage( SWT.ICON_INFORMATION ); this.iconLabel = new Label( this.dialog, SWT.NONE ); this.iconLabel.setImage( icon ); GridData grdData = new GridData(); grdData.horizontalIndent = DEFAULT_INDENT; grdData.verticalIndent = DEFAULT_INDENT; this.iconLabel.setLayoutData( grdData ); }
/** * build icon cell */ protected void buildIconCell() { Image icon = Display.getCurrent().getSystemImage( SWT.ICON_INFORMATION ); this.iconLabel = new Label( this.dialog, SWT.NONE ); this.iconLabel.setImage( icon ); GridData grdData = new GridData(); grdData.horizontalIndent = DEFAULT_INDENT; grdData.verticalIndent = DEFAULT_INDENT; this.iconLabel.setLayoutData( grdData ); }
/** * build icon cell */ protected void buildIconCell() { Image icon = Display.getCurrent().getSystemImage( SWT.ICON_INFORMATION ); this.iconLabel = new Label( this.dialog, SWT.NONE ); this.iconLabel.setImage( icon ); GridData grdData = new GridData(); grdData.horizontalIndent = DEFAULT_INDENT; grdData.verticalIndent = DEFAULT_INDENT; this.iconLabel.setLayoutData( grdData ); }
/** * Returns a {@link Color} given its RGB value. * * @param rgb * the {@link RGB} value of the color * @return the {@link Color} matching the RGB value */ public static Color getColor(RGB rgb) { Color color = m_colorMap.get(rgb); if (color == null) { Display display = Display.getCurrent(); color = new Color(display, rgb); m_colorMap.put(rgb, color); } return color; } /**
/** * This is a workaround for SWT bug (see PDI-15268). * Calling a context menu should be ignored in * SWT org.eclipse.swt.widgets.Control#gtk_event_after * * @return true if it is wrong event */ private boolean isWrongLostFocusEvent() { Control controlGotFocus = Display.getCurrent().getCursorControl(); return Const.isLinux() && ( controlGotFocus == null || text.equals( controlGotFocus ) ); } };
protected void doInEventThread( final Runnable r ) { if ( Display.getCurrent() != null ) { r.run(); } else { Display.getDefault().syncExec( r ); } }
/** * Returns a bold version of the given {@link Font}. * * @param baseFont * the {@link Font} for which a bold version is desired * @return the bold version of the given {@link Font} */ public static Font getBoldFont(Font baseFont) { Font font = m_fontToBoldFontMap.get(baseFont); if (font == null) { FontData fontDatas[] = baseFont.getFontData(); FontData data = fontDatas[0]; font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD); m_fontToBoldFontMap.put(baseFont, font); } return font; } /**
SwtUniversalImage image = new SwtUniversalImageSvg( svg ); Display d = Display.getCurrent() != null ? Display.getCurrent() : Display.getDefault();
/** * Returns an {@link Image} encoded by the specified {@link InputStream}. * * @param stream * the {@link InputStream} encoding the image data * @return the {@link Image} encoded by the specified input stream */ protected static Image getImage(InputStream stream) throws IOException { try { Display display = Display.getCurrent(); ImageData data = new ImageData(stream); if (data.transparentPixel > 0) { return new Image(display, data, data.getTransparencyMask()); } return new Image(display, data); } finally { stream.close(); } } /**
Display d = shell.getDisplay(); if ( d == null ) { d = Display.getCurrent() != null ? Display.getCurrent() : Display.getDefault();
/** * @return the small {@link Image} that can be used as placeholder for missing image. */ private static Image getMissingImage() { Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); // GC gc = new GC(image); gc.setBackground(getColor(SWT.COLOR_RED)); gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); gc.dispose(); // return image; } /**
final Display d = Display.getCurrent();
public void copyTransformationImage( TransMeta transMeta ) { TransGraph transGraph = delegates.trans.findTransGraphOfTransformation( transMeta ); if ( transGraph == null ) { return; } Clipboard clipboard = GUIResource.getInstance().getNewClipboard(); Point area = transMeta.getMaximum(); Image image = transGraph.getTransformationImage( Display.getCurrent(), area.x, area.y, 1.0f ); clipboard.setContents( new Object[] { image.getImageData() }, new Transfer[] { ImageTransfer.getInstance() } ); }
item.setText( 2, meta.getMeasure().getFieldName() ); item.setForeground( Display.getCurrent().getSystemColor( SWT.COLOR_DARK_GREEN ) );
item.setForeground( Display.getCurrent().getSystemColor( SWT.COLOR_DARK_GREEN ) );