Class UIManagerImpl
java.lang.Object
com.biglybt.pifimpl.local.ui.UIManagerImpl
- All Implemented Interfaces:
UIManager
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final AEMonitorprivate static Map<BasicPluginConfigModel, BasicPluginConfigImpl> private static UIManagerImpl.UIMDSImporterprotected static booleanprivate static ArrayList<UIDataSourceListener> protected MenuManagerprotected PluginInterfaceprotected TableManagerprotected static List<UIManagerEventAdapter> protected static CopyOnWriteList<UIManagerEventListener> protected static List<UIInstanceFactory> protected static CopyOnWriteList<Object[]> private static Map<String, BasicPluginViewModel> Fields inherited from interface UIManager
MB_PARAM_AUTO_CLOSE_MS, MB_PARAM_REMEMBER_BY_DEF, MB_PARAM_REMEMBER_ID, MB_PARAM_REMEMBER_IF_ONLY_BUTTON, MB_PARAM_REMEMBER_RES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataSourceListener(UIDataSourceListener l, boolean triggerNow) voidaddUIEventListener(UIManagerEventListener listener) Add a listener that's triggered on when core/plugins need to do an UI-only task, such as display a message to a user, or open an URL in a browser.voidaddUIListener(UIManagerListener listener) Listen forUIManagerListener.UIAttached(UIInstance)andUIManagerListener.UIDetached(UIInstance)events.voidattachUI(UIInstanceFactory factory) attach a new UIvoidattachUI(UIInstanceFactory factory, IUIIntializer init) voidcopyToClipBoard(String data) createBasicPluginConfigModel(String section_name) Creates a basic plugin view model and places it inside the plugins section of the configuration page.createBasicPluginConfigModel(String parent_section, String section_name) Creates a basic plugin view model and adds it to the plugin in one step.Creates a basic plugin view model and adds it to the plugin in one step.createLoggingViewModel(LoggerChannel channel, boolean use_plugin_name) Creates aBasicPluginViewModelobject primarily to be used for storing logging output.Retrieves aUIMessagefrom any interface available, or returns null if one is not available.voiddestroy(BasicPluginConfigModel model) voiddestroy(BasicPluginViewModel model) voiddetachUI(UIInstanceFactory factory) detach a UI - can fail if the UI doesn't support detachingstatic booleanfireEvent(PluginInterface pi, int type, Object data) static booleanfireEvent(UIManagerEventAdapter event) static BasicPluginViewModelstatic StringRetrieves aUIInputReceiverfrom any interface available, or returns null if one is not available.Retrieve the menu manager.Retrieve the Table ManagerReturns an array of all currently attached user interfaces.booleanReturns true if there any user interfaces currently attached to Azureus.static voidvoidOpens up the file using the associated application.voidopenTorrent(Torrent torrent) voidvoidvoidremoveUIEventListener(UIManagerEventListener listener) Remove previously added UIManagerEventListenervoidremoveUIListener(UIManagerListener listener) Remove an existingUIManagerListenervoidsetEverythingHidden(boolean hidden) booleanshowConfigSection(String sectionID) Open Config View to the section specifiedvoidShows the file in a file explorer application in its parent folder.longshowMessageBox(String title_resource, String message_resource, long message_map) longshowMessageBox(String title_resource, String message_resource, long message_map, Object[] params) longshowMessageBox(String title_resource, String message_resource, long message_map, Map<String, Object> params) voidshowTextMessage(String title_resource, String message_resource, String contents) voidprivate static voidstatic void
-
Field Details
-
class_mon
-
initialisation_complete
protected static boolean initialisation_complete -
ui_listeners
-
ui_event_listeners
-
ui_factories
-
ui_event_history
-
config_view_map
-
view_model_map
-
ds_importer
-
pi
-
table_manager
-
listDSListeners
-
-
Constructor Details
-
UIManagerImpl
-
-
Method Details
-
exportDataSource
-
getPluginInterface
-
createBasicPluginViewModel
Description copied from interface:UIManagerCreates a basic plugin view model and adds it to the plugin in one step.- Specified by:
createBasicPluginViewModelin interfaceUIManager- Parameters:
name- The name for the view (this should be localised text, rather than a message string).- Returns:
- BasicPluginViewModel
-
destroy
-
getBasicPluginViewModelKey
-
getBasicPluginViewModel
-
createBasicPluginConfigModel
Description copied from interface:UIManagerCreates a basic plugin view model and places it inside the plugins section of the configuration page.- Specified by:
createBasicPluginConfigModelin interfaceUIManager- Parameters:
section_name- Message Bundle resource id for the config model. This will be used as the name of the config page, as well as an unique id- Returns:
- BasicPluginConfigModel
-
createBasicPluginConfigModel
public BasicPluginConfigModel createBasicPluginConfigModel(String parent_section, String section_name) Description copied from interface:UIManagerCreates a basic plugin view model and adds it to the plugin in one step. view is placed inside the plugins section of the configuration page.- Specified by:
createBasicPluginConfigModelin interfaceUIManager- Parameters:
parent_section- seeConfigSection.SECTION_*section_name- Message Bundle resource id for the config model. This will be used as the name of the config page, as well as an unique id- Returns:
- BasicPluginConfigModel
-
destroy
-
getPluginConfigModels
- Specified by:
getPluginConfigModelsin interfaceUIManager- Returns:
-
copyToClipBoard
- Specified by:
copyToClipBoardin interfaceUIManager- Parameters:
data-- Throws:
UIException
-
openURL
- Specified by:
openURLin interfaceUIManager- Parameters:
url-- Throws:
UIException
-
getTableManager
Description copied from interface:UIManagerRetrieve the Table Manager- Specified by:
getTableManagerin interfaceUIManager- Returns:
- Table management functions
-
getMenuManager
Description copied from interface:UIManagerRetrieve the menu manager.- Specified by:
getMenuManagerin interfaceUIManager- Returns:
- Menu management functions
-
initialisationComplete
public static void initialisationComplete() -
attachUI
Description copied from interface:UIManagerattach a new UI- Specified by:
attachUIin interfaceUIManager- Parameters:
factory-- Throws:
UIException
-
attachUI
-
detachUI
Description copied from interface:UIManagerdetach a UI - can fail if the UI doesn't support detaching- Specified by:
detachUIin interfaceUIManager- Parameters:
factory-- Throws:
UIException
-
addUIListener
Description copied from interface:UIManagerListen forUIManagerListener.UIAttached(UIInstance)andUIManagerListener.UIDetached(UIInstance)events. Typically, you hook this listener so you can accesswhen it gets created. Will fire UIAttached for managers already attachedinvalid reference
UISWTInstance- Specified by:
addUIListenerin interfaceUIManager
-
removeUIListener
Description copied from interface:UIManagerRemove an existingUIManagerListener- Specified by:
removeUIListenerin interfaceUIManager- Parameters:
listener- Listener to remove
-
addUIEventListener
Description copied from interface:UIManagerAdd a listener that's triggered on when core/plugins need to do an UI-only task, such as display a message to a user, or open an URL in a browser. SeeUIManagerEventfor types of events- Specified by:
addUIEventListenerin interfaceUIManager
-
removeUIEventListener
Description copied from interface:UIManagerRemove previously added UIManagerEventListener- Specified by:
removeUIEventListenerin interfaceUIManager
-
hasUIInstances
public boolean hasUIInstances()Description copied from interface:UIManagerReturns true if there any user interfaces currently attached to Azureus. Note that this value may change over time, and that at the point when a plugin is being initialised, there is no guarantee over whether if the user interfaces will have been created yet or not. If you want to monitor what user interfaces are being attached / detached from Azureus, you should add a UIListener to this object.- Specified by:
hasUIInstancesin interfaceUIManager
-
getUIInstances
Description copied from interface:UIManagerReturns an array of all currently attached user interfaces. Note that this value may change over time, and that at the point when a plugin is being initialised, there is no guarantee over whether if the user interfaces will have been created yet or not. If you want to monitor what user interfaces are being attached / detached from Azureus, you should add a UIListener to this object.- Specified by:
getUIInstancesin interfaceUIManager
-
fireEvent
-
fireEvent
-
showTextMessage
- Specified by:
showTextMessagein interfaceUIManager- Parameters:
title_resource-message_resource-contents-
-
showMessageBox
- Specified by:
showMessageBoxin interfaceUIManager- Parameters:
title_resource-message_resource-message_map- - see UIManagerEvent.MT_x- Returns:
- selected value
-
showMessageBox
public long showMessageBox(String title_resource, String message_resource, long message_map, Object[] params) - Specified by:
showMessageBoxin interfaceUIManager- Parameters:
title_resource-message_resource-message_map- - see UIManagerEvent.MT_xparams- - [ remember-id (String), remember-by-default (Boolean), remember-resource (String) ]- Returns:
- selected value
-
showMessageBox
-
openTorrent
- Specified by:
openTorrentin interfaceUIManager- Parameters:
torrent-
-
openFile
-
showFile
-
showConfigSection
Description copied from interface:UIManagerOpen Config View to the section specified- Specified by:
showConfigSectionin interfaceUIManager- Parameters:
sectionID- ID of section to open to.ConfigSection.SECTION_* constants- Returns:
- true-Section opened; false-Section invalid or UI does not support config views
-
getInputReceiver
Description copied from interface:UIManagerRetrieves aUIInputReceiverfrom any interface available, or returns null if one is not available. This is a convenience method to allow you to grab an instance without having to iterate over any attached interfaces.- Specified by:
getInputReceiverin interfaceUIManager- See Also:
-
createMessage
Description copied from interface:UIManagerRetrieves aUIMessagefrom any interface available, or returns null if one is not available. This is a convenience method to allow you to grab an instance without having to iterate over any attached interfaces.- Specified by:
createMessagein interfaceUIManager- See Also:
-
createLoggingViewModel
Description copied from interface:UIManagerCreates aBasicPluginViewModelobject primarily to be used for storing logging output. This is just a shortcut way of creating a log view for the logger channel.- Specified by:
createLoggingViewModelin interfaceUIManager- Parameters:
channel- TheLoggerChannelto associate with.use_plugin_name- If set to true, the log view will be taken from the plugin name, if false, it will be taken from the channel name.
-
setEverythingHidden
public void setEverythingHidden(boolean hidden) - Specified by:
setEverythingHiddenin interfaceUIManager
-
toggleEverythingHidden
public void toggleEverythingHidden()- Specified by:
toggleEverythingHiddenin interfaceUIManager
-
unload
-
addDataSourceListener
- Specified by:
addDataSourceListenerin interfaceUIManager
-
removeDataSourceListener
- Specified by:
removeDataSourceListenerin interfaceUIManager
-
getDataSource
- Specified by:
getDataSourcein interfaceUIManager
-
triggerDataSourceListeners
-