Package org.eclipse.ui

Examples of org.eclipse.ui.IPerspectiveRegistry


          .getWelcomePerspectiveId();
      if (page == null) {
        IAdaptable root = wbAdvisor.getDefaultPageInput();
        page = window.openPage(perspectiveId, root);
      } else {
        IPerspectiveRegistry reg = getWorkbench()
            .getPerspectiveRegistry();
        IPerspectiveDescriptor desc = reg
            .findPerspectiveWithId(perspectiveId);
        if (desc != null) {
          page.setPerspective(desc);
        }
      }
View Full Code Here


            Perspective oldPersp = getActivePerspective();

            // Map the current perspective to the original template.
            // If the original template cannot be found then it has been deleted.
            // In that case just return. (PR#1GDSABU).
            IPerspectiveRegistry reg = WorkbenchPlugin.getDefault()
                    .getPerspectiveRegistry();
            PerspectiveDescriptor desc = (PerspectiveDescriptor) reg
                    .findPerspectiveWithId(oldPersp.getDesc().getId());
            if (desc == null) {
        desc = (PerspectiveDescriptor) reg
                        .findPerspectiveWithId(((PerspectiveDescriptor) oldPersp
                                .getDesc()).getOriginalId());
      }
            if (desc == null) {
        return;
View Full Code Here

      @Override
      public void run() {
        IWorkbench workbench = PlatformUI.getWorkbench();
        IWorkbenchWindow activeWindow = workbench.getActiveWorkbenchWindow();

        IPerspectiveRegistry reg = workbench.getPerspectiveRegistry();
        IPerspectiveDescriptor rtPerspectiveDesc =(IPerspectiveDescriptor) reg.findPerspectiveWithId(perspectiveId);

        if (activeWindow!= null){
          IWorkbenchPage page = activeWindow.getActivePage();
          page.setPerspective(rtPerspectiveDesc);
        }
View Full Code Here

          ((IPerspectiveDataProvider) input).get();
    if (dataCol == null) {
      return emptyList();
    }

    IPerspectiveRegistry registry =
        PlatformUI.getWorkbench().getPerspectiveRegistry();

    List<TreePath> result = newArrayList();
    for (IPerspectiveData data : dataCol) {

      List<Object> segments = newArrayList();
      for (ICategory c : provider.getSelected()) {
        if (!(c instanceof Category)) {
          continue;
        }

        switch ((Category) c) {
        case WORKSPACE:
          segments.add(data.get(IPerspectiveData.WORKSPACE));
          break;
        case DATE:
          segments.add(data.get(IPerspectiveData.DATE));
          break;
        case PERSPECTIVE:
          String id = data.get(IPerspectiveData.PERSPECTIVE_ID);
          IPerspectiveDescriptor p = registry.findPerspectiveWithId(id);
          if (p == null) {
            p = new UndefinedPerspectiveDescriptor(id);
          }
          segments.add(p);
          break;
View Full Code Here

        if (window.containsSubmenu(WorkbenchWindow.OPEN_PERSPECTIVE_SUBMENU)) {
            ShortcutMenu perspMenu = new ShortcutMenu(
                    rootMenu,
                    ShortcutMenu.ID_PERSP,
                    WorkbenchMessages.ActionSetDialogInput_perspectiveCategory);
            IPerspectiveRegistry perspReg = WorkbenchPlugin.getDefault()
                    .getPerspectiveRegistry();
            IPerspectiveDescriptor[] persps = perspReg.getPerspectives();
            for (int i = 0; i < persps.length; i++) {
                if (WorkbenchActivityHelper.filterItem(persps[i])) {
          continue;
        }
                perspMenu.addItem(persps[i]);
View Full Code Here

    if (finalPerspId == null) {
      return;
    }

    // Map perspective id to descriptor.
    IPerspectiveRegistry reg = PlatformUI.getWorkbench().getPerspectiveRegistry();

    // leave this code in - the perspective of a given project may map to
    // activities other than those that the wizard itself maps to.
    IPerspectiveDescriptor finalPersp = reg.findPerspectiveWithId(finalPerspId);
    if (finalPersp != null && finalPersp instanceof IPluginContribution) {
      IPluginContribution contribution = (IPluginContribution) finalPersp;
      if (contribution.getPluginId() != null) {
        IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI.getWorkbench().getActivitySupport();
        IActivityManager activityManager = workbenchActivitySupport.getActivityManager();
View Full Code Here

   * @param id
   *            the id to query.
   * @since 3.0
   */
  private static void addPerspectiveAndDescendants(List<String> perspectiveIds, String id) {
    IPerspectiveRegistry registry = PlatformUI.getWorkbench().getPerspectiveRegistry();
    IPerspectiveDescriptor[] perspectives = registry.getPerspectives();
    for (int i = 0; i < perspectives.length; i++) {
      // @issue illegal ref to workbench internal class;
      // consider adding getOriginalId() as API on IPerspectiveDescriptor
      PerspectiveDescriptor descriptor = ((PerspectiveDescriptor) perspectives[i]);
      if (descriptor.getOriginalId().equals(id)) {
View Full Code Here

        BasicNewResourceWizard.selectAndReveal(newProject, workbench.getActiveWorkbenchWindow());
    }

    protected void updatePerspective() {
        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        IPerspectiveRegistry reg = WorkbenchPlugin.getDefault().getPerspectiveRegistry();
        PerspectiveDescriptor rtPerspectiveDesc = (PerspectiveDescriptor) reg.findPerspectiveWithId(NodePerspective.ID);
        // Now set it as the active perspective.
        if (window != null) {
            IWorkbenchPage page = window.getActivePage();
            page.setPerspective(rtPerspectiveDesc);
        }
View Full Code Here

    if (finalPerspId == null) {
      return;
    }

    // Map perspective id to descriptor.
    IPerspectiveRegistry reg = PlatformUI.getWorkbench()
        .getPerspectiveRegistry();

    // leave this code in - the perspective of a given project may map to
    // activities other than those that the wizard itself maps to.
    IPerspectiveDescriptor finalPersp = reg
        .findPerspectiveWithId(finalPerspId);
    if (finalPersp != null && finalPersp instanceof IPluginContribution) {
      IPluginContribution contribution = (IPluginContribution) finalPersp;
      if (contribution.getPluginId() != null) {
        IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI
View Full Code Here

   *            the id to query.
   * @since 3.0
   */
  private static void addPerspectiveAndDescendants(List perspectiveIds,
      String id) {
    IPerspectiveRegistry registry = PlatformUI.getWorkbench()
        .getPerspectiveRegistry();
    IPerspectiveDescriptor[] perspectives = registry.getPerspectives();
    for (int i = 0; i < perspectives.length; i++) {
      // @issue illegal ref to workbench internal class;
      // consider adding getOriginalId() as API on IPerspectiveDescriptor
      PerspectiveDescriptor descriptor = ((PerspectiveDescriptor) perspectives[i]);
      if (descriptor.getOriginalId().equals(id)) {
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IPerspectiveRegistry

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.