Examples of EditorDescriptor


Examples of org.eclipse.ui.internal.registry.EditorDescriptor

            // update the label to reflect the locked state
            if (!isEditorRemovable(oldDefaultItem)) {
        setLockedItemText(oldDefaultItem, oldDefaultItem.getText());
      }
            // Now set the new default
            EditorDescriptor editor = (EditorDescriptor) items[0].getData(DATA_EDITOR);
            getSelectedResourceType().setDefaultEditor(editor);
            IContentType fromContentType = (IContentType) items[0].getData(DATA_FROM_CONTENT_TYPE);
            items[0].dispose(); //Table is single selection
            TableItem item = new TableItem(editorTable, SWT.NULL, 0);
            item.setData(DATA_EDITOR, editor);
            if (fromContentType != null) {
        item.setData(DATA_FROM_CONTENT_TYPE, fromContentType);
      }
            item
                    .setText(editor.getLabel()
                            + " " + WorkbenchMessages.FileEditorPreference_defaultLabel); //$NON-NLS-1$
            item.setImage(getImage(editor));
            if (!isEditorRemovable(item)) {
        setLockedItemText(item, item.getText());
      }
View Full Code Here

Examples of org.eclipse.ui.internal.registry.EditorDescriptor

   * through the <code>embeddedEditors</code> extension point.
   *
   * @throws CoreException if the editorId is not found
   */
  protected IEditorPart instantiateEditor(String editorId) throws CoreException {
    EditorDescriptor descriptor = (EditorDescriptor) idToDescriptor.get(editorId);
    if (descriptor == null) {
      descriptor = readDescriptor(editorId);
      if (descriptor == null) {
        IStatus status = new Status(IStatus.ERROR, CommonUIPlugin.PLUGIN_ID, ICompositeEditorConstants.COULD_NOT_INSTANTIATE_EDITOR, NLS.bind(Messages.CompositeEditorManager_Could_not_find_editor, (new Object[] { editorId })), null);
        throw new CoreException(status);
      }
    }
    return (IEditorPart) descriptor.getConfigurationElement().createExecutableExtension(ATT_EDITOR_CLASS);
  }
View Full Code Here

Examples of org.eclipse.ui.internal.registry.EditorDescriptor

          // Use reflection to create and set state on an editor descriptor
          // This was done to avoid copying the class to this package
          try {
            Constructor constuctor = EditorDescriptor.class.getDeclaredConstructor(new Class[0]);
            constuctor.setAccessible(true);
            EditorDescriptor descriptor = (EditorDescriptor)constuctor.newInstance(new Object[0]);

            Method method = descriptor.getClass().getDeclaredMethod("setID", new Class[] {String.class});
            method.setAccessible(true);
            method.invoke(descriptor, new Object[]{editorId});

            method = descriptor.getClass().getDeclaredMethod("setConfigurationElement", new Class[] {IConfigurationElement.class});
            method.setAccessible(true);
            method.invoke(descriptor, new Object[]{element});

            idToDescriptor.put(editorId, descriptor);
            return descriptor;
View Full Code Here

Examples of org.eclipse.ui.internal.registry.EditorDescriptor

  /**
   * Creates and populates an editor site for the given editor.
   */
  protected EditorSite createEditorSite(String editorId, IEditorInput input, IEditorPart editor) {
    EditorDescriptor descriptor = (EditorDescriptor) idToDescriptor.get(editorId);
    IEditorReference ref = new EditorReference(getEditorManager(), input, descriptor);
    EditorSite site = new EditorInViewSite(viewSite, ref, editor, page, descriptor);
    IEditorActionBarContributor contributor = descriptor.createActionBarContributor();
    site.setActionBars(createEditorActionBars(descriptor, contributor, site));
    return site;
  }
View Full Code Here

Examples of org.eclipse.ui.internal.registry.EditorDescriptor

   * through the <code>embeddedEditors</code> extension point.
   *
   * @throws CoreException if the editorId is not found
   */
  protected IEditorPart instantiateEditor(String editorId) throws CoreException {
    EditorDescriptor descriptor = (EditorDescriptor) idToDescriptor.get(editorId);
    if (descriptor == null) {
      descriptor = readDescriptor(editorId);
      if (descriptor == null) {
        IStatus status = new Status(IStatus.ERROR, CommonUIPlugin.PLUGIN_ID, ICompositeEditorConstants.COULD_NOT_INSTANTIATE_EDITOR, NLS.bind(Messages.CompositeEditorManager_Could_not_find_editor, (new Object[] { editorId })), null);
        throw new CoreException(status);
      }
    }
    return (IEditorPart) descriptor.getConfigurationElement().createExecutableExtension(ATT_EDITOR_CLASS);
  }
View Full Code Here

Examples of org.eclipse.ui.internal.registry.EditorDescriptor

          // Use reflection to create and set state on an editor descriptor
          // This was done to avoid copying the class to this package
          try {
            Constructor constuctor = EditorDescriptor.class.getDeclaredConstructor(new Class[0]);
            constuctor.setAccessible(true);
            EditorDescriptor descriptor = (EditorDescriptor)constuctor.newInstance(new Object[0]);

            Method method = descriptor.getClass().getDeclaredMethod("setID", new Class[] {String.class});
            method.setAccessible(true);
            method.invoke(descriptor, new Object[]{editorId});

            method = descriptor.getClass().getDeclaredMethod("setConfigurationElement", new Class[] {IConfigurationElement.class});
            method.setAccessible(true);
            method.invoke(descriptor, new Object[]{element});

            idToDescriptor.put(editorId, descriptor);
            return descriptor;
View Full Code Here

Examples of org.eclipse.ui.internal.registry.EditorDescriptor

  /**
   * Creates and populates an editor site for the given editor.
   */
  protected EditorSite createEditorSite(String editorId, IEditorPart editor) {
    EditorDescriptor descriptor = (EditorDescriptor) idToDescriptor.get(editorId);
    IEditorReference ref = new EditorReference();
    EditorSite site = new CompositeEditorSite(mainEditorSite, ref, editor, page, descriptor);
    IEditorActionBarContributor contributor = descriptor.createActionBarContributor();
    site.setActionBars(createEditorActionBars(descriptor, contributor, site));
    return site;
  }
View Full Code Here

Examples of org.springframework.richclient.application.docking.jide.editor.EditorDescriptor

      }
    }

    private void processEditorObject(Object editorObject, boolean activateAfterOpen){
    JidePageDescriptor pageDescriptor = (JidePageDescriptor)getPageDescriptor();
      EditorDescriptor editorDescriptor =
      pageDescriptor.getEditorFactory().getEditorDescriptor(editorObject);
    if(editorDescriptor != null){
      PageComponent pageComponent = editorDescriptor.createPageComponent();
      AbstractEditor editor = (AbstractEditor)pageComponent;
      editor.setEditorInput(editorObject);
        EditorComponentPane editorPane = new EditorComponentPane(pageComponent);
        pageComponent.setContext(new DefaultViewContext(this, editorPane))
        WorkspaceView workspace = (WorkspaceView)workspaceComponent;
View Full Code Here

Examples of org.springframework.richclient.application.docking.jide.editor.EditorDescriptor

    return ( UiAccessBuilderConfiguration<T> ) super.getConfiguration();
  }

  @NotNull
  public EditorDescriptor getEditorDescriptor(@NotNull final ObservableObjectAccess<T> objectAccess) {
    EditorDescriptor editorDescriptor = new EditorDescriptor();

    editorDescriptor.setEditorClass( FormBasedEditor.class );
    //    editorDescriptor.setBeanName( getConfiguration().getIdStrategy().getBaseId() );

    Map<Object, Object> map = new HashMap<Object, Object>();
    map.put( FormBasedEditor.PROPERTY_ID_STRATEGY, getConfiguration().getIdStrategy() );
    map.put( FormBasedEditor.PROPERTY_FORM_FACTORY, getConfiguration().getFormFactory() );
    map.put( FormBasedEditor.PROPERTY_OBJECT_COMMIT, objectAccess );
    map.put( FormBasedEditor.PROPERTY_LABEL_PROVIDER, getLabelProvider() );

    FormBasedEditor.InitializerCallback<T> initializerCallback = new FormBasedEditor.InitializerCallback<T>() {
      @Override
      public void isInitializing( @NotNull final FormBasedEditor<T> editor ) {
        if ( objectAccess instanceof DelegatingObjectAccess ) {
          ObservableObjectAccess<T> currentDelegate = ( ( DelegatingObjectAccess<T> ) objectAccess ).getCurrentDelegate();
          if ( currentDelegate == null ) {
            throw new IllegalStateException( "No delegate available - impossible" );
          }
          currentDelegate.addElementListener( new EditorCloseListener<T>( editor ) );
        } else {
          objectAccess.addElementListener( new EditorCloseListener<T>( editor ) );
        }
      }
    };

    map.put( FormBasedEditor.PROPERTY_INITIALIZER_CALLBACK, initializerCallback );
    editorDescriptor.setEditorProperties( map );

    return editorDescriptor;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.