Package edu.umd.cs.findbugs
Class LaunchAppropriateUI
- java.lang.Object
-
- edu.umd.cs.findbugs.LaunchAppropriateUI
-
public class LaunchAppropriateUI extends java.lang.ObjectClass 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 Summary
Fields Modifier and Type Field Description private java.lang.String[]argsCommand line arguments.static intGUI1UI code for the old Swing GUI.static intGUI2UI code for the new Swing GUI.static intSHOW_HELPUI code for displaying command line help.static intSHOW_VERSIONUI code for displaying command line version information.static intTEXTUIUI code for the text (command line) UI.static java.util.Map<java.lang.String,java.lang.Integer>uiNameToCodeMapMap of UI name strings to integer UI codes.
-
Constructor Summary
Constructors Constructor Description LaunchAppropriateUI(java.lang.String[] args)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private intgetLaunchProperty()Find out what UI should be launched.voidlaunch()Launch the appropriate UI.static voidmain(java.lang.String[] args)main() method.
-
-
-
Field Detail
-
TEXTUI
public static final int TEXTUI
UI code for the text (command line) UI.- See Also:
- Constant Field Values
-
GUI1
public static final int GUI1
UI code for the old Swing GUI. This is deprecated now.- See Also:
- Constant Field Values
-
GUI2
public static final int GUI2
UI code for the new Swing GUI.- See Also:
- Constant Field Values
-
SHOW_HELP
public static final int SHOW_HELP
UI code for displaying command line help.- See Also:
- Constant Field Values
-
SHOW_VERSION
public static final int SHOW_VERSION
UI code for displaying command line version information.- See Also:
- Constant Field Values
-
uiNameToCodeMap
@StaticConstant public static final java.util.Map<java.lang.String,java.lang.Integer> uiNameToCodeMap
Map of UI name strings to integer UI codes.
-
args
private java.lang.String[] args
Command line arguments.
-
-
Method Detail
-
launch
public void launch() throws java.lang.ExceptionLaunch the appropriate UI.- Throws:
java.lang.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.launchUIsystem 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.
- Returns:
- an integer UI code: TEXTUI, GUI1, GUI2, SHOW_VERSION, SHOW_HELP, or possibly another user-set int value
-
main
public static void main(java.lang.String[] args) throws java.lang.Exceptionmain() method. This is where execution of FindBugs (any UI) starts.- Parameters:
args- command line arguments- Throws:
java.lang.Exception
-
-