private void init()
{
GridBagLayout gridBag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
Panel panel = new Panel();
panel.setLayout( gridBag );
ScrollPane scrollPane = new ScrollPane();
scrollPane.add( panel );
scrollPane.getHAdjustable().setUnitIncrement( 20 );
scrollPane.getVAdjustable().setUnitIncrement( 20 );
setLayout( new BorderLayout() );
add( scrollPane, BorderLayout.CENTER );
buildCommand( panel, gridBag, c, "Stop(0)", "stop0",
getRes().getString( "Calls WrapperManager.stop( 0 ) to shutdown the JVM and Wrapper with a success exit code." ) );
buildCommand( panel, gridBag, c, "Stop(1)", "stop1",
getRes().getString( "Calls WrapperManager.stop( 1 ) to shutdown the JVM and Wrapper with a failure exit code." ) );
buildCommand( panel, gridBag, c, "Exit(0)", "exit0",
getRes().getString( "Calls System.exit( 0 ) to shutdown the JVM and Wrapper with a success exit code." ) );
buildCommand( panel, gridBag, c, "Exit(1)", "exit1",
getRes().getString( "Calls System.exit( 1 ) to shutdown the JVM and Wrapper with a failure exit code." ) );
buildCommand( panel, gridBag, c, "StopImmediate(0)", "stopimmediate0",
getRes().getString( "Calls WrapperManager.stopImmediate( 0 ) to immediately shutdown the JVM and Wrapper with a success exit code." ) );
buildCommand( panel, gridBag, c, "StopImmediate(1)", "stopimmediate1",
getRes().getString(" Calls WrapperManager.stopImmediate( 1 ) to immediately shutdown the JVM and Wrapper with a failure exit code." ) );
buildCommand( panel, gridBag, c, "StopAndReturn(0)", "stopandreturn0",
getRes().getString( "Calls WrapperManager.stopAndReturn( 0 ) to shutdown the JVM and Wrapper with a success exit code." ) );
buildCommand( panel, gridBag, c, "Nested Exit(1)", "nestedexit1",
getRes().getString( "Calls System.exit(1) within WrapperListener.stop(1) callback." ) );
buildCommand( panel, gridBag, c, "Halt(0)", "halt0",
getRes().getString( "Calls Runtime.getRuntime().halt(0) to kill the JVM, the Wrapper will restart it." ) );
buildCommand( panel, gridBag, c, "Halt(1)", "halt1",
getRes().getString( "Calls Runtime.getRuntime().halt(1) to kill the JVM, the Wrapper will restart it." ) );
buildCommand( panel, gridBag, c, "Restart()", "restart",
getRes().getString( "Calls WrapperManager.restart() to shutdown the current JVM and start a new one." ) );
buildCommand( panel, gridBag, c, "RestartAndReturn()", "restartandreturn",
getRes().getString( "Calls WrapperManager.restartAndReturn() to shutdown the current JVM and start a new one." ) );
buildCommand( panel, gridBag, c, getRes().getString( "Native Access Violation" ), "access_violation_native",
getRes().getString( "Causes an access violation using native code, the JVM will crash and be restarted." ) );
buildCommand( panel, gridBag, c, getRes().getString( "Simulate JVM Hang" ), "appear_hung",
getRes().getString( "Makes the JVM appear to be hung as viewed from the Wrapper, it will be killed and restarted." ) );
buildCommand( panel, gridBag, c, getRes().getString( "Create Deadlock" ), "deadlock",
getRes().getString( "Creates two new threads which intentionally go into a DeadLock situation. (Standard, Professional)" ) );
buildCommand( panel, gridBag, c, getRes().getString("Simulate Out Of Memory" ), "outofmemory",
getRes().getString( "Throws an OutOfMemoryError to demonstrate the Trigger feature." ) );
buildCommand( panel, gridBag, c, getRes().getString( "Ignore Control Events" ), "ignore_events",
getRes().getString( "Makes this application ignore control events. It will not shutdown in response to CTRL-C. The Wrapper will still respond." ) );
buildCommand( panel, gridBag, c,getRes().getString( "Request Thread Dump" ), "dump",
getRes().getString( "Calls WrapperManager.requestThreadDump() to cause the JVM to dump its current thread state." ) );
buildCommand( panel, gridBag, c, getRes().getString( "System.out Deadlock" ), "deadlock_out",
getRes().getString( "Simulates a failure mode where the System.out object has become deadlocked." ) );
buildCommand( panel, gridBag, c, getRes().getString( "Poll Users" ), "users",
getRes().getString( "Begins calling WrapperManager.getUser() and getInteractiveUser() to monitor the current and interactive users." ) );
buildCommand( panel, gridBag, c, getRes().getString( "Poll Users with Groups" ), "groups",
getRes().getString( "Same as above, but includes information about the user's groups." ) );
buildCommand( panel, gridBag, c, getRes().getString( "Console" ), "console", getRes().getString( "Prompt for Actions in the console." ) );
buildCommand( panel, gridBag, c, getRes().getString( "Idle" ), "idle", getRes().getString( "Run idly." ) );
buildCommand( panel, gridBag, c, getRes().getString( "Dump Properties" ), "properties",
getRes().getString( "Dumps all System Properties to the console." ) );
buildCommand( panel, gridBag, c, getRes().getString( "Dump Configuration" ), "configuration",
getRes().getString( "Dumps all Wrapper Configuration Properties to the console." ) );
m_listenerFlags = new List( 2, true );
m_listenerFlags.add( "Service" );
m_listenerFlags.add( "Control" );
m_listenerFlags.add( "Logging" );
m_listenerFlags.add( "Core" );
Panel flagPanel = new Panel();
flagPanel.setLayout( new BorderLayout() );
flagPanel.add( new Label( "Event Flags: " ), BorderLayout.WEST );
flagPanel.add( m_listenerFlags, BorderLayout.CENTER );
flagPanel.setSize( 100, 10 );
Panel flagPanel2 = new Panel();
flagPanel2.setLayout( new BorderLayout() );
flagPanel2.add( flagPanel, BorderLayout.WEST );
buildCommand( panel, gridBag, c, getRes().getString( "Update Event Listener" ), "listener", flagPanel2 );
buildCommand( panel, gridBag, c, getRes().getString( "Service List" ), "service_list", getRes().getString( "Displays a list of registered services on Windows." ) );
m_serviceName = new TextField( "testwrapper" );
Panel servicePanel = new Panel();
servicePanel.setLayout( new BorderLayout() );
servicePanel.add( new Label( getRes().getString( "Interrogate Service. Service name: " ) ), BorderLayout.WEST );
servicePanel.add( m_serviceName, BorderLayout.CENTER );
Panel servicePanel2 = new Panel();
servicePanel2.setLayout( new BorderLayout() );
servicePanel2.add( servicePanel, BorderLayout.WEST );
buildCommand( panel, gridBag, c, getRes().getString( "Service Interrogate" ), "service_interrogate", servicePanel2 );
buildCommand( panel, gridBag, c, getRes().getString( "Service Start" ), "service_start", getRes().getString( "Starts the above service." ) );
buildCommand( panel, gridBag, c, getRes().getString( "Service Stop" ), "service_stop", getRes().getString( "Stops the above service." ) );
buildCommand( panel, gridBag, c, getRes().getString( "Service User Code" ), "service_user", getRes().getString( "Sends a series of user codes to the above service." ) );
m_consoleTitle = new TextField( getRes().getString( "Java Service Wrapper" ) );
Panel titlePanel = new Panel();
titlePanel.setLayout( new BorderLayout() );
titlePanel.add( new Label( getRes().getString( "Console Title: " ) ), BorderLayout.WEST );
titlePanel.add( m_consoleTitle, BorderLayout.CENTER );
Panel titlePanel2 = new Panel();
titlePanel2.setLayout( new BorderLayout() );
titlePanel2.add( titlePanel, BorderLayout.WEST );
buildCommand( panel, gridBag, c, getRes().getString( "Set Console Title" ), "console_title", titlePanel2 );
m_childCommand = new TextField( getRes().getString( "(Please enter command)" ) );
m_childDetached = new Checkbox( getRes().getString( "Detached (Professional)" ), false);
Panel childPanel = new Panel();
childPanel.setLayout( new BorderLayout() );
childPanel.add( new Label( getRes().getString( "Command: " ) ), BorderLayout.WEST );
childPanel.add( m_childCommand, BorderLayout.CENTER );
childPanel.add( m_childDetached, BorderLayout.EAST );
Panel childPanel2 = new Panel();
childPanel2.setLayout( new BorderLayout() );
childPanel2.add( childPanel, BorderLayout.WEST );
buildCommand( panel, gridBag, c, getRes().getString( "Execute Child Process" ), "child_exec", childPanel2 );
buildCommand( panel, gridBag, c, getRes().getString( "GC" ), "gc", getRes().getString( "Performs a GC sweep." ) );
buildCommand( panel, gridBag, c, getRes().getString( "Is Professional?" ), "is_professional", getRes().getString( "Prints true if this is a Professional Edition." ) );