Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IConfigurationElement


                IDavinciServerConstants.EP_TAG_JSPLUGIN);
        StringBuffer sb = new StringBuffer();
        sb.append("[");
        boolean wasOne = false;
        for (Iterator iterator = extensions.iterator(); iterator.hasNext();) {
            IConfigurationElement configElement = (IConfigurationElement) iterator.next();
            String role = configElement.getAttribute(IDavinciServerConstants.EP_ATTR_JSPLUGIN_ROLE);
            if (role != null && role.length() > 0) {
                // validate authorization for this plugin
            }

            if (wasOne) {
                sb.append(",");
            }
            wasOne = true;
            String path = configElement.getAttribute(IDavinciServerConstants.EP_ATTR_JSPLUGIN_PATH);
            sb.append('"').append(path).append("\",");
            String resourcePath = configElement.getAttribute(IDavinciServerConstants.EP_ATTR_JSPLUGIN_RESOURCE_PATH);
            String bundleName = configElement.getDeclaringExtension().getContributor().getName();
            Bundle bundle = Activator.getActivator().getOtherBundle(bundleName);
            if (bundle != null) {
                URL resourceURL = bundle.getEntry(resourcePath + ".plugin");
                if (resourceURL != null) {
                  InputStreamReader reader = null;
View Full Code Here


            IExtension extension = extensions[i];
            IConfigurationElement[] elements = extension.getConfigurationElements();

            // For each member of the extension ...
            for( int j = 0; j < elements.length; j++ ) {
                IConfigurationElement element = elements[j];
                try {
                    processor.process(extension, element);
                } catch (Throwable exception) {
                    plugin
                            .getLog()
                            .log(
                                    new Status(
                                            IStatus.WARNING,
                                            element.getNamespaceIdentifier(),
                                            0,
                                            MessageFormat
                                                    .format(
                                                            "Error processing extension {0}", new Object[]{exception}), exception)); //$NON-NLS-1$                   
                }
View Full Code Here

            IExtension extension = extensions[i];
            IConfigurationElement[] elements = extension.getConfigurationElements();

            // For each member of the extension ...
            for( int j = 0; j < elements.length; j++ ) {
                IConfigurationElement element = elements[j];
                try {
                    Object obj = itemCreator.createItem(extension, element);
                    if (obj == null)
                        continue; // warning?
View Full Code Here

      }
    }
  }
 
  private AbstractClassModel newModel(String id, WidgetAdapter adapter, EventSetDescriptor eventSet) {
    IConfigurationElement config = listenerModels.get(id);
    try {
      AbstractClassModel model = (AbstractClassModel) config.createExecutableExtension("class");
      model.init(adapter, eventSet);
      return model;
    } catch (CoreException e) {
      ParserPlugin.getLogger().error(e);
      return null;
View Full Code Here

    };
  }
  class PriorityComparator implements Comparator<String>{
   
    public int compare(String o1, String o2) {
      IConfigurationElement config1 = listenerModels.get(o1);
      IConfigurationElement config2 = listenerModels.get(o2);
      String sp1=config1.getAttribute("priority");
      String sp2=config2.getAttribute("priority");
      int p1=sp1==null?Integer.MAX_VALUE:Integer.parseInt(sp1);
      int p2=sp1==null?Integer.MAX_VALUE:Integer.parseInt(sp2);
      return p1-p2;
    }
View Full Code Here

    children = config
        .getChildren(IWorkbenchRegistryConstants.TAG_SELECTION);
    if (children.length > 0) {
      classes = new ArrayList();
      for (int i = 0; i < children.length; i++) {
        IConfigurationElement sel = children[i];
        String cname = sel
            .getAttribute(IWorkbenchRegistryConstants.ATT_CLASS);
        String name = sel
            .getAttribute(IWorkbenchRegistryConstants.ATT_NAME);
        SelectionClass sclass = new SelectionClass();
        sclass.className = cname;
        sclass.nameFilter = name;
        classes.add(sclass);
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.core.runtime.dynamicHelpers.IExtensionChangeHandler#addExtension(org.eclipse.core.runtime.dynamicHelpers.IExtensionTracker, org.eclipse.core.runtime.IExtension)
     */
    public void addExtension(IExtensionTracker tracker, IExtension addedExtension) {
        IConfigurationElement addedElements[] = addedExtension.getConfigurationElements();
        for (int i = 0; i < addedElements.length; i++) {
            DecoratorRegistryReader reader = new DecoratorRegistryReader();
            reader.readElement(addedElements[i]);
            for (Iterator j = reader.getValues().iterator(); j.hasNext();) {
                addDecorator((DecoratorDefinition) j.next());
View Full Code Here

    // Sort the commands extension point based on element name.
    final IConfigurationElement[] commandsExtensionPoint = registry
        .getConfigurationElementsFor(EXTENSION_COMMANDS);
    for (int i = 0; i < commandsExtensionPoint.length; i++) {
      final IConfigurationElement configurationElement = commandsExtensionPoint[i];
      final String name = configurationElement.getName();

      // Check if it is a handler submission or a command definition.
      if (TAG_HANDLER_SUBMISSION.equals(name)) {
        addElementToIndexedArray(configurationElement,
            indexedConfigurationElements,
            INDEX_HANDLER_SUBMISSIONS, handlerSubmissionCount++);
      } else if (TAG_COMMAND.equals(name)) {
        addElementToIndexedArray(configurationElement,
            indexedConfigurationElements,
            INDEX_COMMAND_DEFINITIONS, commandDefinitionCount++);
      }
    }

    // Sort the handler extension point based on element name.
    final IConfigurationElement[] handlersExtensionPoint = registry
        .getConfigurationElementsFor(EXTENSION_HANDLERS);
    for (int i = 0; i < handlersExtensionPoint.length; i++) {
      final IConfigurationElement configurationElement = handlersExtensionPoint[i];
      final String name = configurationElement.getName();

      // Check if it is a handler submission or a command definition.
      if (TAG_HANDLER.equals(name)) {
        addElementToIndexedArray(configurationElement,
            indexedConfigurationElements,
View Full Code Here

   */
  private final void readDefaultHandlersFromRegistry(
      final IConfigurationElement[] configurationElements,
      final int configurationElementCount) {
    for (int i = 0; i < configurationElementCount; i++) {
      final IConfigurationElement configurationElement = configurationElements[i];

      /*
       * Read out the command identifier. This was already checked by
       * <code>CommandPersistence</code>, so we'll just ignore any
       * problems here.
       */
      final String commandId = readOptional(configurationElement, ATT_ID);
      if (commandId == null) {
        continue;
      }

      // Check to see if we have a default handler of any kind.
      if ((configurationElement.getAttribute(ATT_DEFAULT_HANDLER) == null)
          && (configurationElement.getChildren(TAG_DEFAULT_HANDLER).length == 0)) {
        continue;
      }

      handlerActivations.add(handlerService
          .activateHandler(commandId, new HandlerProxy(
View Full Code Here

      final IConfigurationElement[] configurationElements,
      final int configurationElementCount) {
    final List warningsToLog = new ArrayList(1);

    for (int i = 0; i < configurationElementCount; i++) {
      final IConfigurationElement configurationElement = configurationElements[i];

      // Read out the command identifier.
      final String commandId = readRequired(configurationElement,
          ATT_COMMAND_ID, warningsToLog, "Handlers need a command id"); //$NON-NLS-1$
      if (commandId == null) {
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.IConfigurationElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.