Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.Separator


        return OwlUI.getImageDescriptor("icons/obj16/forum.gif"); //$NON-NLS-1$
      }
    });

    /* Show Key Bindings */
    helpMenu.add(new Separator());
    helpMenu.add(new Action(Messages.ApplicationActionBarAdvisor_SHOW_KEY_BINDINGS) {
      @Override
      public void run() {
        IWorkbench workbench = PlatformUI.getWorkbench();
        IBindingService bindingService = (IBindingService) workbench.getService(IBindingService.class);
        bindingService.openKeyAssistDialog();
      }
    });

    helpMenu.add(new Separator());

    /* Report Bugs */
    helpMenu.add(new Action(Messages.ApplicationActionBarAdvisor_REPORT_PROBLEMS) {
      @Override
      public void run() {
        BrowserUtils.openLinkExternal("http://dev.rssowl.org"); //$NON-NLS-1$
      }

      @Override
      public ImageDescriptor getImageDescriptor() {
        return OwlUI.getImageDescriptor("icons/elcl16/bug.gif"); //$NON-NLS-1$
      }
    });

    /* Export Log to File */
    helpMenu.add(new Action(Messages.ApplicationActionBarAdvisor_EXPORT_LOGFILE) {
      @Override
      public void run() {
        FileDialog dialog = new FileDialog(getActionBarConfigurer().getWindowConfigurer().getWindow().getShell(), SWT.SAVE);
        dialog.setText(Messages.ApplicationActionBarAdvisor_EXPORT_LOGFILE_DIALOG);
        dialog.setFilterExtensions(new String[] { "*.log" }); //$NON-NLS-1$
        dialog.setFileName("rssowl.log"); //$NON-NLS-1$
        dialog.setOverwrite(true);

        String file = dialog.open();
        if (StringUtils.isSet(file)) {
          try {

            /* Check for Log Message from Core to have a complete log */
            String logMessages = CoreUtils.getAndFlushLogMessages();
            if (logMessages != null && logMessages.length() > 0)
              Activator.safeLogError(logMessages, null);

            /* Help to find out where the log is coming from */
            Activator.safeLogInfo("Error Log Exported"); //$NON-NLS-1$

            /* Export Log File */
            File logFile = Platform.getLogFileLocation().toFile();
            InputStream inS;
            if (logFile.exists())
              inS = new FileInputStream(logFile);
            else
              inS = new ByteArrayInputStream(new byte[0]);
            FileOutputStream outS = new FileOutputStream(new File(file));
            CoreUtils.copy(inS, outS);

            /* Append a Report of Feeds that are not loading if any */
            String nl = System.getProperty("line.separator"); //$NON-NLS-1$
            if (!StringUtils.isSet(nl))
              nl= "\n"; //$NON-NLS-1$

            StringBuilder errorReport = new StringBuilder();
            Collection<IBookMark> bookmarks = DynamicDAO.getDAO(IBookMarkDAO.class).loadAll();
            for (IBookMark bookmark : bookmarks) {
              if (bookmark.isErrorLoading()) {
                Object errorObj = bookmark.getProperty(Controller.LOAD_ERROR_KEY);
                if (errorObj != null && errorObj instanceof String) {
                  errorReport.append(Controller.getDefault().createLogEntry(bookmark, null, (String) errorObj));
                  errorReport.append(nl).append(nl);
                }
              }
            }

            if (errorReport.length() > 0) {
              FileWriter writer = new FileWriter(new File(file), true);
              try {
                writer.append(nl).append(nl).append(nl);
                writer.write("--- Summary of Feeds that are not Loading -----------------------------------------------"); //$NON-NLS-1$
                writer.append(nl).append(nl);
                writer.write(errorReport.toString());
                writer.close();
              } finally {
                writer.close();
              }
            }
          } catch (FileNotFoundException e) {
            Activator.getDefault().logError(e.getMessage(), e);
          } catch (IOException e) {
            Activator.getDefault().logError(e.getMessage(), e);
          }
        }
      }
    });

    helpMenu.add(new Separator());

    /* Homepage */
    helpMenu.add(new Action(Messages.ApplicationActionBarAdvisor_HOMEPAGE) {
      @Override
      public void run() {
        BrowserUtils.openLinkExternal("http://www.rssowl.org"); //$NON-NLS-1$
      }
    });

    /* License */
    helpMenu.add(new Action(Messages.ApplicationActionBarAdvisor_LICENSE) {
      @Override
      public void run() {
        BrowserUtils.openLinkExternal("http://www.rssowl.org/legal/epl-v10.html"); //$NON-NLS-1$
      }
    });

    // helpMenu.add(getAction(ActionFactory.INTRO.getId()));
    helpMenu.add(new Separator());

    helpMenu.add(new Separator());
    helpMenu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
    helpMenu.add(new Separator());

    helpMenu.add(getAction(ActionFactory.ABOUT.getId()));
    if (Application.IS_MAC) {
      IContributionItem item = helpMenu.find(ActionFactory.ABOUT.getId());
      if (item != null)
View Full Code Here


   * @param shell
   * @param advisor
   */
  protected void fillTrayItem(IMenuManager trayItem, final Shell shell, final ApplicationWorkbenchWindowAdvisor advisor) {
    trayItem.add(new ReloadAllAction(false));
    trayItem.add(new Separator());

    trayItem.add(new Action(Messages.ApplicationActionBarAdvisor_CONFIGURE_NOTIFICATIONS) {
      @Override
      public void run() {
        advisor.restoreFromTray(shell);
        PreferencesUtil.createPreferenceDialogOn(shell, NotifierPreferencesPage.ID, null, null).open();
      }

      @Override
      public ImageDescriptor getImageDescriptor() {
        return OwlUI.getImageDescriptor("icons/elcl16/notification.gif"); //$NON-NLS-1$
      }
    });

    trayItem.add(new Action(Messages.ApplicationActionBarAdvisor_PREFERENCES) {
      @Override
      public void run() {
        advisor.restoreFromTray(shell);
        PreferencesUtil.createPreferenceDialogOn(shell, OverviewPreferencesPage.ID, null, null).open();
      }

      @Override
      public ImageDescriptor getImageDescriptor() {
        return OwlUI.getImageDescriptor("icons/elcl16/preferences.gif"); //$NON-NLS-1$
      }
    });

    trayItem.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));

    trayItem.add(new Action(Messages.ApplicationActionBarAdvisor_EXIT) {
      @Override
      public void run() {
        PlatformUI.getWorkbench().close();
View Full Code Here

          fCoolBarAdvisor.advise(true);
      }
    });

    /* Lock Coolbar  */
    coolBarContextMenuManager.add(new Separator());
    IAction lockToolbarAction = getAction(ActionFactory.LOCK_TOOL_BAR.getId());
    lockToolbarAction.setText(Messages.ApplicationActionBarAdvisor_LOCK_TOOLBAR);
    coolBarContextMenuManager.add(lockToolbarAction);

    /* Toggle State of Toolbar Visibility */
 
View Full Code Here

   * otherwise create a sub menu.
   */
  public static void fillAttachmentsMenu(IMenuManager manager, final IStructuredSelection selection, final IShellProvider shellProvider, boolean directMenu) {
    final List<Pair<IAttachment, URI>> attachments = ModelUtils.getAttachmentLinks(selection);
    if (!attachments.isEmpty()) {
      manager.add(new Separator("attachments")); //$NON-NLS-1$

      /* Either as direct Menu or Submenu */
      IMenuManager attachmentMenu;
      if (directMenu)
        attachmentMenu = manager;
      else {
        attachmentMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_ATTACHMENTS, "attachments"); //$NON-NLS-1$
        manager.add(attachmentMenu);
      }

      final IPreferenceScope preferences = Owl.getPreferenceService().getGlobalScope();

      /* Offer to Download All */
      if (attachments.size() > 1) {
        int sumBytes = 0;
        for (Pair<IAttachment, URI> attachment : attachments) {
          if (attachment.getFirst().getLength() > 0) {
            sumBytes += attachment.getFirst().getLength();
          } else {
            sumBytes = 0;
            break;
          }
        }
        String sumSize = OwlUI.getSize(sumBytes);

        Action downloadAllAction = new Action(sumSize != null ? (NLS.bind(Messages.ApplicationActionBarAdvisor_DOWNLOAD_ALL_WITH_SIZE, sumSize)) : (Messages.ApplicationActionBarAdvisor_DOWNLOAD_ALL)) {
          @Override
          public void run() {
            DirectoryDialog dialog = new DirectoryDialog(shellProvider.getShell(), SWT.None);
            dialog.setText(Messages.ApplicationActionBarAdvisor_SELECT_FOLDER_FOR_DOWNLOADS);

            String downloadFolder = preferences.getString(DefaultPreferences.DOWNLOAD_FOLDER);
            if (StringUtils.isSet(downloadFolder) && new File(downloadFolder).exists())
              dialog.setFilterPath(downloadFolder);

            String folder = dialog.open();
            if (StringUtils.isSet(folder)) {
              for (Pair<IAttachment, URI> attachment : attachments) {
                Controller.getDefault().getDownloadService().download(attachment.getFirst(), attachment.getSecond(), new File(folder), true);
              }

              /* Remember Download Folder in Settings */
              preferences.putString(DefaultPreferences.DOWNLOAD_FOLDER, folder);
            }
          }
        };
        downloadAllAction.setImageDescriptor(OwlUI.getImageDescriptor("icons/elcl16/save_all.gif")); //$NON-NLS-1$
        attachmentMenu.add(downloadAllAction);
        attachmentMenu.add(new Separator());
      }

      /* Collect openable Attachments that have already been downloaded */
      List<Action> openActions = new ArrayList<Action>(1);
      Set<String> downloadLocations = getDownloadLocations();

      /* Offer Download Action for each */
      for (final Pair<IAttachment, URI> attachmentPair : attachments) {
        IAttachment attachment = attachmentPair.getFirst();
        final String fileName = URIUtils.getFile(attachmentPair.getSecond(), OwlUI.getExtensionForMime(attachment.getType()));
        String size = OwlUI.getSize(attachment.getLength());

        Action action = new Action(size != null ? (NLS.bind(Messages.ApplicationActionBarAdvisor_FILE_SIZE, fileName, size)) : (fileName)) {
          @Override
          public void run() {
            FileDialog dialog = new FileDialog(shellProvider.getShell(), SWT.SAVE);
            dialog.setText(Messages.ApplicationActionBarAdvisor_SELECT_FILE_FOR_DOWNLOAD);
            dialog.setFileName(Application.IS_WINDOWS ? CoreUtils.getSafeFileNameForWindows(fileName) : fileName);
            dialog.setOverwrite(true);

            String downloadFolder = preferences.getString(DefaultPreferences.DOWNLOAD_FOLDER);
            if (StringUtils.isSet(downloadFolder) && new File(downloadFolder).exists())
              dialog.setFilterPath(downloadFolder);

            String selectedFileName = dialog.open();
            if (StringUtils.isSet(selectedFileName)) {
              File file = new File(selectedFileName);
              Controller.getDefault().getDownloadService().download(attachmentPair.getFirst(), attachmentPair.getSecond(), file.getName(), file.getParentFile(), true);

              /* Remember Download Folder in Settings */
              preferences.putString(DefaultPreferences.DOWNLOAD_FOLDER, file.getParentFile().toString());
            }
          }
        };

        action.setImageDescriptor(OwlUI.getImageDescriptor("icons/etool16/save_as.gif")); //$NON-NLS-1$
        attachmentMenu.add(action);

        /* Check if Attachment already exists and offer Open Action then */
        String usedFileName = Application.IS_WINDOWS ? CoreUtils.getSafeFileNameForWindows(fileName) : fileName;
        if (shouldOfferOpenAction(usedFileName)) {
          for (String downloadLocation : downloadLocations) {
            final File downloadedFile = new File(downloadLocation, usedFileName);
            if (downloadedFile.exists()) {
              Action openAction = new Action(NLS.bind(Messages.ApplicationActionBarAdvisor_OPEN_FILE, fileName)) {
                @Override
                public void run() {
                  Program.launch(downloadedFile.toString());
                }
              };

              openAction.setImageDescriptor(OwlUI.getAttachmentImage(fileName, attachmentPair.getFirst().getType()));
              openActions.add(openAction);

              break;
            }
          }
        }
      }

      /* Offer Open Action for each downloaded */
      if (!openActions.isEmpty()) {
        attachmentMenu.add(new Separator());
        for (Action openAction : openActions) {
          attachmentMenu.add(openAction);
        }
      }

      /* Offer to Automize Downloading */
      attachmentMenu.add(new Separator());
      attachmentMenu.add(new AutomateFilterAction(PresetAction.DOWNLOAD, selection));
    }
  }
View Full Code Here

   * @param shellProvider a {@link IShellProvider} for dialogs.
   * @param directMenu if <code>true</code> directly fill all items to the menu,
   * otherwise create a sub menu.
   */
  public static void fillShareMenu(IMenuManager manager, final IStructuredSelection selection, final IShellProvider shellProvider, boolean directMenu) {
    manager.add(new Separator("share")); //$NON-NLS-1$

    /* Either as direct Menu or Submenu */
    IMenuManager shareMenu;
    if (directMenu)
      shareMenu = manager;
    else {
      shareMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_SHARE_NEWS, OwlUI.SHARE, "sharenews"); //$NON-NLS-1$
      manager.add(shareMenu);
    }

    /* List all selected Share Providers  */
    final boolean isEnabled = !selection.isEmpty() && !OwlUI.isEntityGroupSelected(selection);
    List<ShareProvider> providers = Controller.getDefault().getShareProviders();
    for (final ShareProvider provider : providers) {
      if (provider.isEnabled()) {
        shareMenu.add(new Action(provider.getName()) {
          @Override
          public void run() {

            /* Special Case "Send E-Mail" action */
            if (SendLinkAction.ID.equals(provider.getId())) {
              IActionDelegate action = new SendLinkAction();
              action.selectionChanged(null, selection);
              action.run(null);
            }

            /* Other Action */
            else {
              Object obj = selection.getFirstElement();
              if (obj != null && obj instanceof INews) {
                String shareLink = provider.toShareUrl((INews) obj);
                new OpenInBrowserAction(new StructuredSelection(shareLink)).run();
              }
            }
          };

          @Override
          public ImageDescriptor getImageDescriptor() {
            if (StringUtils.isSet(provider.getIconPath()))
              return OwlUI.getImageDescriptor(provider.getPluginId(), provider.getIconPath());

            return super.getImageDescriptor();
          };

          @Override
          public boolean isEnabled() {
            return isEnabled;
          }

          @Override
          public String getActionDefinitionId() {
            return SendLinkAction.ID.equals(provider.getId()) ? SendLinkAction.ID : super.getActionDefinitionId();
          }

          @Override
          public String getId() {
            return SendLinkAction.ID.equals(provider.getId()) ? SendLinkAction.ID : super.getId();
          }
        });
      }
    }

    /* Allow to Configure Providers */
    shareMenu.add(new Separator());
    shareMenu.add(new Action(Messages.ApplicationActionBarAdvisor_CONFIGURE) {
      @Override
      public void run() {
        PreferencesUtil.createPreferenceDialogOn(shellProvider.getShell(), SharingPreferencesPage.ID, null, null).open();
      };
View Full Code Here

    /* Load Labels */
    final Collection<ILabel> labels = CoreUtils.loadSortedLabels();

    /* Retrieve Labels that all selected News contain */
    labelMenu.add(new Separator());
    Set<ILabel> selectedLabels = ModelUtils.getLabelsForAll(selection);
    for (final ILabel label : labels) {
      LabelAction labelAction = new LabelAction(label, selection);
      labelAction.setChecked(selectedLabels.contains(label));
      labelMenu.add(labelAction);
    }

    /* New Label */
    labelMenu.add(new Action(Messages.ApplicationActionBarAdvisor_NEW_LABEL) {
      @Override
      public void run() {
        LabelDialog dialog = new LabelDialog(shellProvider.getShell(), DialogMode.ADD, null);
        if (dialog.open() == IDialogConstants.OK_ID) {
          String name = dialog.getName();
          RGB color = dialog.getColor();

          ILabel newLabel = Owl.getModelFactory().createLabel(null, name);
          newLabel.setColor(OwlUI.toString(color));
          newLabel.setOrder(labels.size());
          DynamicDAO.save(newLabel);

          LabelAction labelAction = new LabelAction(newLabel, selection);
          labelAction.run();
        }
      }

      @Override
      public boolean isEnabled() {
        return !selection.isEmpty();
      }
    });

    /* Remove All Labels */
    labelMenu.add(new Separator());
    LabelAction removeAllLabels = new LabelAction(null, selection);
    removeAllLabels.setId(RemoveLabelsHandler.ID);
    removeAllLabels.setActionDefinitionId(RemoveLabelsHandler.ID);
    removeAllLabels.setEnabled(!selection.isEmpty() && !labels.isEmpty());
    labelMenu.add(removeAllLabels);
View Full Code Here

        }
      };
      action.setChecked(filter == selectedFilter);
      optionsMenu.add(action);
      if (filter == Type.SHOW_ALL)
        optionsMenu.add(new Separator());
    }
    menu.add(optionsMenu);
    menu.add(new Separator());

    /* Single Bookmark Set */
    if (roots.size() == 1) {
      fillBookMarksMenu(window, menu, roots.iterator().next().getChildren(), selectedFilter);
    }
View Full Code Here

    /* ToolBar to add and select existing saved searches */
    final ToolBarManager dialogToolBar = new ToolBarManager(SWT.RIGHT | SWT.FLAT);

    /* Separator */
    dialogToolBar.add(new Separator());

    /* Existing Filters */
    {
      IAction existingFilters = new Action(Messages.NewsFilterDialog_SHOW_NEWS_FILTER, IAction.AS_DROP_DOWN_MENU) {
        @Override
View Full Code Here

    };
    newBrowserTab.setImageDescriptor(OwlUI.getImageDescriptor("icons/etool16/new_browser_tab.gif")); //$NON-NLS-1$
    fNavigationToolBarManager.add(newBrowserTab);

    /* Navigate Backward */
    fNavigationToolBarManager.add(new Separator());
    IAction navBackward = new Action(Messages.BrowserBar_BACK) {
      @Override
      public void run() {
        fBrowser.back();
      }

      @Override
      public boolean isEnabled() {
        return fBrowser != null && fBrowser.getControl().isBackEnabled();
      }
    };
    navBackward.setId(BACK_ACTION);
    navBackward.setImageDescriptor(OwlUI.getImageDescriptor("icons/etool16/backward.gif")); //$NON-NLS-1$
    navBackward.setDisabledImageDescriptor(OwlUI.getImageDescriptor("icons/dtool16/backward.gif")); //$NON-NLS-1$
    fNavigationToolBarManager.add(navBackward);

    /* Navigate Forward */
    IAction navForward = new Action(Messages.BrowserBar_FORWARD) {
      @Override
      public void run() {
        fBrowser.forward();
      }

      @Override
      public boolean isEnabled() {
        return fBrowser != null && fBrowser.getControl().isForwardEnabled();
      }
    };
    navForward.setId(FORWARD_ACTION);
    navForward.setImageDescriptor(OwlUI.getImageDescriptor("icons/etool16/forward.gif")); //$NON-NLS-1$
    navForward.setDisabledImageDescriptor(OwlUI.getImageDescriptor("icons/dtool16/forward.gif")); //$NON-NLS-1$
    fNavigationToolBarManager.add(navForward);

    /* Stop */
    IAction stopNav = new Action(Messages.BrowserBar_STOP) {
      @Override
      public void run() {
        fBrowser.getControl().stop();
        setBusy(false);
      }
    };
    stopNav.setImageDescriptor(OwlUI.getImageDescriptor("icons/etool16/cancel.gif")); //$NON-NLS-1$
    fNavigationToolBarManager.add(stopNav);

    /* Reload */
    IAction reload = new Action(Messages.BrowserBar_RELOAD) {
      @Override
      public void run() {
        fBrowser.refresh();
        setBusy(true);
      }
    };
    reload.setImageDescriptor(OwlUI.getImageDescriptor("icons/elcl16/reload.gif")); //$NON-NLS-1$
    fNavigationToolBarManager.add(reload);

    /* Home */
    IAction navHome = new Action(Messages.BrowserBar_HOME) {
      @Override
      public void run() {
        fFeedView.getNewsBrowserControl().getViewer().home();
      }
    };
    navHome.setImageDescriptor(OwlUI.getImageDescriptor("icons/etool16/home.gif")); //$NON-NLS-1$
    fNavigationToolBarManager.add(navHome);

    /* Share */
    fNavigationToolBarManager.add(new Separator());
    IAction shareLink = new Action(Messages.BrowserBar_SHARE_LINK, IAction.AS_DROP_DOWN_MENU) {
      @Override
      public void run() {
        OwlUI.positionDropDownMenu(this, fNavigationToolBarManager);
      }

      @Override
      public String getId() {
        return SHARE_ACTION;
      }
    };
    fNavigationToolBarManager.add(shareLink);
    shareLink.setImageDescriptor(OwlUI.SHARE);
    shareLink.setMenuCreator(new ContextMenuCreator() {

      @Override
      public Menu createMenu(Control parent) {
        MenuManager shareMenu = new MenuManager();

        final IStructuredSelection selection = getSelectionFromBrowser();

        List<ShareProvider> providers = Controller.getDefault().getShareProviders();
        for (final ShareProvider provider : providers) {
          if (provider.isEnabled()) {
            shareMenu.add(new Action(provider.getName()) {
              @Override
              public void run() {
                if (SendLinkAction.ID.equals(provider.getId())) {
                  IActionDelegate action = new SendLinkAction();
                  action.selectionChanged(null, selection);
                  action.run(null);
                } else {
                  Object obj = selection.getFirstElement();
                  if (StringUtils.isSet((String) obj) && !URIUtils.ABOUT_BLANK.equals(obj)) {
                    String shareLink = provider.toShareUrl((String) obj, null);
                    new OpenInBrowserAction(new StructuredSelection(shareLink)).run();
                  }
                }
              };

              @Override
              public ImageDescriptor getImageDescriptor() {
                if (StringUtils.isSet(provider.getIconPath()))
                  return OwlUI.getImageDescriptor(provider.getPluginId(), provider.getIconPath());

                return super.getImageDescriptor();
              };

              @Override
              public boolean isEnabled() {
                return !selection.isEmpty();
              }

              @Override
              public String getActionDefinitionId() {
                return SendLinkAction.ID.equals(provider.getId()) ? SendLinkAction.ID : super.getActionDefinitionId();
              }

              @Override
              public String getId() {
                return SendLinkAction.ID.equals(provider.getId()) ? SendLinkAction.ID : super.getId();
              }
            });
          }
        }

        /* Configure Providers */
        shareMenu.add(new Separator());
        shareMenu.add(new Action(Messages.BrowserBar_CONFIGURE) {
          @Override
          public void run() {
            PreferencesUtil.createPreferenceDialogOn(fBrowser.getControl().getShell(), SharingPreferencesPage.ID, null, null).open();
          };
        });

        return shareMenu.createContextMenu(parent);
      }
    });

    /* Discover Feeds on Website */
    fNavigationToolBarManager.add(new Separator());
    IAction discoverFeeds = new Action(Messages.BrowserBar_FIND_FEEDS) {
      @Override
      public void run() {
        String url = fBrowser.getControl().getUrl();
        if (StringUtils.isSet(url) && !ApplicationServer.getDefault().isNewsServerUrl(url) && !URIUtils.ABOUT_BLANK.equals(url))
View Full Code Here

    });

    dialogToolBar.add(columnDropdown);

    /* Separator */
    dialogToolBar.add(new Separator());

    /* Toggle Preview */
    final String previewActionId = "org.rssowl.ui.internal.dialogs.search.PreviewAction"; //$NON-NLS-1$
    IAction previewAction = new Action(Messages.SearchNewsDialog_PREVIEW_RESULTS, IAction.AS_CHECK_BOX) {
      @Override
      public void run() {
        fIsPreviewVisible = !fIsPreviewVisible;
        fSashForm.setWeights(fIsPreviewVisible ? THREE_SASH_WEIGHTS : TWO_SASH_WEIGHTS);
        fBottomSash.setVisible(fIsPreviewVisible);
        fSashForm.layout();
        dialogToolBar.find(previewActionId).update(IAction.TOOL_TIP_TEXT);

        /* Select and Show News if required */
        if (fIsPreviewVisible && fResultViewer.getTable().getItemCount() > 0) {

          /* Select first News if required */
          if (fResultViewer.getSelection().isEmpty())
            fResultViewer.getTable().select(0);

          /* Set input and Focus */
          fBrowserViewer.setInput(((IStructuredSelection) fResultViewer.getSelection()).getFirstElement());
          hideBrowser(false);
          fResultViewer.getTable().setFocus();

          /* Make sure to show the selection */
          fResultViewer.getTable().showSelection();
        }
      }

      @Override
      public ImageDescriptor getImageDescriptor() {
        return OwlUI.getImageDescriptor("icons/etool16/browsermaximized.gif"); //$NON-NLS-1$
      }

      @Override
      public String getToolTipText() {
        if (fIsPreviewVisible)
          return Messages.SearchNewsDialog_HIDE_PREVIEW;

        return Messages.SearchNewsDialog_SHOW_PREVIEW;
      }
    };
    previewAction.setId(previewActionId);
    previewAction.setChecked(fIsPreviewVisible);
    dialogToolBar.add(previewAction);

    /* Separator */
    dialogToolBar.add(new Separator());

    /* Existing Saved Searches */
    IAction savedSearches = new Action(Messages.SearchNewsDialog_SHOW_SAVED_SEARCH, IAction.AS_DROP_DOWN_MENU) {
      @Override
      public void run() {
View Full Code Here

TOP

Related Classes of org.eclipse.jface.action.Separator

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.