Interface IUserInterface

All Known Implementing Classes:
UI, UI, UI, UITemplate, UITemplateHeadless

public interface IUserInterface
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    buildCommandLine(org.apache.commons.cli.Options options)
     
    void
    Core has been created, but not fully initialize (No GlobalManager, etc)
    void
    init(boolean first, boolean others)
    Initializes the UI.
    processArgs(org.apache.commons.cli.CommandLine commands, String[] args)
    Process arguments coming either from command line, or from startserver
    void
    Take control of the main thread, if you need to.
  • Method Details

    • buildCommandLine

      void buildCommandLine(org.apache.commons.cli.Options options)
    • init

      void init(boolean first, boolean others)
      Initializes the UI. The UI should not be started at this stage.
      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.
    • coreCreated

      void coreCreated(Core core)
      Core has been created, but not fully initialize (No GlobalManager, etc)

      Add your Core.addLifecycleListener(CoreLifecycleListener) to get your GlobalManager reference

    • processArgs

      String[] processArgs(org.apache.commons.cli.CommandLine commands, String[] args)
      Process arguments coming either from command line, or from startserver

      may be called before core is started

      Parameters:
      commands - query-able list of command line options
      args - all the arguments
      Returns:
      Unhandled arguments, or null you don't want any other UIs to be triggered
    • takeMainThread

      void takeMainThread()
      Take 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.