if (o instanceof GenericMapper) { String xml = e.getAttribute("xml"); String contributorPluginId = e.getContributor() .getName(); Bundle bundle = Platform.getBundle(contributorPluginId);
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 void loadProperties(IConfigurationElement element) { IConfigurationElement[] children = element.getChildren(); properties = new HashMap(children.length); for (int i = 0; i < children.length; i++) { IConfigurationElement child = children[i]; String key = child.getAttribute(ATTR_NAME); String value = child.getAttribute(ATTR_VALUE); if (key != null && value != null) properties.put(key, value); } definingBundle = Activator.getBundle(element.getContributor()); }
/** * 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)); } }
private void reportDuplicatePlatform( IConfigurationElement oneConfigElement, IConfigurationElement otherConfigElement) { String message = "The plugins \"" + oneConfigElement.getContributor().getName() + "\" and \"" + otherConfigElement.getContributor().getName() + "\" have registered a duplicate attribute \"id\" " + "for the extension element \"jpaPlatform\"."; JptCorePlugin.log(message); }
@Override public boolean isDeclaringPluginActive() { Bundle fBundle= Platform.getBundle(fConfigElement.getContributor().getName()); return fBundle.getState() == Bundle.ACTIVE; }
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
public void run() throws Exception { String pluginId = fElement.getContributor().getName(); boolean isPlugInActivated= Platform.getBundle(pluginId).getState() == Bundle.ACTIVE; if (isPlugInActivated || canActivatePlugIn()) result[0]= (AbstractHyperlinkDetector)fElement.createExecutableExtension(CLASS_ATTRIBUTE); } /*
/** * @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 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 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 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); } }
public void fail(String message) throws InvalidRegistryObjectException { String id= findId(fElement); String extensionPointId= fElement.getDeclaringExtension().getExtensionPointUniqueIdentifier(); Object[] args= { fElement.getContributor().getName(), id, extensionPointId }; String blame= MessageFormat.format(RulerColumnMessages.ExtensionPointHelper_invalid_contribution_msg, args); IStatus status= new Status(IStatus.WARNING, TextEditorPlugin.PLUGIN_ID, IStatus.OK, blame + message, null); fLog.log(status); throw new InvalidRegistryObjectException(); }
@Override public String getPluginId() { IConfigurationElement element = getConfigurationElement(); if (!element.isValid()) { crashDisable(); return null; } return element.getContributor().getName(); }