KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > designer > model > TextInput


1 /*
2  * (c) Rob Gordon 2005
3  */

4 package org.oddjob.designer.model;
5
6 import java.util.Observable JavaDoc;
7
8
9 /**
10  * A model for a visual component which is intended to be rendered as a
11  * large text area.
12  * <p>
13  * The text is retrieved and set via a text exchange object.
14  */

15 abstract public class TextInput extends Observable JavaDoc
16 implements DesignDefinition, FormDefinition {
17
18     private final String JavaDoc heading;
19     
20     public TextInput(String JavaDoc heading) {
21         this.heading = heading;
22     }
23
24     public String JavaDoc getTitle() {
25         return heading;
26     }
27
28     abstract public void setText(String JavaDoc text);
29
30     abstract public String JavaDoc getText();
31     
32     /* (non-Javadoc)
33      * @see org.oddjob.designer.model.DialogDefinition#accept(org.oddjob.designer.model.DialogProcessor)
34      */

35     public void accept(DesignProcessor processor) {
36         processor.onTextInput(this);
37     }
38     
39     /* (non-Javadoc)
40      * @see org.oddjob.designer.model.DesignDefinition#isPopulated()
41      */

42     public boolean isPopulated() {
43         return getText() != null && getText().length() > 0;
44     }
45 }
46
Popular Tags