@Test public void validateInsideCell() throws Throwable { class MyModel extends AbstractPM { AbstractOperationPM op = util.createAbstractOperation(); final TextPM t = new TextPM(); public MyModel() { PMManager.setup(this); } } final MyModel model = new MyModel(); model.op.getValidator().add(new ValidationRule() { public ValidationState validate() { if (model.t.getText().equals("open sesame")) { return null; } else { return new ValidationState("type in 'open sesame'"); } } }); assertEquals("op.isEnabled()", false, model.op.isEnabled()); model.t.setText("open sesame"); assertEquals("op.isEnabled()", true, model.op.isEnabled()); }
public boolean isEnabled() { return this.isValid(); }
AbstractOperationPM extends AbstractPM implements IOperationPM { public boolean isEnabled() { return this.isValid(); } }
AbstractOperationPM extends AbstractPM implements IOperationPM { public boolean isEnabled() { return this.isValid(); } protected  AbstractOperationPM(); }
AbstractOperationPM extends AbstractPM implements IOperationPM { public boolean isEnabled() { return this.isValid(); } protected  AbstractOperationPM(); void setIcon(Icon newIcon); Icon getIcon(); void setIconUrl(URL url); String getTitle(); void setTitle(String title); String getDescription(); void setDescription(String description); abstract boolean execute(); boolean isEnabled(); void check(); }
AbstractOperationPM extends AbstractPM implements IOperationPM { public boolean isEnabled() { return this.isValid(); } protected  AbstractOperationPM(); void setIcon(Icon newIcon); Icon getIcon(); void setIconUrl(URL url); String getTitle(); void setTitle(String title); String getDescription(); void setDescription(String description); abstract boolean execute(); boolean isEnabled(); void check();  }