com.aelitis.azureus.ui.swt.shells.main
Class UIFunctionsImpl

java.lang.Object
  extended by com.aelitis.azureus.ui.swt.shells.main.UIFunctionsImpl
All Implemented Interfaces:
AzureusCoreComponent, UIFunctionsSWT, UIFunctions

public class UIFunctionsImpl
extends java.lang.Object
implements UIFunctionsSWT

Author:
TuxPaper

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.aelitis.azureus.ui.UIFunctions
UIFunctions.actionListener, UIFunctions.TagReturner
 
Field Summary
protected  boolean isTorrentMenuVisible
           
 
Fields inherited from interface com.aelitis.azureus.ui.UIFunctions
ACTION_FULL_UPDATE, ACTION_UPDATE_RESTART_REQUEST, MAIN_WINDOW_NAME, MAIN_WINDOW_NAME_PLUS, 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, VIEW_CONFIG, VIEW_DM_DETAILS, VIEW_MYTORRENTS, VS_ACTIVE, VS_MINIMIZED, VS_MINIMIZED_TO_TRAY, VS_TRAY_ONLY
 
Constructor Summary
UIFunctionsImpl(MainWindow window)
           
 
Method Summary
 void addPluginView(java.lang.String viewID, UISWTViewEventListener l)
           
 boolean addTorrentWithOptions(boolean force, TorrentOpenOptions torrentOptions)
          Opens the Torrent Add Options Window, if configured to
 boolean addTorrentWithOptions(TorrentOpenOptions torrentOptions, java.util.Map<java.lang.String,java.lang.Object> addOptions)
           
 int adjustPXForDPI(int px)
           
 void bringToFront()
          Bring main window to the front
 void bringToFront(boolean tryTricks)
          Bring main window to the front
 void closeAllDetails()
           
 void closeDownloadBars()
           
 void closeGlobalTransferBar()
           
 void closePluginView(UISWTViewCore view)
           
 void closePluginViews(java.lang.String sViewID)
           
 IMainMenu createMainMenu(org.eclipse.swt.widgets.Shell shell)
          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.
 TabbedMdiInterface createTabbedMDI(org.eclipse.swt.widgets.Composite parent, java.lang.String id)
           
 boolean dispose(boolean for_restart, boolean close_already_in_progress)
          Request the UI be shut down.
 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 Slidey
 org.eclipse.swt.widgets.Shell getMainShell()
           
 IMainStatusBar getMainStatusBar()
           
 IMainWindow getMainWindow()
           
 MultipleDocumentInterface getMDI()
          Retrieve the MDI (Sidebar, TabbedMDI)
 MultipleDocumentInterfaceSWT getMDISWT()
           
 UISWTView[] getPluginViews()
           
 SWTSkin getSkin()
           
 UISWTInstanceImpl getSWTPluginInstanceImpl()
           
 UIToolBarManager getToolBarManager()
           
 UISWTInstance getUISWTInstance()
           
 int getUIType()
           
 UIUpdater getUIUpdater()
          Retrieves the class that handles periodically updating the UI
 UIFunctionsUserPrompter 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)
           
 void openPluginView(java.lang.String sParentID, java.lang.String sViewID, UISWTViewEventListener l, java.lang.Object dataSource, 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 openView(int viewID, java.lang.Object data)
          Deprecated. 
 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 UI
 void refreshTorrentMenu()
           
 void removePluginView(java.lang.String viewID)
           
 void runOnUIThread(int ui_type, java.lang.Runnable runnable)
           
 void setHideAll(boolean hidden)
           
 void setSkin(SWTSkin skin)
           
 void setStatusText(int statustype, java.lang.String string, UIStatusTextClickListener l)
           
 void setStatusText(java.lang.String string)
           
 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()
           
 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
 

Field Detail

isTorrentMenuVisible

protected boolean isTorrentMenuVisible
Constructor Detail

UIFunctionsImpl

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

getUIType

public int getUIType()
Specified by:
getUIType in interface UIFunctions

addPluginView

public void addPluginView(java.lang.String viewID,
                          UISWTViewEventListener l)
Specified by:
addPluginView in interface UIFunctionsSWT

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

getVisibilityState

public int getVisibilityState()
Specified by:
getVisibilityState in interface UIFunctions

closeDownloadBars

public void closeDownloadBars()
Specified by:
closeDownloadBars in interface UIFunctionsSWT

closePluginView

public void closePluginView(UISWTViewCore view)
Specified by:
closePluginView in interface UIFunctionsSWT

closePluginViews

public void closePluginViews(java.lang.String sViewID)
Specified by:
closePluginViews in interface UIFunctionsSWT

dispose

public boolean dispose(boolean for_restart,
                       boolean close_already_in_progress)
Description copied from interface: UIFunctions
Request the UI be shut down.

Specified by:
dispose in interface UIFunctions
Returns:
true - request granted, UI is being shut down false - request denied (example: password entry failed)

getMainShell

public org.eclipse.swt.widgets.Shell getMainShell()
Specified by:
getMainShell in interface UIFunctionsSWT

getPluginViews

public UISWTView[] getPluginViews()
Specified by:
getPluginViews in interface UIFunctionsSWT
Returns:

getSWTPluginInstanceImpl

public UISWTInstanceImpl getSWTPluginInstanceImpl()

openPluginView

public void openPluginView(java.lang.String sParentID,
                           java.lang.String sViewID,
                           UISWTViewEventListener l,
                           java.lang.Object dataSource,
                           boolean bSetFocus)
Specified by:
openPluginView in interface UIFunctionsSWT

refreshIconBar

public void refreshIconBar()
Specified by:
refreshIconBar 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

removePluginView

public void removePluginView(java.lang.String viewID)
Specified by:
removePluginView in interface UIFunctionsSWT

setStatusText

public void setStatusText(java.lang.String string)
Specified by:
setStatusText in interface UIFunctions

setStatusText

public void setStatusText(int statustype,
                          java.lang.String string,
                          UIStatusTextClickListener l)
Specified by:
setStatusText in interface UIFunctions

getMainStatusBar

public IMainStatusBar getMainStatusBar()
Specified by:
getMainStatusBar in interface UIFunctionsSWT

openView

@Deprecated
public void openView(int viewID,
                                java.lang.Object data)
Deprecated. 

Specified by:
openView in interface UIFunctions

getUISWTInstance

public UISWTInstance getUISWTInstance()
Specified by:
getUISWTInstance in interface UIFunctionsSWT

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

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

getUserPrompter

public UIFunctionsUserPrompter getUserPrompter(java.lang.String title,
                                               java.lang.String text,
                                               java.lang.String[] buttons,
                                               int defaultOption)
Specified by:
getUserPrompter in interface UIFunctions

isGlobalTransferBarShown

public boolean isGlobalTransferBarShown()
Specified by:
isGlobalTransferBarShown in interface UIFunctionsSWT

showGlobalTransferBar

public void showGlobalTransferBar()
Specified by:
showGlobalTransferBar in interface UIFunctionsSWT

closeGlobalTransferBar

public void closeGlobalTransferBar()
Specified by:
closeGlobalTransferBar in interface UIFunctionsSWT

refreshTorrentMenu

public void refreshTorrentMenu()
Specified by:
refreshTorrentMenu in interface UIFunctionsSWT

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)

getMainWindow

public IMainWindow getMainWindow()
Specified by:
getMainWindow in interface UIFunctionsSWT

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:

closeAllDetails

public void closeAllDetails()
Specified by:
closeAllDetails in interface UIFunctionsSWT

hasDetailViews

public boolean hasDetailViews()
Specified by:
hasDetailViews in interface UIFunctionsSWT
Returns:

performAction

public void performAction(int action_id,
                          java.lang.Object args,
                          UIFunctions.actionListener listener)
Specified by:
performAction in interface UIFunctions

showCoreWaitDlg

public org.eclipse.swt.widgets.Shell showCoreWaitDlg()
Specified by:
showCoreWaitDlg in interface UIFunctionsSWT

doSearch

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

doSearch

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

promptForSearch

public void promptForSearch()
Specified by:
promptForSearch in interface UIFunctionsSWT

getMDI

public MultipleDocumentInterface getMDI()
Description copied from interface: UIFunctions
Retrieve the MDI (Sidebar, TabbedMDI)

Specified by:
getMDI in interface UIFunctions
Returns:

getMDISWT

public MultipleDocumentInterfaceSWT getMDISWT()
Specified by:
getMDISWT in interface UIFunctionsSWT

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

installPlugin

public void installPlugin(java.lang.String plugin_id,
                          java.lang.String resource_prefix,
                          UIFunctions.actionListener listener)
Specified by:
installPlugin in interface UIFunctions

getToolBarManager

public UIToolBarManager getToolBarManager()
Specified by:
getToolBarManager in interface UIFunctionsSWT

runOnUIThread

public void runOnUIThread(int 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

openRemotePairingWindow

public void openRemotePairingWindow()
Specified by:
openRemotePairingWindow 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

setHideAll

public void setHideAll(boolean hidden)
Specified by:
setHideAll in interface UIFunctionsSWT

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

addTorrentWithOptions

public boolean addTorrentWithOptions(TorrentOpenOptions torrentOptions,
                                     java.util.Map<java.lang.String,java.lang.Object> addOptions)
Specified by:
addTorrentWithOptions in interface UIFunctions

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

openTorrentWindow

public void openTorrentWindow()
Specified by:
openTorrentWindow in interface UIFunctionsSWT

showCreateTagDialog

public void showCreateTagDialog(UIFunctions.TagReturner tagReturner)
Specified by:
showCreateTagDialog in interface UIFunctions

createTabbedMDI

public TabbedMdiInterface createTabbedMDI(org.eclipse.swt.widgets.Composite parent,
                                          java.lang.String id)
Specified by:
createTabbedMDI in interface UIFunctionsSWT
id - TODO

adjustPXForDPI

public int adjustPXForDPI(int px)
Specified by:
adjustPXForDPI in interface UIFunctions