Skip to content

Commit

Permalink
#7578 fix advanced settings moving (#7595)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Jurowicz authored and scottdraves committed Jun 28, 2018
1 parent 8c2831b commit 9f78748
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ public class SparkConfiguration extends VBox {
super(new ArrayList<>());
this.add = createAddButton();
this.header = new HBox(asList(sparkVersionWidget(sparkVersion), this.add));
List<PropertyItem> propertyItems = createPropertyItems(advancedSettings);
this.properties = new PropertiesWidget(propertyItems);
VBox configuration = new VBox(asList(this.properties.getWidget(), this.header));
configuration.setDomClasses(new ArrayList<>(asList("bx-spark-configuration")));
add(configuration);
this.addConfiguration(advancedSettings);
}

private HTML sparkVersionWidget(String version) {
Expand Down Expand Up @@ -89,6 +85,14 @@ private PropertyItem createPropertyItem(Text nameWidget, Text valueWidget) {
return propertyItem;
}

private void addConfiguration(Map<String, String> advancedSettings) {
List<PropertyItem> propertyItems = createPropertyItems(advancedSettings);
this.properties = new PropertiesWidget(propertyItems);
VBox configuration = new VBox(asList(this.properties.getWidget(), this.header));
configuration.setDomClasses(new ArrayList<>(asList("bx-spark-configuration")));
add(configuration);
}

@Override
public String getModelNameValue() {
return MODEL_NAME_VALUE;
Expand Down Expand Up @@ -120,10 +124,8 @@ public List<Configuration> getConfiguration() {
}

public void setConfiguration(Map<String, String> advancedSettings) {
List<PropertyItem> propertyItems = createPropertyItems(advancedSettings);
this.properties = new PropertiesWidget(propertyItems);
this.remove(this.getChildren().get(0));
add(new VBox(asList(this.properties.getWidget(), this.header)));
this.addConfiguration(advancedSettings);
}

public void setDisabledToAll() {
Expand Down

0 comments on commit 9f78748

Please sign in to comment.