/** * Instantiates a new collect field. * * @param caption the caption * @param groups the available groups */ public CollectField(String caption, List<String> groups) { setCaption(caption); selectField.setRows(10); selectField.setLeftColumnCaption("Available"); selectField.setRightColumnCaption("Selected"); for (String group : groups) { selectField.addItem(group); } }
@Override public Component createEditor() { TwinColSelect ret = new TwinColSelect(); ret.setMultiSelect(true); ret.setNullSelectionAllowed(true); ret.setLeftColumnCaption( MNls.find(getForm(), getName() + ".available=Available options") ); ret.setRightColumnCaption( MNls.find(getForm(), getName() + ".selected=Selected options") ); return ret; }