Package org.eclipse.ui

Examples of org.eclipse.ui.WorkbenchException


      } else if (throwable instanceof RuntimeException) {
        throw (RuntimeException) throwable;
      } else if (throwable instanceof WorkbenchException) {
        throw (WorkbenchException) throwable;
      } else {
        throw new WorkbenchException(StatusUtil.newStatus(
            WorkbenchPlugin.PI_WORKBENCH, throwable));
      }
    }
  }
View Full Code Here


    protected IActionDelegate validateDelegate(Object obj)
            throws WorkbenchException {
        if (obj instanceof IEditorActionDelegate) {
      return (IEditorActionDelegate) obj;
    } else {
      throw new WorkbenchException(
                    "Action must implement IEditorActionDelegate"); //$NON-NLS-1$
    }
    }
View Full Code Here

            throws WorkbenchException {
        if (obj instanceof IActionDelegate) {
      return (IActionDelegate) obj;
    }
       
        throw new WorkbenchException(
                "Action must implement IActionDelegate"); //$NON-NLS-1$
    }
View Full Code Here

      throws WorkbenchException {
    if (obj instanceof IWorkbenchWindowPulldownDelegate) {
      return (IWorkbenchWindowPulldownDelegate) obj;
    }

    throw new WorkbenchException(
        "Action must implement IWorkbenchWindowPulldownDelegate"); //$NON-NLS-1$
  }
View Full Code Here

   */
    public WorkbenchPage(WorkbenchWindow w, String layoutID, IAdaptable input)
            throws WorkbenchException {
        super();
        if (layoutID == null) {
      throw new WorkbenchException(WorkbenchMessages.WorkbenchPage_UndefinedPerspective);
    }
        init(w, layoutID, input, true);
    }
View Full Code Here

        if (layoutID != null) {
            PerspectiveDescriptor desc = (PerspectiveDescriptor) WorkbenchPlugin
                    .getDefault().getPerspectiveRegistry()
                    .findPerspectiveWithId(layoutID);
            if (desc == null) {
        throw new WorkbenchException(
                        NLS.bind(WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective,layoutID ));
      }
            Perspective persp = findPerspective(desc);
            if (persp == null) {
              persp = createPerspective(desc, true);
View Full Code Here

        // Create layout engine.
        IPerspectiveFactory factory = null;
        try {
            factory = persp.createFactory();
        } catch (CoreException e) {
            throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() ));
        }
   
    /*
     * IPerspectiveFactory#createFactory() can return null
     */
    if (factory == null) {
      throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() ));
    }   
   
   
        // Create layout factory.
        ViewSashContainer container = new ViewSashContainer(page, getClientComposite());
View Full Code Here

    if (result[0] instanceof IWorkbenchWindow) {
      return (IWorkbenchWindow) result[0];
    } else if (result[0] instanceof WorkbenchException) {
      throw (WorkbenchException) result[0];
    } else {
      throw new WorkbenchException(
          WorkbenchMessages.Abnormal_Workbench_Conditi);
    }
  }
View Full Code Here

      }

      IPerspectiveDescriptor desc = getPerspectiveRegistry()
          .findPerspectiveWithId(perspectiveId);
      if (desc == null) {
        throw new WorkbenchException(
            NLS
                .bind(
                    WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective,
                    perspectiveId));
      }
      win.getShell().open();
      if (page == null) {
        page = win.openPage(perspectiveId, input);
      } else {
        page.setPerspective(desc);
      }
      return page;
    }

    // Just throw an exception....
    throw new WorkbenchException(NLS
        .bind(WorkbenchMessages.Workbench_showPerspectiveError,
            perspectiveId));
  }
View Full Code Here

      if (IPreferenceConstants.OPM_NEW_WINDOW != mode) {
        IWorkbenchPage page = win.getActiveWorkbenchPage();
        IPerspectiveDescriptor desc = getPerspectiveRegistry()
            .findPerspectiveWithId(perspectiveId);
        if (desc == null) {
          throw new WorkbenchException(
              NLS
                  .bind(
                      WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective,
                      perspectiveId));
        }
        win.getShell().open();
        if (page == null) {
          page = win.openPage(perspectiveId, input);
        } else {
          page.setPerspective(desc);
        }
        return page;
      }
    }

    // If the specified window has no active perspective, then open the
    // requested perspective and show the specified window.
    if (win != null) {
      IWorkbenchPage page = win.getActiveWorkbenchPage();
      IPerspectiveDescriptor persp = null;
      if (page != null) {
        persp = page.getPerspective();
      }
      if (persp == null) {
        IPerspectiveDescriptor desc = getPerspectiveRegistry()
            .findPerspectiveWithId(perspectiveId);
        if (desc == null) {
          throw new WorkbenchException(
              NLS
                  .bind(
                      WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective,
                      perspectiveId));
        }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.WorkbenchException

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.