Examples of IWorkbenchPart


Examples of org.eclipse.ui.IWorkbenchPart

    // TODO Auto-generated method stub
    if (enabledWhen == null) {
      enabledWhen = new Expression() {
        public EvaluationResult evaluate(IEvaluationContext context)
            throws CoreException {
          IWorkbenchPart part = InternalHandlerUtil
              .getActivePart(context);
          if (part != null) {
            PartPane pane = ((PartSite) part.getSite()).getPane();
            if ((pane instanceof ViewPane)
                && ((ViewPane) pane).hasViewMenu()) {
              return EvaluationResult.TRUE;
            }
          }
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPart

        final MenuItem item = new MenuItem(parent, SWT.CHECK);
        item.setText(WorkbenchMessages.EditorPane_pinEditor);
        item.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                IWorkbenchPart part = getPartReference().getPart(true);
                if (part == null) {
                    // this should never happen
                    item.setSelection(false);
                    item.setEnabled(false);
                } else {
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPart

    if (selectedItem != null) {
      if (selectedItem instanceof IEditorReference) {
        page.setEditorAreaVisible(true);
      }
      if (selectedItem instanceof IWorkbenchPartReference) {
        IWorkbenchPart part = ((IWorkbenchPartReference) selectedItem)
            .getPart(true);
        if (part != null) {
          page.activate(part);
        }
      }
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPart

  /**
   * Initialize the slave services for this site.
   */
  private void initializeDefaultServices() {
    final IWorkbenchPart parentPart = parentSite.getPart();
    final Expression defaultExpression = new ActivePartExpression(
        parentPart);

    final IHandlerService parentService = (IHandlerService) parentSite
        .getService(IHandlerService.class);
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPart

        } else {
            // @issue the following is resource-specific legacy code
            // Build the selection from the IFile of the editor
            Class resourceClass = LegacyResourceSupport.getResourceClass();
            if (resourceClass != null) {
                IWorkbenchPart part = workbenchWindow.getPartService()
                        .getActivePart();
                if (part instanceof IEditorPart) {
                    IEditorInput input = ((IEditorPart) part).getEditorInput();
                    Object resource = Util.getAdapter(input, resourceClass);
                    if (resource != null) {
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPart

    public void dispose() {
        if (handler != null) {
            handler.removePropertyChangeListener(propertyChangeListener);
            handler = null;
        }
        IWorkbenchPart part = getActivePart();
        if (part != null) {
            IWorkbenchPartSite site = part.getSite();
            SubActionBars bars = (SubActionBars) ((PartSite) site).getActionBars();
            bars.removePropertyChangeListener(propertyChangeListener);
        }
    }
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPart

     * A workbench part has been closed.
     *
     * @param part the workbench part that has been closed
     */
    public void partClosed(IWorkbenchPart part) {
        IWorkbenchPart activePart = part.getSite().getPage().getActivePart();
        if (activePart != null) {
      // We are going to get a part activated message so don't bother setting the
            // action handler to null. This prevents enablement flash in the toolbar
            return;
    }
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPart

        super.partDeactivated(part);
        IWorkbenchPartSite site = part.getSite();
        SubActionBars bars = (SubActionBars) ((PartSite) site).getActionBars();
        bars.removePropertyChangeListener(propertyChangeListener);

        IWorkbenchPart activePart = part.getSite().getPage().getActivePart();
        if (activePart != null) {
      // We are going to get a part activated message so don't bother setting the
            // action handler to null. This prevents enablement flash in the toolbar
            return;
    }
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPart

    /*
     * @see AbstractPartSelectionTracker#getSelection()
     */
    public ISelection getSelection() {
        IWorkbenchPart part = getPart();
        if (part != null) {
            ISelectionProvider sp = part.getSite().getSelectionProvider();
            if (sp != null) {
                return sp.getSelection();
            }
        }
        return null;
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPart

    /**
     * @see AbstractDebugSelectionProvider#getSelectionProvider()
     */
    protected ISelectionProvider getSelectionProvider() {
        IWorkbenchPart part = getPart();
        if (part != null) {
            return part.getSite().getSelectionProvider();
        }
        return null;
    }
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.