Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IConfigurationElement


    }
  }

  private void loadTypeExporters() {
    IExtensionRegistry reg = Platform.getExtensionRegistry();
    IConfigurationElement elements[] = reg.getConfigurationElementsFor(TYPEEXPORTER_EXTENSION_POINT);

    for (IConfigurationElement element : elements) {
      try {
        IConfigurationElement[] formats = element.getChildren("format"); //$NON-NLS-1$
        for (IConfigurationElement format : formats) {
View Full Code Here


     */
    private void configurationElement(Extension ex, IConfigurationElement[] elms, ConfigurationElement parent)
    {
        for( int c=0; c<elms.length; c++)
        {
            IConfigurationElement iconfElm = elms[c];
            ConfigurationElement confElm = new ConfigurationElement(ex,iconfElm.getName(),null);
            for( int a=0; a<iconfElm.getAttributeNames().length; a++)
            {
                confElm.putAttribute(iconfElm.getAttributeNames()[a], iconfElm.getAttribute(iconfElm.getAttributeNames()[a]));
            }
            confElm.setText(iconfElm.getValue());
            if( parent == null )
            {
                ex.addConfigurationElement(confElm);
            }
            else
            {
                parent.addConfigurationElement(confElm);
            }
            configurationElement(ex,iconfElm.getChildren(),confElm);
        }
    }
View Full Code Here

    if (extension != null) {
      IExtension[] extensions =  extension.getExtensions();
      for(int i = 0; i < extensions.length; i++){
        IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
        for(int j = 0; j < configElements.length; j++){
          IConfigurationElement configurationElement = configElements[j];
          String initializerID = configurationElement.getAttribute("id"); //$NON-NLS-1$
          if (initializerID != null && initializerID.equals(containerID)){
            if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED)
              verbose_found_container_initializer(containerID, configurationElement);
            try {
              Object execExt = configurationElement.createExecutableExtension("class"); //$NON-NLS-1$
              if (execExt instanceof ClasspathContainerInitializer){
                return (ClasspathContainerInitializer)execExt;
              }
            } catch(CoreException e) {
              // executable extension could not be created: ignore this initializer
View Full Code Here

    if (extension != null) {
      IExtension[] extensions =  extension.getExtensions();
      for(int i = 0; i < extensions.length; i++){
        IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
        for(int j = 0; j < configElements.length; j++){
          IConfigurationElement configElement = configElements[j];
          try {
            String varAttribute = configElement.getAttribute("variable"); //$NON-NLS-1$
            if (variable.equals(varAttribute)) {
              if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED)
                verbose_found_variable_initializer(variable, configElement);
              Object execExt = configElement.createExecutableExtension("class"); //$NON-NLS-1$
              if (execExt instanceof ClasspathVariableInitializer){
                ClasspathVariableInitializer initializer = (ClasspathVariableInitializer)execExt;
                String deprecatedAttribute = configElement.getAttribute("deprecated"); //$NON-NLS-1$
                if (deprecatedAttribute != null) {
                  JavaModelManager.getJavaModelManager().deprecatedVariables.put(variable, deprecatedAttribute);
                }
                String readOnlyAttribute = configElement.getAttribute("readOnly"); //$NON-NLS-1$
                if (JavaModelManager.TRUE.equals(readOnlyAttribute)) {
                  JavaModelManager.getJavaModelManager().readOnlyVariables.add(variable);
                }
                return initializer;
              }
View Full Code Here

        // For each extension:
        for ( int m = 0; m < members.length; m++ )
        {
            EntryEditorExtension bean = new EntryEditorExtension();

            IConfigurationElement member = members[m];
            IExtension extension = member.getDeclaringExtension();
            String extendingPluginId = extension.getNamespaceIdentifier();

            bean.setId( member.getAttribute( ID_ATTR ) );
            bean.setName( member.getAttribute( NAME_ATTR ) );
            bean.setDescription( member.getAttribute( DESCRIPTION_ATTR ) );
            String iconPath = member.getAttribute( ICON_ATTR );
            ImageDescriptor icon = AbstractUIPlugin.imageDescriptorFromPlugin( extendingPluginId, iconPath );
            if ( icon == null )
            {
                icon = ImageDescriptor.getMissingImageDescriptor();
            }
            bean.setIcon( icon );
            bean.setClassName( member.getAttribute( CLASS_ATTR ) );
            bean.setEditorId( member.getAttribute( EDITOR_ID_ATTR ) );
            bean.setMultiWindow( "true".equalsIgnoreCase( member.getAttribute( MULTI_WINDOW_ATTR ) ) ); //$NON-NLS-1$
            bean.setPriority( Integer.parseInt( member.getAttribute( PRIORITY_ATTR ) ) );

            try
            {
                bean.setEditorInstance( ( IEntryEditor ) member.createExecutableExtension( CLASS_ATTR ) );
            }
            catch ( CoreException e )
            {
                // Will never happen
            }
View Full Code Here

        if (data instanceof ConfigurationElementCategory) {
            ConfigurationElementCategory category = (ConfigurationElementCategory) data;
            cell.setText(category.toString());
            iconDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(Plugin.PLUGIN_ID, "icons/fldr_obj.gif");
        } else if (data instanceof IConfigurationElement) {
            IConfigurationElement element = (IConfigurationElement) data;
            cell.setText(element.getAttribute("name"));

            String iconPath = element.getAttribute("icon");
            if (iconPath != null)
                iconDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(element.getContributor().getName(), iconPath);
        } else {
            cell.setText("<<ERROR>>");
            iconDescriptor = null;
        }
View Full Code Here

    }

    private void setSelectionFromConfigElement(IConfigurationElement element) {
        showTemplateDescription(element);

        IConfigurationElement old = this.selectedElement;
        this.selectedElement = element;
        propSupport.firePropertyChange(PROP_ELEMENT, old, element);
    }
View Full Code Here

    public IConfigurationElement getSelectedElement() {
        return selectedElement;
    }

    public void setSelectedElement(IConfigurationElement selectedElement) {
        IConfigurationElement old = this.selectedElement;
        this.selectedElement = selectedElement;
        if (Display.getCurrent() != null && table != null && !table.isDisposed()) {
            if (!programmaticChange) {
                try {
                    programmaticChange = true;
View Full Code Here

public class PluginClassSorter extends ViewerSorter {

    @Override
    public int compare(Viewer viewer, Object e1, Object e2) {
        IConfigurationElement elem1 = (IConfigurationElement) e1;
        IConfigurationElement elem2 = (IConfigurationElement) e2;

        // Sort undeprecated plugins before deprecated ones.
        int result = sortDeprecation(elem1, elem2);
        if (result != 0)
            return result;
View Full Code Here

        if (data instanceof ConfigurationElementCategory) {
            ConfigurationElementCategory category = (ConfigurationElementCategory) data;
            cell.setText(category.toString());
            iconDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(Plugin.PLUGIN_ID, "icons/fldr_obj.gif");
        } else if (data instanceof IConfigurationElement) {
            IConfigurationElement element = (IConfigurationElement) data;
            cell.setText(element.getAttribute("name"));

            String iconPath = element.getAttribute("icon");
            if (iconPath != null)
                iconDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(element.getContributor().getName(), iconPath);
            else
                iconDescriptor = null;
        } else {
            cell.setText("<<ERROR>>");
            iconDescriptor = 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.