/** * Return the plugin directory location- the directory that all the plugins are located in (i.e. * d:\installdir\plugin) */ public static IPath getPluginLocation(String pluginId) { //IExtensionRegistry registry = Platform.getExtensionRegistry(); Bundle bundle = Platform.getBundle(pluginId); if (bundle != null) { try { IPath installPath = new Path(bundle.getEntry("/").toExternalForm()).removeTrailingSeparator(); //$NON-NLS-1$ String installStr = Platform.asLocalURL(new URL(installPath.toString())).getFile(); return new Path(installStr); } catch (IOException e) { }; } return null; }
/** * Return the plugin directory location- the directory that all the plugins are located in (i.e. * d:\installdir\plugin) */ public static IPath getPluginLocation(String pluginId) { // IExtensionRegistry registry = Platform.getExtensionRegistry(); Bundle bundle = Platform.getBundle(pluginId); if (bundle != null) { try { IPath installPath = new Path(bundle.getEntry("/").toExternalForm()).removeTrailingSeparator(); String installStr = Platform.asLocalURL(new URL(installPath.toString())).getFile(); return new Path(installStr); } catch (IOException e) { }; } return null; }
/** * Returns a string url representing the install location of the given bundle model * @param model the model to create the url for * @param includeReference whether to prefix the url with 'reference:' * @return string url for bundle location */ public static String getBundleURL(IPluginModelBase model, boolean includeReference) { if (model == null || model.getInstallLocation() == null) return null; StringBuffer buf = new StringBuffer(); if (includeReference) { buf.append(TargetPlatformHelper.REFERENCE_PREFIX); } buf.append(TargetPlatformHelper.FILE_URL_PREFIX); buf.append(new Path(model.getInstallLocation()).removeTrailingSeparator().toString()); return buf.toString(); }
/** * Returns the location of the default target platform, namely the location * of the host (running) instance of Eclipse. * * @return the location of the default target platform */ public static String getDefaultLocation() { URL installURL = Platform.getInstallLocation().getURL(); IPath path = new Path(installURL.getFile()).removeTrailingSeparator(); return path.toOSString(); }
/** * Returns the location of the default target platform, namely the location * of the host (running) instance of Eclipse. * * @return the location of the default target platform */ public static String getDefaultLocation() { Location location = Platform.getInstallLocation(); if (location != null) { URL url = Platform.getInstallLocation().getURL(); IPath path = new Path(url.getFile()).removeTrailingSeparator(); return path.toOSString(); } return ""; //$NON-NLS-1$ }
@Override public String resolveValue(IDynamicVariable variable, String argument) throws CoreException { if ("ARCH".equals(argument)) { //$NON-NLS-1$ return Platform.getOSArch(); } else if ("ECLIPSE_HOME".equals(argument)) { //$NON-NLS-1$ URL installURL = Platform.getInstallLocation().getURL(); IPath ppath = new Path(installURL.getFile()).removeTrailingSeparator(); return getCorrectPath(ppath.toOSString()); } else if ("NL".equals(argument)) { //$NON-NLS-1$ return Platform.getNL(); } else if ("OS".equals(argument)) { //$NON-NLS-1$ return Platform.getOS(); } else if ("WS".equals(argument)) { //$NON-NLS-1$ return Platform.getWS(); } return null; }
if (location != null) { URL url = location.getURL(); IPath path = new Path(url.getFile()).removeTrailingSeparator(); if (path.toFile().exists()) { locationcombo.add(path.toOSString());
(new Path(CommonPlugin.asLocalURI(uri).toFileString()).removeTrailingSeparator(), IResource.ALLOW_MISSING_LOCAL, new NullProgressMonitor());
(new Path(CommonPlugin.asLocalURI(uri).toFileString()).removeTrailingSeparator(), IResource.ALLOW_MISSING_LOCAL, new NullProgressMonitor());
if(location != null) { URL url = location.getURL(); IPath path = new Path(url.getFile()).removeTrailingSeparator(); if(path.toFile().exists()) { locationcombo.add(path.toOSString());
if (oldPaths[j] != null && path.equals(new Path(oldPaths[j]).removeTrailingSeparator())) continue entryLoop; } else if (entries[i].getEntryKind() == IClasspathEntry.CPE_CONTAINER)
if (dialog.open() == Window.OK) { String name= provider.getFullPath(dialog.getFirstResult()); return new Path(name).removeTrailingSeparator().toString();
if (dialog.open() == Window.OK) { String name= provider.getFullPath(dialog.getFirstResult()); return new Path(name).removeTrailingSeparator().toString();
if (dialog.open() == Window.OK) { String name= provider.getFullPath(dialog.getFirstResult()); return new Path(name).removeTrailingSeparator().toString();