@Test public void testUpdate() throws IllegalStateException, AcmeException { System.out.println("update"); AcmeModelView instance = new AcmeModelViewImpl(svp); int expResult = 0; int result = ((AcmeModelViewImpl) instance).updateCnt; assertEquals(expResult, result); expResult = 1; instance.update(); result = ((AcmeModelViewImpl) instance).updateCnt; assertEquals(expResult, result); expResult = 1; instance.update(); result = ((AcmeModelViewImpl) instance).updateCnt; assertEquals(expResult, result); IAcmeSystem model = (IAcmeSystem) svp.getView().getModelInstance(); IAcmeCommand<IAcmeComponent> command = model.getCommandFactory().componentDeleteCommand(model.getComponent("Server0")); command.execute(); try { expResult = 2; instance.update(); result = ((AcmeModelViewImpl) instance).updateCnt; assertEquals(expResult, result); expResult = 2; instance.update(); result = ((AcmeModelViewImpl) instance).updateCnt; assertEquals(expResult, result); } finally { command.undo(); } }
@Override public void update() { model = (IAcmeSystem) systemViewProvider.getView().getModelInstance(); if (isModelChanged()) { subUpdate(); } }
AcmeModelView extends CustomComponent implements IUpdatableWidget { @Override public void update() { model = (IAcmeSystem) systemViewProvider.getView().getModelInstance(); if (isModelChanged()) { subUpdate(); } } }
AcmeModelView extends CustomComponent implements IUpdatableWidget { @Override public void update() { model = (IAcmeSystem) systemViewProvider.getView().getModelInstance(); if (isModelChanged()) { subUpdate(); } } AcmeModelView(ISystemViewProvider svp); }
AcmeModelView extends CustomComponent implements IUpdatableWidget { @Override public void update() { model = (IAcmeSystem) systemViewProvider.getView().getModelInstance(); if (isModelChanged()) { subUpdate(); } } AcmeModelView(ISystemViewProvider svp); @Override void update(); @Override boolean isActive(); @Override void activate(); @Override void deactivate(); }
AcmeModelView extends CustomComponent implements IUpdatableWidget { @Override public void update() { model = (IAcmeSystem) systemViewProvider.getView().getModelInstance(); if (isModelChanged()) { subUpdate(); } } AcmeModelView(ISystemViewProvider svp); @Override void update(); @Override boolean isActive(); @Override void activate(); @Override void deactivate();  }