Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchPart


  @Override
  public void init(IWorkbenchWindow window) {
    renameAction = null;

    if (window != null) {
      IWorkbenchPart activePart = window.getPartService().getActivePart();
      if (activePart != null) {
        if (activePart instanceof PHPStructuredEditor) {
          renameAction = new RenameAction((PHPStructuredEditor) activePart);
        } else {
          renameAction = new RenameAction(activePart.getSite());
        }
      }
    }
  }
View Full Code Here


      }
    } else {
      if (activeWindow != null) {
        IWorkbenchPage activePage = activeWindow.getActivePage();
        if (activePage != null) {
          IWorkbenchPart activePart = activePage.getActivePart();
          if (activePart != null) {
            IWorkbenchPartSite activeSite = activePart.getSite();
            if (activeSite != null) {
              if (renameAction.getSite() != activeSite) {
                init(activeWindow);
              }
View Full Code Here

  @Override
  public void init(IWorkbenchWindow window) {
    extractAction = null;

    if (window != null) {
      IWorkbenchPart activePart = window.getPartService().getActivePart();
      if (activePart != null) {
        if (activePart instanceof PHPStructuredEditor) {
          extractAction = new ExtractMethod((PHPStructuredEditor) activePart);
        } else {
          extractAction = new ExtractMethod(activePart.getSite());
        }
      }
    }
  }
View Full Code Here

      }
    } else {
      if (activeWindow != null) {
        IWorkbenchPage activePage = activeWindow.getActivePage();
        if (activePage != null) {
          IWorkbenchPart activePart = activePage.getActivePart();
          if (activePart != null) {
            IWorkbenchPartSite activeSite = activePart.getSite();
            if (activeSite != null) {
              if (extractAction.getSite() != activeSite) {
                init(activeWindow);
              }
View Full Code Here

    }

    private IWorkbenchPart getActivePart() {
        final IWorkbenchWindow window = getSite().getWorkbenchWindow();
        final IPartService service = window.getPartService();
        final IWorkbenchPart part = service.getActivePart();
        return part;
    }
View Full Code Here

        }
        return e;
    }

    protected boolean isActivePart() {
        final IWorkbenchPart part = getActivePart();
        return part != null && part.equals(this);
    }
View Full Code Here

        // get all the view and editor parts
        final List<IWorkbenchPart> parts = Lists.newArrayList();
        IWorkbenchPartReference refs[] = page.getViewReferences();
        for (int i = 0; i < refs.length; i++) {
            final IWorkbenchPart part = refs[i].getPart(false);
            if (part != null) {
                parts.add(part);
            }
        }
        refs = page.getEditorReferences();
        for (int i = 0; i < refs.length; i++) {
            if (refs[i].getPart(false) != null) {
                parts.add(refs[i].getPart(false));
            }
        }

        final ISelection selection = new StructuredSelection(resource);
        final Iterator<IWorkbenchPart> itr = parts.iterator();
        while (itr.hasNext()) {
            final IWorkbenchPart part = itr.next();

            // get the part's ISetSelectionTarget implementation
            ISetSelectionTarget target = null;
            if (part instanceof ISetSelectionTarget) {
                target = (ISetSelectionTarget) part;
            } else {
                target = (ISetSelectionTarget) part.getAdapter(ISetSelectionTarget.class);
            }

            if (target != null) {
                // select and reveal resource
                final ISetSelectionTarget finalTarget = target;
View Full Code Here

  /**
   * @generated
   */
  public void run() {
    IWorkbenchPart workbenchPart = workbenchPartDescriptor.getPartPage()
        .getActivePart();
    if (workbenchPart instanceof IDiagramWorkbenchPart) {
      final IDiagramWorkbenchPart part = (IDiagramWorkbenchPart) workbenchPart;
      try {
        new IRunnableWithProgress() {
View Full Code Here

  public AnnotationOutline(AnnotationEditor editor) {
    mEditor = editor;
  }

  private boolean isActiveView() {
    IWorkbenchPart part = getSite().getPage().getActivePart();

    return (part instanceof ContentOutline && ((ContentOutline) part).getCurrentPage() == this);
  }
View Full Code Here

  /**
   * Shows a page for the active workbench part.
   */
  private void showBootstrapPart() {
    IWorkbenchPart part = getBootstrapPart();
    if (part != null) {
      partActivated(part);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IWorkbenchPart

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.