Package com.biglybt.ui.swt.shells.main
Class UIFunctionsImpl
- java.lang.Object
-
- com.biglybt.ui.swt.shells.main.UIFunctionsImpl
-
- All Implemented Interfaces:
CoreComponent
,UIFunctionsSWT
,UIFunctions
public class UIFunctionsImpl extends java.lang.Object implements UIFunctionsSWT
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.biglybt.ui.UIFunctions
UIFunctions.actionListener, UIFunctions.TagReturner
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
isTorrentMenuVisible
private static LogIDs
LOGID
private MainWindow
mainWindow
private static java.lang.String
MSG_ALREADY_EXISTS
private static java.lang.String
MSG_ALREADY_EXISTS_NAME
private ParameterListener
paramShowTorrentsMenuListener
private static boolean
PROXY_VIEW_URL
private SWTSkin
skin
Stores the currentSWTSkin
so it can be used bycreateMainMenu(Shell)
-
Fields inherited from interface com.biglybt.ui.UIFunctions
ACTION_FULL_UPDATE, ACTION_UPDATE_RESTART_REQUEST, MAIN_WINDOW_NAME, OTO_DEFAULT_SAVE_PATH, OTO_DEFAULT_SAVE_PATH_DEFAULT, OTO_DEFAULT_TO_STOPPED, OTO_DEFAULT_TO_STOPPED_DEFAULT, OTO_FORCE_OPEN, OTO_FORCE_OPEN_DEFAULT, OTO_HIDE_ERRORS, OTO_HIDE_ERRORS_DEFAULT, OTO_SILENT, OTO_SILENT_DEFAULT, STATUSICON_ERROR, STATUSICON_NONE, STATUSICON_WARNING, VS_ACTIVE, VS_MINIMIZED, VS_MINIMIZED_TO_TRAY, VS_TRAY_ONLY
-
-
Constructor Summary
Constructors Constructor Description UIFunctionsImpl(MainWindow window)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addTorrentWithOptions(boolean force, TorrentOpenOptions torrentOptions)
Opens the Torrent Add Options Window, if configured toboolean
addTorrentWithOptions(TorrentOpenOptions torrentOptions, java.util.Map<java.lang.String,java.lang.Object> addOptions)
private boolean
addTorrentWithOptionsSupport(TorrentOpenOptions torrentOptions, java.util.Map<java.lang.String,java.lang.Object> addOptions, boolean is_silent)
void
bringToFront()
Bring main window to the frontvoid
bringToFront(boolean tryTricks)
Bring main window to the frontprivate static boolean
checkForSpecialSearchTerm(java.lang.String str)
void
closeAllDetails()
void
closeDownloadBars()
void
closeGlobalTransferBar()
void
copyToClipboard(java.lang.String text)
IMainMenu
createMainMenu(org.eclipse.swt.widgets.Shell shell)
Creates the main application menu and attach it to the givenShell
; this is only used for OSX so that we can attach the global menu to popup dialogs which is the expected behavior on OSX.void
dispose()
boolean
dispose(boolean for_restart)
void
doSearch(java.lang.String sSearchText)
void
doSearch(java.lang.String sSearchText, boolean toSubscribe)
void
forceNotify(int iconID, java.lang.String title, java.lang.String text, java.lang.String details, java.lang.Object[] relatedObjects, int timeoutSecs)
Might launch the old-school Mr Slideyboolean
getHideAll()
org.eclipse.swt.widgets.Shell
getMainShell()
IMainStatusBar
getMainStatusBar()
IMainWindow
getMainWindow()
MultipleDocumentInterface
getMDI()
Retrieve the MDI (Sidebar, TabbedMDI)MultipleDocumentInterfaceSWT
getMDISWT()
UISWTView[]
getPluginViews()
SWTSkin
getSkin()
UIToolBarManager
getToolBarManager()
UISWTInstance
getUISWTInstance()
java.lang.String
getUIType()
UIUpdater
getUIUpdater()
Retrieves the class that handles periodically updating the UIUIFunctionsUserPrompter
getUserPrompter(java.lang.String title, java.lang.String text, java.lang.String[] buttons, int defaultOption)
int
getVisibilityState()
boolean
hasDetailViews()
void
installPlugin(java.lang.String plugin_id, java.lang.String resource_prefix, UIFunctions.actionListener listener)
boolean
isGlobalTransferBarShown()
boolean
isProgramInstalled(java.lang.String extension, java.lang.String name)
boolean
isUIThread()
void
openPluginView(UISWTViewBuilderCore builder, boolean bSetFocus)
void
openRemotePairingWindow()
void
openTorrentOpenOptions(org.eclipse.swt.widgets.Shell shell, java.lang.String sPathOfFilesToOpen, java.lang.String[] sFilesToOpen, boolean defaultToStopped, boolean forceOpen)
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)
void
openTorrentWindow()
void
performAction(int action_id, java.lang.Object args, UIFunctions.actionListener listener)
void
playOrStreamDataSource(java.lang.Object ds, java.lang.String referal, boolean launch_already_checked, boolean complete_only)
void
promptForSearch()
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)
void
refreshIconBar()
void
refreshLanguage()
Change/Refresh the language of the UIvoid
refreshTorrentMenu()
void
runOnUIThread(java.lang.String ui_type, java.lang.Runnable runnable)
void
setHideAll(boolean hidden)
void
setSkin(SWTSkin skin)
void
setStatusText(int statustype, java.lang.String key, UIStatusTextClickListener l)
void
setStatusText(java.lang.String key)
org.eclipse.swt.widgets.Shell
showCoreWaitDlg()
void
showCreateTagDialog(UIFunctions.TagReturner tagReturner)
void
showErrorMessage(java.lang.String keyPrefix, java.lang.String details, java.lang.String[] textParams)
void
showGlobalTransferBar()
void
showInExplorer(java.io.File f)
void
showText(java.lang.String title, java.lang.String content)
private void
showURL(java.lang.String url, java.lang.String target)
void
tableColumnAddedListeners(TableColumnImpl tableColumn, java.lang.Object listeners)
boolean
viewURL(java.lang.String url, java.lang.String target, double w, double h, boolean allowResize, boolean isModal)
boolean
viewURL(java.lang.String url, java.lang.String target, int w, int h, boolean allowResize, boolean isModal)
void
viewURL(java.lang.String url, java.lang.String target, java.lang.String sourceRef)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.biglybt.ui.UIFunctions
dispose
-
-
-
-
Field Detail
-
PROXY_VIEW_URL
private static final boolean PROXY_VIEW_URL
- See Also:
- Constant Field Values
-
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
-
mainWindow
private final MainWindow mainWindow
-
skin
private SWTSkin skin
Stores the currentSWTSkin
so it can be used bycreateMainMenu(Shell)
-
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 interfaceUIFunctions
-
bringToFront
public void bringToFront()
Description copied from interface:UIFunctions
Bring main window to the front- Specified by:
bringToFront
in interfaceUIFunctions
-
bringToFront
public void bringToFront(boolean tryTricks)
Description copied from interface:UIFunctions
Bring main window to the front- Specified by:
bringToFront
in interfaceUIFunctions
- Parameters:
tryTricks
- : try tricks to force it to the top
-
getVisibilityState
public int getVisibilityState()
- Specified by:
getVisibilityState
in interfaceUIFunctions
-
closeDownloadBars
public void closeDownloadBars()
- Specified by:
closeDownloadBars
in interfaceUIFunctionsSWT
-
dispose
public boolean dispose(boolean for_restart)
- Specified by:
dispose
in interfaceUIFunctions
-
getMainShell
public org.eclipse.swt.widgets.Shell getMainShell()
- Specified by:
getMainShell
in interfaceUIFunctionsSWT
-
getPluginViews
public UISWTView[] getPluginViews()
- Specified by:
getPluginViews
in interfaceUIFunctionsSWT
- Returns:
-
openPluginView
public void openPluginView(UISWTViewBuilderCore builder, boolean bSetFocus)
- Specified by:
openPluginView
in interfaceUIFunctionsSWT
-
refreshIconBar
public void refreshIconBar()
- Specified by:
refreshIconBar
in interfaceUIFunctions
-
refreshLanguage
public void refreshLanguage()
Description copied from interface:UIFunctions
Change/Refresh the language of the UI- Specified by:
refreshLanguage
in interfaceUIFunctions
-
setStatusText
public void setStatusText(java.lang.String key)
- Specified by:
setStatusText
in interfaceUIFunctions
-
setStatusText
public void setStatusText(int statustype, java.lang.String key, UIStatusTextClickListener l)
- Specified by:
setStatusText
in interfaceUIFunctions
-
getMainStatusBar
public IMainStatusBar getMainStatusBar()
- Specified by:
getMainStatusBar
in interfaceUIFunctionsSWT
-
getUISWTInstance
public UISWTInstance getUISWTInstance()
- Specified by:
getUISWTInstance
in interfaceUIFunctionsSWT
-
viewURL
public void viewURL(java.lang.String url, java.lang.String target, java.lang.String sourceRef)
- Specified by:
viewURL
in interfaceUIFunctions
-
viewURL
public boolean viewURL(java.lang.String url, java.lang.String target, int w, int h, boolean allowResize, boolean isModal)
- Specified by:
viewURL
in interfaceUIFunctions
-
viewURL
public boolean viewURL(java.lang.String url, java.lang.String target, double w, double h, boolean allowResize, boolean isModal)
- Specified by:
viewURL
in interfaceUIFunctions
-
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 interfaceUIFunctions
-
getUserPrompter
public UIFunctionsUserPrompter getUserPrompter(java.lang.String title, java.lang.String text, java.lang.String[] buttons, int defaultOption)
- Specified by:
getUserPrompter
in interfaceUIFunctions
-
isGlobalTransferBarShown
public boolean isGlobalTransferBarShown()
- Specified by:
isGlobalTransferBarShown
in interfaceUIFunctionsSWT
-
showGlobalTransferBar
public void showGlobalTransferBar()
- Specified by:
showGlobalTransferBar
in interfaceUIFunctionsSWT
-
closeGlobalTransferBar
public void closeGlobalTransferBar()
- Specified by:
closeGlobalTransferBar
in interfaceUIFunctionsSWT
-
refreshTorrentMenu
public void refreshTorrentMenu()
- Specified by:
refreshTorrentMenu
in interfaceUIFunctionsSWT
-
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 givenShell
; 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 interfaceUIFunctionsSWT
- Returns:
-
getSkin
public SWTSkin getSkin()
-
setSkin
public void setSkin(SWTSkin skin)
-
getMainWindow
public IMainWindow getMainWindow()
- Specified by:
getMainWindow
in interfaceUIFunctionsSWT
-
getUIUpdater
public UIUpdater getUIUpdater()
Description copied from interface:UIFunctions
Retrieves the class that handles periodically updating the UI- Specified by:
getUIUpdater
in interfaceUIFunctions
- Returns:
-
closeAllDetails
public void closeAllDetails()
- Specified by:
closeAllDetails
in interfaceUIFunctionsSWT
-
hasDetailViews
public boolean hasDetailViews()
- Specified by:
hasDetailViews
in interfaceUIFunctionsSWT
- Returns:
-
performAction
public void performAction(int action_id, java.lang.Object args, UIFunctions.actionListener listener)
- Specified by:
performAction
in interfaceUIFunctions
-
showCoreWaitDlg
public org.eclipse.swt.widgets.Shell showCoreWaitDlg()
- Specified by:
showCoreWaitDlg
in interfaceUIFunctionsSWT
-
doSearch
public void doSearch(java.lang.String sSearchText)
- Specified by:
doSearch
in interfaceUIFunctions
- Parameters:
sSearchText
-
-
doSearch
public void doSearch(java.lang.String sSearchText, boolean toSubscribe)
- Specified by:
doSearch
in interfaceUIFunctions
-
checkForSpecialSearchTerm
private static boolean checkForSpecialSearchTerm(java.lang.String str)
-
promptForSearch
public void promptForSearch()
- Specified by:
promptForSearch
in interfaceUIFunctionsSWT
-
getMDI
public MultipleDocumentInterface getMDI()
Description copied from interface:UIFunctions
Retrieve the MDI (Sidebar, TabbedMDI)- Specified by:
getMDI
in interfaceUIFunctions
- Returns:
-
getMDISWT
public MultipleDocumentInterfaceSWT getMDISWT()
- Specified by:
getMDISWT
in interfaceUIFunctionsSWT
-
showErrorMessage
public void showErrorMessage(java.lang.String keyPrefix, java.lang.String details, java.lang.String[] textParams)
- Specified by:
showErrorMessage
in interfaceUIFunctions
- Parameters:
keyPrefix
-details
- may not get displayedtextParams
-
-
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 interfaceUIFunctions
-
installPlugin
public void installPlugin(java.lang.String plugin_id, java.lang.String resource_prefix, UIFunctions.actionListener listener)
- Specified by:
installPlugin
in interfaceUIFunctions
-
getToolBarManager
public UIToolBarManager getToolBarManager()
- Specified by:
getToolBarManager
in interfaceUIFunctionsSWT
-
runOnUIThread
public void runOnUIThread(java.lang.String ui_type, java.lang.Runnable runnable)
- Specified by:
runOnUIThread
in interfaceUIFunctions
-
isUIThread
public boolean isUIThread()
- Specified by:
isUIThread
in interfaceUIFunctions
-
isProgramInstalled
public boolean isProgramInstalled(java.lang.String extension, java.lang.String name)
- Specified by:
isProgramInstalled
in interfaceUIFunctions
-
openRemotePairingWindow
public void openRemotePairingWindow()
- Specified by:
openRemotePairingWindow
in interfaceUIFunctions
-
playOrStreamDataSource
public void playOrStreamDataSource(java.lang.Object ds, java.lang.String referal, boolean launch_already_checked, boolean complete_only)
- Specified by:
playOrStreamDataSource
in interfaceUIFunctions
-
setHideAll
public void setHideAll(boolean hidden)
- Specified by:
setHideAll
in interfaceUIFunctionsSWT
-
getHideAll
public boolean getHideAll()
- Specified by:
getHideAll
in interfaceUIFunctionsSWT
-
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 interfaceUIFunctions
- Parameters:
force
- Override configuration, show it!- Returns:
- true if torrent was added
-
addTorrentWithOptions
public boolean addTorrentWithOptions(TorrentOpenOptions torrentOptions, java.util.Map<java.lang.String,java.lang.Object> addOptions)
- Specified by:
addTorrentWithOptions
in interfaceUIFunctions
-
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 interfaceUIFunctionsSWT
-
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 interfaceUIFunctionsSWT
options
- See UIFunctions constants
-
openTorrentWindow
public void openTorrentWindow()
- Specified by:
openTorrentWindow
in interfaceUIFunctionsSWT
-
showCreateTagDialog
public void showCreateTagDialog(UIFunctions.TagReturner tagReturner)
- Specified by:
showCreateTagDialog
in interfaceUIFunctions
-
tableColumnAddedListeners
public void tableColumnAddedListeners(TableColumnImpl tableColumn, java.lang.Object listeners)
- Specified by:
tableColumnAddedListeners
in interfaceUIFunctions
-
copyToClipboard
public void copyToClipboard(java.lang.String text)
- Specified by:
copyToClipboard
in interfaceUIFunctions
-
showInExplorer
public void showInExplorer(java.io.File f)
- Specified by:
showInExplorer
in interfaceUIFunctions
-
showText
public void showText(java.lang.String title, java.lang.String content)
- Specified by:
showText
in interfaceUIFunctions
-
dispose
public void dispose()
-
-