*******************************************************************************/
package org.simantics.document.ui;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
+import org.simantics.document.ui.graphfile.ExternalEditorAdapter;
/**
* The activator class controls the plug-in life cycle
public ImageDescriptor cross;
public ImageDescriptor clock_red;
+
+ private static Path location;
/**
* The constructor
Bundle bundle = context.getBundle();
- DOCUMENT_DECORATION_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/document_decoration.png"));
- cross = ImageDescriptor.createFromURL(bundle.getResource("icons/silk_small/cross.png"));
- clock_red = ImageDescriptor.createFromURL(bundle.getResource("icons/silk_small/clock_red.png"));
+ DOCUMENT_DECORATION_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/document_decoration.png")); //$NON-NLS-1$
+ cross = ImageDescriptor.createFromURL(bundle.getResource("icons/silk_small/cross.png")); //$NON-NLS-1$
+ clock_red = ImageDescriptor.createFromURL(bundle.getResource("icons/silk_small/clock_red.png")); //$NON-NLS-1$
+ IPath ipath = Platform.getStateLocation(bundle);
+ location = Paths.get(ipath.toOSString());
}
/*
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
+ ExternalEditorAdapter.stopFileWatcher();
plugin = null;
super.stop(context);
}
return plugin;
}
+ public static Path getInstanceLocation() {
+ return location;
+ }
}