Ejemplo n.º 1
0
 protected void load() {
   nameField.setText(data.name);
   costField.setValue(data.cost);
   colorBox.setSelectedItem(data.color);
   charField.setValue(data.text);
   weightField.setValue(data.weight);
   spellBox.setSelectedItem(data.spell);
 }
Ejemplo n.º 2
0
 protected void save() {
   data.name = nameField.getText();
   try {
     costField.commitEdit();
     data.cost = ((Long) costField.getValue()).intValue();
   } catch (ParseException e) {
     data.cost = 0;
   }
   data.color = colorBox.getSelectedItem().toString();
   data.text = charField.getText();
   data.weight = Float.parseFloat(weightField.getText());
   if (spellBox.getSelectedItem() != null) {
     data.spell = spellBox.getSelectedItem().toString();
   }
   data.setPath(Editor.getStore().getActive().get("id"));
 }