Set value if rollout is edited

Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
SirWayne
2016-06-28 17:49:16 +02:00
parent 7e32cbd21c
commit 9ce6e43b87
4 changed files with 12 additions and 10 deletions

View File

@@ -348,6 +348,7 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
private void populateValuesOfDistribution(final Long editDistId) {
this.editDistId = editDistId;
if (editDistId == null) {
return;
}
@@ -368,13 +369,12 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
if (distSet.getDescription() != null) {
descTextArea.setValue(distSet.getDescription());
}
populateDistSetTypeNameCombo();
}
public CommonDialogWindow getWindow(final Long editDistId) {
eventBus.publish(this, DragEvent.HIDE_DROP_HINT);
resetComponents();
populateDistSetTypeNameCombo();
populateValuesOfDistribution(editDistId);
window = SPUIWindowDecorator.getWindow(i18n.get("caption.add.new.dist"), null,
SPUIDefinitions.CREATE_UPDATE_WINDOW, this, event -> saveDistribution(), event -> discardDistribution(),
@@ -386,7 +386,7 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
/**
* Populate DistributionSet Type name combo.
*/
public void populateDistSetTypeNameCombo() {
private void populateDistSetTypeNameCombo() {
distsetTypeNameComboBox.setContainerDataSource(getDistSetTypeLazyQueryContainer());
distsetTypeNameComboBox.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME);
distsetTypeNameComboBox.setValue(getDefaultDistributionSetType().getName());

View File

@@ -155,8 +155,9 @@ public class AddUpdateRolloutWindowLayout extends GridLayout {
buildLayout();
}
public CommonDialogWindow getWindow() {
public CommonDialogWindow getWindow(final Long rolloutId) {
resetComponents();
populateData(rolloutId);
window = SPUIWindowDecorator.getWindow(i18n.get("caption.configure.rollout"), null,
SPUIDefinitions.CREATE_UPDATE_WINDOW, this, event -> onRolloutSave(), event -> onDiscard(),
uiProperties.getLinks().getDocumentation().getRolloutView(), this, i18n);
@@ -728,8 +729,11 @@ public class AddUpdateRolloutWindowLayout extends GridLayout {
* @param rolloutId
* rollout id
*/
public void populateData(final Long rolloutId) {
resetComponents();
private void populateData(final Long rolloutId) {
if (rolloutId == null) {
return;
}
editRolloutEnabled = Boolean.TRUE;
rolloutForEdit = rolloutManagement.findRolloutById(rolloutId);
rolloutName.setValue(rolloutForEdit.getName());

View File

@@ -431,8 +431,7 @@ public class RolloutListGrid extends AbstractGrid {
}
private void onUpdate(final ContextMenuData contextMenuData) {
addUpdateRolloutWindow.populateData(contextMenuData.getRolloutId());
final CommonDialogWindow addTargetWindow = addUpdateRolloutWindow.getWindow();
final CommonDialogWindow addTargetWindow = addUpdateRolloutWindow.getWindow(contextMenuData.getRolloutId());
addTargetWindow.setCaption(i18n.get("caption.update.rollout"));
UI.getCurrent().addWindow(addTargetWindow);
addTargetWindow.setVisible(Boolean.TRUE);

View File

@@ -91,8 +91,7 @@ public class RolloutListHeader extends AbstractGridHeader {
@Override
protected void addNewItem(final ClickEvent event) {
addUpdateRolloutWindow.resetComponents();
final Window addTargetWindow = addUpdateRolloutWindow.getWindow();
final Window addTargetWindow = addUpdateRolloutWindow.getWindow(null);
UI.getCurrent().addWindow(addTargetWindow);
addTargetWindow.setVisible(Boolean.TRUE);