protected void createFilterControls(Composite con) { Label filterLabel = new Label(con,SWT.NONE); filterLabel.setText("Filter:"); GridDataFactory.swtDefaults().applyTo(filterLabel); Text filterText = new Text(con, SWT.BORDER); filterText.setMessage("(" + PreferenceFilter.MIN_FILTER_CHARS + " chars at least)"); filterText.addModifyListener(event -> { filterChanged(filterText.getText()); }); GridDataFactory.fillDefaults().grab(true,false).applyTo(filterText); Button clearBtn = new Button(con, SWT.PUSH); clearBtn.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(PrefEditorPlugin.PLUGIN_ID,"icons/clear.gif").createImage()); GridDataFactory.swtDefaults().applyTo(clearBtn); clearBtn.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { filterText.setText(""); filterChanged(""); } }); }
private void createActions() { newNodeAction = new NewNodeAction(this); renameNodeAction = new RenameNodeAction(this); deleteNodeAction = new DeleteNodeAction(this); moveUpNodeAction = new MoveUpNodeAction(this); moveDownNodeAction = new MoveDownNodeAction(this); promoteNodeAction = new PromoteNodeAction(this); demoteNodeAction = new DemoteNodeAction(this); refreshAction = new Action() { @Override public void run() { refresh(); } }; refreshAction.setText(Messages.getString("CommonStructureControl.RefreshActionText")); //$NON-NLS-1$ refreshAction.setImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin(TFSCommonUIClientPlugin.PLUGIN_ID, "icons/Refresh.gif")); //$NON-NLS-1$ }
@Override public void init(final IBuildDefinition buildDefinition) { this.buildDefinition = buildDefinition; setWindowTitle(Messages.getString("V1AntBuildWizard.WizardTitle")); //$NON-NLS-1$ setDefaultPageImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin(TFSTeamBuildPlugin.PLUGIN_ID, "icons/ant_wiz.png")); //$NON-NLS-1$ setNeedsProgressMonitor(true); // setup default workspace. if (buildDefinition.getWorkspace().getMappings().length == 0) { buildDefinition.getWorkspace().map( ServerPath.ROOT + buildDefinition.getTeamProject(), BuildConstants.SOURCE_DIR_ENVIRONMENT_VARIABLE); } }
/** * Constructs a {@link QueuedBuildsTableControl}. The {@link IBuildServer} * may be <code>null</code> (column text for a V3 build server will be * shown); call {@link #setBuildServer(IBuildServer)} to update the control. * * @param buildServer * the build server to use (may be <code>null</code>) */ public QueuedBuildsTableControl( final Composite parent, final int style, final IBuildServer buildServer, final String viewDataKey) { super(parent, style, IQueuedBuild.class, viewDataKey); this.buildServer = buildServer; reasonHeaderImage = AbstractUIPlugin.imageDescriptorFromPlugin( TFSTeamBuildPlugin.PLUGIN_ID, "/icons/ColumnHeaderReason.gif").createImage(); //$NON-NLS-1$ statusHeaderImage = AbstractUIPlugin.imageDescriptorFromPlugin( TFSTeamBuildPlugin.PLUGIN_ID, "/icons/ColumnHeaderStatus.gif").createImage(); //$NON-NLS-1$ setupTableColumns(); setUseDefaultContentProvider(); getViewer().setSorter(createSorter()); getViewer().setLabelProvider(new LabelProvider()); setEnableTooltips(true, true); }
public SVNPluginAction(IConfigurationElement element) { super(element.getAttribute(ATT_LABEL), getStyleFromElement(element)); this.element = element; pluginId = element.getContributor().getName(); createDelegate(); setId(element.getAttribute(ATT_ID)); setToolTipText(element.getAttribute(ATT_TOOLTIP)); if ((getStyle() == AS_RADIO_BUTTON) || (getStyle() == AS_CHECK_BOX)) { String bool = element.getAttribute(ATT_STATE); setChecked("true".equals(bool)); //$NON-NLS-1$ } String iconPath = element.getAttribute(ATT_ICON); if ((iconPath != null) && (iconPath.length() > 0)) { ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, iconPath); if (desc != null) { setImageDescriptor(desc); } } // Give delegate a chance to adjust enable state selectionChanged(StructuredSelection.EMPTY); }
public static Image getImage( String pluginID, String image){ /*--- create from class file location ImageDescriptor iDescr = ImageDescriptor.createFromFile(CoreResources.class, name); Image image = resourceCache.getImage(iDescr); return image; --- get workbench shared image IWorkbench workbench = PlatformUI.getWorkbench(); ISharedImages images = workbench.getSharedImages(); image = images.getImage(ISharedImages.IMG_OBJ_FOLDER); --- image from plugin MyPlugin.getImageDescriptor("icons/a_image.gif").createImage(); AbstractUIPlugin.imageDescriptorFromPlugin(myPluginID, image)).createImage(); */ if (Utils.isIDE()) { return resourceCache.getImage(AbstractUIPlugin.imageDescriptorFromPlugin(pluginID, image)); } else { return resourceCache.getImage(image); } }
/** * Register an image from the workspace shared image pool. If the image * resource does not exist or fails to load, a default "error" resource is * supplied. * * @param name name of the image * @param sharedName name of the shared image ({@link ISharedImages}) * @return whether the image has correctly been loaded */ private boolean newPluginImage(String name, String pluginId, String filename) { boolean success = true; ImageDescriptor id = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, filename); if (id == null) { id = ImageDescriptor.getMissingImageDescriptor(); // id = getSharedByName(ISharedImages.IMG_OBJS_ERROR_TSK); success = false; } descMap.put(name, id); imageMap.put(name, id.createImage(true)); return success; }
/** * Constructor for TabDescriptor. * * @param configurationElement * the configuration element for the tab descriptor. */ public TabDescriptor(IConfigurationElement configurationElement) { super(); if (configurationElement != null) { id = configurationElement.getAttribute(ATT_ID); label = configurationElement.getAttribute(ATT_LABEL); String imageString = configurationElement.getAttribute(ATT_IMAGE); if (imageString != null) { image = AbstractUIPlugin.imageDescriptorFromPlugin( configurationElement.getDeclaringExtension() .getNamespaceIdentifier(), imageString); } String indentedString = configurationElement.getAttribute(ATT_INDENTED); indented = indentedString != null && indentedString.equals("true"); //$NON-NLS-1$ String scrollableString = configurationElement.getAttribute(ATT_SCROLLABLE); scrollable= scrollableString == null || scrollableString.toLowerCase().equals("true"); //$NON-NLS-1$ category = configurationElement.getAttribute(ATT_CATEGORY); afterTab = configurationElement.getAttribute(ATT_AFTER_TAB); if (id == null || label == null || category == null) { // the tab id, label and category are mandatory - log error handleTabError(configurationElement, null); } } selected = false; }
public static Image getImage(AbstractUIPlugin plugin, String path) { ImageRegistry registry = plugin.getImageRegistry(); Image image = registry.get(path); if (image == null) { ImageDescriptor id = getImageDescriptor(plugin.getBundle().getSymbolicName(), path); if (id == null) { return null; } registry.put(path, id); image = registry.get(path); } return image; }
private static Image getImage(String bundleSymbolicName, String path, ImageDescriptor id) { String computedName = bundleSymbolicName + path; Image image = JFaceResources.getImage(computedName); if (image != null) { return image; } if (id == null) { id = AbstractUIPlugin.imageDescriptorFromPlugin(bundleSymbolicName, path); } if (id != null) { JFaceResources.getImageRegistry().put(computedName, id); return JFaceResources.getImage(computedName); } return null; }
@Override public void init(IWorkbench workbench, IStructuredSelection currentSelection) { this.selection = currentSelection; setWindowTitle(NFARExportMessages.WizardTitle_export); setDefaultPageImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin( "org.eclipse.ui.ide", "$nl$/icons/full/wizban/exportzip_wiz.png"));//$NON-NLS-1$ setNeedsProgressMonitor(true); }
@Override protected final IDialogSettings getDialogSettings() { AbstractUIPlugin activator = getUIPlugin(); if (activator == null) { return null; } return activator.getDialogSettings(); }
/** * Loads image in Image Registry is not available in it * * @param pluginId * : Id of the plugin containing thie image * @param imageFilePath * : image File Path in plugin * @return Image if loaded */ private synchronized Image loadImage(String pluginId, String imageFilePath) { String id = pluginId + ":" + imageFilePath; Image image = Activator.getDefault().getImageRegistry().get(id); if (image != null) return image; ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, imageFilePath); if (imageDescriptor != null) { image = imageDescriptor.createImage(); Activator.getDefault().getImageRegistry().put(pluginId + ":" + imageFilePath, image); } return image; }
public CSSNodeAction( final CommonStructureControl cssControl, final String text, final String toolTipText, final String iconPath) { super(cssControl); this.cssControl = cssControl; setText(text); if (toolTipText != null && toolTipText.length() > 0) { setToolTipText(toolTipText); } if (iconPath != null && iconPath.length() > 0) { setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(TFSCommonUIClientPlugin.PLUGIN_ID, iconPath)); } }
public static ImageDescriptor getImageDescriptor( final IConfigurationElement configElement, final String attributeName, final String extensionPointName) { final String s = configElement.getAttribute(attributeName); if (s == null) { return null; } final String contributor = getContributorFor(configElement); return AbstractUIPlugin.imageDescriptorFromPlugin(contributor, s); }
public ImageDescriptor getIcon() { if (icon != null) { return icon; } final String iconPath = configElement.getAttribute(ATT_ICON); if (iconPath == null) { return null; } icon = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, iconPath); return icon; }
@Override public void init(final IBuildDefinition buildDefinition) { this.buildDefinition = buildDefinition; setWindowTitle(Messages.getString("V2AntBuildWizard.WindowTitle")); //$NON-NLS-1$ setDefaultPageImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin(TFSTeamBuildPlugin.PLUGIN_ID, "icons/ant_wiz.png")); //$NON-NLS-1$ setNeedsProgressMonitor(true); }
@Override public void init(final IBuildDefinition buildDefinition) { this.buildDefinition = buildDefinition; setWindowTitle(Messages.getString("V2MavenBuildWizard.WindowTitle")); //$NON-NLS-1$ setDefaultPageImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin(TFSTeamBuildPlugin.PLUGIN_ID, "icons/build_wiz.png")); //$NON-NLS-1$ setNeedsProgressMonitor(true); }
public BuildExplorer() { super(); queuedPageImage = AbstractUIPlugin.imageDescriptorFromPlugin( TFSTeamBuildPlugin.PLUGIN_ID, "/icons/BuildStatusNotStarted.gif").createImage(); //$NON-NLS-1$ completedPageImage = AbstractUIPlugin.imageDescriptorFromPlugin( TFSTeamBuildPlugin.PLUGIN_ID, "/icons/BuildStatusPartial.gif").createImage(); //$NON-NLS-1$ refreshAction = new RefreshBuildExplorerAction(); instance = this; }
@Override protected Image getImage(Template template) { ImageRegistry registry = FtcPlugin.getDefault().getImageRegistry(); Image image = registry.get(TEMPLATE_IMAGE); if (image == null) { ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(PluginConst.PLUGIN_NAME, TEMPLATE_IMAGE); registry.put(TEMPLATE_IMAGE, desc); image = registry.get(TEMPLATE_IMAGE); } return image; }
@Override public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { String iconResource = config.getAttribute("icon"); this.imageDescriptor = iconResource == null ? null : AbstractUIPlugin .imageDescriptorFromPlugin(config.getDeclaringExtension().getContributor().getName(), iconResource); }
public RemoteBookmarkStoreDescriptor(String id, String label, String iconResource, String iconOverlayResource, String bundleSymbolicName) { this.id = id; this.label = label; this.imageDescriptor = iconResource == null ? null : AbstractUIPlugin .imageDescriptorFromPlugin(bundleSymbolicName, iconResource); this.imageOverlayDescriptor = iconOverlayResource == null ? null : AbstractUIPlugin .imageDescriptorFromPlugin(bundleSymbolicName, iconOverlayResource); }
@SuppressWarnings("PMD.ConstructorCallsOverridableMethod") @Inject public ConfigurableTemplateStore(final ContextTypeRegistry registry, final IPreferenceStore store, @Named(Constants.LANGUAGE_NAME) final String key, final AbstractUIPlugin plugin) { super(registry, store, key + ".templates"); //$NON-NLS-1$ this.res = getTemplateFileURL(plugin); this.preferenceStore = store; this.key = key + ".sharedTemplates"; //$NON-NLS-1$ try { load(); } catch (IOException e) { LOG.error(e.getMessage(), e); } }
/** * Creates an image descriptor from the given imageFilePath and adds the * image descriptor to the image descriptor registry. If an image descriptor * could not be created, the default "missing" image descriptor is returned * but not added to the image descriptor registry. * * @param imageFilePath * @return ImageDescriptor image descriptor for imageFilePath or default * "missing" image descriptor if resource could not be found */ private ImageDescriptor createImageDescriptor(String imageFilePath) { ImageDescriptor imageDescriptor = AbstractUIPlugin .imageDescriptorFromPlugin(PLUGINID, imageFilePath); if (imageDescriptor != null) { getImageDescriptorRegistry().put(imageFilePath, imageDescriptor); } else { imageDescriptor = ImageDescriptor.getMissingImageDescriptor(); } return imageDescriptor; }
/** * Returns an image descriptor for the image file at the given plug-in * relative path. * * @param path * the path * @return the image descriptor */ public static ImageDescriptor getImageDescriptor(String path) { if (path == null) { return null; } ImageRegistry imageRegistry = getDefault().getImageRegistry(); ImageDescriptor imageDescriptor = imageRegistry.getDescriptor(path); if (imageDescriptor == null) { imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin( "de.loskutov.eclipseskins.extvs", path); imageRegistry.put(path, imageDescriptor); } return imageDescriptor; }
private Menu createContextMenu(final Control parent) { final MenuManager mm = new MenuManager(); final Action execute = new ExecuteDisplayAction(this); final MenuManager morph = new MorphWidgetMenuSupport(editor).getMenuManager(); final ImageDescriptor icon = AbstractUIPlugin.imageDescriptorFromPlugin(ModelPlugin.ID, "icons/display.png"); final Action perspective = new OpenPerspectiveAction(icon, Messages.OpenEditorPerspective, EditorPerspective.ID); final Action reload = new ReloadDisplayAction(this); mm.setRemoveAllWhenShown(true); mm.addMenuListener(manager -> { manager.add(execute); final List<Widget> selection = editor.getWidgetSelectionHandler().getSelection(); if (! selection.isEmpty()) { if (selection.size() > 1) manager.add(new CreateGroupAction(editor, selection)); if (selection.size() == 1 && selection.get(0) instanceof GroupWidget) manager.add(new RemoveGroupAction(editor, (GroupWidget)selection.get(0))); if (selection.size() == 1 && selection.get(0) instanceof EmbeddedDisplayWidget) manager.add(new EditEmbeddedDisplayAction((EmbeddedDisplayWidget)selection.get(0))); manager.add(morph); } manager.add(reload); final DisplayModel model = editor.getModel(); if (model != null && !model.isClassModel()) manager.add(new ReloadClassesAction(this)); manager.add(perspective); }); return mm.createContextMenu(parent); }
@Inject public XtextTemplateStore(ContextTypeRegistry registry, IPreferenceStore store, @Named(Constants.LANGUAGE_NAME) String key, AbstractUIPlugin plugin) { super(registry, store, key + ".templates"); res = getTemplateFileURL(plugin); try { load(); } catch (IOException e) { log.error(e.getMessage(), e); } }
public ShowPluginsAction(ConfigurableViewer configurableViewer) { super("", AS_CHECK_BOX); this.configurableViewer = configurableViewer; setToolTipText("Show Included Plugins and Fragments"); setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(FeatureExplorerConstants.PLUGIN_ID, "icons/plugins_and_fragments.gif")); }
public static ImageDescriptor getWizardBanner(String serverTypeId) { IConfigurationElement config = DockerFoundryBrandingExtensionPoint.getConfigurationElement(serverTypeId); String wizBanner = DockerFoundryBrandingExtensionPoint.getWizardBannerPath(serverTypeId); if (config != null && wizBanner != null && wizBanner.trim().length() > 0) { String bundle = config.getContributor().getName(); return AbstractUIPlugin.imageDescriptorFromPlugin(bundle, wizBanner); } return null; }
private static ImageDescriptor loadIcon(String name) { try { if (!PlatformUI.isWorkbenchRunning()) { return NO_IMAGE; } } catch (Throwable ex) { return NO_IMAGE; } return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, "icons/"+name); }
private void init(AbstractUIPlugin activator) { if (activator != null && activator.getBundle() != null) { _preferences = activator.getPreferenceStore(); } else { _preferences = null; } _allPreferences = new Hashtable<String, String>(); _defaultPreferences = new Hashtable<String, String>(); }
public SortAction(TreeViewer viewer, IPreferenceStore store, String preferenceKey) { super(JSONUIMessages.SortAction_0, store, preferenceKey, false); //$NON-NLS-1$ ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin( JSONUIPlugin.PLUGIN_ID, JSONEditorPluginImages.IMG_OBJ_SORT); setImageDescriptor(desc); setToolTipText(getText()); treeViewer = viewer; if (isChecked()) { treeViewer.setComparator(new ViewerComparator()); } }
public ExportDataAdapterAction(TreeViewer treeViewer) { super(); setId(ID); this.treeViewer = treeViewer; setText(Messages.ExportDataAdapterAction_exportName); setDescription(Messages.ExportDataAdapterAction_exportDescription); setToolTipText(Messages.ExportDataAdapterAction_exportTooltip); setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin( "org.eclipse.ui", "$nl$/icons/full/etool16/export_wiz.gif")); //$NON-NLS-1$ //$NON-NLS-2$ setDisabledImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin( "org.eclipse.ui", "$nl$/icons/full/dtool16/export_wiz.gif")); //$NON-NLS-1 //$NON-NLS-1$ //$NON-NLS-2$ }