Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchPart


  private IPartListener getPartListener() {
    if (partListener == null) {
      final IWorkbenchPartSite site = (IWorkbenchPartSite) appContext
          .getVariable(ISources.ACTIVE_SITE_NAME);

      final IWorkbenchPart currentPart;
      if (site instanceof MultiPageEditorSite) {
        currentPart = ((MultiPageEditorSite) site).getMultiPageEditor();
      } else {
        currentPart = site.getPart();
      }
View Full Code Here


  /**
   * Initialize the action delegate by calling its lifecycle method.
   */
  private final boolean initDelegate() {
    final IWorkbenchPage page = window.getActivePage();
    final IWorkbenchPart activePart;
    final IEditorPart activeEditor;
    if (page == null) {
      activePart = null;
      activeEditor = null;
    } else {
View Full Code Here

    /**
     * Notify the workbook page that the part pane has
     * been activated by the user.
     */
    public void requestActivation() {
        IWorkbenchPart part = partReference.getPart(true);
        // Cannot activate the outer bit of a MultiEditor. In previous versions of the
        // workbench, MultiEditors had their own implementation of EditorPane for the purpose
        // of overriding requestActivation with a NOP... however, keeping the old pattern would
        // mean it is necessary to eagerly activate an editor's plugin in order to determine
        // what type of pane to create.
View Full Code Here

     * Sets focus to this part.
     */
    public void setFocus() {
        requestActivation();

        IWorkbenchPart part = partReference.getPart(true);
        if (part != null) {
            Control control = getControl();
            if (!SwtUtil.isFocusAncestor(control)) {
                // First try to call part.setFocus
                part.setFocus();
            }
        }
    }
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
   */
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IWorkbenchPart part = HandlerUtil.getActivePartChecked(event);
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);

    if (part instanceof IEditorPart) {
      window.getActivePage().closeEditor((IEditorPart) part, true);
    } else if (part instanceof IViewPart) {
View Full Code Here

        if (EditorRegistry.EMPTY_EDITOR_ID.equals(getId())) {
          return getEmptyEditor(getDescriptor());
        }
        PartInitException exception = null;
       
        IWorkbenchPart result = null;
       
        // Try to restore the editor -- this does the real work of restoring the editor
        //
        try {
            result = createPartHelper();
View Full Code Here

    }

    protected void fireActivePartChanged(IWorkbenchPartReference oldRef, IWorkbenchPartReference newRef) {
        partService.setActivePart(newRef);
       
        IWorkbenchPart realPart = newRef == null? null : newRef.getPart(false);
        selectionService.setActivePart(realPart);
    }
View Full Code Here

    registerEnablement();
  }

  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.showSystemMenu();
      }
    }
View Full Code Here

  protected Expression getEnabledWhenExpression() {
    if (enabledWhen == null) {
      enabledWhen = new Expression() {
        public EvaluationResult evaluate(IEvaluationContext context)
            throws CoreException {
          IWorkbenchPart part = InternalHandlerUtil
              .getActivePart(context);

          if (part != null) {
            return EvaluationResult.TRUE;
          }
View Full Code Here

     */
    private void fillMenu(IMenuManager innerMgr) {
        // Remove all.
        innerMgr.removeAll();

        IWorkbenchPart sourcePart = getSourcePart();
        if (sourcePart == null) {
            return;
        }
        ShowInContext context = getContext(sourcePart);
        if (context == null) {
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.