String xml = e.getAttribute("xml"); String contributorPluginId = e.getContributor() .getName(); Bundle bundle = Platform.getBundle(contributorPluginId); InputStream input = (InputStream) bundle.getResource(
private void readStockThemes(Map<String, ColorTheme> themes) { IConfigurationElement[] config = Platform.getExtensionRegistry() .getConfigurationElementsFor( Activator.EXTENSION_POINT_ID_THEME); try { for (IConfigurationElement e : config) { String xml = e.getAttribute("file"); String contributorPluginId = e.getContributor().getName(); Bundle bundle = Platform.getBundle(contributorPluginId); InputStream input = (InputStream) bundle.getResource(xml) .getContent(); ParsedTheme theme = parseTheme(input, false); amendThemeEntries(theme.getTheme().getEntries()); themes.put(theme.getTheme().getName(), theme.getTheme()); } } catch (Exception e) { e.printStackTrace(); } }
/** * Returns the name space that declares this working set. * * @return the name space declaring this working set */ public String getDeclaringNamespace() { return configElement.getContributor().getName(); }
/** * @param configElement */ public StatusHandlerProductBindingDescriptor( IConfigurationElement configElement) { super(); id = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ID); pluginId = configElement.getContributor().getName(); productId = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_PRODUCTID); handlerId = configElement.getAttribute(ATT_HANDLER_ID); }
@Override public String getPluginId() { return configurationElement == null ? pluginId : configurationElement .getContributor().getName(); }
private void loadFromExtension() throws CoreException { String identifier = configElement.getAttribute(ATT_ID); label = configElement.getAttribute(ATT_NAME); className = configElement.getAttribute(ATT_CLASS); description = configElement.getAttribute(ATT_DESCRIPTION); // Sanity check. if ((label == null) || (className == null) || (identifier == null) || (description == null)) { throw new CoreException(new Status(IStatus.ERROR, configElement.getContributor().getName(), 0, "Invalid extension (missing label or class name): " + identifier, //$NON-NLS-1$ null)); } id = identifier; }
private static String[] readGlobalLoadingPluginNames() { IExtensionRegistry reg = Platform.getExtensionRegistry(); IExtensionPoint exPoint = reg.getExtensionPoint(ID, "globalPluginResourceLoad"); //$NON-NLS-1$ IExtension[] extensions = exPoint.getExtensions(); String[] names = new String[extensions.length]; if (extensions.length > 0) { for (int i = 0; i < extensions.length; i++) names[i] = extensions[i].getContributor().getName(); } return names; }
/** * The factory extension was malformed. Log an appropriate exception */ private void logError() { String msg = NLS.bind(RegistryMessages.adapters_badAdapterFactory, element.getContributor().getName()); RuntimeLog.log(new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, 0, msg, null)); } }
@Override public boolean isDeclaringPluginActive() { Bundle fBundle= Platform.getBundle(fConfigElement.getContributor().getName()); return fBundle.getState() == Bundle.ACTIVE; }
public Bundle getBundle(IContributor contributor) { String name = contributor.getName(); PackageAdmin admin = getPackageAdmin(); Bundle[] bundles = admin.getBundles(name, null); if (bundles == null || bundles.length == 0) return null; return bundles[0]; // if there is more than one we need more work... }
private void processIconAttr() { String iconAttr = mElement.getAttribute(ATTR_ICON); if (iconAttr != null && iconAttr.trim().length() > 0) { URL url = Platform.getBundle( mElement.getContributor().getName()).getEntry( iconAttr); mIcon = ImageDescriptor.createFromURL(url); } else { mIcon = ImageDescriptor.getMissingImageDescriptor(); } }
@Override public void run() throws Exception { String pluginId = fElement.getContributor().getName(); boolean isPlugInActivated= Platform.getBundle(pluginId).getState() == Bundle.ACTIVE; if (isPlugInActivated || canActivatePlugIn()) result[0]= (IHyperlinkDetector)fElement.createExecutableExtension(CLASS_ATTRIBUTE); } @Override
private String getNamespace(IConfigurationElement configurationElement) { String namespace = null; if (configurationElement != null) { IExtension extension = configurationElement.getDeclaringExtension(); if (extension != null) { namespace = extension.getContributor().getName(); } } return namespace; }
/** * @param element the configuration element */ public CleanUpTabPageDescriptor(IConfigurationElement element) { fElement= element; fName= element.getAttribute(ATTRIBUTE_ID_NAME); String kind= fElement.getAttribute(ATTRIBUTE_NAME_KIND); fKind= getCleanUpKind(kind); if (fKind == -1) JavaPlugin.logErrorMessage(Messages.format(FixMessages.CleanUpRegistry_WrongKindForConfigurationUI_error, new String[] { fName, element.getContributor().getName(), kind })); }
private void reportError(String template, String arg, IConfigurationElement element, Throwable e) { String supplier = element.getContributor().getName(); String message = NLS.bind(template, arg, supplier); AuthPlugin.getDefault().logError(message, e); } }
private Bundle getBundle() { String namespace= fElement.getDeclaringExtension().getContributor().getName(); Bundle bundle= Platform.getBundle(namespace); return bundle; }
private void registerFileAssociation(IConfigurationElement fileAssociationElement) { //TODO: need to ensure the config. element is valid String contentTypeId = getUniqueId(fileAssociationElement.getContributor().getName(), fileAssociationElement.getAttribute("content-type")); //$NON-NLS-1$ ContentType target = catalog.internalGetContentType(contentTypeId); if (target == null) return; addFileAssociation(fileAssociationElement, target); } }
private Bundle getBundle() { String namespace= fElement.getDeclaringExtension().getContributor().getName(); Bundle bundle= Platform.getBundle(namespace); return bundle; } }
@Override public String getPluginId() { IConfigurationElement element = getConfigurationElement(); if (!element.isValid()) { crashDisable(); return null; } return element.getContributor().getName(); }
private void displayExtension(IExtension extention, CommandInterpreter ci, boolean full) { if (extention == null) return; if (full) { ci.print("Id: " + extention.getUniqueIdentifier()); //$NON-NLS-1$ ci.print(" PointId: " + extention.getExtensionPointUniqueIdentifier()); //$NON-NLS-1$ ci.println(" [from " + extention.getContributor().getName() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ } else { ci.println(extention.getUniqueIdentifier() + " [from " + extention.getContributor().getName() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ } }