|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.ceryle.util.http.HTTPControlPanel
public class HTTPControlPanel
A class that extends JPanel to provide a control panel for the server. This is a singleton class. To obtain the instance of this class:
HTTPControlPanel panel = HTTPControlPanel.getInstance();
You can also attach a ChangeListener to this class using the
EventManager, then listen for
ChangeEvents to be fired upon changes to the server's status.
EventManager.addChangeListener(HTTPControlPanel.getInstance(),
new ChangeListener() {
public void stateChanged( ChangeEvent e ) {
HTTPControlPanel hcp = (HTTPControlPanel)e.getSource();
mylabel.setText( hcp.getStatus() );
}
});
Note that there will be more event firings than actual state changes, but that getStatus() will always return the correct state.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Method Summary | |
|---|---|
static HTTPControlPanel |
getInstance()
A static method that returns a web server control panel. |
String |
getStatus()
Returns the current status message as a String. |
static boolean |
isAvailable()
Returns true if the control panel (a singleton class) has been instantiated. |
protected static void |
permitStart()
Sets the state to permit server start events. |
protected void |
setServerAvailability()
Set the state of the Start, Halt and Kill buttons according to the current state of the HTTP server. |
protected void |
setServerAvailability(boolean isRunning)
Set the state of the Start, Halt and Kill buttons according to the parameter value. |
void |
writeStatus(String message)
Writes a status message to the display field. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static HTTPControlPanel getInstance()
public static boolean isAvailable()
public void writeStatus(String message)
public String getStatus()
protected void setServerAvailability()
protected static void permitStart()
protected void setServerAvailability(boolean isRunning)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||