Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IExtension


  public void scan(IProgressMonitor monitor, String attribute, IExtensionCallback<T> callback) {
    if (extensionPoint != null) {
      IExtension[] extensions = extensionPoint.getExtensions();
      for (int i = 0; i < extensions.length; i++) {
        IExtension extension = extensions[i];

        if (extension.getLabel() != null && monitor != null)
          monitor.setTaskName(extension.getLabel());

        IConfigurationElement[] elements = extension.getConfigurationElements();

        for (IConfigurationElement element : elements) {
          String name = element.getAttribute(attribute);

          if (monitor != null)
            monitor.subTask(name);

          T clazz = createExecutable(element);

          if (clazz != null) {
            boolean abort = callback.created(extension.getNamespaceIdentifier(), name, clazz);

            if (abort)
              break;
          }
        }
View Full Code Here


  public T createExecutable(String extensionId) {
    T clazz = null;

    if (extensionPoint != null) {
      IExtension extension = extensionPoint.getExtension(extensionId);

      if(extension != null) {
        IConfigurationElement[] elements = extension.getConfigurationElements();

        if(elements.length>0)
          clazz = createExecutable(elements[0]);
      }
    }
View Full Code Here

  public T createExecutableByValue(String extensionId, String attribute, String value) {
    T clazz = null;

    if (extensionPoint != null) {
      IExtension extension = extensionPoint.getExtension(extensionId);

      if(extension != null) {
        IConfigurationElement[] elements = extension.getConfigurationElements();

        if(elements.length>0) {
          for (int i = 0; i < elements.length; i++) {
            IConfigurationElement configurationElement = elements[i];
            String ceValue = configurationElement.getAttribute(attribute);
View Full Code Here

  public void dumpExtensions() {
    if (extensionPoint != null) {
      IExtension[] extensions = extensionPoint.getExtensions();
 
      for (int i = 0; i < extensions.length; i++) {
        IExtension temp = extensions[i];
        System.out.println("Extension#"+i+" "+temp.getSimpleIdentifier() + "/" + temp.getUniqueIdentifier());
     
    }
  }
View Full Code Here

           {
             IExtensionDelta delta = deltas[i];
             if (delta.getExtensionPoint().getUniqueIdentifier().equals(qualifiedExtensionPointID))
             {
               boolean add = delta.getKind() == IExtensionDelta.ADDED;
               IExtension extension = delta.getExtension();
               IConfigurationElement[] configurationElement = extension.getConfigurationElements();
               for (int j = 0; j < configurationElement.length; ++j)
               {
                 internalReadElement(configurationElement[j], add);
               }
             }
View Full Code Here

   * Logs the error in the desktop log using the provided
   * text and the information in the configuration element.
   */
  protected void logError(IConfigurationElement element, String text)
  {
    IExtension extension = element.getDeclaringExtension();
    System.err.println("Plugin " + extension.getContributor().getName() + ", extension " + extension.getExtensionPointUniqueIdentifier());
    System.err.println(text);
  }
View Full Code Here

           {
             IExtensionDelta delta = deltas[i];
             if (delta.getExtensionPoint().getUniqueIdentifier().equals(qualifiedExtensionPointID))
             {
               boolean add = delta.getKind() == IExtensionDelta.ADDED;
               IExtension extension = delta.getExtension();
               IConfigurationElement[] configurationElement = extension.getConfigurationElements();
               for (int j = 0; j < configurationElement.length; ++j)
               {
                 internalReadElement(configurationElement[j], add);
               }
             }
View Full Code Here

   * Logs the error in the desktop log using the provided
   * text and the information in the configuration element.
   */
  protected void logError(IConfigurationElement element, String text)
  {
    IExtension extension = element.getDeclaringExtension();
    System.err.println("Plugin " + extension.getContributor().getName() + ", extension " + extension.getExtensionPointUniqueIdentifier());
    System.err.println(text);
  }
View Full Code Here

          Set entries= fDescriptorMapping.entrySet();
          Iterator iter= entries.iterator();
          while (iter.hasNext()) {
            Map.Entry entry= (Map.Entry)iter.next();
            if (bundleName.equals(entry.getValue())) {
                IExtension extension = getConfigurationElement(entry.getKey()).getDeclaringExtension();
              return extension.getExtensionPointUniqueIdentifier();
            }
          }
        }
      }
      return "unknown"//$NON-NLS-1$
View Full Code Here

  private IApplication getApplication(String applicationToRun) throws CoreException {
    // Assume we are in 3.0 mode.
    // Find the name of the application as specified by the PDE JUnit launcher.
    // If no application is specified, the 3.0 default workbench application
    // is returned.
    IExtension extension = Platform.getExtensionRegistry().getExtension( Platform.PI_RUNTIME, Platform.PT_APPLICATIONS,
        applicationToRun );
    if (extension == null)
      return null;

    // If the extension does not have the correct grammar, return null.
    // Otherwise, return the application object.
    IConfigurationElement[] elements = extension.getConfigurationElements();
    if (elements.length > 0) {
      IConfigurationElement[] runs = elements[0].getChildren( "run" ); //$NON-NLS-1$
      if (runs.length > 0) {
        Object runnable = runs[0].createExecutableExtension( "class" ); //$NON-NLS-1$
        if (runnable instanceof IApplication)
View Full Code Here

TOP

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

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.