List of usage examples for org.eclipse.jface.resource ImageDescriptor getImageData
public ImageData getImageData(int zoom)
ImageData
object for this image descriptor. From source file:de.fhg.igd.swingrcp.SwingAction.java
License:Open Source License
/** * Creates a Swing action from a JFace action * //from ww w . java 2 s . c om * @param action the JFace action */ public SwingAction(IAction action) { super(); this.action = action; putValue(Action.NAME, action.getText()); putValue(Action.SHORT_DESCRIPTION, action.getToolTipText()); putValue(Action.LONG_DESCRIPTION, action.getDescription()); ImageDescriptor imageDesc = action.getImageDescriptor(); if (imageDesc != null) { ImageData imageData = imageDesc.getImageData(100); if (imageData != null) { BufferedImage img = SwingRCPUtilities.convertToAWT(imageData, true); ImageIcon icon = new ImageIcon(img); putValue(Action.SMALL_ICON, icon); } } }