diff options
| author | abranson <andrew.branson@cern.ch> | 2011-08-04 00:42:34 +0200 |
|---|---|---|
| committer | abranson <andrew.branson@cern.ch> | 2011-08-04 00:42:34 +0200 |
| commit | 0ec8481c10cd8277d84c7c1a785483a0a739e5a0 (patch) | |
| tree | 5f6e5d9ae75193e67e6f3b3dfa488960c5cde1d5 /source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java | |
| parent | 036cbdba66f804743c4c838ed598d6972c4b3e17 (diff) | |
More code cleanup:
Refactored Entity Proxy Subscription to handle generics better
Rewrote RemoteMap to use TreeMap instead of the internal array for
order. It now sorts its keys by number if they parse, else as strings.
Removed a no-longer-in-progress outcome form class
Diffstat (limited to 'source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java')
| -rw-r--r-- | source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java b/source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java index 303a870..ef56046 100644 --- a/source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java +++ b/source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java @@ -19,9 +19,9 @@ import com.c2kernel.scripting.Script; import com.c2kernel.utils.Logger;
/*******************************************************************************
- *
+ *
* $Revision: 1.4 $ $Date: 2005/08/16 13:59:56 $
- *
+ *
* Copyright (C) 2003 CERN - European Organization for Nuclear Research All
* rights reserved.
******************************************************************************/
@@ -40,28 +40,33 @@ public class ComboField extends StringEditField { this.listNode = listNode;
createLOV();
}
-
- public String getDefaultValue() {
+
+ @Override
+ public String getDefaultValue() {
if (vals.getDefaultKey() != null)
return vals.get(vals.getDefaultKey()).toString();
else
return "";
}
- public String getText() {
+ @Override
+ public String getText() {
return vals.get(comboModel.getSelectedItem()).toString();
}
- public JTextComponent makeTextField() {
+ @Override
+ public JTextComponent makeTextField() {
// not used by this control
return null;
}
- public void setText(String text) {
+ @Override
+ public void setText(String text) {
comboModel.setSelectedItem(text);
}
- public Component getControl() {
+ @Override
+ public Component getControl() {
return comboField;
}
@@ -76,12 +81,12 @@ public class ComboField extends StringEditField { if (lovType.equals("PathList"))
populateLOVFromLDAP(param);
}
-
+
// handle enumerations
// TODO: should be ANDed with above results
if (content.hasFacet(Facet.ENUMERATION)) {
//ListOfValues andList = new ListOfValues();
- Enumeration enums = content.getFacets(Facet.ENUMERATION);
+ Enumeration<?> enums = content.getFacets(Facet.ENUMERATION);
while (enums.hasMoreElements()) {
Facet thisEnum = (Facet)enums.nextElement();
vals.put(thisEnum.getValue(), thisEnum.getValue(), false);
@@ -99,8 +104,8 @@ public class ComboField extends StringEditField { */
private void populateLOVFromLDAP(String param) {
// TODO '/root/path;prop=val;prop=val'
-
-
+
+
}
private void populateLOVFromScript(String scriptName) {
@@ -116,12 +121,14 @@ public class ComboField extends StringEditField { }
}
- public void setDecl(AttributeDecl model) throws StructuralException {
+ @Override
+ public void setDecl(AttributeDecl model) throws StructuralException {
super.setDecl(model);
createLOV();
}
- public void setDecl(ElementDecl model) throws StructuralException {
+ @Override
+ public void setDecl(ElementDecl model) throws StructuralException {
super.setDecl(model);
createLOV();
}
@@ -130,7 +137,8 @@ public class ComboField extends StringEditField { *
*/
- public void setEditable(boolean editable) {
+ @Override
+ public void setEditable(boolean editable) {
comboField.setEditable(editable);
}
}
\ No newline at end of file |
