|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--uk.org.iscream.cms.conient.datacomponents.VisibleDataComponent | +--uk.org.iscream.cms.conient.datacomponents.ServiceDataComponent
This is the most basic of DataComponents. It simply displays the value as a String in a JTextField.
Field Summary | |
protected String |
_attribute
The attribute that this component is concerned with |
protected String |
_cache
Remembers what the last value was, so we only update if we have to. |
protected int |
_displayLength
The length of the JTextField |
protected JTextField |
_item
Just a normal label to display our value as a String |
protected JLabel |
_label
The friendly label for this component |
protected String |
_name
The friendly name of this component |
protected String |
_statusAttribute
The service status attribute that this component is concerned with |
protected String |
_statusCache
Remembers what the last value was, so we only update if we have to. |
protected int |
DEFAULT_TEXT_LENGTH
The default length of the JTextField |
String |
REVISION
The current CVS revision of this class |
Fields inherited from class javax.swing.JPanel |
|
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.Container |
|
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 |
Constructor Summary | |
ServiceDataComponent(String name,
String attribute,
String statusAttribute)
Creates the component with a friendly name to be used as label |
Method Summary | |
String |
getPacketAttribute()
Returns the string showing the packet attribute that the component is looking after |
void |
run()
This run method updates any Swing components The setValue() method adds this component to the Swing Event Dispatching Queue to run this method. |
void |
setValue(XMLPacket packet)
This takes the packet to obtain the value from, it then performs all approriate conversions and adds this class to the Swing Event Dispatching queue. |
String |
toString()
Overrides the Object.toString()
method to provide clean logging (every class should have this). |
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 |
Field Detail |
public final String REVISION
protected final int DEFAULT_TEXT_LENGTH
protected String _name
protected String _attribute
protected String _statusAttribute
protected JLabel _label
protected String _cache
protected String _statusCache
protected int _displayLength
protected JTextField _item
Constructor Detail |
public ServiceDataComponent(String name, String attribute, String statusAttribute)
name
- the friendly nameattribute
- the data attribute we look afterMethod Detail |
public void run()
public String toString()
Object.toString()
method to provide clean logging (every class should have this).
toString
in class Component
public void setValue(XMLPacket packet) throws DataFormatException
packet
- the XMLPacket to get the data from
DataFormatException
- if there was a problem converting the data for displaypublic String getPacketAttribute()
|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |