KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > gulden > framework > amoda > generic > option > GenericOptionChoice


1 /*
2  * Project: AMODA - Abstract Modeled Application
3  * Class: de.gulden.framework.amoda.generic.option.GenericOptionChoice
4  * Version: snapshot-beautyj-1.1
5  *
6  * Date: 2004-09-29
7  *
8  * This is a snapshot version of the AMODA 0.2 development branch,
9  * it is not released as a seperate version.
10  * For AMODA, see http://amoda.berlios.de/.
11  *
12  * This is licensed under the GNU Lesser General Public License (LGPL)
13  * and comes with NO WARRANTY.
14  *
15  * Author: Jens Gulden
16  * Email: amoda@jensgulden.de
17  */

18
19 package de.gulden.framework.amoda.generic.option;
20
21 import de.gulden.framework.amoda.generic.data.*;
22 import de.gulden.framework.amoda.model.data.*;
23 import de.gulden.framework.amoda.model.option.*;
24 import de.gulden.framework.amoda.model.option.OptionChoice;
25 import java.lang.*;
26 import java.util.*;
27
28 /**
29  * Class GenericOptionChoice.
30  *
31  * @author Jens Gulden
32  * @version snapshot-beautyj-1.1
33  */

34 public class GenericOptionChoice extends GenericOptions implements OptionChoice {
35
36     // ------------------------------------------------------------------------
37
// --- constructor ---
38
// ------------------------------------------------------------------------
39

40     public GenericOptionChoice() {
41         // your code here
42
}
43
44
45     // ------------------------------------------------------------------------
46
// --- methods ---
47
// ------------------------------------------------------------------------
48

49     public OptionEntry getSelectedOption() {
50         for (Iterator it=getEntries().values().iterator();it.hasNext();) {
51             OptionEntry o=(OptionEntry)it.next();
52             if (o.getValue().getBoolean()==true) {
53                 return o;
54             }
55         }
56         return null;
57     }
58
59     public String JavaDoc getSelectedId() {
60         OptionEntry o=getSelectedOption();
61         if (o!=null) {
62             return o.getId();
63         } else {
64             return null;
65         }
66     }
67
68     public Value getValue() {
69         // your code here
70
return null;
71     }
72
73     public Value getValue(int state) {
74         // your code here
75
return null;
76     }
77
78     public Class JavaDoc getType() {
79         throw new AbstractMethodError JavaDoc("getType() is not available on GenericOptionChoice");
80     }
81
82     public String JavaDoc findTitle() {
83         return de.gulden.framework.amoda.generic.metadata.GenericMetadata.findTitle(this); // restoreoriginal implementation
84
}
85
86 } // end GenericOptionChoice
87
Popular Tags