public Properties getProperties() { Properties prop = new Properties(); String name = saName.getText(); String interval = saInt.getText(); boolean opt = saYes.isSelected(); prop.put("name", name); prop.put("suppressInt", interval); prop.put("suppressAll", opt + ""); return prop; }
public void setProperties(String actionName) { saName.setEnabled(true); if (actionName == null) { saInt.setText(0 + ""); saYes.setSelected(true); saInt.setEnabled(false); saNo.setSelected(false); saName.setText(""); saName.setEnabled(true); } else if (NotifierList.notifiers.get(actionName) == null) { saInt.setText(0 + ""); saYes.setSelected(true); saInt.setEnabled(false); saNo.setSelected(false); saName.setText(""); saName.setEnabled(true); } else { FilterAction action = (FilterAction) NotifierList.notifiers.get(actionName); Properties prop = action.getProperties(); String saint = prop.getProperty("suppressInt"); if (saint == null) saint = "0"; saInt.setText(saint); String name = prop.getProperty("name"); if (name == null) name = ""; saName.setText(name); saName.setEnabled(false); String opt = prop.getProperty("suppressAll"); if (opt != null && opt.equals("true")) { saYes.setSelected(true); saInt.setEnabled(false); saNo.setSelected(false); } else { saYes.setSelected(false); saInt.setEnabled(true); saNo.setSelected(true); } } }