Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Answered by Sergei Chevtsov, 06-14-2007

Basically, use FileLocator .
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/runtime/FileLocator.html
Similar methods in other classes are deprecated and call FileLocator anyway.

To get a Bundle instance associated with the desired plugin, use ((Plugin)myPlugin).getBundle(). (http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/runtime/Plugin.html)

If you can't access the instance of the desired Plugin, then (in addition to yelling at the plugin developer (smile)) use Platform.getBundle(symbolicName) where "symbolicName" is specified in the plugin's MANIFEST.MF file.
(http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/runtime/Platform.html)

Finally, use new Path](myPath), where "myPath" is relative to the plugin's top directory, to get an instance of IPath. (http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/runtime/Path.html)

...

How can I manipulate the main workbench menu at runtime?

...

Answered by Sergei Chevtsov, 07-25-2007

Use ErrorDialog like so, e.g.:

ErrorDialog.openError(shell, title, null, new Status(IStatus.ERROR, pluginId, IStatus.OK, localizedMessage, exception));

...