@Test public void testOnOK() { Command command = mock(Command.class); when(view.getGeneratorType()).thenReturn(STRATEGY_VALUE); when(view.getGeneratorName()).thenReturn(GENERATOR_VALUE); dialog.setProperty(fieldInfo); dialog.setOkCommand(command); dialog.onOK(); verify(fieldInfo).setCurrentValue(STRATEGY, STRATEGY_VALUE); verify(fieldInfo).setCurrentValue(GENERATOR, GENERATOR_VALUE); verify(view).hide(); verify(command).execute(); }
void onOK() { DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property; fieldInfo.clearCurrentValues(); String strategy = view.getGeneratorType(); if (!UIUtil.NOT_SELECTED.equals(strategy)) { fieldInfo.setCurrentValue(STRATEGY, strategy); fieldInfo.setCurrentValue(GENERATOR, view.getGeneratorName()); } view.hide(); if (okCommand != null) { okCommand.execute(); } }
IdGeneratorEditionDialog implements PropertyEditionPopup { void onOK() { DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property; fieldInfo.clearCurrentValues(); String strategy = view.getGeneratorType(); if (!UIUtil.NOT_SELECTED.equals(strategy)) { fieldInfo.setCurrentValue(STRATEGY, strategy); fieldInfo.setCurrentValue(GENERATOR, view.getGeneratorName()); } view.hide(); if (okCommand != null) { okCommand.execute(); } } }
IdGeneratorEditionDialog implements PropertyEditionPopup { void onOK() { DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property; fieldInfo.clearCurrentValues(); String strategy = view.getGeneratorType(); if (!UIUtil.NOT_SELECTED.equals(strategy)) { fieldInfo.setCurrentValue(STRATEGY, strategy); fieldInfo.setCurrentValue(GENERATOR, view.getGeneratorName()); } view.hide(); if (okCommand != null) { okCommand.execute(); } } @Inject  IdGeneratorEditionDialog(View view); }
IdGeneratorEditionDialog implements PropertyEditionPopup { void onOK() { DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property; fieldInfo.clearCurrentValues(); String strategy = view.getGeneratorType(); if (!UIUtil.NOT_SELECTED.equals(strategy)) { fieldInfo.setCurrentValue(STRATEGY, strategy); fieldInfo.setCurrentValue(GENERATOR, view.getGeneratorName()); } view.hide(); if (okCommand != null) { okCommand.execute(); } } @Inject  IdGeneratorEditionDialog(View view); @Override Widget asWidget(); @Override void show(); @Override void setOkCommand(Command okCommand); @Override void setProperty(PropertyEditorFieldInfo property); @Override String getStringValue(); @Override void setStringValue(String value); }
IdGeneratorEditionDialog implements PropertyEditionPopup { void onOK() { DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property; fieldInfo.clearCurrentValues(); String strategy = view.getGeneratorType(); if (!UIUtil.NOT_SELECTED.equals(strategy)) { fieldInfo.setCurrentValue(STRATEGY, strategy); fieldInfo.setCurrentValue(GENERATOR, view.getGeneratorName()); } view.hide(); if (okCommand != null) { okCommand.execute(); } } @Inject  IdGeneratorEditionDialog(View view); @Override Widget asWidget(); @Override void show(); @Override void setOkCommand(Command okCommand); @Override void setProperty(PropertyEditorFieldInfo property); @Override String getStringValue(); @Override void setStringValue(String value);  }