@Override public void set(final WidgetModel model) { super.set(model); log = model.getContext().getService(LogService.class); final int columns = model.getItem().getColumnCount(); // construct text widget of the appropriate style, if specified boolean addScrollPane = false; if (model.isStyle(TextWidget.AREA_STYLE)) { textComponent = new JTextArea("", 5, columns); addScrollPane = true; } else if (model.isStyle(TextWidget.PASSWORD_STYLE)) { textComponent = new JPasswordField("", columns); } else { textComponent = new JTextField("", columns); } setToolTip(textComponent); getComponent().add(addScrollPane ? new JScrollPane(textComponent) : textComponent); limitLength(); textComponent.getDocument().addDocumentListener(this); refreshWidget(); }
@Override public void set(final WidgetModel model) { super.set(model); final int columns = model.getItem().getColumnCount(); textField = new TextField("", columns); textField.addTextListener(this); getComponent().add(textField, BorderLayout.CENTER); refreshWidget(); }
/** Creates a new module item with the same values as the given item. */ public DefaultMutableModuleItem(final ModuleInfo info, final ModuleItem<T> item) { super(info); name = item.getName(); type = item.getType(); genericType = item.getGenericType(); ioType = item.getIOType(); visibility = item.getVisibility(); required = item.isRequired(); persisted = item.isPersisted(); persistKey = item.getPersistKey(); initializer = item.getInitializer(); validater = item.getValidater(); callback = item.getCallback(); widgetStyle = item.getWidgetStyle(); minimumValue = item.getMinimumValue(); maximumValue = item.getMaximumValue(); softMinimum = item.getSoftMinimum(); softMaximum = item.getSoftMaximum(); stepSize = item.getStepSize(); columnCount = item.getColumnCount(); final List<T> itemChoices = item.getChoices(); if (itemChoices != null) choices.addAll(itemChoices); label = item.getLabel(); description = item.getDescription(); }
/** Creates a new module item with the same values as the given item. */ public DefaultMutableModuleItem(final ModuleInfo info, final ModuleItem<T> item) { super(info); name = item.getName(); type = item.getType(); genericType = item.getGenericType(); ioType = item.getIOType(); visibility = item.getVisibility(); required = item.isRequired(); persisted = item.isPersisted(); persistKey = item.getPersistKey(); initializer = item.getInitializer(); validater = item.getValidater(); callback = item.getCallback(); widgetStyle = item.getWidgetStyle(); minimumValue = item.getMinimumValue(); maximumValue = item.getMaximumValue(); softMinimum = item.getSoftMinimum(); softMaximum = item.getSoftMaximum(); stepSize = item.getStepSize(); columnCount = item.getColumnCount(); final List<T> itemChoices = item.getChoices(); if (itemChoices != null) choices.addAll(itemChoices); label = item.getLabel(); description = item.getDescription(); }