X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.document.ui%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Fui%2FActivator.java;h=5a25c5b6b7f8708d0c7865ff20ad0ee8150ca68a;hp=a4db0a578a5f4eb72ecbc5dd30c6530e06fb975c;hb=e140d8f611f3ebcee3f36370aa0b50344d896953;hpb=505e21552623e5c9b12fefb2e3793a64d390a8fd diff --git a/bundles/org.simantics.document.ui/src/org/simantics/document/ui/Activator.java b/bundles/org.simantics.document.ui/src/org/simantics/document/ui/Activator.java index a4db0a578..5a25c5b6b 100644 --- a/bundles/org.simantics.document.ui/src/org/simantics/document/ui/Activator.java +++ b/bundles/org.simantics.document.ui/src/org/simantics/document/ui/Activator.java @@ -11,10 +11,16 @@ *******************************************************************************/ 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 @@ -31,6 +37,8 @@ public class Activator extends AbstractUIPlugin { public ImageDescriptor cross; public ImageDescriptor clock_red; + + private static Path location; /** * The constructor @@ -54,6 +62,8 @@ public class Activator extends AbstractUIPlugin { cross = ImageDescriptor.createFromURL(bundle.getResource("icons/silk_small/cross.png")); clock_red = ImageDescriptor.createFromURL(bundle.getResource("icons/silk_small/clock_red.png")); + IPath ipath = Platform.getStateLocation(bundle); + location = Paths.get(ipath.toOSString()); } /* @@ -61,6 +71,7 @@ public class Activator extends AbstractUIPlugin { * @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); } @@ -74,4 +85,7 @@ public class Activator extends AbstractUIPlugin { return plugin; } + public static Path getInstanceLocation() { + return location; + } }