Package org.eclipse.ui

Examples of org.eclipse.ui.IPerspectiveDescriptor


    return new PerspectiveEvent(new Interval(dateTime, dateTime.plus(1)), p);
  }

  @Override
  protected PerspectiveEvent createEventDiff(DateTime dateTime) {
    IPerspectiveDescriptor p = PlatformUI.getWorkbench()
        .getPerspectiveRegistry().getPerspectives()[1];
    return new PerspectiveEvent(new Interval(dateTime, dateTime.plus(2)), p);
  }
View Full Code Here


    /* (non-Javadoc)
     * @see org.eclipse.jface.viewers.ILabelProvider
     */
    public final Image getImage(Object element) {
        if (element instanceof IPerspectiveDescriptor) {
            IPerspectiveDescriptor desc = (IPerspectiveDescriptor) element;
            ImageDescriptor imageDescriptor = desc.getImageDescriptor();
            if (imageDescriptor == null) {
                imageDescriptor = WorkbenchImages
                        .getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_DEF_PERSPECTIVE);
            }
            Image image = (Image) imageCache.get(imageDescriptor);
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.jface.viewers.ILabelProvider
     */
    public final String getText(Object element) {
        if (element instanceof IPerspectiveDescriptor) {
            IPerspectiveDescriptor desc = (IPerspectiveDescriptor) element;
            String label = desc.getLabel();
            if (markDefault) {
                String def = PlatformUI.getWorkbench().getPerspectiveRegistry()
                        .getDefaultPerspective();
                if (desc.getId().equals(def)) {
                    label = NLS.bind(WorkbenchMessages.PerspectivesPreference_defaultLabel, label );
                }
            }
            return label;
        }
View Full Code Here

    dialog.open();
    if (dialog.getReturnCode() == Window.CANCEL) {
      return;
    }

    final IPerspectiveDescriptor descriptor = dialog.getSelection();
    if (descriptor != null) {
      openPerspective(descriptor.getId(), activeWorkbenchWindow);
    }
  }
View Full Code Here

          page.activate(part);
        }
      }
     
      if (selectedItem instanceof IPerspectiveDescriptor){
              IPerspectiveDescriptor persp = (IPerspectiveDescriptor) selectedItem;
              page.setPerspective(persp);
      }

    }
  }
View Full Code Here

         * Convert the perspective descriptors to actions, and filter out
         * actions using the activity/capability mechanism.
         */
        final List actions = new ArrayList(persps.size());
        for (Iterator i = persps.iterator(); i.hasNext();) {
            final IPerspectiveDescriptor descriptor = (IPerspectiveDescriptor) i
                    .next();
            final IAction action = getAction(descriptor.getId());
            if (action != null) {
                if (WorkbenchActivityHelper.filterItem(action)) {
          continue;
        }
                actions.add(action);
View Full Code Here

     * @since 3.1
     */
    private final IAction getAction(final String id) {
        IAction action = (IAction) actions.get(id);
        if (action == null) {
            IPerspectiveDescriptor descriptor = reg.findPerspectiveWithId(id);
            if (descriptor != null) {
                action = new OpenPerspectiveAction(window, descriptor, this);
                action.setActionDefinitionId(id);
                actions.put(id, action);
            }
View Full Code Here

    }

        String[] ids = page.getPerspectiveShortcuts();

        for (int i = 0; i < ids.length; i++) {
            IPerspectiveDescriptor desc = reg.findPerspectiveWithId(ids[i]);
            if (desc != null && !list.contains(desc)) {
                if (WorkbenchActivityHelper.filterItem(desc)) {
          continue;
        }
                list.add(desc);
View Full Code Here

                .getShell(), reg);
        dlg.open();
        if (dlg.getReturnCode() == Window.CANCEL) {
      return;
    }
        IPerspectiveDescriptor desc = dlg.getSelection();
        if (desc != null) {
            run(desc, event);
        }
    }
View Full Code Here

        if (data == null || !(data instanceof PerspectiveBarContributionItem)) {
      return;
    }

        PerspectiveBarContributionItem pbci = (PerspectiveBarContributionItem) data;
        IPerspectiveDescriptor selectedPerspective = pbci.getPerspective();

        // The perspective bar menu is created lazily here.
        // Its data is set (each time) to the tool item, which refers to the SetPagePerspectiveAction
        // which in turn refers to the page and perspective.
        // It is important not to refer to the action, the page or the perspective directly
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IPerspectiveDescriptor

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.