Class LaunchAppropriateUI

java.lang.Object
edu.umd.cs.findbugs.LaunchAppropriateUI

public class LaunchAppropriateUI extends Object
Class to launch the appropriate textUI or GUI. This class is the Main-Class in the findbugs.jar manifest, and is responsible for running an appropriate main() method.
  • Field Details

    • TEXTUI

      public static final int TEXTUI
      UI code for the text (command line) UI.
      See Also:
    • GUI1

      public static final int GUI1
      UI code for the old Swing GUI. This is deprecated now.
      See Also:
    • GUI2

      public static final int GUI2
      UI code for the new Swing GUI.
      See Also:
    • SHOW_HELP

      public static final int SHOW_HELP
      UI code for displaying command line help.
      See Also:
    • SHOW_VERSION

      public static final int SHOW_VERSION
      UI code for displaying command line version information.
      See Also:
    • uiNameToCodeMap

      @StaticConstant public static final Map<String,Integer> uiNameToCodeMap
      Map of UI name strings to integer UI codes.
    • args

      private String[] args
      Command line arguments.
  • Constructor Details

    • LaunchAppropriateUI

      public LaunchAppropriateUI(String[] args)
      Constructor.
      Parameters:
      args - command line arguments
  • Method Details

    • launch

      public void launch() throws Exception
      Launch the appropriate UI.
      Throws:
      Exception
    • getLaunchProperty

      private int getLaunchProperty()
      Find out what UI should be launched.

      First, we check the command line arguments to see if the first argument specifies the UI (e.g., "-textui", "-gui", etc.)

      If the first command line argument does not specify the UI, then we check the findbugs.launchUI system property to one of the following values:

      • -Dfindbugs.launchUI=textui for textui,
      • -Dfindbugs.launchUI=gui1 for the original swing gui,
      • -Dfindbugs.launchUI=gui2 for the new swing gui,
      • -Dfindbugs.launchUI=version for the ShowVersion main() method, or
      • -Dfindbugs.launchUI=help for the ShowHelp main() method.
      Any other value (or the absence of any value) will not change the default behavior, which is to launch the newer "gui2" on systems that support it.
      Returns:
      an integer UI code: TEXTUI, GUI1, GUI2, SHOW_VERSION, SHOW_HELP, or possibly another user-set int value
    • main

      public static void main(String[] args) throws Exception
      main() method. This is where execution of FindBugs (any UI) starts.
      Parameters:
      args - command line arguments
      Throws:
      Exception