import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import com.quantum.model.BookmarkCollection;
-import com.quantum.util.xml.XMLHelper;
-import com.quantum.view.subset.SubsetContentProvider;
-
import org.eclipse.core.resources.ISavedState;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.graphics.RGB;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
+import com.quantum.model.BookmarkCollection;
+import com.quantum.util.xml.XMLHelper;
+import com.quantum.view.subset.SubsetContentProvider;
+
/**
* Main class of the quantum plugin, sets defaults, saves and recovers state.
* @author root
* @param descriptor
*/
public QuantumPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
+ this();
+ }
+ /**
+ * This version is recommended for eclipse3.0 and above
+ */
+ public QuantumPlugin(){
+ super();
plugin = this;
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#startup()
+ * This method is deprecated in Eclipse3.0 we must use start(BundleContext context):
+ * Migration completed.
*/
public void startup() throws CoreException {
super.startup();
+ startupMigrationTempMethod(); // To be removed later
+ }
+
+ /**
+ * Used during startup Eclipse3.0 compatible
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ super.start(bundleContext);
+ startupMigrationTempMethod(); // To be removed later
+ }
+ private void startupMigrationTempMethod() throws CoreException {
+ // the contents of this.startup() is moved to here to avoid code duplication - see this.start(BundleContext)
ISavedState lastState =
ResourcesPlugin.getWorkspace().addSaveParticipant(
this,
* @throws MalformedURLException
*/
private URL getIconLocation() throws MalformedURLException {
- URL installURL = getDescriptor().getInstallURL();
+// URL installURL = getDescriptor().getInstallURL();
+ URL installURL = getBundle().getEntry("/");
return new URL(installURL, "icons/");
}
}
\ No newline at end of file