Examples of IWorkbenchPage


Examples of org.eclipse.ui.IWorkbenchPage

   *
   * @return the first <code>FeedView</code> from the active Workbench Window of
   * the PlatformUI facade or <code>NULL</code> if none.
   */
  public static FeedView getFirstActiveFeedView() {
    IWorkbenchPage page = getPage();
    if (page != null) {
      IEditorReference[] editorReferences = page.getEditorReferences();
      for (IEditorReference editorReference : editorReferences) {
        try {
          if (editorReference.getEditorInput() instanceof FeedViewInput)
            return (FeedView) editorReference.getEditor(true);
        } catch (PartInitException e) {
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPage

   *
   * @return the first <code>WebBrowserView</code> from the active Workbench
   * Window of the PlatformUI facade or <code>NULL</code> if none.
   */
  public static WebBrowserView getFirstActiveBrowser() {
    IWorkbenchPage page = getPage();
    if (page != null) {
      IEditorReference[] editorReferences = page.getEditorReferences();
      for (IEditorReference editorReference : editorReferences) {
        try {
          if (editorReference.getEditorInput() instanceof WebBrowserInput)
            return (WebBrowserView) editorReference.getEditor(true);
        } catch (PartInitException e) {
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPage

   *
   * @return the <code>BookMarkExplorer</code> from the PlatformUI facade or
   * <code>NULL</code> if not opened.
   */
  public static BookMarkExplorer getOpenedBookMarkExplorer() {
    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

Examples of org.eclipse.ui.IWorkbenchPage

   * @return the current selected {@link IFolder} of the bookmark explorer or
   * the parent of the current selected {@link IMark} or <code>null</code> if
   * none.
   */
  public static IFolder getBookMarkExplorerSelection() {
    IWorkbenchPage page = getPage();
    if (page != null) {
      IViewPart viewPart = page.findView(BookMarkExplorer.VIEW_ID);
      if (viewPart != null) {
        IStructuredSelection selection = (IStructuredSelection) viewPart.getSite().getSelectionProvider().getSelection();
        if (!selection.isEmpty()) {
          Object selectedEntity = selection.iterator().next();
          if (selectedEntity instanceof IFolder)
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPage

    }
  }

  /** Identical with ActionFactory.CLOSE_OTHERS */
  public static void closeOtherEditors() {
    IWorkbenchPage page = getPage();
    if (page != null) {
      IEditorReference[] refArray = page.getEditorReferences();
      if (refArray != null && refArray.length > 1) {
        IEditorReference[] otherEditors = new IEditorReference[refArray.length - 1];
        IEditorReference activeEditor = (IEditorReference) page.getReference(page.getActiveEditor());
        for (int i = 0; i < refArray.length; i++) {
          if (refArray[i] != activeEditor)
            continue;
          System.arraycopy(refArray, 0, otherEditors, 0, i);
          System.arraycopy(refArray, i + 1, otherEditors, i, refArray.length - 1 - i);
          break;
        }
        page.closeEditors(otherEditors, true);
      }
    }
  }
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPage

  /**
   * Switch between showing and hiding the Bookmarks View.
   */
  public static void toggleBookmarks() {
    IWorkbenchPage page = OwlUI.getPage();
    if (page != null) {
      IViewPart explorerView = page.findView(BookMarkExplorer.VIEW_ID);

      /* Hide Bookmarks */
      if (explorerView != null)
        page.hideView(explorerView);

      /* Show Bookmarks */
      else {
        try {
          page.showView(BookMarkExplorer.VIEW_ID);
        } catch (PartInitException e) {
          Activator.getDefault().logError(e.getMessage(), e);
        }
      }
    }
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPage

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

        /* Display selected Feed since its existing already */
        else {
          IWorkbenchPage page = OwlUI.getPage();
          if (page != null)
            OwlUI.openInFeedView(page, new StructuredSelection(existingBookMark));
        }
      }
    });
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPage

    /* 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

Examples of org.eclipse.ui.IWorkbenchPage

      FeedView activeFeedView = OwlUI.getActiveFeedView();

      /* Run on active FeedView if any */
      if (fType.isNewsScoped() && activeFeedView != null) {
        if (activeFeedView.navigate(true, fType.isNewsScoped(), fType.isNext(), fType.isUnread())) {
          IWorkbenchPage page = activeFeedView.getSite().getPage();
          page.activate(activeFeedView.getSite().getPart());
          page.activate(activeFeedView);

          return true;
        }
      }

View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPage

      return;
    }

    /* Otherwise open Feedview and select the News */
    IBookMark bookMark = Controller.getDefault().getCacheService().getBookMark(fFeedReference);
    IWorkbenchPage page = OwlUI.getPage();
    if (page != null) {

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

      /* First try if the Bookmark is already visible */
      IEditorReference editorRef = EditorUtils.findEditor(page.getEditorReferences(), bookMark);
      if (editorRef != null) {
        IEditorPart editor = editorRef.getEditor(false);
        if (editor instanceof FeedView) {
          ((FeedView) editor).setSelection(new StructuredSelection(fNewsReference));
          page.activate(editor);
        }
      }

      /* Otherwise Open */
      else {
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.