List of usage examples for org.eclipse.jface.resource ImageDescriptor createFromFile
public static ImageDescriptor createFromFile(Class<?> location, String filename)
From source file:org.qsos.action.RadarAction.java
License:Open Source License
/** * @param w/* www . ja v a2 s . c o m*/ */ public RadarAction(JQ w) { window = w; setText("specialDisplay@Ctrl+d"); //$NON-NLS-1$ setToolTipText(Messages.getString("RadarAction.toolTipTextRadar")); //$NON-NLS-1$ setImageDescriptor(ImageDescriptor.createFromFile(null, "share/icons/special_display.png")); //$NON-NLS-1$ }
From source file:org.qsos.action.ReinitializeFieldsAction.java
License:Open Source License
/** * @param w//from w w w . j av a2s. com */ public ReinitializeFieldsAction(JQ w) { window = w; setText("Create@Ctrl+r"); //$NON-NLS-1$ setToolTipText(Messages.getString("ReinitializeFieldsAction.toolTipTextReInitialize")); //$NON-NLS-1$ setImageDescriptor(ImageDescriptor.createFromFile(null, "share/icons/reinitialize.png")); //$NON-NLS-1$ //setImageDescriptor( ImageDescriptor.createFromURL(getClass().getResource("/share/icons/reinitialize.png"))); }
From source file:org.qsos.action.SaveSheetAction.java
License:Open Source License
/** * @param w/*www . ja v a2 s. co m*/ */ public SaveSheetAction(JQ w) { super("&Save@Ctrl+s", ImageDescriptor.createFromFile(SaveSheetAction.class, "/share/icons/save.png")); //$NON-NLS-1$ //$NON-NLS-2$ setImageDescriptor(ImageDescriptor.createFromFile(null, "share/icons/save.png")); //$NON-NLS-1$ //setDisabledImageDescriptor(ImageDescriptor.createFromFile(SaveSheetAction.class,"share/icons/save.png")); setToolTipText(Messages.getString("SaveSheetAction.toolTipTextSave")); //$NON-NLS-1$ window = w; }
From source file:org.rifidi.designer.rcp.gpioeditor.GPIOEditor.java
License:LGPL
@Override protected PaletteRoot getPaletteRoot() { PaletteRoot palette = new PaletteRoot(); PaletteGroup toolGroup = new PaletteGroup("Tools"); // Add a selection tool to the group ToolEntry tool = new PanningSelectionToolEntry(); toolGroup.add(tool);//from ww w . j a va 2s .co m palette.setDefaultEntry(tool); // Add a marquee tool to the group toolGroup.add(new MarqueeToolEntry()); // Add a (unnamed) separator to the group toolGroup.add(new PaletteSeparator()); // Add (solid-line) connection tool tool = new ConnectionCreationToolEntry("Solid connection", "Create a solid-line connection", new CreationFactory() { public Object getNewObject() { return null; } // see ShapeEditPart#createEditPolicies() // this is abused to transmit the desired line style public Object getObjectType() { return null; } }, ImageDescriptor.createFromFile(GPIOPlugin.class, "icons/connection_s16.gif"), ImageDescriptor.createFromFile(GPIOPlugin.class, "icons/connection_s24.gif")); toolGroup.add(tool); palette.add(toolGroup); return palette; }
From source file:org.salever.gef.examples.layersupport.shapes.editors.ShapesEditorPaletteFactory.java
License:Open Source License
/** Create the "Shapes" drawer. */ private static PaletteContainer createShapesDrawer() { PaletteDrawer componentsDrawer = new PaletteDrawer("Shapes"); CombinedTemplateCreationEntry component = new CombinedTemplateCreationEntry("Ellipse", "Create an elliptical shape", EllipticalShape.class, new SimpleFactory(EllipticalShape.class), ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/ellipse16.gif"), ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/ellipse24.gif")); componentsDrawer.add(component);/*ww w .j a va 2 s. co m*/ component = new CombinedTemplateCreationEntry("Rectangle", "Create a rectangular shape", RectangularShape.class, new SimpleFactory(RectangularShape.class), ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/rectangle16.gif"), ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/rectangle24.gif")); componentsDrawer.add(component); component = new CombinedTemplateCreationEntry("Container", "Create a container shape", Container.class, new SimpleFactory(Container.class), ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/container_16.gif"), ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/container_32.gif")); componentsDrawer.add(component); return componentsDrawer; }
From source file:org.salever.gef.examples.layersupport.shapes.editors.ShapesEditorPaletteFactory.java
License:Open Source License
/** Create the "Tools" group. */ private static PaletteContainer createToolsGroup(PaletteRoot palette) { PaletteToolbar toolbar = new PaletteToolbar("Tools"); // Add a selection tool to the group ToolEntry tool = new PanningSelectionToolEntry(); toolbar.add(tool);/*from www . ja v a2 s . c o m*/ palette.setDefaultEntry(tool); // Add a marquee tool to the group toolbar.add(new MarqueeToolEntry()); // Add (solid-line) connection tool tool = new ConnectionCreationToolEntry("Solid connection", "Create a solid-line connection", new CreationFactory() { public Object getNewObject() { return null; } // see ShapeEditPart#createEditPolicies() // this is abused to transmit the desired line style public Object getObjectType() { return Connection.SOLID_CONNECTION; } }, ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/connection_s16.gif"), ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/connection_s24.gif")); toolbar.add(tool); // Add (dashed-line) connection tool tool = new ConnectionCreationToolEntry("Dashed connection", "Create a dashed-line connection", new CreationFactory() { public Object getNewObject() { return null; } // see ShapeEditPart#createEditPolicies() // this is abused to transmit the desired line style public Object getObjectType() { return Connection.DASHED_CONNECTION; } }, ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/connection_d16.gif"), ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/connection_d24.gif")); toolbar.add(tool); return toolbar; }
From source file:org.savara.tools.scenario.designer.DesignerImages.java
License:Apache License
/** * This method returns the image descriptor associated with the * supplied name.// w w w . jav a2 s. c o m * * @param name The name * @return The descriptor */ public static ImageDescriptor getImageDescriptor(String name) { ImageDescriptor ret = null; if ((ret = m_registry.getDescriptor(name)) == null) { ret = ImageDescriptor.createFromFile(DesignerImages.class, IMAGES_LOCATION + name); m_registry.put(name, ret); } return (ret); }
From source file:org.savara.tools.scenario.designer.simulate.ScenarioSimulationImages.java
License:Apache License
/** * This method returns the image descriptor associated with the * supplied name./*from ww w. j ava 2s . co m*/ * * @param name The name * @return The descriptor */ public static ImageDescriptor getImageDescriptor(String name) { ImageDescriptor ret = ImageDescriptor.createFromFile(ScenarioSimulationImages.class, IMAGES_LOCATION + name); return (ret); }
From source file:org.scribble.protocol.designer.editor.ScribbleImages.java
License:Apache License
/** * This method returns the image descriptor associated with the * supplied name.//from ww w . jav a 2 s . c o m * * @param name The name * @return The descriptor */ public static ImageDescriptor getImageDescriptor(String name) { ImageDescriptor ret = null; if ((ret = m_registry.getDescriptor(name)) == null) { ret = ImageDescriptor.createFromFile(ScribbleImages.class, IMAGES_LOCATION + name); m_registry.put(name, ret); } return (ret); }
From source file:org.seasar.eclipse.common.util.StaticImageLoader.java
License:Apache License
public static void loadResources(ImageRegistry registry, Class holder, String name) { ResourceBundle bundle = getBundle(name, holder.getClassLoader()); if (bundle == null) { return;/*from w ww . j a va 2 s .c om*/ } BeanDesc holderBd = BeanDescFactory.getBeanDesc(holder); Map pathMap = ResourceBundleUtil.convertMap(bundle); for (int i = 0; i < holderBd.getFieldSize(); i++) { Field field = holderBd.getField(i); String key = field.getName(); if (validateMask(field)) { continue; } if (pathMap.containsKey(key) == false) { log(key + " not found in " + name); continue; } ImageDescriptor id = registry.getDescriptor(key); if (id == null) { id = ImageDescriptor.createFromFile(holder, pathMap.get(key).toString()); registry.put(key, id); } else { log(key + " is already registered [" + holder + "]"); } if (isAssignableFrom(ImageDescriptor.class, field)) { FieldUtil.set(field, null, id); } else if (isAssignableFrom(Image.class, field)) { FieldUtil.set(field, null, registry.get(key)); } } }