@Test public void testOnOK() { Command command = mock(Command.class); when(view.getSequenceName()).thenReturn(SEQUENCE_NAME_VALUE); when(view.getGeneratorName()).thenReturn(NAME_VALUE); when(view.getInitialValue()).thenReturn(INITIAL_VALUE.toString()); when(view.getAllocationSize()).thenReturn(ALLOCATION_SIZE_VALUE.toString()); dialog.setProperty(fieldInfo); dialog.setOkCommand(command); dialog.onOK(); verify(fieldInfo).setCurrentValue(SequenceGeneratorValueHandler.SEQUENCE_NAME, SEQUENCE_NAME_VALUE); verify(fieldInfo).setCurrentValue(SequenceGeneratorValueHandler.NAME, NAME_VALUE); verify(fieldInfo).setCurrentValue(SequenceGeneratorValueHandler.INITIAL_VALUE, INITIAL_VALUE); verify(fieldInfo).setCurrentValue(SequenceGeneratorValueHandler.ALLOCATION_SIZE, ALLOCATION_SIZE_VALUE); verify(view).hide(); verify(command).execute(); }
void onOK() { DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property; fieldInfo.clearCurrentValues(); String generatorName = view.getGeneratorName(); if (generatorName != null && !generatorName.isEmpty()) { fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.NAME, generatorName); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.SEQUENCE_NAME, view.getSequenceName()); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.INITIAL_VALUE, getInitialValue()); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.ALLOCATION_SIZE, getAllocationSize()); } view.hide(); if (okCommand != null) { okCommand.execute(); } }
SequenceGeneratorEditionDialog implements PropertyEditionPopup { void onOK() { DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property; fieldInfo.clearCurrentValues(); String generatorName = view.getGeneratorName(); if (generatorName != null && !generatorName.isEmpty()) { fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.NAME, generatorName); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.SEQUENCE_NAME, view.getSequenceName()); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.INITIAL_VALUE, getInitialValue()); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.ALLOCATION_SIZE, getAllocationSize()); } view.hide(); if (okCommand != null) { okCommand.execute(); } } }
SequenceGeneratorEditionDialog implements PropertyEditionPopup { void onOK() { DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property; fieldInfo.clearCurrentValues(); String generatorName = view.getGeneratorName(); if (generatorName != null && !generatorName.isEmpty()) { fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.NAME, generatorName); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.SEQUENCE_NAME, view.getSequenceName()); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.INITIAL_VALUE, getInitialValue()); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.ALLOCATION_SIZE, getAllocationSize()); } view.hide(); if (okCommand != null) { okCommand.execute(); } } @Inject  SequenceGeneratorEditionDialog(View view); }
SequenceGeneratorEditionDialog implements PropertyEditionPopup { void onOK() { DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property; fieldInfo.clearCurrentValues(); String generatorName = view.getGeneratorName(); if (generatorName != null && !generatorName.isEmpty()) { fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.NAME, generatorName); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.SEQUENCE_NAME, view.getSequenceName()); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.INITIAL_VALUE, getInitialValue()); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.ALLOCATION_SIZE, getAllocationSize()); } view.hide(); if (okCommand != null) { okCommand.execute(); } } @Inject  SequenceGeneratorEditionDialog(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); }
SequenceGeneratorEditionDialog implements PropertyEditionPopup { void onOK() { DataModelerPropertyEditorFieldInfo fieldInfo = (DataModelerPropertyEditorFieldInfo) property; fieldInfo.clearCurrentValues(); String generatorName = view.getGeneratorName(); if (generatorName != null && !generatorName.isEmpty()) { fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.NAME, generatorName); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.SEQUENCE_NAME, view.getSequenceName()); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.INITIAL_VALUE, getInitialValue()); fieldInfo.setCurrentValue(SequenceGeneratorValueHandler.ALLOCATION_SIZE, getAllocationSize()); } view.hide(); if (okCommand != null) { okCommand.execute(); } } @Inject  SequenceGeneratorEditionDialog(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);  }