ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/conient/uk/org/iscream/cms/conient/datacomponents/StringDataComponent.java
(Generate patch)

Comparing projects/cms/source/conient/uk/org/iscream/cms/conient/datacomponents/StringDataComponent.java (file contents):
Revision 1.14 by ajm, Thu Mar 15 01:05:46 2001 UTC vs.
Revision 1.16 by ajm, Sun Mar 18 16:28:53 2001 UTC

# Line 6 | Line 6 | import javax.swing.JLabel;
6   import javax.swing.JTextField;
7   import java.awt.GridLayout;
8   import javax.swing.SwingUtilities;
9 + import uk.org.iscream.util.XMLPacket;
10  
11   /**
12   * This is the most basic of DataComponents.
# Line 52 | Line 53 | public class StringDataComponent extends VisibleDataCo
53          _item.setText("-uninitialised-");
54          add(_label);
55          add(_item);
56 +        setVisible(false);
57      }
58  
59   //---PUBLIC METHODS---
# Line 63 | Line 65 | public class StringDataComponent extends VisibleDataCo
65       * run this method.
66       */
67      public void run() {
68 <        _item.setText(_cache);
68 >        if(!isVisible()) {
69 >            setVisible(true);
70 >        }
71 >        _item.setText(_cache);
72      }
73      
74      /**
# Line 81 | Line 86 | public class StringDataComponent extends VisibleDataCo
86   //---ACCESSOR/MUTATOR METHODS---
87  
88      /**
89 <     * This takes the String value of the parameter that this component
85 <     * is monitoring direct from the packet, it then performs all
89 >     * This takes the packet to obtain the value from, it then performs all
90       * approriate conversions and adds this class to the Swing Event
91       * Dispatching queue.
92       *
93 <     * @param value the value for this data component
93 >     * @param packet the XMLPacket to get the data from
94       * @throws DataFormatException if there was a problem converting the data for display
95       */
96 <    public void setValue(String value) throws DataFormatException {
96 >    public void setValue(XMLPacket packet) throws DataFormatException {
97 >        String value = packet.getParam(_attribute);
98          try {
99              if(!_cache.equals(value)) {
100                  _cache = value;
# Line 138 | Line 143 | public class StringDataComponent extends VisibleDataCo
143      protected JLabel _label;
144      
145      /**
146 <     * Remebers what the last value was, so we
146 >     * Remembers what the last value was, so we
147       * only update if we have to.
148       */    
149 <    String _cache = "";
149 >    protected String _cache = "";
150      
151      /**
152       * The length of the JTextField

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines