Skip to content

Commit

Permalink
0004943: Cleaned up v- classes
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-miller-jumpmind committed Sep 15, 2021
1 parent 5c80160 commit 237553b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 25 deletions.
Expand Up @@ -54,7 +54,9 @@
import com.vaadin.flow.component.textfield.TextArea;
import com.vaadin.flow.server.StreamResource;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.Scroller;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.orderedlayout.Scroller.ScrollDirection;

public class DbExportDialog extends ResizableDialog {

Expand Down Expand Up @@ -110,7 +112,7 @@ enum DbExportFormat {

private TableSelectionLayout tableSelectionLayout;

private VerticalLayout optionLayout;
private Scroller optionLayout;

private HorizontalLayout buttonFooter;

Expand Down Expand Up @@ -193,16 +195,15 @@ protected void addButtons() {
}

protected void createOptionLayout() {
optionLayout = new VerticalLayout();
optionLayout.addClassName("v-scrollable");
optionLayout.setMargin(false);
optionLayout.setSpacing(true);
optionLayout.setSizeFull();
optionLayout.add(new Span("Please choose from the following options"));
VerticalLayout optionContent = new VerticalLayout();
optionContent.setMargin(false);
optionContent.setSpacing(true);
optionContent.setSizeFull();
optionContent.add(new Span("Please choose from the following options"));

FormLayout formLayout = new FormLayout();
formLayout.setSizeFull();
optionLayout.addAndExpand(formLayout);
optionContent.addAndExpand(formLayout);

formatSelect = new ComboBox<DbExportFormat>("Format", Arrays.asList(DbExportFormat.values()));
formatSelect.setValue(DbExportFormat.SQL);
Expand Down Expand Up @@ -279,6 +280,9 @@ protected void createOptionLayout() {
exportFormatOptionGroup.addValueChangeListener(event -> setExportButtonsEnabled());
formLayout.add(exportFormatOptionGroup);

optionLayout = new Scroller(optionContent);
optionLayout.setScrollDirection(ScrollDirection.VERTICAL);
optionLayout.setSizeFull();
}

protected void setDefaultCompatibility() {
Expand Down
Expand Up @@ -42,7 +42,9 @@
import com.vaadin.flow.component.radiobutton.RadioButtonGroup;
import com.vaadin.flow.component.textfield.TextField;
import com.vaadin.flow.data.value.ValueChangeMode;
import com.vaadin.flow.component.orderedlayout.Scroller;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.orderedlayout.Scroller.ScrollDirection;

public class DbFillDialog extends ResizableDialog {

Expand All @@ -64,7 +66,7 @@ public class DbFillDialog extends ResizableDialog {

private TableSelectionLayout tableSelectionLayout;

private VerticalLayout optionLayout;
private Scroller optionLayout;

private Checkbox continueBox;

Expand Down Expand Up @@ -172,16 +174,15 @@ protected void addButtons() {
}

protected void createOptionLayout() {
optionLayout = new VerticalLayout();
optionLayout.addClassName("v-scrollable");
optionLayout.setMargin(false);
optionLayout.setSpacing(true);
optionLayout.setSizeFull();
optionLayout.add(new Span("Please choose from the following options"));
VerticalLayout optionContent = new VerticalLayout();
optionContent.setMargin(false);
optionContent.setSpacing(true);
optionContent.setSizeFull();
optionContent.add(new Span("Please choose from the following options"));

FormLayout formLayout = new FormLayout();
formLayout.setSizeFull();
optionLayout.addAndExpand(formLayout);
optionContent.addAndExpand(formLayout);

countField = new TextField("Count (# of rows to fill)");
countField.setValue("1");
Expand Down Expand Up @@ -237,7 +238,10 @@ protected void createOptionLayout() {
oGroup.setItems("Fill Table(s)", "Send to Sql Editor");
oGroup.setValue("Fill Table(s)");
formLayout.add(oGroup);


optionLayout = new Scroller(optionContent);
optionLayout.setScrollDirection(ScrollDirection.VERTICAL);
optionLayout.setSizeFull();
}

protected void confirm() {
Expand Down
Expand Up @@ -56,7 +56,9 @@
import com.vaadin.flow.component.upload.Upload;
import com.vaadin.flow.data.value.ValueChangeMode;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.Scroller;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.orderedlayout.Scroller.ScrollDirection;

public class DbImportDialog extends ResizableDialog {

Expand All @@ -72,7 +74,7 @@ enum DbImportFormat {

private Table selectedTable;

private VerticalLayout importLayout;
private Scroller importLayout;

private ComboBox<DbImportFormat> formatSelect;

Expand Down Expand Up @@ -124,17 +126,16 @@ public DbImportDialog(IDatabasePlatform databasePlatform, Set<Table> selectedTab
}

protected void createImportLayout() {
importLayout = new VerticalLayout();
importLayout.setSizeFull();
importLayout.addClassName("v-scrollable");
importLayout.setMargin(false);
importLayout.setSpacing(true);
VerticalLayout importContent = new VerticalLayout();
importContent.setSizeFull();
importContent.setMargin(false);
importContent.setSpacing(true);

importLayout.add(new Label("Please select from the following options"));
importContent.add(new Label("Please select from the following options"));

FormLayout formLayout = new FormLayout();
formLayout.setSizeFull();
importLayout.addAndExpand(formLayout);
importContent.addAndExpand(formLayout);

formatSelect = new ComboBox<>("Format");
formatSelect.setItems( DbImportFormat.values());
Expand Down Expand Up @@ -271,6 +272,10 @@ public OutputStream receiveUpload(String filename, String mimeType) {
upload.setUploadButton(uploadButton);
formLayout.add(upload);

importLayout = new Scroller(importContent);
importLayout.setScrollDirection(ScrollDirection.VERTICAL);
importLayout.setSizeFull();

cancelButton = new Button("Cancel", event -> close());
add(importLayout, 1);
HorizontalLayout buttonLayout = buildButtonFooter(cancelButton);
Expand Down

0 comments on commit 237553b

Please sign in to comment.