Examples of EditorDescriptor


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

    FileDialog dialog = new FileDialog(getShell(), SWT.OPEN
        | SWT.PRIMARY_MODAL);
    dialog.setFilterExtensions(Executable_Filters);
    String result = dialog.open();
    if (result != null) {
      EditorDescriptor editor = EditorDescriptor.createForProgram(result);
      // pretend we had obtained it from the list of os registered editors
      TableItem ti = new TableItem(editorTable, SWT.NULL);
      ti.setData(editor);
      ti.setText(editor.getLabel());
      Image image = editor.getImageDescriptor().createImage();
      ti.setImage(image);

      // need to pass an array to setSelection -- 1FSKYVO: SWT:ALL -
      // inconsistent setSelection api on Table
      editorTable.setSelection(new TableItem[] { ti });
View Full Code Here

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

        if (partName == null) {
            partName = title;
        }

        // Get the editor descriptor.
        EditorDescriptor desc = null;
        if (id != null) {
            desc = getDescriptor(id);
        }
        // desc may be null if id is null or desc is not found, but findImage below handles this
        String location = memento.getString(IWorkbenchConstants.TAG_PATH);
View Full Code Here

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

     *
     * @param id
     * @return
     */
    private EditorDescriptor getDescriptor(String id) {
        EditorDescriptor desc;
        IEditorRegistry reg = WorkbenchPlugin.getDefault()
                .getEditorRegistry();
        desc = (EditorDescriptor) reg.findEditor(id);
        return desc;
    }
View Full Code Here

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

           
            EditorPane pane = (EditorPane)getPane();
           
            pane.createControl((Composite) manager.page.getEditorPresentation().getLayoutPart().getControl());
           
            EditorDescriptor descr = getDescriptor();
           
            EditorSite site = new EditorSite(this, part, manager.page, descr);
           
            site.setActionBars(new EditorActionBars(manager.page, site.getWorkbenchWindow(), getId()));
           
View Full Code Here

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

        try {
            IEditorInput editorInput = getEditorInput();
           
            // Get the editor descriptor.
            String editorID = getId();
            EditorDescriptor desc = getDescriptor();
           
            if (desc == null) {
                throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_missing_editor_descriptor, editorID));
            }
           
           
            if (desc.isInternal()) {   
                // Create an editor instance.
                try {
                    UIStats.start(UIStats.CREATE_PART, editorID);
                    part = manager.createPart(desc);
                   
                    if (part != null && part instanceof MultiEditor) {
              multiEditorChildren = manager.openMultiEditor(this,
                (MultiEditor) part, (MultiEditorInput) editorInput);
            }
                    if (part instanceof IWorkbenchPart3) {
                      createPartProperties((IWorkbenchPart3)part);
                    }
                } finally {
                    UIStats.end(UIStats.CREATE_PART, this, editorID);
                }
               
            } else if (desc.getId().equals(
                    IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID)) {
               
                part = ComponentSupport.getSystemInPlaceEditor();
               
                if (part == null) {
View Full Code Here

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

    if (editorId == null || input == null) {
      throw new IllegalArgumentException();
    }

    IEditorRegistry reg = getEditorRegistry();
    EditorDescriptor desc = (EditorDescriptor) reg.findEditor(editorId);
    if (desc == null) {
      throw new PartInitException(NLS.bind(
          WorkbenchMessages.EditorManager_unknownEditorIDMessage,
          editorId));
    }
View Full Code Here

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

    IEditorReference refArray[] = new IEditorReference[editorArray.length];
    IEditorPart partArray[] = new IEditorPart[editorArray.length];

    IEditorRegistry reg = getEditorRegistry();
    for (int i = 0; i < editorArray.length; i++) {
      EditorDescriptor innerDesc = (EditorDescriptor) reg
          .findEditor(editorArray[i]);
      if (innerDesc == null) {
        throw new PartInitException(NLS.bind(
            WorkbenchMessages.EditorManager_unknownEditorIDMessage,
            editorArray[i]));
View Full Code Here

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

  /**
   * @return
   */
  /*package*/ IEditorReference openEmptyTab() {
    IEditorInput input = new NullEditorInput();
    EditorDescriptor desc = (EditorDescriptor) ((EditorRegistry) getEditorRegistry())
        .findEditor(EditorRegistry.EMPTY_EDITOR_ID);
    EditorReference result = new EditorReference(this, input, desc);
    try {
      createEditorTab(result, ""); //$NON-NLS-1$
      return result;
View Full Code Here

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

      page.closeEditor(reusableEditorRef, false);
      return result;
    }

    EditorSite site = (EditorSite) reusableEditor.getEditorSite();
    EditorDescriptor oldDesc = site.getEditorDescriptor();
    if ((desc.getId().equals(oldDesc.getId()))
        && (reusableEditor instanceof IReusableEditor)) {
      Workbench wb = (Workbench) page.getWorkbenchWindow().getWorkbench();
      editorPresentation.moveEditor(reusableEditor, -1);
      wb.getEditorHistory().add(reusableEditor.getEditorInput(),
          site.getEditorDescriptor());
View Full Code Here

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

                .getShell());
        dialog.setEditorsToFilter(getAssociatedEditors());
        dialog
                .setMessage(NLS.bind(WorkbenchMessages.Choose_the_editor_for_file,getSelectedResourceType().getLabel() ));
        if (dialog.open() == Window.OK) {
            EditorDescriptor editor = (EditorDescriptor) dialog
                    .getSelectedEditor();
            if (editor != null) {
                int i = editorTable.getItemCount();
                boolean isEmpty = i < 1;
                TableItem item = new TableItem(editorTable, SWT.NULL, i);
                item.setData(DATA_EDITOR, editor);
                if (isEmpty) {
          item
                            .setText(editor.getLabel()
                                    + " " + WorkbenchMessages.FileEditorPreference_defaultLabel); //$NON-NLS-1$
        } else {
          item.setText(editor.getLabel());
        }
                item.setImage(getImage(editor));
                editorTable.setSelection(i);
                editorTable.setFocus();
                getSelectedResourceType().addEditor(editor);
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.