Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchWindow


    if (cursorControl == null)
      return null;

    /* Return Window that belongs to Cursor-Shell */
    Shell cursorShell = cursorControl.getShell();
    IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
    for (IWorkbenchWindow workbenchWindow : windows) {
      if (workbenchWindow.getShell().equals(cursorShell))
        return workbenchWindow;
    }

View Full Code Here


   *
   * @return the first <code>IWorkbenchPage</code> from the PlatformUI facade or
   * <code>NULL</code> if none.
   */
  public static IWorkbenchPage getPage() {
    IWorkbenchWindow window = getWindow();
    if (window != null) {

      /* First try active Page */
      if (window.getActivePage() != null)
        return window.getActivePage();

      /* Finally try any Page */
      IWorkbenchPage[] pages = window.getPages();
      if (pages.length > 0)
        return pages[0];
    }

    return null;
View Full Code Here

   * @return the first <code>IWorkbenchPage</code> from the Workbench-Window the
   * mouse is currently over from the PlatformUI facade or <code>NULL</code> if
   * none.
   */
  public static IWorkbenchPage getPageAtCursor() {
    IWorkbenchWindow window = getWindowAtCursor();
    if (window != null) {

      /* First try active Page */
      if (window.getActivePage() != null)
        return window.getActivePage();

      /* Finally try any Page */
      IWorkbenchPage[] pages = window.getPages();
      if (pages.length > 0)
        return pages[0];
    }

    return null;
View Full Code Here

   *
   * @return the primary <code>Shell</code> from the PlatformUI facade or
   * <code>NULL</code> if none.
   */
  public static Shell getPrimaryShell() {
    IWorkbenchWindow window = getPrimaryWindow();
    if (window != null)
      return window.getShell();

    return null;
  }
View Full Code Here

   *
   * @return the active <code>Shell</code> from the PlatformUI facade or
   * <code>NULL</code> if none.
   */
  public static Shell getActiveShell() {
    IWorkbenchWindow window = getWindow();
    if (window != null)
      return window.getShell();

    return null;
  }
View Full Code Here

   * Update the current active window title based on the given title.
   *
   * @param title the name of the input that is currently visible in RSSOwl.
   */
  public static void updateWindowTitle(String title) {
    IWorkbenchWindow window = getWindow();
    if (window != null) {
      String appTitle = "RSSOwl"; //$NON-NLS-1$
      if (StringUtils.isSet(title))
        title = NLS.bind(Messages.OwlUI_TITLE, title, appTitle);
      else
        title = appTitle;

      window.getShell().setText(title);
    }
  }
View Full Code Here

    /* Open BookMarks which are to open on startup */
    if (!newsmarksToOpenOnStartup.isEmpty()) {
      JobRunner.runInUIThread(null, new Runnable() {
        public void run() {
          IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
          IWorkbenchPage page = (window != null) ? window.getActivePage() : null;
          if (page != null) {
            IPreferenceScope preferences = Owl.getPreferenceService().getGlobalScope();
            boolean reuseFeedView = preferences.getBoolean(DefaultPreferences.ALWAYS_REUSE_FEEDVIEW);
            int maxOpenEditors = EditorUtils.getOpenEditorLimit();
            int openFeedViewCount = OwlUI.getOpenFeedViewCount();
View Full Code Here

      CoreUtils.reparentWithProperties(reparenting);
    }
  }

  private Shell getWorkbenchShell() {
    IWorkbenchWindow wWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (wWindow != null)
      return wWindow.getShell();

    return null;
  }
View Full Code Here

      launcher.start();
    }
  }

  private static void showErrorIfExternalBrowserFails() {
    final IWorkbenchWindow window = OwlUI.getWindow();
    if (window == null)
      return;

    JobRunner.runInUIThread(window.getShell(), new Runnable() {
      public void run() {
        MessageBox box = new MessageBox(window.getShell(), SWT.ICON_WARNING | SWT.OK | SWT.CANCEL);
        box.setText("Unable to Launch External Browser");
        box.setMessage("RSSOwl is unable to launch the external browser. Please configure it and try again.");

        if (box.open() == SWT.OK)
          PreferencesUtil.createPreferenceDialogOn(window.getShell(), MiscPreferencePage.ID, null, null).open();
      }
    });
  }
View Full Code Here

    /* Create and Register with Workbench */
    Menu menu = manager.createContextMenu(fViewer.getControl());
    fViewer.getControl().setMenu(menu);

    /* Register with Part Site */
    IWorkbenchWindow window = OwlUI.getWindow();
    if (window != null) {
      IWorkbenchPart activePart = window.getPartService().getActivePart();
      if (activePart != null && activePart.getSite() != null)
        activePart.getSite().registerContextMenu(manager, fViewer);
    }
  }
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.