Examples of StructuredSelection


Examples of org.eclipse.jface.viewers.StructuredSelection

    /*  Labels Menu */
    else if (queryProvided && LABELS_MENU_HANDLER_ID.equals(id)) {
      INews news = getNews(query);
      if (news != null) {
        setSelection(new StructuredSelection(news));
        Point cursorLocation = fBrowser.getControl().getDisplay().getCursorLocation();
        cursorLocation.y = cursorLocation.y + 16;
        fLabelsContextMenu.setLocation(cursorLocation);
        fLabelsContextMenu.setVisible(true);
      }
    }

    /*  Attachments Menu */
    else if (queryProvided && ATTACHMENTS_MENU_HANDLER_ID.equals(id)) {
      INews news = getNews(query);
      if (news != null) {
        setSelection(new StructuredSelection(news));
        Point cursorLocation = fBrowser.getControl().getDisplay().getCursorLocation();
        cursorLocation.y = cursorLocation.y + 16;
        fAttachmentsContextMenu.setLocation(cursorLocation);
        fAttachmentsContextMenu.setVisible(true);
      }
    }

    /* News Context Menu */
    else if (queryProvided && NEWS_MENU_HANDLER_ID.equals(id)) {
      INews news = getNews(query);
      if (news != null) {
        setSelection(new StructuredSelection(news));
        Point cursorLocation = fBrowser.getControl().getDisplay().getCursorLocation();
        cursorLocation.y = cursorLocation.y + 16;
        fNewsContextMenu.setLocation(cursorLocation);
        fNewsContextMenu.setVisible(true);
      }
    }

    /* Share News Context Menu */
    else if (queryProvided && SHARE_NEWS_MENU_HANDLER_ID.equals(id)) {
      INews news = getNews(query);
      if (news != null) {
        setSelection(new StructuredSelection(news));
        Point cursorLocation = fBrowser.getControl().getDisplay().getCursorLocation();
        cursorLocation.y = cursorLocation.y + 16;
        fShareNewsContextMenu.setLocation(cursorLocation);
        fShareNewsContextMenu.setVisible(true);
      }
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

            /* Do not open any Feed if already showing max number of Feeds */
            if (openFeedViewCount >= maxOpenEditors)
              return;

            /* Open in Feedview */
            OwlUI.openInFeedView(page, new StructuredSelection(newsmarksToOpenOnStartup), false, true, null);
          }
        }
      });
    }
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

      newLabel.setColor(OwlUI.toString(color));
      newLabel.setOrder(fViewer.getTree().getItemCount());
      DynamicDAO.save(newLabel);

      fViewer.refresh();
      fViewer.setSelection(new StructuredSelection(newLabel));
    }
    fViewer.getTree().setFocus();
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

        if (feed.getHomepage() != null) {
          str.append(NLS.bind(Messages.PreviewFeedDialog_FOUND_N_NEWS_HOMEPAGE, newsCount, fBookmark.getName()));
          fStatusLabel.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
              new OpenInBrowserAction(new StructuredSelection(feed.getHomepage())).run();
            }
          });
        } else
          str.append(NLS.bind(Messages.PreviewFeedDialog_FOUND_N_NEWS, newsCount, fBookmark.getName()));
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

      if (explorer != null)
        explorer.reveal(target, true);
    }

    /* Reload Imported Elements */
    new ReloadTypesAction(new StructuredSelection(folderChilds), OwlUI.getPrimaryShell()).run();

    /* Force to rerun saved searches */
    JobRunner.runDelayedInBackgroundThread(new Runnable() {
      public void run() {
        Controller.getDefault().getSavedSearchService().updateSavedSearches(true);
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

    parent = DynamicDAO.save(parent);

    /* Auto-Reload added BookMark */
    for (IMark mark : parent.getMarks()) {
      if (mark.equals(bookmark)) {
        new ReloadTypesAction(new StructuredSelection(mark), getShell()).run();
        break;
      }
    }

    return true;
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

        public void widgetSelected(SelectionEvent e) {
          try {
            URI uri = new URI("http://www.feedvalidator.org/check.cgi?url=" + URIUtils.urlEncode(bm.getFeedLinkReference().getLinkAsText())); //$NON-NLS-1$

            OpenInBrowserAction action = new OpenInBrowserAction();
            action.selectionChanged(null, new StructuredSelection(uri));
            action.run();
          } catch (URISyntaxException ex) {
            Activator.safeLogError(ex.getMessage(), ex);
          }
        }
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

          if (homepage != null) {
            fHomepageLink.addSelectionListener(new SelectionAdapter() {
              @Override
              public void widgetSelected(SelectionEvent e) {
                OpenInBrowserAction action = new OpenInBrowserAction();
                action.selectionChanged(null, new StructuredSelection(homepage));
                action.run();
              }
            });
          }
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

  @Override
  public void open(MouseEvent e) {

    /* Open Link in Browser if Modifier Key is pressed */
    if ((e.stateMask & SWT.MOD1) != 0) {
      new OpenInBrowserAction(new StructuredSelection(fNewsLink)).run();
      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 */
 
View Full Code Here

Examples of org.eclipse.jface.viewers.StructuredSelection

          IEditorPart existingEditor = page.findEditor(fvInput);
          if (existingEditor != null && existingEditor instanceof FeedView) {
            feedview = (FeedView) existingEditor;

            /* Set Selection */
            feedview.setSelection(new StructuredSelection(news));
          }

          /* Otherwise open the Input in a new Editor */
          else
            feedview = (FeedView) page.openEditor(fvInput, FeedView.ID, true);
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.