private String getContributingPlugin(IConfigurationElement configurationElement) { Object parent = configurationElement; while (parent != null) { if (parent instanceof IExtension) { return ((IExtension) parent).getNamespace(); } parent = ((IConfigurationElement) parent).getParent(); } return null; }
public static String findId(IConfigurationElement element) { String id= null; while (element != null && id == null) { id= element.getAttribute("id"); //$NON-NLS-1$ if (id != null) break; Object parent= element.getParent(); if (parent instanceof IExtension) { id= ((IExtension) parent).getUniqueIdentifier(); break; } else if (parent instanceof IConfigurationElement) { element= (IConfigurationElement) parent; } else { break; } } return id == null ? "<unknown>" : id; //$NON-NLS-1$ }
public static String findId(IConfigurationElement element) { String id= null; while (element != null) { id= element.getAttribute("id"); //$NON-NLS-1$ if (id != null) break; Object parent= element.getParent(); if (parent instanceof IExtension) { id= ((IExtension) parent).getUniqueIdentifier(); break; } else if (parent instanceof IConfigurationElement) { element= (IConfigurationElement) parent; } else { break; } } return id == null ? "<unknown>" : id; //$NON-NLS-1$ }
public static String findId(IConfigurationElement element) { String id= null; while (element != null) { id= element.getAttribute("id"); //$NON-NLS-1$ if (id != null) break; Object parent= element.getParent(); if (parent instanceof IExtension) { id= ((IExtension) parent).getUniqueIdentifier(); break; } else if (parent instanceof IConfigurationElement) { element= (IConfigurationElement) parent; } else { break; } } return id == null ? "<unknown>" : id; //$NON-NLS-1$ }
public static String getActionSetCommandId(IConfigurationElement element) { String id = getDefinitionId(element); if (id != null) { return id; } id = getId(element); String actionSetId = null; Object obj = element.getParent(); while (obj instanceof IConfigurationElement && actionSetId == null) { IConfigurationElement parent = (IConfigurationElement) obj; if (parent.getName().equals(IWorkbenchRegistryConstants.TAG_ACTION_SET)) { actionSetId = getId(parent); } obj = parent.getParent(); } return ACTION_SET_CMD_PREFIX + actionSetId + '/' + id; }
public static String getActionSetCommandId(IConfigurationElement element) { String id = MenuHelper.getDefinitionId(element); if (id != null) { return id; } id = MenuHelper.getId(element); String actionSetId = null; Object obj = element.getParent(); while (obj instanceof IConfigurationElement && actionSetId == null) { IConfigurationElement parent = (IConfigurationElement) obj; String parentName = parent.getName(); if (parentName.equals(IWorkbenchRegistryConstants.TAG_ACTION_SET) || parentName.equals(IWorkbenchRegistryConstants.TAG_VIEW_CONTRIBUTION) || parentName.equals(IWorkbenchRegistryConstants.TAG_EDITOR_CONTRIBUTION)) { actionSetId = MenuHelper.getId(parent); } obj = parent.getParent(); } return IWorkbenchRegistryConstants.AUTOGENERATED_PREFIX + actionSetId + '/' + id; }
private String getDebugPath(IConfigurationElement configurationElement) { StringBuffer buf= new StringBuffer(); buf.append(configurationElement.getName()); Object parent= configurationElement.getParent(); while (parent != null) { if (parent instanceof IConfigurationElement) { buf.append(" > "); //$NON-NLS-1$ IConfigurationElement parent2= (IConfigurationElement) parent; buf.append(parent2.getName()); String id= parent2.getAttribute("id"); //$NON-NLS-1$ if (id != null) buf.append(" (id=").append(id).append(')'); //$NON-NLS-1$ parent= parent2.getParent(); } else if (parent instanceof IExtension) { IExtension parent2= (IExtension) parent; buf.append(" : "); //$NON-NLS-1$ buf.append(parent2.getExtensionPointUniqueIdentifier()); buf.append(" @ "); //$NON-NLS-1$ buf.append(parent2.getContributor().getName()); parent= null; } else { parent= null; } } return buf.toString(); }
private String getDebugPath(IConfigurationElement configurationElement) { StringBuffer buf= new StringBuffer(); buf.append(configurationElement.getName()); Object parent= configurationElement.getParent(); while (parent != null) { if (parent instanceof IConfigurationElement) { buf.append(" > "); //$NON-NLS-1$ IConfigurationElement parent2= (IConfigurationElement) parent; buf.append(parent2.getName()); String id= parent2.getAttribute("id"); //$NON-NLS-1$ if (id != null) buf.append(" (id=").append(id).append(')'); //$NON-NLS-1$ parent= parent2.getParent(); } else if (parent instanceof IExtension) { IExtension parent2= (IExtension) parent; buf.append(" : "); //$NON-NLS-1$ buf.append(parent2.getExtensionPointUniqueIdentifier()); buf.append(" @ "); //$NON-NLS-1$ buf.append(parent2.getContributor().getName()); parent= null; } else { parent= null; } } return buf.toString(); }
private String getDebugPath(IConfigurationElement configurationElement) { StringBuilder buf= new StringBuilder(); buf.append(configurationElement.getName()); Object parent= configurationElement.getParent(); while (parent != null) { if (parent instanceof IConfigurationElement) { buf.append(" > "); //$NON-NLS-1$ IConfigurationElement parent2= (IConfigurationElement) parent; buf.append(parent2.getName()); String id= parent2.getAttribute("id"); //$NON-NLS-1$ if (id != null) buf.append(" (id=").append(id).append(')'); //$NON-NLS-1$ parent= parent2.getParent(); } else if (parent instanceof IExtension) { IExtension parent2= (IExtension) parent; buf.append(" : "); //$NON-NLS-1$ buf.append(parent2.getExtensionPointUniqueIdentifier()); buf.append(" @ "); //$NON-NLS-1$ buf.append(parent2.getContributor().getName()); parent= null; } else { parent= null; } } return buf.toString(); }
private String getDebugPath(IConfigurationElement configurationElement) { StringBuffer buf= new StringBuffer(); buf.append(configurationElement.getName()); Object parent= configurationElement.getParent(); while (parent != null) { if (parent instanceof IConfigurationElement) { buf.append(" > "); //$NON-NLS-1$ IConfigurationElement parent2= (IConfigurationElement) parent; buf.append(parent2.getName()); String id= parent2.getAttribute("id"); //$NON-NLS-1$ if (id != null) buf.append(" (id=").append(id).append(')'); //$NON-NLS-1$ parent= parent2.getParent(); } else if (parent instanceof IExtension) { IExtension parent2= (IExtension) parent; buf.append(" : "); //$NON-NLS-1$ buf.append(parent2.getExtensionPointUniqueIdentifier()); buf.append(" @ "); //$NON-NLS-1$ buf.append(parent2.getContributor().getName()); parent= null; } else { parent= null; } } return buf.toString(); }
private static TemplateModel _createTemplateModel(IConfigurationElement element, String pluginName) { TemplateModel templateModel = null; try { String id = element.getAttribute("id"); String resource = element.getAttribute("resource"); String templateFolder = null; List<TemplateVariable> paramList = new ArrayList<>(); IConfigurationElement[] items = ((IExtension)element.getParent()).getConfigurationElements(); for (IConfigurationElement item : items) { if ("templatesFolder".equals(item.getName())) { templateFolder = item.getAttribute("path"); } if ("templateVariable".equals(item.getName())) { String paramName = item.getAttribute("name"); String reqVal = item.getAttribute("required"); paramList.add(new TemplateVariable(paramName, reqVal)); } } Configuration config = new Configuration(); TemplateVariable[] vars = paramList.toArray(new TemplateVariable[0]); templateModel = new TemplateModel(pluginName, config, id, resource, templateFolder, vars); } catch (Exception e) { LiferayCore.logError(e); } return templateModel; }
private static IContextFunction createToggleFunction(final IConfigurationElement element) { Object ice = element.getParent(); if (!(ice instanceof IConfigurationElement)) { return null;
if (mNewProviderID != null && mNewProviderID.length() < 1) { IConfigurationElement parentElement = (IConfigurationElement) config .getParent(); if (ConnectionProfileManager.EXT_ELEM_CONNECTION_PROFILE .equals(parentElement.getName())) {
if (logEntries == null) logEntries = new ArrayList(3); logEntries.add(new FrameworkLogEntry(Activator.PI_APP, NLS.bind(Messages.provider_invalid, element.getParent().toString()), 0, e, null));
if (logEntries == null) logEntries = new ArrayList(3); logEntries.add(new FrameworkLogEntry(Activator.PI_APP, NLS.bind(Messages.provider_invalid, element.getParent().toString()), 0, e, null));
CompletionProposalCategory(IConfigurationElement element, CompletionProposalComputerRegistry registry) { fElement= element; fRegistry= registry; IExtension parent= (IExtension) element.getParent(); fId= parent.getUniqueIdentifier(); checkNotNull(fId, "id"); //$NON-NLS-1$ String name= parent.getLabel(); if (name == null) fName= fId; else fName= name; String icon= element.getAttribute(ICON); ImageDescriptor img= null; if (icon != null) { Bundle bundle= getBundle(); if (bundle != null) { Path path= new Path(icon); URL url= FileLocator.find(bundle, path, null); img= ImageDescriptor.createFromURL(url); } } fImage= img; }
if (logEntries == null) logEntries = new ArrayList(3); logEntries.add(new FrameworkLogEntry(Activator.PI_APP, NLS.bind(Messages.provider_invalid, element.getParent().toString()), 0, e, null));
CompletionProposalCategory(IConfigurationElement element, CompletionProposalComputerRegistry registry) throws CoreException { fElement= element; fRegistry= registry; IExtension parent= (IExtension) element.getParent(); fId= parent.getUniqueIdentifier(); checkNotNull(fId, "id"); //$NON-NLS-1$
if (commandId == null) { Object obj = element.getParent(); if (obj instanceof IConfigurationElement) { contributionId = ((IConfigurationElement) obj)
CompletionProposalCategory(IConfigurationElement element, CompletionProposalComputerRegistry registry) throws CoreException { fElement= element; fRegistry= registry; IExtension parent= (IExtension) element.getParent(); fId= parent.getUniqueIdentifier(); checkNotNull(fId, "id"); //$NON-NLS-1$