Author: svasilyev
Date: 2007-10-16 12:20:58 -0400 (Tue, 16 Oct 2007)
New Revision: 4252
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.tomahawk/src/org/jboss/tools/jsf/vpe/tomahawk/TomahawkPlugin.java
Log:
Sync with jbosstools_xulrunner branch
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.tomahawk/src/org/jboss/tools/jsf/vpe/tomahawk/TomahawkPlugin.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.tomahawk/src/org/jboss/tools/jsf/vpe/tomahawk/TomahawkPlugin.java 2007-10-16
16:19:53 UTC (rev 4251)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.tomahawk/src/org/jboss/tools/jsf/vpe/tomahawk/TomahawkPlugin.java 2007-10-16
16:20:58 UTC (rev 4252)
@@ -10,10 +10,17 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.tomahawk;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
+import java.net.URL;
+
+import org.eclipse.ui.plugin.*;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-
+/**
+ * The main plugin class to be used in the desktop.
+ */
public class TomahawkPlugin extends AbstractUIPlugin {
//The shared instance.
@@ -47,5 +54,26 @@
public static TomahawkPlugin getDefault() {
return plugin;
}
-
+
+ /**
+ * 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) {
+ return
AbstractUIPlugin.imageDescriptorFromPlugin("org.jboss.tools.jsf.vpe.otrix",
path);
+ }
+
+ public static String getInstallPath() {
+ Bundle bundle = Platform.getBundle("org.jboss.tools.jsf.vpe.otrix");
+ URL url = null;
+ try {
+ url = bundle == null ? null : Platform.resolve(bundle.getEntry("/"));
+ } catch (Exception e) {
+ url = bundle.getEntry("/");
+ }
+ return (url == null) ? null : url.getPath();
+ }
}