public boolean available() { return config.isValid(); }
/** * Return whether or not this decorator should be * applied to adapted types. * * @return whether or not this decorator should be * applied to adapted types */ public boolean isAdaptable() { if (!definingElement.isValid()) { crashDisable(); return false; } return Boolean.valueOf(definingElement.getAttribute(ATT_ADAPTABLE)).booleanValue(); }
/** * Gets the name. * * @return Returns the label attribute from the decorator contribution, or * null if the underlined definition is not valid anymore */ public String getName() { if (!definingElement.isValid()) { crashDisable(); return null; } return definingElement.getAttribute(ATT_LABEL); }
public ProvisioningAction getAction(String actionId, VersionRange versionRange) { IConfigurationElement actionElement = getActionMap().get(actionId); if (actionElement != null && actionElement.isValid()) { try { ProvisioningAction action = (ProvisioningAction) actionElement.createExecutableExtension(ATTRIBUTE_CLASS); String touchpointType = actionElement.getAttribute(TOUCHPOINT_TYPE); if (touchpointType != null) { String touchpointVersion = actionElement.getAttribute(TOUCHPOINT_VERSION); Touchpoint touchpoint = touchpointManager.getTouchpoint(touchpointType, touchpointVersion); if (touchpoint == null) throw new IllegalArgumentException(NLS.bind(Messages.ActionManager_Required_Touchpoint_Not_Found, touchpointType, actionId)); action.setTouchpoint(touchpoint); } return action; } catch (InvalidRegistryObjectException e) { // skip } catch (CoreException e) { throw new IllegalArgumentException(NLS.bind(Messages.ActionManager_Exception_Creating_Action_Extension, actionId)); } } return null; }
public ProvisioningAction getAction(String actionId, VersionRange versionRange) { IConfigurationElement actionElement = getActionMap().get(actionId); if (actionElement != null && actionElement.isValid()) { try { ProvisioningAction action = (ProvisioningAction) actionElement.createExecutableExtension(ATTRIBUTE_CLASS); String touchpointType = actionElement.getAttribute(TOUCHPOINT_TYPE); if (touchpointType != null) { String touchpointVersion = actionElement.getAttribute(TOUCHPOINT_VERSION); Touchpoint touchpoint = touchpointManager.getTouchpoint(touchpointType, touchpointVersion); if (touchpoint == null) throw new IllegalArgumentException(NLS.bind(Messages.ActionManager_Required_Touchpoint_Not_Found, touchpointType, actionId)); action.setTouchpoint(touchpoint); } return action; } catch (InvalidRegistryObjectException e) { // skip } catch (CoreException e) { throw new IllegalArgumentException(NLS.bind(Messages.ActionManager_Exception_Creating_Action_Extension, actionId)); } } return null; }
/** * Returns the description * * @return Returns the label attribute from the decorator contribution, or * null if the underlined definition is not valid anymore */ public String getDescription() { if (!definingElement.isValid()) { crashDisable(); return null; } return RegistryReader.getDescription(definingElement); }
private Map<String, QueryGroupProvider> getRegisteredQueryGroups() { if(contributedQueryGroups != null) { return contributedQueryGroups; } contributedQueryGroups = new HashMap<>(); if (Platform.isRunning()) { for (IConfigurationElement e : Platform.getExtensionRegistry().getConfigurationElementsFor(IExtensions.QUERY_SPECIFICATION_EXTENSION_POINT_ID)) { if (e.isValid()) { processExtension(e); } } } return contributedQueryGroups; }
private Map<EStructuralFeature, PQueryProvider> getSurrogateQueryProviders() { if(contributedSurrogateQueries != null) { return contributedSurrogateQueries; } contributedSurrogateQueries = new HashMap<>(); if (Platform.isRunning()) { for (IConfigurationElement e : Platform.getExtensionRegistry().getConfigurationElementsFor(ViatraQueryRuntimeConstants.SURROGATE_QUERY_EXTENSIONID)) { if (e.isValid()) { processExtension(e); } } } return contributedSurrogateQueries; }
@Override public Map<String, String> loadGenmodels() { if (genmodelUriMap != null) { return genmodelUriMap; } genmodelUriMap = Maps.newHashMap(); if (Platform.getExtensionRegistry() != null) { IConfigurationElement[] packages = Platform.getExtensionRegistry().getConfigurationElementsFor( EPACKAGE_EXTENSION_ID); for (IConfigurationElement packageExtension : packages) { if (packageExtension.isValid()) { String genmodelUri = packageExtension.getAttribute(GENMODEL_ATTRIBUTE); if (genmodelUri != null && !genmodelUri.isEmpty()) { String uri = packageExtension.getAttribute(URI_ATTRIBUTE); if (URI.createURI(genmodelUri).isRelative()) { genmodelUriMap.put(uri, String.format("platform:/plugin/%s/%s", packageExtension .getContributor().getName(), genmodelUri)); } else { genmodelUriMap.put(uri, genmodelUri); } } } } } return genmodelUriMap; } }
@Override public Map<String, String> loadGenmodels() { if (genmodelUriMap != null) { return genmodelUriMap; } genmodelUriMap = Maps.newHashMap(); if (Platform.getExtensionRegistry() != null) { IConfigurationElement[] packages = Platform.getExtensionRegistry().getConfigurationElementsFor( EPACKAGE_EXTENSION_ID); for (IConfigurationElement packageExtension : packages) { if (packageExtension.isValid()) { String genmodelUri = packageExtension.getAttribute(GENMODEL_ATTRIBUTE); if (genmodelUri != null && !genmodelUri.isEmpty()) { String uri = packageExtension.getAttribute(URI_ATTRIBUTE); if (URI.createURI(genmodelUri).isRelative()) { genmodelUriMap.put(uri, String.format("platform:/plugin/%s/%s", packageExtension .getContributor().getName(), genmodelUri)); } else { genmodelUriMap.put(uri, genmodelUri); } } } } } return genmodelUriMap; } }
Set<String> fqns = new HashSet<>(); for (IConfigurationElement e : element.getChildren("query-specification")) { if (e.isValid()) { String fqn = e.getAttribute("fqn"); boolean added = fqns.add(fqn);
@Override public String getPluginId() { IConfigurationElement element = getConfigurationElement(); if (!element.isValid()) { crashDisable(); return null; } return element.getContributor().getName(); }
/** * Initialize the enablement expression for this decorator */ protected void initializeEnablement() { if (!definingElement.isValid()) { crashDisable(); return; } IConfigurationElement[] elements = definingElement.getChildren(CHILD_ENABLEMENT); if (elements.length == 0) { String className = definingElement.getAttribute(ATT_OBJECT_CLASS); if (className != null) { enablement = new ActionExpression(ATT_OBJECT_CLASS, className); } } else { enablement = new ActionExpression(elements[0]); } }