Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchWindow


    }
  }

  @Override
  public void selectionChanged(IAction action, ISelection selection) {
    IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (renameAction == null) {
      init(activeWindow);
      if (renameAction != null) {
        renameAction.update(selection);
      }
    } 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) {
View Full Code Here


    }
  }

  @Override
  public void selectionChanged(IAction action, ISelection selection) {
    IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (extractAction == null) {
      init(activeWindow);
      if (extractAction != null) {
        extractAction.update(selection);
      }
    } 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) {
View Full Code Here

     * Shows the duplicates view.
     */
    public static void showDuplicatesView() {
        final IWorkbench workbench = PlatformUI.getWorkbench();

        final IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
        try {

            @SuppressWarnings("unused")
            final IViewPart view = window.getActivePage().showView(duplicatedView);

        } catch (final PartInitException e) {
            ErlLogger.error(e);
        }
    }
View Full Code Here

     * Hide the duplicates view.
     */
    public static void closeDuplicatesView() {
        final IWorkbench workbench = PlatformUI.getWorkbench();

        final IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
        IViewPart view;
        try {
            view = window.getActivePage().showView(duplicatedView);
            window.getActivePage().hideView(view);
        } catch (final PartInitException e) {
            ErlLogger.error(e);
        }

    }
View Full Code Here

        createImageDescriptor(ErlideUIConstants.IMG_ERLANG_LOGO, baseURL);
    }

    public static IWorkbenchPage getActivePage() {
        final IWorkbenchWindow w = getActiveWorkbenchWindow();
        if (w != null) {
            return w.getActivePage();
        }
        return null;
    }
View Full Code Here

    public static IWorkbenchWindow getActiveWorkbenchWindow() {
        return getDefault().getWorkbench().getActiveWorkbenchWindow();
    }

    public static Shell getActiveWorkbenchShell() {
        final IWorkbenchWindow window = getActiveWorkbenchWindow();
        if (window != null) {
            return window.getShell();
        }
        return null;
    }
View Full Code Here

        // if (!fIsCallHiararchyViewerOwner)
        // appendToGroup(menu, fOpenCallHierarchy);

        if (fShowShowInMenu) {
            final MenuManager showInSubMenu = new MenuManager(getShowInMenuLabel());
            final IWorkbenchWindow workbenchWindow = getSite().getWorkbenchWindow();
            showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN
                    .create(workbenchWindow));
            menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, showInSubMenu);
        }
View Full Code Here

        if (i > 0) {
            name = name.substring(0, i);
        }
        final FunctionRef ref = new FunctionRef(name, f.getFunctionName(), f.getArity());

        final IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        final IWorkbenchPage page = dw.getActivePage();

        final AsyncCaller<CallHierarchyView> ac = new AsyncCaller<CallHierarchyView>(100) {

            @Override
            protected CallHierarchyView prepare() {
View Full Code Here

                break;
            }
        }
        if (erl) {
            final IWorkbench workbench = PlatformUI.getWorkbench();
            final IWorkbenchWindow activeWorkbenchWindow = workbench
                    .getActiveWorkbenchWindow();
            if (activeWorkbenchWindow != null) {
                final IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
                try {
                    activePage.showView(CONSOLE_VIEW_ID);
                } catch (final PartInitException e) {
                    // ignore
                }
View Full Code Here

            }
        }
    }

    protected final boolean isActiveEditor() {
        final IWorkbenchWindow window = getSite().getWorkbenchWindow();
        final IWorkbenchPage page = window.getActivePage();
        if (page == null) {
            return false;
        }
        final IEditorPart activeEditor = page.getActiveEditor();
        return activeEditor != null && activeEditor.equals(this);
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IWorkbenchWindow

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.