Examples of PackageExplorerPart


Examples of org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart

    IStructuredSelection selection = null;   
    if (part instanceof org.eclipse.ui.views.navigator.ResourceNavigator) {
        ResourceNavigator navigator = (ResourceNavigator) part;
        selection = (IStructuredSelection) navigator.getTreeViewer().getSelection();
    } else if (part instanceof org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart) {
      PackageExplorerPart packageExplorer = (PackageExplorerPart) part;
      selection = (IStructuredSelection) packageExplorer.getTreeViewer().getSelection();
    }
    if (selection != null && !selection.isEmpty()) {
        Object element = selection.getFirstElement();
        if (element instanceof IAdaptable) {
          IAdaptable adaptable = (IAdaptable) element;
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart

    String viewId = "org.eclipse.jdt.ui.PackageExplorer"; // defined by you
    IViewReference ref = page.findViewReference(viewId);
    if (ref != null) {
      IWorkbenchPart part = ref.getPart(true);
      if (part instanceof PackageExplorerPart) {
        PackageExplorerPart explorer = (PackageExplorerPart) part;
        explorer.rootModeChanged(PackageExplorerPart.WORKING_SETS_AS_ROOTS);
        sortWorkingSets(workingSetNames, explorer);
      }
    }
  }
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart

  protected synchronized void attachToPartIfNecessary(IWorkbenchPartReference partReference) {
    if (partReference != null && (JavaUI.ID_PACKAGES.equals(partReference.getId()) || PerspectiveFactory.ID_WO_PACKAGES.equals(partReference.getId()))) {
      IWorkbenchPart part = partReference.getPart(false);
      if (part instanceof PackageExplorerPart) {
        PackageExplorerPart packageExplorerPart = (PackageExplorerPart) part;
        if (!_listeningPackageExplorers.contains(packageExplorerPart)) {
          TreeViewer packageExplorerTreeViewer = packageExplorerPart.getTreeViewer();
          if (packageExplorerTreeViewer != null) {
            packageExplorerTreeViewer.addDoubleClickListener(this);
            _listeningPackageExplorers.add(packageExplorerPart);
          }
        }
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart

    }

    if (!(activePart instanceof PackageExplorerPart))
      return EMPTY_WORKING_SET_ARRAY;

    PackageExplorerPart explorerPart = (PackageExplorerPart) activePart;
    if (explorerPart.getRootMode() == PackageExplorerPart.PROJECTS_AS_ROOTS) {
      // Get active filter
      IWorkingSet filterWorkingSet = explorerPart.getFilterWorkingSet();
      if (filterWorkingSet == null)
        return EMPTY_WORKING_SET_ARRAY;

      if (!isValidWorkingSet(filterWorkingSet))
        return EMPTY_WORKING_SET_ARRAY;

      return new IWorkingSet[] { filterWorkingSet };
    }
    else {
      // If we have been gone into a working set return the working set
      Object input = explorerPart.getViewPartInput();
      if (!(input instanceof IWorkingSet))
        return EMPTY_WORKING_SET_ARRAY;

      IWorkingSet workingSet = (IWorkingSet) input;
      if (!isValidWorkingSet(workingSet))
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart

      Display.getDefault().asyncExec(new Runnable() {
        public void run() {
          IWorkbenchPart activePart= getActivePart();
          if (activePart instanceof IPackagesViewPart) {
            PackageExplorerPart view= PackageExplorerPart.openInActivePerspective();
            view.tryToReveal(newElement);
          }
        }
      });
    }
    return res;
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart

      Display.getDefault().asyncExec(new Runnable() {
        public void run() {
          IWorkbenchPart activePart= getActivePart();
          if (activePart instanceof IPackagesViewPart) {
            PackageExplorerPart view= PackageExplorerPart.openInActivePerspective();
            view.tryToReveal(newElement);
          }
        }
      });
    }
    return res;
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.