/** * Returns a URL for the given path in the given bundle. Returns <code>null</code> if the URL * could not be computed or created. * * @param bundle the bundle in which to search * @param path path relative to plug-in installation location * @return a URL for the given path or <code>null</code>. The actual form * of the returned URL is not specified. * @see #find(Bundle, IPath, Map) * @see #resolve(URL) * @see #asLocalURL(URL) * @since 3.0 * @deprecated use {@link FileLocator#find(Bundle, IPath, Map)} */ @Deprecated public static URL find(Bundle bundle, IPath path) { return FileLocator.find(bundle, path, null); }
/** * Returns a URL for the given path. Returns <code>null</code> if the URL * could not be computed or created. * * @param path path relative to plug-in installation location * @return a URL for the given path or <code>null</code> * @deprecated use {@link FileLocator#find(Bundle, IPath, Map)} */ @Deprecated public final URL find(IPath path) { return FileLocator.find(getBundle(), path, null); }
return FileLocator.find(bundle, path, override);
/** * Returns a URL for the given path. Returns <code>null</code> if the URL * could not be computed or created. * * @param path file path relative to plug-in installation location * @param override map of override substitution arguments to be used for * any $arg$ path elements. The map keys correspond to the substitution * arguments (eg. "$nl$" or "$os$"). The resulting * values must be of type java.lang.String. If the map is <code>null</code>, * or does not contain the required substitution argument, the default * is used. * @return a URL for the given path or <code>null</code> * @deprecated use {@link FileLocator#find(Bundle, IPath, Map)} */ @Deprecated public final URL find(IPath path, Map<String,String> override) { return FileLocator.find(getBundle(), path, override); }
public Properties getProductCustomization() { initValues(); URL url = null; if (customizationValue != null) { // try to convert the key to a URL try { url = new URL(customizationValue); } catch (MalformedURLException e) { // didn't work so treat it as a filename url = FileLocator.find(customizationBundle, new Path(customizationValue), null); } } if (url == null) { if (InternalPlatform.DEBUG_PLUGIN_PREFERENCES) InternalPlatform.message("Product preference customization file: " + customizationValue + " not found for bundle: " + productID); //$NON-NLS-1$//$NON-NLS-2$ } return loadProperties(url); }
public Properties getProductTranslation() { initValues(); URL transURL = null; if (customizationValue != null) transURL = FileLocator.find(customizationBundle, NL_DIR.append(customizationValue).removeFileExtension().addFileExtension(PROPERTIES_FILE_EXTENSION), null); if (transURL == null && InternalPlatform.DEBUG_PLUGIN_PREFERENCES) InternalPlatform.message("No preference translations found for product/file: " + customizationBundle.getSymbolicName() + '/' + customizationValue); //$NON-NLS-1$ return loadProperties(transURL); }
public static URL find(Bundle pluginDesc, IPath flatFilePath, ArrayList<String> pathPrefix) { // try to find the actual file. for (int i = 0; i < pathPrefix.size(); i++) { URL url = FileLocator.find(pluginDesc, new Path(pathPrefix.get(i) + flatFilePath), null); if (url != null) return url; } return null; }
public static ImageDescriptor createImageDescriptor(Bundle bundle, IPath path) { URL url = FileLocator.find(bundle, path, null); if (url != null) { return ImageDescriptor.createFromURL(url); } return null; }
public URL getDefaultResourceURL(String attribute, URL dflt) { String value= getDefaultAttribute(attribute, null); if (value == null) return dflt; Bundle bundle= getBundle(); if (bundle == null) return dflt; Path path= new Path(value); return FileLocator.find(bundle, path, null); }
public URL getDefaultResourceURL(String attribute, URL dflt) { String value= getDefaultAttribute(attribute, null); if (value == null) return dflt; Bundle bundle= getBundle(); if (bundle == null) return dflt; Path path= new Path(value); return FileLocator.find(bundle, path, null); }
public URL getDefaultResourceURL(String attribute, URL dflt) { String value= getDefaultAttribute(attribute, null); if (value == null) return dflt; Bundle bundle= getBundle(); if (bundle == null) return dflt; Path path= new Path(value); return FileLocator.find(bundle, path, null); }
public static ImageDescriptor createImageDescriptor(Bundle bundle, IPath path, boolean useMissingImageDescriptor) { URL url= FileLocator.find(bundle, path, null); if (url != null) { return ImageDescriptor.createFromURL(url); } if (useMissingImageDescriptor) { return ImageDescriptor.getMissingImageDescriptor(); } return null; } }
/** * Creates the specified image descriptor and registers it */ private void createImageDescriptor(String id, ImageRegistry reg) { URL url = FileLocator.find(getBundle(), new Path(ProvUIImages.ICON_PATH + id), null); ImageDescriptor desc = ImageDescriptor.createFromURL(url); reg.put(id, desc); }
private ImageDescriptor getImageDesc(String img) { Bundle bundle = FacesConfigPlugin.getPlugin().getBundle(); URL url = FileLocator.find(bundle, new Path(img), null); ImageDescriptor desc = ImageDescriptor.createFromURL(url); if (desc == MISSING_IMAGE){ return null; } return desc; }
private ImageDescriptor getImageDesc(String img) { Bundle bundle = FacesConfigPlugin.getPlugin().getBundle(); URL url = FileLocator.find(bundle, new Path(img), null); ImageDescriptor desc = ImageDescriptor.createFromURL(url); if (desc == MISSING_IMAGE){ return null; } return desc; } }
/** * Returns a string from a property file */ public static URL getImagePath(String name) { IPath path = new Path("$nl$/icons/").append(name); //$NON-NLS-1$ return FileLocator.find(HelpUIPlugin.getDefault().getBundle(), path, null); }
/** * Returns the image descriptor with the given relative path. */ protected ImageDescriptor getImageDescriptor(String relativePath) { String iconPath = "icons/full/"; //$NON-NLS-1$ URL url = FileLocator.find(WorkbenchNavigatorPlugin.getDefault().getBundle(), new Path(iconPath + relativePath), Collections.<String, String> emptyMap()); if (url == null) { return ImageDescriptor.getMissingImageDescriptor(); } return ImageDescriptor.createFromURL(url); }
/** * Creates the specified image descriptor and registers it */ private void createImageDescriptor(String id, ImageRegistry reg) { URL url = FileLocator.find(getBundle(), new Path(ICON_PATH).append(id), null); ImageDescriptor desc = ImageDescriptor.createFromURL(url); reg.put(id, desc); }
private ImageDescriptor createImageDescriptor(String relativePath) { Bundle bundle = CheatSheetPlugin.getPlugin().getBundle(); URL url = FileLocator.find(bundle, new Path(relativePath),null); if (url == null) return null; try { url = FileLocator.resolve(url); return ImageDescriptor.createFromURL(url); } catch (IOException e) { return null; } }
public static ImageDescriptor getImageDescriptor(String bundleId, String name) { ImageRegistry registry = HelpUIPlugin.getDefault().getImageRegistry(); ImageDescriptor desc = registry.getDescriptor(name); if (desc==null) { Bundle bundle = Platform.getBundle(bundleId); if (bundle==null) return null; URL url = FileLocator.find(bundle, new Path(name), null); desc = ImageDescriptor.createFromURL(url); registry.put(name, desc); } return desc; }