Class UI

All Implemented Interfaces:
IUserInterface

public class UI extends UITemplate
Created by TuxPaper on 7/4/2017.
  • Field Details

    • LOGID

      private static final LogIDs LOGID
    • useSystemTheme

      private static volatile boolean useSystemTheme
    • isFirstUI

      private static boolean isFirstUI
    • this_mon

      protected final AEMonitor this_mon
    • queued_torrents

      protected List queued_torrents
    • queueTorrents

      protected boolean queueTorrents
  • Constructor Details

    • UI

      public UI()
  • Method Details

    • canUseSystemTheme

      public static boolean canUseSystemTheme()
    • useSystemTheme

      public static boolean useSystemTheme()
    • isURI

      protected static boolean isURI(String file_name)
    • 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
      Overrides:
      init in class UITemplate
      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

      public void coreCreated(Core core)
      Description copied from interface: IUserInterface
      Core has been created, but not fully initialize (No GlobalManager, etc)

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

      Specified by:
      coreCreated in interface IUserInterface
      Overrides:
      coreCreated in class UITemplate
    • 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
      Overrides:
      takeMainThread in class UITemplate
    • buildCommandLine

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

      public String[] processArgs(org.apache.commons.cli.CommandLine commands, 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
      Specified by:
      processArgs in class UITemplate
      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
    • handleFile

      protected void handleFile(String file_name, boolean open, String save_path)
    • openQueuedTorrents

      protected void openQueuedTorrents()
    • isFirstUI

      public static boolean isFirstUI()