Class UIFunctionsImpl

    • Field Detail

      • MSG_ALREADY_EXISTS

        private static final java.lang.String MSG_ALREADY_EXISTS
        See Also:
        Constant Field Values
      • MSG_ALREADY_EXISTS_NAME

        private static final java.lang.String MSG_ALREADY_EXISTS_NAME
        See Also:
        Constant Field Values
      • LOGID

        private static final LogIDs LOGID
      • isTorrentMenuVisible

        protected boolean isTorrentMenuVisible
      • paramShowTorrentsMenuListener

        private final ParameterListener paramShowTorrentsMenuListener
    • Constructor Detail

      • UIFunctionsImpl

        public UIFunctionsImpl​(MainWindow window)
        Parameters:
        window -
    • Method Detail

      • getUIType

        public java.lang.String getUIType()
        Specified by:
        getUIType in interface UIFunctions
      • bringToFront

        public void bringToFront()
        Description copied from interface: UIFunctions
        Bring main window to the front
        Specified by:
        bringToFront in interface UIFunctions
      • bringToFront

        public void bringToFront​(boolean tryTricks)
        Description copied from interface: UIFunctions
        Bring main window to the front
        Specified by:
        bringToFront in interface UIFunctions
        Parameters:
        tryTricks - : try tricks to force it to the top
      • dispose

        public boolean dispose​(boolean for_restart)
        Specified by:
        dispose in interface UIFunctions
      • refreshLanguage

        public void refreshLanguage()
        Description copied from interface: UIFunctions
        Change/Refresh the language of the UI
        Specified by:
        refreshLanguage in interface UIFunctions
      • setStatusText

        public void setStatusText​(java.lang.String key)
        Specified by:
        setStatusText in interface UIFunctions
      • viewURL

        public void viewURL​(java.lang.String url,
                            java.lang.String target,
                            java.lang.String sourceRef)
        Specified by:
        viewURL in interface UIFunctions
      • viewURL

        public boolean viewURL​(java.lang.String url,
                               java.lang.String target,
                               int w,
                               int h,
                               boolean allowResize,
                               boolean isModal)
        Specified by:
        viewURL in interface UIFunctions
      • viewURL

        public boolean viewURL​(java.lang.String url,
                               java.lang.String target,
                               double w,
                               double h,
                               boolean allowResize,
                               boolean isModal)
        Specified by:
        viewURL in interface UIFunctions
      • showURL

        private void showURL​(java.lang.String url,
                             java.lang.String target)
        Parameters:
        url -
        target -
      • promptUser

        public void promptUser​(java.lang.String title,
                               java.lang.String text,
                               java.lang.String[] buttons,
                               int defaultOption,
                               java.lang.String rememberID,
                               java.lang.String rememberText,
                               boolean rememberByDefault,
                               int autoCloseInMS,
                               UserPrompterResultListener l)
        Specified by:
        promptUser in interface UIFunctions
      • createMainMenu

        public IMainMenu createMainMenu​(org.eclipse.swt.widgets.Shell shell)
        Description copied from interface: UIFunctionsSWT
        Creates the main application menu and attach it to the given Shell; this is only used for OSX so that we can attach the global menu to popup dialogs which is the expected behavior on OSX. Windows and Linux do not require this since they do not have a global menu and because their main menu is already attached to the main application window.
        Specified by:
        createMainMenu in interface UIFunctionsSWT
        Returns:
      • getSkin

        public SWTSkin getSkin()
      • setSkin

        public void setSkin​(SWTSkin skin)
      • getUIUpdater

        public UIUpdater getUIUpdater()
        Description copied from interface: UIFunctions
        Retrieves the class that handles periodically updating the UI
        Specified by:
        getUIUpdater in interface UIFunctions
        Returns:
      • doSearch

        public void doSearch​(java.lang.String sSearchText)
        Specified by:
        doSearch in interface UIFunctions
        Parameters:
        sSearchText -
      • doSearch

        public void doSearch​(java.lang.String sSearchText,
                             boolean toSubscribe)
        Specified by:
        doSearch in interface UIFunctions
      • checkForSpecialSearchTerm

        private static boolean checkForSpecialSearchTerm​(java.lang.String str)
      • showErrorMessage

        public void showErrorMessage​(java.lang.String keyPrefix,
                                     java.lang.String details,
                                     java.lang.String[] textParams)
        Specified by:
        showErrorMessage in interface UIFunctions
        Parameters:
        keyPrefix -
        details - may not get displayed
        textParams -
      • forceNotify

        public void forceNotify​(int iconID,
                                java.lang.String title,
                                java.lang.String text,
                                java.lang.String details,
                                java.lang.Object[] relatedObjects,
                                int timeoutSecs)
        Description copied from interface: UIFunctions
        Might launch the old-school Mr Slidey
        Specified by:
        forceNotify in interface UIFunctions
      • runOnUIThread

        public void runOnUIThread​(java.lang.String ui_type,
                                  java.lang.Runnable runnable)
        Specified by:
        runOnUIThread in interface UIFunctions
      • isProgramInstalled

        public boolean isProgramInstalled​(java.lang.String extension,
                                          java.lang.String name)
        Specified by:
        isProgramInstalled in interface UIFunctions
      • playOrStreamDataSource

        public void playOrStreamDataSource​(java.lang.Object ds,
                                           java.lang.String referal,
                                           boolean launch_already_checked,
                                           boolean complete_only)
        Specified by:
        playOrStreamDataSource in interface UIFunctions
      • addTorrentWithOptions

        public boolean addTorrentWithOptions​(boolean force,
                                             TorrentOpenOptions torrentOptions)
        Description copied from interface: UIFunctions
        Opens the Torrent Add Options Window, if configured to
        Specified by:
        addTorrentWithOptions in interface UIFunctions
        Parameters:
        force - Override configuration, show it!
        Returns:
        true if torrent was added
      • addTorrentWithOptionsSupport

        private boolean addTorrentWithOptionsSupport​(TorrentOpenOptions torrentOptions,
                                                     java.util.Map<java.lang.String,​java.lang.Object> addOptions,
                                                     boolean is_silent)
      • openTorrentOpenOptions

        public void openTorrentOpenOptions​(org.eclipse.swt.widgets.Shell shell,
                                           java.lang.String sPathOfFilesToOpen,
                                           java.lang.String[] sFilesToOpen,
                                           boolean defaultToStopped,
                                           boolean forceOpen)
        Specified by:
        openTorrentOpenOptions in interface UIFunctionsSWT
      • openTorrentOpenOptions

        public void openTorrentOpenOptions​(org.eclipse.swt.widgets.Shell shell,
                                           java.lang.String sPathOfFilesToOpen,
                                           java.lang.String[] sFilesToOpen,
                                           java.util.Map<java.lang.String,​java.lang.Object> options)
        Specified by:
        openTorrentOpenOptions in interface UIFunctionsSWT
        options - See UIFunctions constants
      • copyToClipboard

        public void copyToClipboard​(java.lang.String text)
        Specified by:
        copyToClipboard in interface UIFunctions
      • showText

        public void showText​(java.lang.String title,
                             java.lang.String content)
        Specified by:
        showText in interface UIFunctions
      • dispose

        public void dispose()