Class UITemplate
java.lang.Object
com.biglybt.ui.common.UITemplate
- All Implemented Interfaces:
IUserInterface
- Direct Known Subclasses:
UI, UITemplateHeadless
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcoreCreated(Core core) Core has been created, but not fully initialize (No GlobalManager, etc)booleanvoidinit(boolean first, boolean others) Initializes the UI.booleanisFirst()abstract String[]processArgs(org.apache.commons.cli.CommandLine commands, String[] args) Process arguments coming either from command line, or from startservervoidTake control of the main thread, if you need to.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IUserInterface
buildCommandLine
-
Field Details
-
core
-
first
private boolean first -
others
private boolean others
-
-
Constructor Details
-
UITemplate
public UITemplate()Creates a new instance of UITemplate
-
-
Method Details
-
takeMainThread
public void takeMainThread()Description copied from interface:IUserInterfaceTake control of the main thread, if you need to. This is primarily for UIs that want to start core themselves, or need their UI on the main thread.
If you don't need to take control of the main thread, don't, so that another potential UI can (SWT) This method may never be triggered if an earlier UI took control of the main thread.- Specified by:
takeMainThreadin interfaceIUserInterface
-
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
-
init
public void init(boolean first, boolean others) Description copied from interface:IUserInterfaceInitializes the UI. The UI should not be started at this stage.- Specified by:
initin interfaceIUserInterface- 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.
-
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- 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
-
isFirst
public boolean isFirst() -
hasOthers
public boolean hasOthers()
-