Java Code Examples for org.eclipse.ui.plugin.AbstractUIPlugin

The following examples show how to use org.eclipse.ui.plugin.AbstractUIPlugin. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: http4e   Source File: ResourceUtils.java    License: Apache License 2.0 6 votes vote down vote up
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);
   }
}
 
Example 2
Source Project: ADT_Frontend   Source File: AbapGitStagingView.java    License: MIT License 5 votes vote down vote up
/**
 * Action for unstaging an object from staged section to unstaged section
 */
private void createUnstageAction() {
	this.actionUnstage = new Action(Messages.AbapGitStaging_action_unstage_xtol,
			AbstractUIPlugin.imageDescriptorFromPlugin(AbapGitUIPlugin.PLUGIN_ID, "icons/etool/unstage.png")) { //$NON-NLS-1$
		public void run() {
			IStructuredSelection selection = (IStructuredSelection) AbapGitStagingView.this.stagedTreeViewer.getSelection();
			unstageSelectedObjects(selection);
		}
	};
}
 
Example 3
Source Project: CogniCrypt   Source File: AltConfigWizard.java    License: Eclipse Public License 2.0 5 votes vote down vote up
public AltConfigWizard() {
	super();
	// Set the Look and Feel of the application to the operating
	// system's look and feel.
	try {
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
	} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
		Activator.getDefault().logError(e);
	}
	setWindowTitle("CogniCrypt");

	final ImageDescriptor image = AbstractUIPlugin.imageDescriptorFromPlugin("de.cognicrypt.codegenerator", "platform:/plugin/de.cognicrypt.core/icons/cognicrypt-medium.png ");
	setDefaultPageImageDescriptor(image);
	this.constraints = new LinkedHashMap<>();
}
 
Example 4
Source Project: google-cloud-eclipse   Source File: PipelineArgumentsTab.java    License: Apache License 2.0 5 votes vote down vote up
@VisibleForTesting
PipelineArgumentsTab(IWorkspaceRoot workspaceRoot, DataflowDependencyManager dependencyManager) {
  this.workspaceRoot = workspaceRoot;
  this.dependencyManager = dependencyManager;
  hierarchy = pipelineOptionsHierarchyFactory.global(new NullProgressMonitor());
  ImageDescriptor descriptor = AbstractUIPlugin
      .imageDescriptorFromPlugin(DataflowUiPlugin.PLUGIN_ID, "icons/Dataflow_16.png");
  image = descriptor != null ? descriptor.createImage() : null;;
}
 
Example 5
/**
 * Call this method to retrieve the (cache) ImageDescriptor for the given
 * id.
 *
 * @param id
 *            the id of the image descriptor or relative icon path if icon
 *            is inside of default icons folder
 * @return the ImageDescriptor instance.
 */
public ImageDescriptor getImageDescriptor(String id) {
    ImageDescriptor imageDescriptor = imageDescriptors.get(id);
    if (imageDescriptor == null) {
        String pluginId = getDefault().getBundle().getSymbolicName();
        imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, ICON_PATH + id);
        imageDescriptors.put(id, imageDescriptor);
    }
    return imageDescriptor;
}
 
Example 6
public AbstractHelloWorldUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 7
public AbstractBmTestLanguageUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 8
Source Project: depan   Source File: StatsResources.java    License: Apache License 2.0 4 votes vote down vote up
private static ImageDescriptor getImageDescriptor(String path) {
  return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
 
Example 9
public AbstractExpressionUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 10
public AbstractYangUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 11
Source Project: dsl-devkit   Source File: ExpressionUiModule.java    License: Eclipse Public License 1.0 4 votes vote down vote up
public ExpressionUiModule(final AbstractUIPlugin plugin) {
  super(plugin);
}
 
Example 12
public Bug291022TestLanguageUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 13
public EncodingUiTestLanguageUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 14
public ParametersTestLanguageUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 15
public ReferringTestLanguageUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 16
Source Project: xtext-eclipse   Source File: PluginImageHelper.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public AbstractUIPlugin getPlugin() {
	return plugin;
}
 
Example 17
public AbstractReferringTestLanguageUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 18
Source Project: depan   Source File: ViewDocResources.java    License: Apache License 2.0 4 votes vote down vote up
private static ImageDescriptor getImageDescriptor(String path) {
  return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
 
Example 19
public Ecore2XtextTestUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 20
Source Project: depan   Source File: NodeListResources.java    License: Apache License 2.0 4 votes vote down vote up
private static ImageDescriptor getImageDescriptor(String path) {
  return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
 
Example 21
public UnorderedGroupsTestLanguageUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 22
Source Project: n4js   Source File: AbstractJSONUiModule.java    License: Eclipse Public License 1.0 4 votes vote down vote up
public AbstractJSONUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 23
public AbstractContentAssistNoTerminalExtensionTestLanguageUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 24
public AbstractTypeExpressionsUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 25
public Bug332217TestLanguageUiModule(AbstractUIPlugin plugin) {
	super(plugin);
}
 
Example 26
Source Project: dsl-devkit   Source File: CheckCfgUiModule.java    License: Eclipse Public License 1.0 4 votes vote down vote up
public CheckCfgUiModule(final AbstractUIPlugin plugin) {
  super(plugin);
}
 
Example 27
Source Project: neoscada   Source File: AbstractChartView.java    License: Eclipse Public License 1.0 4 votes vote down vote up
public ControllerAction ()
{
    super ( "Show controller", AbstractUIPlugin.imageDescriptorFromPlugin ( Activator.PLUGIN_ID, "icons/chartController.gif" ) ); //$NON-NLS-2$
    setDescription ( "Show the chart controller view" );
    setToolTipText ( "Show the chart controller view" );
}
 
Example 28
Source Project: neoscada   Source File: AbstractChartView.java    License: Eclipse Public License 1.0 4 votes vote down vote up
public EditorAction ()
{
    super ( "Show editor", AbstractUIPlugin.imageDescriptorFromPlugin ( Activator.PLUGIN_ID, "icons/editchart.png" ) ); //$NON-NLS-2$
    setDescription ( "Show the chart model editor view" );
    setToolTipText ( "Show the chart model editor view" );
}
 
Example 29
Source Project: neoscada   Source File: AbstractChartView.java    License: Eclipse Public License 1.0 4 votes vote down vote up
public HelpAction ()
{
    super ( "Help", AbstractUIPlugin.imageDescriptorFromPlugin ( Activator.PLUGIN_ID, "icons/help.gif" ) );
}
 
Example 30
Source Project: neoscada   Source File: Activator.java    License: Eclipse Public License 1.0 4 votes vote down vote up
private void createDiscoverers ()
{
    final WritableSet resultDiscoverers = new WritableSet ( DisplayRealm.getRealm ( getWorkbench ().getDisplay () ) );
    final WritableSet resultStores = new WritableSet ( DisplayRealm.getRealm ( getWorkbench ().getDisplay () ) );

    for ( final IConfigurationElement ele : Platform.getExtensionRegistry ().getConfigurationElementsFor ( EXTP_CONNECTON_DISCOVERER ) )
    {
        if ( ELE_DISCOVERER.equals ( ele.getName () ) )
        {
            final String id = ele.getAttribute ( "id" );
            String name = ele.getAttribute ( "name" );
            if ( name == null )
            {
                name = id;
            }

            final String icon = ele.getAttribute ( "icon" );
            ImageDescriptor imageDescriptor = null;
            if ( icon != null )
            {
                imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin ( ele.getContributor ().getName (), icon );
            }

            final String description = ele.getAttribute ( "description" );

            // create
            try
            {
                final ConnectionDiscovererBean bean = new ConnectionDiscovererBean ( id, name, description, imageDescriptor, (ConnectionDiscoverer)ele.createExecutableExtension ( "class" ) );
                resultDiscoverers.add ( bean );

                if ( bean.isStore () )
                {
                    resultStores.add ( bean );
                }
            }
            catch ( final CoreException e )
            {
                getLog ().log ( e.getStatus () );
            }
        }
    }

    this.discoverers = resultDiscoverers;
    this.stores = resultStores;
}