00001
00066 package com.arcle.rmt.superwaba.vc.rqml;
00067
00068 import waba.ui.ComboBox;
00069 import waba.ui.Edit;
00070 import waba.ui.Control;
00071 import waba.ui.Label;
00072 import com.arcle.rmt.rqml.RQMLFirstClass;
00073
00080 public class GeneralAttributes2 extends FirstClassPanel {
00081
00082
00083
00084 public void loadData(RQMLFirstClass elem) {
00085 edVersion.setText(elem.getVersion());
00086
00087
00088
00089
00090 idxPriority = elem.getPriority() - elem.PRIORITY_LOW;
00091 idxDifficulty = elem.getDifficulty() - elem.DIFFICULTY_LOW;
00092 idxStability = elem.getStability() - elem.STABILITY_LOW;
00093 idxStatus = elem.getStatus();
00094 }
00095
00096
00097 public void saveData(RQMLFirstClass elem) {
00098 elem.setVersion(edVersion.getText());
00099 elem.setPriority(cbPriority.getSelectedIndex() + elem.PRIORITY_LOW);
00100 elem.setDifficulty(cbDifficulty.getSelectedIndex() + elem.DIFFICULTY_LOW);
00101 elem.setStability(cbStability.getSelectedIndex() + elem.STABILITY_LOW);
00102 elem.setStatus(cbStatus.getSelectedIndex());
00103 }
00104
00105
00106
00107
00108 protected void initChildren()
00109 {
00110 lbVersion = createLabel("Version:");
00111
00112 lbPriority = createLabel("Priority:");
00113 lbDifficulty = createLabel("Difficulty:");
00114 lbStatus = createLabel("Status:");
00115 lbStability = createLabel("Stability:");
00116
00117 edVersion = createEdit("Version");
00118
00119
00120 cbPriority = createComboBox(PRIORITIES);
00121 cbDifficulty = createComboBox(DIFFICULTIES);
00122 cbStatus = createComboBox(STATUSES);
00123 cbStability = createComboBox(STABILITIES);
00124
00125 }
00126
00127 protected void initCompleted() {
00128 super.initCompleted();
00129
00130 cbPriority.select(idxPriority);
00131 cbDifficulty.select(idxDifficulty);
00132 cbStability.select(idxStability);
00133 cbStatus.select(idxStatus);
00134 }
00135
00136
00137 protected Control[][] getFormControls() {
00138 Control[][] children = new Control[][] {
00139 {lbVersion, edVersion},
00140 {lbPriority, cbPriority},
00141 {lbDifficulty, cbDifficulty},
00142 {lbStatus, cbStatus},
00143 {lbStability, cbStability}
00144 };
00145 return children;
00146 }
00147
00148
00149 public String getCaption() {
00150 return "Extended";
00151 }
00152
00153
00154 private Label lbVersion;
00155
00156 private Label lbPriority;
00157 private Label lbDifficulty;
00158 private Label lbStatus;
00159 private Label lbStability;
00160
00161 private Edit edVersion;
00162
00163 private ComboBox cbPriority;
00164 private ComboBox cbDifficulty;
00165 private ComboBox cbStatus;
00166 private ComboBox cbStability;
00167
00168 private static final String[] THREE_LEVEL = new String[]{
00169 "low",
00170 "normal",
00171 "high"
00172 };
00173
00174 private static final String[] PRIORITIES = THREE_LEVEL;
00175
00176 private static final String[] DIFFICULTIES = THREE_LEVEL;
00177
00178 private static final String[] STABILITIES = THREE_LEVEL;
00179
00180 private static final String[] STATUSES = {
00181 "proposed",
00182 "approved",
00183 "incorporated",
00184 "validated"
00185 };
00186
00187 private int idxPriority;
00188 private int idxDifficulty;
00189 private int idxStatus;
00190 private int idxStability;
00191
00192 }