Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchPart


      if (adapter.equals(IWorkbenchPart.class)) {
        return site.getPart();
      }
      // Refer all other requests to the part itself.
      // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=108144
      IWorkbenchPart part = site.getPart();
      if (part != null) {
        return Util.getAdapter(part, adapter);
      }
    }
    return null;
View Full Code Here


      public void partBroughtToTop(IWorkbenchPartReference partRef) {
      }

      public void partClosed(IWorkbenchPartReference partRef) {
        IWorkbenchPart part = partRef.getPart(false);
        if (part == MultiEditor.this && innerEditors != null) {
          PartService partService = ((WorkbenchPage) getSite()
              .getPage()).getPartService();
          for (int i = 0; i < innerEditors.length; i++) {
            IEditorPart editor = innerEditors[i];
            IWorkbenchPartReference innerRef = ((PartSite) editor
                .getSite()).getPartReference();
            partService.firePartClosed(innerRef);
          }
        }
      }

      public void partDeactivated(IWorkbenchPartReference partRef) {
      }

      public void partOpened(IWorkbenchPartReference partRef) {
        IWorkbenchPart part = partRef.getPart(false);
        if (part == MultiEditor.this && innerEditors != null) {
          PartService partService = ((WorkbenchPage) getSite()
              .getPage()).getPartService();
          for (int i = 0; i < innerEditors.length; i++) {
            IEditorPart editor = innerEditors[i];
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.jface.viewers.ILabelProvider
     */
    public final String getText(Object element) {
        if (element instanceof IWorkbenchPart) {
            IWorkbenchPart part = (IWorkbenchPart) element;
            String path = part.getTitleToolTip();
            if (path == null || path.trim().length() == 0) {
                return part.getTitle();
            }
            return part.getTitle() + "  [" + path + "]"; //$NON-NLS-1$ //$NON-NLS-2$
        }
        if (element instanceof Saveable) {
          Saveable model = (Saveable) element;
            String path = model.getToolTipText();
            if (path == null || path.trim().length() == 0) {
View Full Code Here

    // A part can't be activated until it is added
    // Assert.isTrue(ref == null || parts.contains(ref));

    if (ref != null) {
      IWorkbenchPart part = ref.getPart(true);
      Assert.isNotNull(part);
      if (part instanceof MultiEditor) {
        IWorkbenchPartSite site = ((MultiEditor) part)
            .getActiveEditor().getSite();
        if (site instanceof PartSite) {
View Full Code Here

    // A part can't be activated until it is added
    // Assert.isTrue(ref == null || parts.contains(ref));

    if (ref != null) {
      IWorkbenchPart part = ref.getPart(true);
      Assert.isNotNull(part);
      if (part instanceof MultiEditor) {
        IWorkbenchPartSite site = ((MultiEditor) part)
            .getActiveEditor().getSite();
        if (site instanceof PartSite) {
View Full Code Here

  }

  private void partOpened(WorkbenchPartReference ref) {
    Assert.isNotNull(ref);

    IWorkbenchPart actualPart = ref.getPart(false);
    // We're firing the event that says "the part was just created"... so
    // there better be a part there.
    Assert.isNotNull(actualPart);
    // Must be called after the part is inserted into the part list
    // Assert.isTrue(parts.contains(ref));
    // The active part must be opened before it is activated, so we should
    // never get an
    // open event for a part that is already active. (This either indicates
    // that a redundant
    // open event was fired or that a closed part was somehow activated)
    Assert.isTrue(activePartReference != ref);
    // The active editor must be opened before it is activated, so we should
    // never get an
    // open event for an editor that is already active. (This either
    // indicates that a redundant
    // open event was fired or that a closed editor was somehow activated)
    Assert.isTrue(activeEditorReference != ref);

    SaveablesList modelManager = (SaveablesList) actualPart
        .getSite().getService(ISaveablesLifecycleListener.class);
    modelManager.postOpen(actualPart);

    // Fire the "part opened" event
    firePartOpened(ref);
View Full Code Here

   * @param ref
   */
  private void partClosed(WorkbenchPartReference ref) {
    Assert.isNotNull(ref);

    IWorkbenchPart actualPart = ref.getPart(false);
    // Called before the part is disposed, so the part should still be
    // there.
    Assert.isNotNull(actualPart);
    // Must be called before the part is actually removed from the part list
    // Assert.isTrue(parts.contains(ref));
View Full Code Here

            firePropertyChange(propId);
        }
       
        // Let the model manager know as well
        if (propId == IWorkbenchPartConstants.PROP_DIRTY) {
          IWorkbenchPart actualPart = getPart(false);
          if (actualPart != null) {
        SaveablesList modelManager = (SaveablesList) actualPart.getSite().getService(ISaveablesLifecycleListener.class);
            modelManager.dirtyChanged(actualPart);
          }
        }
    }
View Full Code Here

            }
           
            try {
                state = STATE_CREATION_IN_PROGRESS;
               
                IWorkbenchPart newPart = createPart();
                if (newPart != null) {
                    part = newPart;
                    // Add a dispose listener to the part. This dispose listener does nothing but log an exception
                    // if the part's widgets get disposed unexpectedly. The workbench part reference is the only
                    // object that should dispose this control, and it will remove the listener before it does so.
View Full Code Here

   *
   * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
   */
  public Object execute(ExecutionEvent event) throws ExecutionException {

    IWorkbenchPart part = HandlerUtil.getActivePart(event);
    if (part != null) {
      IWorkbenchPartSite site = part.getSite();
      if (site instanceof PartSite) {
        PartPane pane = ((PartSite) site).getPane();
        pane.showPaneMenu();
      }
    }
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.