if (getForm() != null) {
try {
// find the action method
actionMethod = getForm().getClass().getMethod(code);
// find the @Action annotation.
Action ac = actionMethod.getAnnotation(Action.class);
String eprop = ac.enabledProperty();
if(eprop!=null && !eprop.isEmpty()) {
Utils.addPropertyChangeListener(getForm(), eprop, enabledListener);
}
String sprop = ac.selectedProperty();
if(sprop!=null && !sprop.isEmpty()) {
Utils.addPropertyChangeListener(getForm(), sprop, selectedListener);
}
} catch (NoSuchMethodException ex) {
log.severe(String.format("No method named %s in %s", code, getForm().getClass().getName()));