Package org.eclipse.ui.views

Examples of org.eclipse.ui.views.IViewRegistry


   * @return structured selection in the Servers view, if the Servers view is
   * open and available, or null otherwise
   */
  public static IStructuredSelection getServersViewSelection() {

    IViewRegistry registry = PlatformUI.getWorkbench().getViewRegistry();
    String serversViewID = SERVERS_VIEW_ID;

    // fast check to verify that the servers View is available.
    IViewDescriptor serversViewDescriptor = registry.find(serversViewID);
    if (serversViewDescriptor != null) {

      // Granular null checks required as any of the workbench components
      // may not be available at some given point in time (e.g., during
      // start/shutdown)
View Full Code Here


   */
  public void update(Perspective oldPersp, Perspective newPersp) {
    if (oldPersp == null || newPersp == null) {
      return;
    }
    IViewRegistry viewReg = WorkbenchPlugin.getDefault().getViewRegistry();
    IStickyViewDescriptor[] stickyDescs = viewReg.getStickyViews();
    for (int i = 0; i < stickyDescs.length; i++) {
      final String viewId = stickyDescs[i].getId();
      try {
        // show a sticky view if it was in the last perspective and
        // hasn't already been activated in this one
View Full Code Here

  private IAction getAction(String id) {
    // Keep a cache, rather than creating a new action each time,
    // so that image caching in ActionContributionItem works.
    IAction action = (IAction) actions.get(id);
    if (action == null) {
      IViewRegistry reg = WorkbenchPlugin.getDefault().getViewRegistry();
      IViewDescriptor desc = reg.find(id);
      if (desc != null) {
        action = new ShowViewAction(window, desc, makeFast);
        action.setActionDefinitionId(id);
        actions.put(id, action);
      }
View Full Code Here

     */
    private IViewDescriptor[] getViewDescriptors(IWorkbenchPart sourcePart) {
        String srcId = sourcePart.getSite().getId();
        ArrayList ids = getShowInPartIds(sourcePart);
        ArrayList descs = new ArrayList();
        IViewRegistry reg = WorkbenchPlugin.getDefault().getViewRegistry();
        for (Iterator i = ids.iterator(); i.hasNext();) {
            String id = (String) i.next();
            if (!id.equals(srcId)) {
                IViewDescriptor desc = reg.find(id);
                if (desc != null) {
                    descs.add(desc);
                }
            }
        }
View Full Code Here

      if (activatedStickyViewsInThisPerspective == null) {
        activatedStickyViewsInThisPerspective = new HashSet(7);
        stickyPerspectives.put(newPersp.getDesc().getId(),
            activatedStickyViewsInThisPerspective);
      }
      IViewRegistry viewReg = WorkbenchPlugin.getDefault()
          .getViewRegistry();
      IStickyViewDescriptor[] stickyDescs = viewReg.getStickyViews();
      for (int i = 0; i < stickyDescs.length; i++) {
        final String viewId = stickyDescs[i].getId();
        try {
          // show a sticky view if it was in the last perspective and hasn't already been activated in this one
          if (oldPersp.findView(viewId) != null
View Full Code Here

    if (m == null) {
      return;
    }

    Set<IViewCategory> result = new HashSet<IViewCategory>();
    IViewRegistry r = PlatformUI.getWorkbench().getViewRegistry();
    for (IViewCategory c : r.getCategories()) {
      for (IMemento child : m.getChildren(MEMENTO_ELEMENT)) {
        if (c.getId().equals(child.getTextData())) {
          result.add(c);
        }
      }
View Full Code Here

    if (dataCol == null) {
      return emptyList();
    }

    IWorkbench workbench = PlatformUI.getWorkbench();
    IViewRegistry viewRegistry = workbench.getViewRegistry();
    IEditorRegistry editorRegistry = workbench.getEditorRegistry();

    List<TreePath> result = newArrayList();
    for (IPartData 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(IPartData.WORKSPACE));
          break;
        case DATE:
          segments.add(data.get(IPartData.DATE));
          break;
        case WORKBENCH_TOOL:
          String id = data.get(IPartData.PART_ID);
          IWorkbenchPartDescriptor part = viewRegistry.find(id);
          if (part == null) {
            part = editorRegistry.findEditor(id);
          }
          if (part == null) {
            part = new UndefinedWorkbenchPartDescriptor(id);
View Full Code Here

        }

        if (window.containsSubmenu(WorkbenchWindow.SHOW_VIEW_SUBMENU)) {
            ShortcutMenu viewMenu = new ShortcutMenu(rootMenu,
                    ShortcutMenu.ID_VIEW, WorkbenchMessages.ActionSetDialogInput_viewCategory);
            IViewRegistry viewReg = WorkbenchPlugin.getDefault()
                    .getViewRegistry();
            IViewCategory [] categories = viewReg.getCategories();
            activeIds = Arrays.asList(perspective.getShowViewShortcuts());
            for (int i = 0; i < categories.length; i++) {
                IViewCategory category = categories[i];
                if (WorkbenchActivityHelper.filterItem(category)) {
          continue;
View Full Code Here

     *
     * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
     */
    private Object[] createChildren(Object element) {
        if (element instanceof IViewRegistry) {
            IViewRegistry reg = (IViewRegistry) element;
            IViewCategory [] categories = reg.getCategories();

            ArrayList filtered = new ArrayList();
            for (int i = 0; i < categories.length; i++) {
                if (!hasChildren(categories[i])) {
          continue;
View Full Code Here

        }

        // check that primary view id is valid, but only if it has no wildcard
        String primaryId = ViewFactory.extractPrimaryId(id);
        if (!ViewFactory.hasWildcard(primaryId)) {
          IViewRegistry reg = WorkbenchPlugin.getDefault().getViewRegistry();
          IViewDescriptor desc = reg.find(primaryId);
          if (desc == null) {
              // cannot safely open the dialog so log the problem
              WorkbenchPlugin.log("Unable to find view with id: " + primaryId + ", when creating perspective " + getDescriptor().getId()); //$NON-NLS-1$ //$NON-NLS-2$
              return false;
          }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.views.IViewRegistry

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.