Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchPage.openEditor()


      Collection obj = (Collection) selection.getFirstElement();
      // If we had a selection lets open the editor
      if (obj != null) {
        CollectionEditorInput input = new CollectionEditorInput(obj);
        try {
          page.openEditor(input, CollectionEditor.ID);

        } catch (PartInitException e) {
          System.out.println(e.getStackTrace());
        }
      }
View Full Code Here


        final IWorkbench wbench = PlatformUI.getWorkbench();
        final IWorkbenchPage page = wbench.getActiveWorkbenchWindow().getActivePage();
        final IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry()
                .getDefaultEditor(file.getName());
        try {
            page.openEditor(new FileEditorInput(file), desc.getId());
        } catch (final PartInitException e) {
            ErlLogger.error(e);
        }
    }
View Full Code Here

    private static IEditorPart openInEditor(final IEditorInput input,
            final String editorID, final boolean activate) throws PartInitException {
        if (input != null) {
            final IWorkbenchPage p = ErlideUIPlugin.getActivePage();
            if (p != null) {
                final IEditorPart editorPart = p.openEditor(input, editorID, activate);
                return editorPart;
            }
        }
        return null;
    }
View Full Code Here

        input = EditorUtility.getEditorInput(module);
        if (input != null) {
            final String editorId = EditorUtility.getEditorID(input, module);
            if (editorId != null) {
                try {
                    part = page.openEditor(input, editorId);
                } catch (final PartInitException e) {
                    ErlideUIPlugin.errorDialog(window.getShell(), "Go to File",
                            "Exception occurred", e); //
                }
            }
View Full Code Here

            true, new NullProgressMonitor());
      }
      IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
          .getActivePage();
     
      ConsoleEditor openEditor = (ConsoleEditor) activePage.openEditor(new FileEditorInput(file),
              "com.onpositive.google.scrapbook.javaeditor");
    } catch (CoreException e) {
      Activator.getDefault().log(e);
      MessageDialog.openError(Display.getCurrent().getActiveShell(),
          "Error", e.getMessage());
View Full Code Here

        getString("_WARN_No_Editor", uri.lastSegment()));
      return false;
    }
    else {
      try {
        page.openEditor(new URIEditorInput(uri), editorDescriptor.getId());
      }
      catch (PartInitException exception) {
        MessageDialog.openError(
          workbenchWindow.getShell(),
          getString("_UI_OpenEditorError_label"),
View Full Code Here

      }

      IEditorInput editorInput = getEditorInput();
      IWorkbenchPage page = myViewerSite.getPage();
      try {
        page.openEditor(editorInput,
            OntoUML.diagram.part.OntoUMLDiagramEditor.ID);
      } catch (PartInitException e) {
        OntoUML.diagram.part.OntoUMLDiagramEditorPlugin.getInstance()
            .logError("Exception while openning diagram", e); //$NON-NLS-1$
      }
View Full Code Here

   */
  public static boolean openDiagram(Resource diagram)
      throws PartInitException {
    IWorkbenchPage page = PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage();
    page.openEditor(new URIEditorInput(diagram.getURI()),
        OntoUML.diagram.part.OntoUMLDiagramEditor.ID);
    return true;
  }

  /**
 
View Full Code Here

                      OntoUML.diagram.part.Messages.DiagramEditorActionBarAdvisor_DefaultFileEditorMessage,
                      fileURI.toFileString()));
      return false;
    } else {
      try {
        page.openEditor(new URIEditorInput(fileURI), editorDescriptor
            .getId());
      } catch (PartInitException exception) {
        MessageDialog
            .openError(
                workbenchWindow.getShell(),
View Full Code Here

        IFile file = conf.getJavaProject().getProject().getFile(conf.getIvyXmlPath());
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        if (file != null) {
            try {
                String editorId = "org.apache.ivyde.editors.IvyEditor";
                page.openEditor(new FileEditorInput(file), editorId, true);
                // only remember the default editor if the open succeeds
                IDE.setDefaultEditor(file, editorId);
            } catch (PartInitException e) {
                Shell parent = page.getWorkbenchWindow().getShell();
                String title = "Problems Opening 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.