Examples of IViewDescriptor


Examples of org.eclipse.ui.views.IViewDescriptor

    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

Examples of org.eclipse.ui.views.IViewDescriptor

    // 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

Examples of org.eclipse.ui.views.IViewDescriptor

        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

Examples of org.eclipse.ui.views.IViewDescriptor

     * disposed when releaseView is called an equal number of times
     * to createView.
     */
    public IViewReference createView(String id, String secondaryId)
            throws PartInitException {
        IViewDescriptor desc = viewReg.find(id);
        // ensure that the view id is valid
        if (desc == null) {
      throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate,  id ));
    }
        // ensure that multiple instances are allowed if a secondary id is given
        if (secondaryId != null) {
            if (!desc.getAllowMultiple()) {
                throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_noMultiple, id));
            }
        }
        String key = getKey(id, secondaryId);
        IViewReference ref = (IViewReference) counter.get(key);
View Full Code Here

Examples of org.eclipse.ui.views.IViewDescriptor

                .getDescriptor();

        IWorkbenchActivitySupport support = PlatformUI.getWorkbench()
                .getActivitySupport();

        IViewDescriptor descriptor = viewFactory.getViewRegistry().find(viewId);
        if (!(descriptor instanceof IPluginContribution)) {
      return;
    }

        IIdentifier identifier = support.getActivityManager().getIdentifier(
View Full Code Here

Examples of org.eclipse.ui.views.IViewDescriptor

  public void run()  {
      logger.debug("running");
     
    if(window != null) { 
        try  {
            IViewDescriptor vdesc = PlatformUI.getWorkbench().getViewRegistry().find(viewId);
            logger.trace("vdesc: " + vdesc);

            if(vdesc.getAllowMultiple()) {
                logger.debug("view allows multiple; open another");
                window.getActivePage().showView(viewId, Integer.toString(instanceNum++), IWorkbenchPage.VIEW_ACTIVATE);
            }
            else {
                logger.debug("view doesn't allow multiple; find the current one");
View Full Code Here

Examples of org.eclipse.ui.views.IViewDescriptor

    if (element instanceof IViewCategory) {
      return sharedImg;

    } else if (element instanceof IViewDescriptor) {

      IViewDescriptor view = (IViewDescriptor) element;
      Image img = images.get(view.getId());
      if (img == null) {
        img = view.getImageDescriptor().createImage();
        images.put(view.getId(), img);
      }
      return img;
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.ui.views.IViewDescriptor

  }
 
  @Override
  protected boolean isLeafMatch(Viewer viewer, Object element) {
    if (element instanceof IViewDescriptor) {
      IViewDescriptor v = (IViewDescriptor) element;
      return wordMatches(v.getLabel()) || wordMatches(v.getId());
    }
    return false;
  }
View Full Code Here

Examples of org.eclipse.ui.views.IViewDescriptor

    if (pg == null) {
      return;
    }

    try {
      IViewDescriptor v = (IViewDescriptor) o;
      pg.showView(v.getId(), null, IWorkbenchPage.VIEW_VISIBLE);
    } catch (PartInitException ex) {
    }
    super.doubleClickOnLeaf(o);
  }
View Full Code Here

Examples of org.eclipse.ui.views.IViewDescriptor

      filteredTree.getViewer().setExpandedElements(categoriesToExpand.toArray());
    }
       
        String selectedViewId = settings.get(STORE_SELECTED_VIEW_ID);
        if (selectedViewId != null) {
            IViewDescriptor viewDesc = reg.find(selectedViewId);
            if (viewDesc != null) {
                filteredTree.getViewer().setSelection(new StructuredSelection(viewDesc), true);
            }
        }
    }
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.