Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchPage


    /* Only Link for Single Selections */
    if (selection.size() == 1) {
      Object element = selection.getFirstElement();

      /* Find the Editor showing given Selection */
      IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
      IEditorReference[] editorReferences = activePage.getEditorReferences();
      IEditorReference reference = EditorUtils.findEditor(editorReferences, element);
      if (reference != null)
        activePage.bringToTop(reference.getPart(false));
    }
  }
View Full Code Here


  /**
   * TODO Find a better solution once its possible to add listeners to
   * {@link IPreferenceScope} and then listen to changes of display-properties.
   */
  public static void updateFilterAndGrouping() {
    IWorkbenchPage page = OwlUI.getPage();
    if (page != null) {
      IEditorReference[] editorReferences = page.getEditorReferences();
      for (IEditorReference reference : editorReferences) {
        try {
          IEditorInput editorInput = reference.getEditorInput();
          if (editorInput instanceof FeedViewInput) {
            FeedView feedView = (FeedView) reference.getEditor(true);
View Full Code Here

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

    return null;
  }
View Full Code Here

   *
   * @return the first active <code>FeedView</code> from the PlatformUI facade
   * or <code>NULL</code> if none.
   */
  public static FeedView getActiveFeedView() {
    IWorkbenchPage page = getPage();
    if (page != null) {
      IEditorPart activeEditor = page.getActiveEditor();
      if (activeEditor != null && activeEditor instanceof FeedView)
        return (FeedView) activeEditor;
    }

    return null;
View Full Code Here

   *
   * @return the <code>BookMarkExplorer</code> from the PlatformUI facade or
   * <code>NULL</code> if not opened.
   */
  public static BookMarkExplorer getOpenBookMarkExplorer() {
    IWorkbenchPage page = getPage();
    if (page != null) {
      IViewReference[] viewReferences = page.getViewReferences();
      for (IViewReference viewRef : viewReferences) {
        if (viewRef.getId().equals(BookMarkExplorer.VIEW_ID)) {
          IViewPart view = viewRef.getView(true);
          if (view instanceof BookMarkExplorer)
            return (BookMarkExplorer) view;
View Full Code Here

          new NewBookMarkAction(shell, null, null, link).run(null);
        }

        /* Display selected Feed since its existing already */
        else {
          IWorkbenchPage page = OwlUI.getPage();
          if (page != null) {
            try {
              page.openEditor(new FeedViewInput(existingBookMark), FeedView.ID, OpenStrategy.activateOnOpen());
            } catch (PartInitException e) {
              Activator.getDefault().getLog().log(e.getStatus());
            }
          }
        }
View Full Code Here

    /* Only Link for Single Selections */
    if (selection.size() == 1) {
      Object element = selection.getFirstElement();

      /* Find the Editor showing given Selection */
      IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
      IEditorReference[] editorReferences = activePage.getEditorReferences();
      IEditorReference reference = EditorUtils.findEditor(editorReferences, element);
      if (reference != null)
        activePage.bringToTop(reference.getPart(false));
    }
  }
View Full Code Here

    return super.close();
  }

  /* Restore RSSOwl and Close the Notifier */
  private void doRestore() {
    IWorkbenchPage page = OwlUI.getPage();
    if (page != null) {

      /* Restore Window */
      OwlUI.restoreWindow(page);

View Full Code Here

  }

  private void internalRun() {

    /* Require a Page */
    IWorkbenchPage page = OwlUI.getPage();
    if (page == null)
      return;

    /* Restore Window */
    if (fRestoreWindow)
View Full Code Here

    try {
      IPreferenceScope eclipsePreferences = Owl.getPreferenceService().getEclipseScope();
      IPreferenceScope owlPreferences = Owl.getPreferenceService().getGlobalScope();

      WebBrowserInput input = new WebBrowserInput(href, context);
      IWorkbenchPage page = OwlUI.getPage();
      if (page != null) {
        boolean multipleTabs = eclipsePreferences.getBoolean(DefaultPreferences.ECLIPSE_MULTIPLE_TABS);
        boolean openInBackground = owlPreferences.getBoolean(DefaultPreferences.OPEN_BROWSER_IN_BACKGROUND);
        boolean reuseTab = owlPreferences.getBoolean(DefaultPreferences.ALWAYS_REUSE_BROWSER);

        /* Try to Reuse existing Browser first if set */
        if (reuseTab) {
          WebBrowserView browser = OwlUI.getFirstActiveBrowser();
          if (browser != null) {
            browser.setInput(input);
            if (!openInBackground)
              page.activate(browser);

            return browser;
          }
        }

        /* Open Browser Tab in Background */
        if (multipleTabs && openInBackground) {
          IEditorPart previousActiveEditor = page.getActiveEditor();
          page.getWorkbenchWindow().getShell().setRedraw(false);
          try {
            view = (WebBrowserView) page.openEditor(input, WebBrowserView.EDITOR_ID, true);

            if (previousActiveEditor != null)
              page.activate(previousActiveEditor);
          } finally {
            page.getWorkbenchWindow().getShell().setRedraw(true);
          }
        }

        /* Open Browser Tab in Front */
        else
          view = (WebBrowserView) page.openEditor(input, WebBrowserView.EDITOR_ID, true);
      }
    } catch (PartInitException e) {
      Activator.getDefault().logError(e.getMessage(), e);
    }

View Full Code Here

TOP

Related Classes of org.eclipse.ui.IWorkbenchPage

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.