From 0ec8481c10cd8277d84c7c1a785483a0a739e5a0 Mon Sep 17 00:00:00 2001 From: abranson Date: Thu, 4 Aug 2011 00:42:34 +0200 Subject: 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 --- .../gui/tabs/outcome/form/field/ComboField.java | 38 +++++++++++++--------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java') 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 -- cgit v1.2.3