List of usage examples for org.eclipse.jface.resource ImageDescriptor createFromFile
public static ImageDescriptor createFromFile(Class<?> location, String filename)
From source file:org.talend.designer.core.ui.action.ShowJobSettingsViewAction.java
License:Open Source License
/** * DOC Administrator ShowJobSettingsViewAction constructor comment. *//*from ww w . java 2 s.co m*/ public ShowJobSettingsViewAction() { setId(ID); setImageDescriptor(ImageDescriptor.createFromFile(ECoreImage.class, ECoreImage.PROCESS_ICON.getPath())); setText(Messages.getString("ShowJobSettingsViewAction.showView")); //$NON-NLS-1$ }
From source file:org.talend.designer.core.ui.views.CodeView.java
License:Open Source License
@Override public void createPartControl(Composite parent) { this.parent = parent; parent.setLayout(new FillLayout()); ECodeLanguage language = LanguageManager.getCurrentLanguage(); ISourceViewer viewer = null;// ww w. j a va2 s. c o m final StyledText text; int styles = SWT.H_SCROLL | SWT.V_SCROLL; document = new Document(); switch (language) { case JAVA: IPreferenceStore store = JavaPlugin.getDefault().getCombinedPreferenceStore(); viewer = new JavaSourceViewer(parent, null, null, false, styles, store); viewer.setDocument(document); JavaTextTools tools = JavaPlugin.getDefault().getJavaTextTools(); tools.setupJavaDocumentPartitioner(viewer.getDocument(), IJavaPartitions.JAVA_PARTITIONING); SimpleJavaSourceViewerConfiguration config = new SimpleJavaSourceViewerConfiguration( tools.getColorManager(), store, null, IJavaPartitions.JAVA_PARTITIONING, true); viewer.configure(config); viewer.getTextWidget().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); document = viewer.getDocument(); break; default: // empty since only have java } viewer.setEditable(false); text = viewer.getTextWidget(); // getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(this); IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager(); IAction wrapAction = new Action() { @Override public void run() { text.setWordWrap(isChecked()); } }; wrapAction.setToolTipText("wrap"); //$NON-NLS-1$ wrapAction.setChecked(false); wrapAction.setImageDescriptor(ImageDescriptor.createFromFile(DesignerPlugin.class, "/icons/wrap.gif")); //$NON-NLS-1$ tbm.add(wrapAction); createMenu(); }
From source file:org.talend.designer.dbmap.ui.image.ImageProviderMapper.java
License:Open Source License
public static ImageDescriptor getImageDescriptor(ImageInfo image) { return ImageDescriptor.createFromFile(PluginUtils.class, image.getPath()); }
From source file:org.talend.designer.gefabstractmap.resource.ImageProviderMapper.java
License:Open Source License
public static ImageDescriptor getImageDescriptor(ImageInfo image) { return ImageDescriptor.createFromFile(NewAbstractmap.class, image.getPath()); }
From source file:org.whole.lang.ui.notations.NotationImages.java
License:Open Source License
public static ImageDescriptor createImageDescriptor(String imageFilePath) { return ImageDescriptor.createFromFile(NotationImages.class, imageFilePath); }
From source file:org.whole.lang.ui.wizards.WholeModelWizardPage1.java
License:Open Source License
public WholeModelWizardPage1(IWorkbench aWorkbench, IStructuredSelection selection) { super("sampleModelPage1", selection); this.setTitle("Whole Model"); this.setDescription("Create a new Whole Model"); this.setImageDescriptor(ImageDescriptor.createFromFile(E4CompatibilityPlugin.class, "images/banner.png")); this.workbench = aWorkbench; }
From source file:org.zamia.plugin.views.fsm.FSMEditorPaletteFactory.java
License:Open Source License
@SuppressWarnings("unchecked") private static PaletteContainer createComponentsDrawer() { PaletteDrawer drawer = new PaletteDrawer("Components", null); List entries = new ArrayList(); CombinedTemplateCreationEntry combined = new CombinedTemplateCreationEntry("State", "Create a new State Node", FSMState.class, new SimpleFactory(FSMState.class), ImageDescriptor.createFromFile(FSMState.class, "images/gear16.gif"), ImageDescriptor.createFromFile(FSMState.class, "images/gear16.gif")); entries.add(combined);// w ww .j a v a 2 s. co m drawer.addAll(entries); return drawer; }
From source file:org.zamia.plugin.views.fsm.FSMEditorPaletteFactory.java
License:Open Source License
@SuppressWarnings("unchecked") private static PaletteContainer createControlGroup(PaletteRoot root) { PaletteGroup controlGroup = new PaletteGroup("Control Group"); List entries = new ArrayList(); ToolEntry tool = new SelectionToolEntry(); entries.add(tool);// w w w . j a v a 2 s .co m root.setDefaultEntry(tool); tool = new MarqueeToolEntry(); entries.add(tool); PaletteSeparator sep = new PaletteSeparator("org.eclipse.gef.examples.flow.flowplugin.sep2"); sep.setUserModificationPermission(PaletteEntry.PERMISSION_NO_MODIFICATION); entries.add(sep); tool = new ConnectionCreationToolEntry("Transition Creation", "Creating transitions", null, ImageDescriptor.createFromFile(FSMState.class, "images/connection16.gif"), ImageDescriptor.createFromFile(FSMState.class, "images/connection16.gif")); entries.add(tool); controlGroup.addAll(entries); return controlGroup; }
From source file:pt.iscte.dcti.visual_tracer.view.ImageUtils.java
License:Open Source License
/** * Retrieves the image corresponding to the given file name. * Note that the image is managed by an image registry. You should not * dispose the image after use./*ww w .j a v a 2s .c om*/ * #param shortFileName * @return What? */ public static Image getImage(String imageName) { Image image = null; String shortFileName = imageName + imageFormat; File imageFile = new File("Images/" + shortFileName); if (!imageFile.exists()) return null; if (imageRegistry.getDescriptor(shortFileName) == null) { ImageDescriptor descriptor = ImageDescriptor.createFromFile(null, "Images/" + shortFileName); imageRegistry.put(shortFileName, descriptor); } image = imageRegistry.get(shortFileName); return image; }
From source file:repast.simphony.agents.designer.ui.editors.PaletteHelper.java
License:Open Source License
/** * Creates the control tools./*w ww . ja v a 2 s .com*/ * * @param root * @return the control group */ static private PaletteContainer createControlGroup(PaletteRoot root) { PaletteGroup controlGroup = new PaletteGroup( AgentBuilderPlugin.getResourceString("AgentEditor_Palette_Category_ControlGroup.label"));//$NON-NLS-1$ List entries = new ArrayList(); ToolEntry tool = new AgentBuilderSelectionToolEntry(); entries.add(tool); root.setDefaultEntry(tool); tool = new MarqueeToolEntry(); entries.add(tool); PaletteSeparator sep = new PaletteSeparator("repast.simphony.agents.designer.ui.editors.sep"); //$NON-NLS-1$ sep.setUserModificationPermission(PaletteEntry.PERMISSION_NO_MODIFICATION); entries.add(sep); tool = new AgentBuilderConnectionCreationToolEntry( AgentBuilderPlugin.getResourceString("AgentEditor_Palette_Tool_CreationTool_Connection.label"), //$NON-NLS-1$ AgentBuilderPlugin .getResourceString("AgentEditor_Palette_Tool_CreationTool_Connection.description"), //$NON-NLS-1$ null, ImageDescriptor.createFromFile(BehaviorStepModelPart.class, "icons/connection16.gif"), //$NON-NLS-1$ ImageDescriptor.createFromFile(BehaviorStepModelPart.class, "icons/connection24.gif")//$NON-NLS-1$ ); entries.add(tool); controlGroup.addAll(entries); return controlGroup; }