X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.ui%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fui%2Fmodulebrowser%2FCreateModuleAction.java;fp=bundles%2Forg.simantics.scl.ui%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fui%2Fmodulebrowser%2FCreateModuleAction.java;h=fb47d553e0a19a4bc60c004dd4d1632966a04c4c;hp=1d70442c85d709f5162f06da8e7427ca8b252404;hb=9712014e959584157b02e594be8719c151b8f5b0;hpb=d14bfb83fddf30539f401de54ce9f61bd0aff25c diff --git a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/CreateModuleAction.java b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/CreateModuleAction.java index 1d70442c8..fb47d553e 100644 --- a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/CreateModuleAction.java +++ b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/CreateModuleAction.java @@ -12,15 +12,15 @@ import org.simantics.scl.ui.Activator; import gnu.trove.map.hash.THashMap; public class CreateModuleAction { - public static final String PREFIX = "reference:file:/"; + public static final String PREFIX = "reference:file:/"; //$NON-NLS-1$ public static final void createModule(Bundle bundle, String packageName, String moduleName) throws IOException { String bundleLocation = bundle.getLocation(); bundleLocation = bundleLocation.substring(PREFIX.length()); - Path packagePath = Paths.get(bundleLocation).resolve("scl").resolve(packageName); + Path packagePath = Paths.get(bundleLocation).resolve("scl").resolve(packageName); //$NON-NLS-1$ Files.createDirectories(packagePath); - Path modulePath = packagePath.resolve(moduleName + ".scl"); + Path modulePath = packagePath.resolve(moduleName + ".scl"); //$NON-NLS-1$ if(Files.exists(modulePath)) return; Files.createFile(modulePath); @@ -31,7 +31,7 @@ public class CreateModuleAction { THashMap result = new THashMap(); for(Bundle bundle : context.getBundles()) { String location = bundle.getLocation(); - if(location.endsWith(".jar") || !location.startsWith(PREFIX)) + if(location.endsWith(".jar") || !location.startsWith(PREFIX)) //$NON-NLS-1$ continue; location = location.substring(PREFIX.length()); Path bundlePath = Paths.get(location); @@ -46,21 +46,21 @@ public class CreateModuleAction { for(Bundle bundle : bundles.values()) { String location = bundle.getLocation(); location = location.substring(PREFIX.length()); - Path packagePath = Paths.get(location).resolve("scl").resolve(packageName); + Path packagePath = Paths.get(location).resolve("scl").resolve(packageName); //$NON-NLS-1$ if(Files.exists(packagePath)) return bundle.getSymbolicName(); } int p = packageName.lastIndexOf('/'); if(p == -1) - return ""; + return ""; //$NON-NLS-1$ else return findBestPlugin(bundles, packageName.substring(0, p)); } public static int packageMatchLength(Bundle bundle, String packageName) { - if(bundle.getEntry("scl") == null) + if(bundle.getEntry("scl") == null) //$NON-NLS-1$ return 0; - packageName = "scl/" + packageName; + packageName = "scl/" + packageName; //$NON-NLS-1$ while(packageName.length() > 3) { if(bundle.getEntry(packageName) != null) return packageName.length();