Class UITemplate

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Core core  
      private boolean first  
      private boolean others  
    • Constructor Summary

      Constructors 
      Constructor Description
      UITemplate()
      Creates a new instance of UITemplate
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void coreCreated​(Core core)
      Core has been created, but not fully initialize (No GlobalManager, etc)
      boolean hasOthers()  
      void init​(boolean first, boolean others)
      Initializes the UI.
      boolean isFirst()  
      abstract java.lang.String[] processArgs​(org.apache.commons.cli.CommandLine commands, java.lang.String[] args)
      Process arguments coming either from command line, or from startserver
      void takeMainThread()
      Take control of the main thread, if you need to.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • core

        protected Core core
      • first

        private boolean first
      • others

        private boolean others
    • Constructor Detail

      • UITemplate

        public UITemplate()
        Creates a new instance of UITemplate
    • Method Detail

      • takeMainThread

        public void takeMainThread()
        Description copied from interface: IUserInterface
        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.

        Specified by:
        takeMainThread in interface IUserInterface
      • init

        public void init​(boolean first,
                         boolean others)
        Description copied from interface: IUserInterface
        Initializes the UI. The UI should not be started at this stage.
        Specified by:
        init in interface IUserInterface
        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

        public abstract java.lang.String[] processArgs​(org.apache.commons.cli.CommandLine commands,
                                                       java.lang.String[] args)
        Description copied from interface: IUserInterface
        Process arguments coming either from command line, or from startserver

        may be called before core is started

        Specified by:
        processArgs in interface IUserInterface
        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
      • isFirst

        public boolean isFirst()
      • hasOthers

        public boolean hasOthers()