Class UI
java.lang.Object
com.biglybt.ui.common.UITemplate
com.biglybt.ui.common.UITemplateHeadless
com.biglybt.ui.console.UI
- All Implemented Interfaces:
UIInstance, UIInstanceFactory, UIManagerEventListener, IUserInterface, UIInstanceBase
public class UI
extends UITemplateHeadless
implements IUserInterface, UIInstanceFactory, UIInstanceBase, UIManagerEventListener
-
Field Summary
FieldsFields inherited from class UITemplate
coreFields inherited from interface UIInstance
UIT_CONSOLE, UIT_SWT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildCommandLine(org.apache.commons.cli.Options options) voidcoreCreated(Core core) Core has been created, but not fully initialize (No GlobalManager, etc)Creates aUIMessageinstance to allow a plugin to inform or ask the user something.voiddetach()This method will be called by the UI manager when detaching the UI to permit the action to be vetoed/any detach logic to occur.voiddispose()This method will be called by the UI manager after the UIInstance is detached.booleaneventOccurred(UIManagerEvent event) Not yet supported.getInstance(PluginInterface plugin_interface) Some UI instances need to understand which plugin they are associated with.voidinit(boolean first, boolean others) Creates a new instance of MainvoidopenRemoteTorrent(String url) voidopenTorrent(String fileName, String save_path) booleanopenView(BasicPluginViewModel model) String[]processArgs(org.apache.commons.cli.CommandLine commands, String[] args) Process arguments coming either from command line, or from startserverintpromptUser(String title, String text, String[] options, int defaultOption) Prompts the user with a title, text, and a series of options.voidpromptUser(String title, String text, String[] options, int defaultOption, UIMessageListener listener) Prompts the user with a title, text, and a series of options.private voidstartUI()voidPluginInterface is unloading..Methods inherited from class UITemplate
hasOthers, isFirst, takeMainThreadMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IUserInterface
takeMainThread
-
Field Details
-
console
-
-
Constructor Details
-
UI
public UI()
-
-
Method Details
-
init
public void init(boolean first, boolean others) Creates a new instance of Main- Specified by:
initin interfaceIUserInterface- Overrides:
initin classUITemplate- Parameters:
first- This UI Instance is the first on the command line and should take control of singular stuff (LocaleUtil and torrents added via Command Line).others- Indicates whether other UIs run along.
-
buildCommandLine
public void buildCommandLine(org.apache.commons.cli.Options options) - Specified by:
buildCommandLinein interfaceIUserInterface
-
processArgs
Description copied from interface:IUserInterfaceProcess arguments coming either from command line, or from startserver may be called before core is started- Specified by:
processArgsin interfaceIUserInterface- Specified by:
processArgsin classUITemplate- Parameters:
commands- query-able list of command line optionsargs- all the arguments- Returns:
- Unhandled arguments, or null you don't want any other UIs to be triggered
-
getUIType
- Specified by:
getUITypein interfaceUIInstance- Specified by:
getUITypein interfaceUIInstanceFactory- Returns:
-
coreCreated
Description copied from interface:IUserInterfaceCore has been created, but not fully initialize (No GlobalManager, etc) Add yourCore.addLifecycleListener(CoreLifecycleListener)to get your GlobalManager reference- Specified by:
coreCreatedin interfaceIUserInterface- Overrides:
coreCreatedin classUITemplate
-
startUI
private void startUI() -
openRemoteTorrent
-
openTorrent
-
getInstance
Description copied from interface:UIInstanceFactorySome UI instances need to understand which plugin they are associated with. This method gives the opportunity to customise the UIInstance returned to a plugin so that operations on it can take the appropriate actions- Specified by:
getInstancein interfaceUIInstanceFactory
-
detach
Description copied from interface:UIInstanceFactoryThis method will be called by the UI manager when detaching the UI to permit the action to be vetoed/any detach logic to occur. It should not be directly called by the plugin code- Specified by:
detachin interfaceUIInstanceFactory- Throws:
UIException
-
dispose
public void dispose()Description copied from interface:UIInstanceFactoryThis method will be called by the UI manager after the UIInstance is detached.- Specified by:
disposein interfaceUIInstanceFactory
-
eventOccurred
- Specified by:
eventOccurredin interfaceUIManagerEventListener- Parameters:
event-- Returns:
- true if the event has been handled
-
promptUser
Description copied from interface:UIInstancePrompts the user with a title, text, and a series of options. The options are typically displayed as buttons. This method returns blocks the UI until the user makes a choice. It's recommended to useUIInstance.promptUser(String, String, String[], int, UIMessageListener)instead- Specified by:
promptUserin interfaceUIInstance- Parameters:
title-text-options-- Returns:
- Index of option chosen, -1 if cancelled or error
-
promptUser
public void promptUser(String title, String text, String[] options, int defaultOption, UIMessageListener listener) Description copied from interface:UIInstancePrompts the user with a title, text, and a series of options. The options are typically displayed as buttons. This method returns immediately.- Specified by:
promptUserin interfaceUIInstance- Parameters:
options- List of options to present to the user. Typically shown as buttonslistener- triggered after user chooses an option
-
openView
- Specified by:
openViewin interfaceUIInstance
-
getInputReceiver
Not yet supported.- Specified by:
getInputReceiverin interfaceUIInstance
-
createMessage
Description copied from interface:UIInstanceCreates aUIMessageinstance to allow a plugin to inform or ask the user something. Some interfaces may not allow or support the ability for a plugin to ask a user in this manner, in which case they will returnnullfor this method.- Specified by:
createMessagein interfaceUIInstance
-
getToolBarManager
- Specified by:
getToolBarManagerin interfaceUIInstance
-
unload
Description copied from interface:UIInstanceBasePluginInterface is unloading.. destroy anything related to it- Specified by:
unloadin interfaceUIInstanceBase
-