@Override public void actionPerformed(ActionEvent e) { if (e.getSource() instanceof JRadioButton) { JRadioButton button = (JRadioButton) e.getSource(); String typeName = button.getText(); nodePropertyParameters.propertyType = PropertyType.valueFromName(typeName); valueCardPanel.show(typeName); } }
@Override public void valueChanged(ListSelectionEvent e) { if (e.getSource() instanceof JList) { JList list = (JList) e.getSource(); String typeName = (String) list.getSelectedValue(); nodePropertyParameters.propertyType = PropertyType.valueFromName(typeName); valueCardPanel.show(typeName); } }
private void updateFields() { name.setText(nodePropertyParameters.name); String propertyTypeName = PropertyType.nameFromValue(nodePropertyParameters.propertyType); List<String> typeNames = Arrays.asList(getPropertyTypes()); int index = typeNames.indexOf(propertyTypeName); log.trace("property type: " + propertyTypeName + " index: " + index); type.setSelectedIndex(index); value.setText((String) nodePropertyParameters.value); valueCardPanel.setFieldFromValue( nodePropertyParameters.value, nodePropertyParameters.propertyType); valueCardPanel.show(propertyTypeName); errorValueFormat.setText(nodePropertyParameters.errorMessage); }