Package org.eclipse.ui

Examples of org.eclipse.ui.IEditorDescriptor


   *            the external file
   */
  protected void openExternalFile(File file) {
    try {
      boolean activate = OpenStrategy.activateOnOpen();
      IEditorDescriptor desc = IDE.getEditorDescriptor(file.getName());
      IDE.openEditor(getWorkbenchPage(), file.toURI(), desc.getId(),
          activate);
    } catch (PartInitException e) {
      ErrorDialog.openError(getWorkbenchPage().getWorkbenchWindow()
          .getShell(),
          UIText.OpenWorkingFileAction_openWorkingFileShellTitle, e
View Full Code Here


  }

  private static String getEditorId(String fileName, IContentType type) {
    IEditorRegistry registry = PlatformUI.getWorkbench()
        .getEditorRegistry();
    IEditorDescriptor descriptor = registry
        .getDefaultEditor(fileName, type);
    String id;
    if (descriptor == null || descriptor.isOpenExternal()) {
      id = "org.eclipse.ui.DefaultTextEditor"; //$NON-NLS-1$
    } else {
      id = descriptor.getId();
    }
    return id;
  }
View Full Code Here

          .getEditorInput(element);
    }
    if (input == null) {
      return;
    }
    IEditorDescriptor descriptor = IDE.getEditorDescriptor(input.getName());
    IWorkbenchPage page = PHPDebugUIPlugin.getActivePage();
    IEditorPart editor = page.openEditor(input, descriptor.getId());
    org.eclipse.dltk.internal.ui.editor.EditorUtility.revealInEditor(
        editor, lineNumber - 1);
  }
View Full Code Here

  public String getEditorId(IEditorInput input, Object inputObject) {
    if (input instanceof NonExistingPHPFileEditorInput) {
      return UntitledPHPEditor.ID;
    }
    try {
      IEditorDescriptor descriptor = IDE.getEditorDescriptor(input
          .getName());
      return descriptor.getId();
    } catch (PartInitException e) {
      return null;
    }
  }
View Full Code Here

    if (defaultDescriptor != null) {
      return defaultDescriptor;
    }

    IEditorDescriptor editorDesc = defaultDescriptor;

    // next check the OS for in-place editor (OLE on Win32)
    if (editorReg.isSystemInPlaceEditorAvailable(name)) {
      editorDesc = editorReg.findEditor(IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID);
    }
View Full Code Here

     // Why is this null?
       //TODO: Open this up with the RIGHT editor...
       
     
    //Set the path which is project - path;
     IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(fileName);
     System.out.println("Would normally open " + fileName + " with... " + desc);
     //from http://wiki.eclipse.org/index.php/FAQ_How_do_I_open_an_editor_on_a_file_in_the_workspace%3F
     //to open an editor at a marker/line number
     //IDE.openEditor(page, marker);
    
View Full Code Here

    }
    else {
      //final String fileName = file.getAbsolutePath();
      RemoteFileEditorInput input = new RemoteFileEditorInput(file);
      try {
        IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(file.getName().getBaseName());       
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
          .getActivePage();
        //page.openEditor(input, desc.getId());

        page.openEditor(input, CFMLEditor.ID);
View Full Code Here

          return GoPluginImages.NAVIGATOR_SOURCE_PACKAGE_FOLDER.getImage();
        }
       
        // TODO: should cleanup up this.
       
        IEditorDescriptor descriptor = IDE.getEditorDescriptor(fileStore.getName());
        if (descriptor != null) {
          return descriptor.getImageDescriptor().createImage();
        } else {
          return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
            ISharedImages.IMG_OBJ_FILE).createImage();
        }
      } catch (PartInitException e) {
View Full Code Here

    }

    public IEditorPart openAndSelect(IWorkbenchPage wbPage, IFile file, int offset, int length, boolean activate)
            throws PartInitException {
        String editorId = null;
        IEditorDescriptor desc = IDE.getEditorDescriptor(file);
        if (desc == null || !desc.isInternal()) {
            editorId = "org.eclipse.ui.DefaultTextEditor"; //$NON-NLS-1$
        } else {
            editorId = desc.getId();
        }

        IEditorPart editor;
        if (NewSearchUI.reuseEditor()) {
            editor = showWithReuse(file, wbPage, editorId, activate);
View Full Code Here

            throws PartInitException {
        return IDE.openEditor(wbPage, file, editorID, activate);
    }

    private String getEditorID(IFile file) throws PartInitException {
        IEditorDescriptor desc = IDE.getEditorDescriptor(file);
        if (desc == null)
            return PydevPlugin.getDefault().getWorkbench().getEditorRegistry()
                    .findEditor(IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID).getId();
        return desc.getId();
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IEditorDescriptor

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.