Package com.biglybt.pifimpl.local.ui
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 AEMonitor
private static Map<BasicPluginConfigModel,
BasicPluginConfigImpl> private static UIManagerImpl.UIMDSImporter
protected static boolean
private static ArrayList<UIDataSourceListener>
protected MenuManager
protected PluginInterface
protected TableManager
protected static List<UIManagerEventAdapter>
protected static CopyOnWriteList<UIManagerEventListener>
protected static List<UIInstanceFactory>
protected static CopyOnWriteList<Object[]>
private static Map<String,
BasicPluginViewModel> Fields inherited from interface com.biglybt.pif.ui.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 TypeMethodDescriptionvoid
addDataSourceListener
(UIDataSourceListener l, boolean triggerNow) void
addUIEventListener
(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.void
addUIListener
(UIManagerListener listener) Listen forUIManagerListener.UIAttached(UIInstance)
andUIManagerListener.UIDetached(UIInstance)
events.void
attachUI
(UIInstanceFactory factory) attach a new UIvoid
attachUI
(UIInstanceFactory factory, IUIIntializer init) void
copyToClipBoard
(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 aBasicPluginViewModel
object primarily to be used for storing logging output.Retrieves aUIMessage
from any interface available, or returns null if one is not available.void
destroy
(BasicPluginConfigModel model) void
destroy
(BasicPluginViewModel model) void
detachUI
(UIInstanceFactory factory) detach a UI - can fail if the UI doesn't support detachingstatic boolean
fireEvent
(PluginInterface pi, int type, Object data) static boolean
fireEvent
(UIManagerEventAdapter event) static BasicPluginViewModel
static String
Retrieves aUIInputReceiver
from 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.boolean
Returns true if there any user interfaces currently attached to Azureus.static void
void
Opens up the file using the associated application.void
openTorrent
(Torrent torrent) void
void
void
removeUIEventListener
(UIManagerEventListener listener) Remove previously added UIManagerEventListenervoid
removeUIListener
(UIManagerListener listener) Remove an existingUIManagerListener
void
setEverythingHidden
(boolean hidden) boolean
showConfigSection
(String sectionID) Open Config View to the section specifiedvoid
Shows the file in a file explorer application in its parent folder.long
showMessageBox
(String title_resource, String message_resource, long message_map) long
showMessageBox
(String title_resource, String message_resource, long message_map, Object[] params) long
showMessageBox
(String title_resource, String message_resource, long message_map, Map<String, Object> params) void
showTextMessage
(String title_resource, String message_resource, String contents) void
private static void
static 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:UIManager
Creates a basic plugin view model and adds it to the plugin in one step.- Specified by:
createBasicPluginViewModel
in 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:UIManager
Creates a basic plugin view model and places it inside the plugins section of the configuration page.- Specified by:
createBasicPluginConfigModel
in 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:UIManager
Creates 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:
createBasicPluginConfigModel
in 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:
getPluginConfigModels
in interfaceUIManager
- Returns:
-
copyToClipBoard
- Specified by:
copyToClipBoard
in interfaceUIManager
- Throws:
UIException
-
openURL
- Specified by:
openURL
in interfaceUIManager
- Throws:
UIException
-
getTableManager
Description copied from interface:UIManager
Retrieve the Table Manager- Specified by:
getTableManager
in interfaceUIManager
- Returns:
- Table management functions
-
getMenuManager
Description copied from interface:UIManager
Retrieve the menu manager.- Specified by:
getMenuManager
in interfaceUIManager
- Returns:
- Menu management functions
-
initialisationComplete
public static void initialisationComplete() -
attachUI
Description copied from interface:UIManager
attach a new UI- Specified by:
attachUI
in interfaceUIManager
- Throws:
UIException
-
attachUI
-
detachUI
Description copied from interface:UIManager
detach a UI - can fail if the UI doesn't support detaching- Specified by:
detachUI
in interfaceUIManager
- Throws:
UIException
-
addUIListener
Description copied from interface:UIManager
Listen forUIManagerListener.UIAttached(UIInstance)
andUIManagerListener.UIDetached(UIInstance)
events. Typically, you hook this listener so you can accessUISWTInstance
when it gets created. Will fire UIAttached for managers already attached- Specified by:
addUIListener
in interfaceUIManager
-
removeUIListener
Description copied from interface:UIManager
Remove an existingUIManagerListener
- Specified by:
removeUIListener
in interfaceUIManager
- Parameters:
listener
- Listener to remove
-
addUIEventListener
Description copied from interface:UIManager
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. SeeUIManagerEvent
for types of events- Specified by:
addUIEventListener
in interfaceUIManager
-
removeUIEventListener
Description copied from interface:UIManager
Remove previously added UIManagerEventListener- Specified by:
removeUIEventListener
in interfaceUIManager
-
hasUIInstances
public boolean hasUIInstances()Description copied from interface:UIManager
Returns 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:
hasUIInstances
in interfaceUIManager
-
getUIInstances
Description copied from interface:UIManager
Returns 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:
getUIInstances
in interfaceUIManager
-
fireEvent
-
fireEvent
-
showTextMessage
- Specified by:
showTextMessage
in interfaceUIManager
-
showMessageBox
- Specified by:
showMessageBox
in interfaceUIManager
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:
showMessageBox
in interfaceUIManager
message_map
- - see UIManagerEvent.MT_xparams
- - [ remember-id (String), remember-by-default (Boolean), remember-resource (String) ]- Returns:
- selected value
-
showMessageBox
public long showMessageBox(String title_resource, String message_resource, long message_map, Map<String, Object> params) - Specified by:
showMessageBox
in interfaceUIManager
- Returns:
-
openTorrent
- Specified by:
openTorrent
in interfaceUIManager
-
openFile
Description copied from interface:UIManager
Opens up the file using the associated application. -
showFile
Description copied from interface:UIManager
Shows the file in a file explorer application in its parent folder. -
showConfigSection
Description copied from interface:UIManager
Open Config View to the section specified- Specified by:
showConfigSection
in 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:UIManager
Retrieves aUIInputReceiver
from 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:
getInputReceiver
in interfaceUIManager
- See Also:
-
createMessage
Description copied from interface:UIManager
Retrieves aUIMessage
from 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:
createMessage
in interfaceUIManager
- See Also:
-
createLoggingViewModel
Description copied from interface:UIManager
Creates aBasicPluginViewModel
object 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:
createLoggingViewModel
in interfaceUIManager
- Parameters:
channel
- TheLoggerChannel
to 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:
setEverythingHidden
in interfaceUIManager
-
toggleEverythingHidden
public void toggleEverythingHidden()- Specified by:
toggleEverythingHidden
in interfaceUIManager
-
unload
-
addDataSourceListener
- Specified by:
addDataSourceListener
in interfaceUIManager
-
removeDataSourceListener
- Specified by:
removeDataSourceListener
in interfaceUIManager
-
getDataSource
- Specified by:
getDataSource
in interfaceUIManager
-
triggerDataSourceListeners
-