Example usage for com.vaadin.ui VerticalLayout setSizeFull

List of usage examples for com.vaadin.ui VerticalLayout setSizeFull

Introduction

In this page you can find the example usage for com.vaadin.ui VerticalLayout setSizeFull.

Prototype

@Override
    public void setSizeFull() 

Source Link

Usage

From source file:org.jumpmind.metl.ui.views.DeployView.java

License:Open Source License

@PostConstruct
protected void init() {
    setSizeFull();/*from  w ww  . j  av a 2  s  .  com*/

    tabbedPanel = new TabbedPanel();

    HorizontalSplitPanel leftSplit = new HorizontalSplitPanel();
    leftSplit.setSizeFull();
    leftSplit.setSplitPosition(AppConstants.DEFAULT_LEFT_SPLIT, Unit.PIXELS);

    deployNavigator = new DeployNavigator(context, tabbedPanel);

    leftSplit.setFirstComponent(deployNavigator);
    VerticalLayout container = new VerticalLayout();
    container.setSizeFull();
    container.addComponent(tabbedPanel);
    leftSplit.setSecondComponent(container);

    addComponent(leftSplit);

}

From source file:org.jumpmind.metl.ui.views.design.EditFlowPanel.java

License:Open Source License

public EditFlowPanel(ApplicationContext context, String flowId, DesignNavigator designNavigator,
        TabbedPanel tabs) {//from w  w  w  . j  a v  a  2s .  c  o  m

    this.configurationService = context.getConfigurationService();
    this.flow = configurationService.findFlow(flowId);
    this.readOnly = context.isReadOnly(configurationService.findProjectVersion(flow.getProjectVersionId()),
            Privilege.DESIGN);
    this.context = context;
    this.tabs = tabs;
    this.designNavigator = designNavigator;

    this.propertySheet = new PropertySheet(context, tabs, readOnly);
    this.propertySheet.setListener((components) -> {
        List<FlowStep> steps = new ArrayList<FlowStep>();
        for (Component c : components) {
            steps.add(EditFlowPanel.this.flow.findFlowStepWithComponentId(c.getId()));
        }
        refreshStepOnDiagram(steps);
    });
    this.propertySheet.setCaption("Property Sheet");

    this.componentPalette = new EditFlowPalette(this, context, flow.getProjectVersionId());

    addComponent(componentPalette);

    VerticalLayout rightLayout = new VerticalLayout();
    rightLayout.setSizeFull();

    rightLayout.addComponent(buildButtonBar());

    VerticalSplitPanel splitPanel = new VerticalSplitPanel();
    splitPanel.setSizeFull();
    splitPanel.setSplitPosition(50, Unit.PERCENTAGE);

    diagramLayout = new VerticalLayout();
    diagramLayout.setWidth(10000, Unit.PIXELS);
    diagramLayout.setHeight(10000, Unit.PIXELS);

    DragAndDropWrapper wrapper = new DragAndDropWrapper(diagramLayout);
    wrapper.setSizeUndefined();
    wrapper.setDropHandler(new DropHandler());

    flowPanel = new Panel();
    flowPanel.setSizeFull();
    flowPanel.addStyleName(ValoTheme.PANEL_WELL);
    flowPanel.setContent(wrapper);

    splitPanel.addComponent(flowPanel);
    splitPanel.addComponent(propertySheet);

    rightLayout.addComponent(splitPanel);
    rightLayout.setExpandRatio(splitPanel, 1);

    addComponent(rightLayout);
    setExpandRatio(rightLayout, 1);

    if (flow.getFlowSteps().size() > 0) {
        selected = new ArrayList<AbstractObject>();
        selected.add(flow.getFlowSteps().get(0));
        propertySheet.setSource(selected);
    }

    redrawFlow();
}

From source file:org.jumpmind.metl.ui.views.design.EditXsltPanel.java

License:Open Source License

protected void buildUI() {

    ButtonBar buttonBar = new ButtonBar();
    addComponent(buttonBar);/*from w  ww  .  jav  a  2  s.co  m*/

    if (!readOnly) {
        Button testButton = buttonBar.addButton("Test", FontAwesome.FILE_CODE_O);
        testButton.addClickListener(new TestClickListener());
    }

    filterField = buttonBar.addFilter();
    filterField.addTextChangeListener(this);

    HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
    splitPanel.setSizeFull();
    splitPanel.setSplitPosition(50, Unit.PERCENTAGE);

    VerticalLayout leftLayout = new VerticalLayout();
    editor = new AceEditor();
    editor.setMode(AceMode.xml);
    editor.setSizeFull();
    editor.setHighlightActiveLine(true);
    editor.setShowPrintMargin(false);
    editor.addTextChangeListener(new StylesheetChangeListener());
    editor.setValue(component.findSetting(XsltProcessor.XSLT_PROCESSOR_STYLESHEET).getValue());
    leftLayout.addComponent(new Label("XSLT Stylesheet"));
    leftLayout.addComponent(editor);
    leftLayout.setExpandRatio(editor, 1.0f);
    leftLayout.setSizeFull();
    splitPanel.setFirstComponent(leftLayout);

    VerticalLayout rightLayout = new VerticalLayout();
    rightLayout.setSizeFull();
    rightLayout.addComponent(new Label("Sample Input XML"));
    textArea = new TextArea();
    textArea.setEnabled(false);
    textArea.setSizeFull();
    textArea.setValue(getSampleXml());
    rightLayout.addComponent(textArea);
    rightLayout.setExpandRatio(textArea, 1.0f);
    splitPanel.setSecondComponent(rightLayout);

    addComponent(splitPanel);
    setExpandRatio(splitPanel, 1.0f);

    textArea.setReadOnly(readOnly);
    editor.setReadOnly(readOnly);

}

From source file:org.jumpmind.metl.ui.views.design.TableColumnSelectWindow.java

License:Open Source License

public TableColumnSelectWindow(ApplicationContext context, Model model) {
    super("Import from Database into Model");
    this.context = context;
    this.model = model;

    setWidth(600.0f, Unit.PIXELS);/*  ww w . j  ava  2 s .  co  m*/
    setHeight(600.0f, Unit.PIXELS);

    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);
    layout.setMargin(true);
    layout.setSizeFull();
    layout.addComponent(new Label("Select tables and columns to import into the model."));

    Panel scrollable = new Panel();
    scrollable.addStyleName(ValoTheme.PANEL_BORDERLESS);
    scrollable.addStyleName(ValoTheme.PANEL_SCROLL_INDICATOR);
    scrollable.setSizeFull();

    provider = new DbProvider(context);
    dbTree = new DbTree(provider, new DefaultSettingsProvider(context.getConfigDir()));
    scrollable.setContent(dbTree);

    layout.addComponent(scrollable);
    layout.setExpandRatio(scrollable, 1.0f);
    addComponent(layout, 1);

    Button refreshButton = new Button("Refresh");
    Button cancelButton = new Button("Cancel");
    Button selectButton = new Button("Import");
    addComponent(buildButtonFooter(refreshButton, cancelButton, selectButton));

    cancelButton.addClickListener(event -> close());
    selectButton.addClickListener(event -> select());
    refreshButton.addClickListener(event -> refresh());
}

From source file:org.jumpmind.metl.ui.views.DesignView.java

License:Open Source License

@PostConstruct
protected void init() {
    setSizeFull();//  w  w  w .  ja  va  2 s  .c  o  m

    tabbedPanel = new TabbedPanel();

    HorizontalSplitPanel leftSplit = new HorizontalSplitPanel();
    leftSplit.setSizeFull();
    leftSplit.setSplitPosition(AppConstants.DEFAULT_LEFT_SPLIT, Unit.PIXELS);

    projectNavigator = new DesignNavigator(context, tabbedPanel);

    leftSplit.setFirstComponent(projectNavigator);
    VerticalLayout container = new VerticalLayout();
    container.setSizeFull();
    container.addComponent(tabbedPanel);
    leftSplit.setSecondComponent(container);

    addComponent(leftSplit);
}

From source file:org.jumpmind.metl.ui.views.ManageNavigator.java

License:Open Source License

public ManageNavigator(FolderType folderType, ApplicationContext context) {
    this.context = context;

    setSizeFull();// ww w.jav a2  s.  c  om

    addStyleName(ValoTheme.MENU_ROOT);

    VerticalLayout content = new VerticalLayout();
    content.setSizeFull();
    setContent(content);

    MenuBar leftMenuBar = new MenuBar();
    leftMenuBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
    leftMenuBar.setWidth(100, Unit.PERCENTAGE);
    content.addComponent(leftMenuBar);

    treeTable = buildTreeTable();
    content.addComponent(treeTable);
    content.setExpandRatio(treeTable, 1);

    agentsFolder = new Folder();
    agentsFolder.setName("Agents");

    flowsFolder = new Folder();
    flowsFolder.setName("Flows");
}

From source file:org.jumpmind.metl.ui.views.ManageView.java

License:Open Source License

@SuppressWarnings("serial")
@PostConstruct//from w w  w  .jav a 2s  . com
protected void init() {
    viewButton = new Button("View Log");
    viewButton.setEnabled(false);
    viewButton.addClickListener(new ClickListener() {
        public void buttonClick(ClickEvent event) {
            viewLog(table.getValue());
        }
    });

    VerticalLayout mainTab = new VerticalLayout();
    mainTab.setSizeFull();
    HorizontalLayout header = new HorizontalLayout();
    header.addComponent(viewButton);
    header.setComponentAlignment(viewButton, Alignment.BOTTOM_RIGHT);

    statusSelect = new ComboBox("Status");
    statusSelect.setNewItemsAllowed(false);
    statusSelect.setNullSelectionAllowed(false);
    statusSelect.addItem(ANY);
    statusSelect.setValue(ANY);
    for (ExecutionStatus status : ExecutionStatus.values()) {
        statusSelect.addItem(status.toString());
    }
    ;
    statusSelect.addValueChangeListener(new ValueChangeListener() {
        @Override
        public void valueChange(ValueChangeEvent event) {
            refreshUI(getBackgroundData());
        }
    });
    header.addComponent(statusSelect);
    header.setComponentAlignment(statusSelect, Alignment.BOTTOM_RIGHT);

    HorizontalLayout limitLayout = new HorizontalLayout();
    limitLayout.setSpacing(true);
    Label limitLabel = new Label("Limit:");
    limitLayout.addComponent(limitLabel);
    limitLayout.setComponentAlignment(limitLabel, Alignment.MIDDLE_CENTER);
    TextField limitField = new TextField(null, String.valueOf(DEFAULT_LIMIT));
    limitField.setWidth("5em");
    limitField.setImmediate(true);
    limitField.setTextChangeEventMode(TextChangeEventMode.LAZY);
    limitField.setTextChangeTimeout(200);
    limitField.addTextChangeListener(new TextChangeListener() {
        public void textChange(TextChangeEvent event) {
            try {
                limit = Integer.parseInt(event.getText());
            } catch (Exception e) {
            }
            refreshUI(getBackgroundData());
        }
    });
    limitLayout.addComponent(limitField);
    limitLayout.setComponentAlignment(limitField, Alignment.BOTTOM_RIGHT);
    header.addComponent(limitLayout);
    header.setComponentAlignment(limitLayout, Alignment.BOTTOM_RIGHT);
    header.setExpandRatio(limitLayout, 1.0f);

    TextField filterField = new TextField();
    filterField.setInputPrompt("Filter");
    filterField.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    filterField.setIcon(FontAwesome.SEARCH);
    filterField.setImmediate(true);
    filterField.setTextChangeEventMode(TextChangeEventMode.LAZY);
    filterField.setTextChangeTimeout(200);
    filterField.addTextChangeListener(new TextChangeListener() {
        public void textChange(TextChangeEvent event) {
            executionContainer.removeAllContainerFilters();
            if (!StringUtils.isBlank(event.getText())) {
                executionContainer.addContainerFilter(new MultiPropertyFilter(event.getText(), new String[] {
                        "agentName", "hostName", "flowName", "status", "startTime", "endTime" }));
            }
        }
    });
    header.addComponent(filterField);
    header.setComponentAlignment(filterField, Alignment.BOTTOM_RIGHT);

    header.setSpacing(true);
    header.setMargin(true);
    header.setWidth("100%");
    mainTab.addComponent(header);

    table = new Table();
    table.setContainerDataSource(executionContainer);
    table.setSelectable(true);
    table.setMultiSelect(false);
    table.setSizeFull();
    table.addItemClickListener(new ItemClickListener() {
        @Override
        public void itemClick(ItemClickEvent event) {
            if (event.isDoubleClick()) {
                viewLog(event.getItemId());
            }
        }
    });
    table.setVisibleColumns(
            new Object[] { "agentName", "deploymentName", "hostName", "status", "startTime", "endTime" });
    table.setColumnHeaders(new String[] { "Agent", "Deployment", "Host", "Status", "Start", "End" });
    table.setSortContainerPropertyId("startTime");
    table.setSortAscending(false);
    table.addValueChangeListener(new ValueChangeListener() {
        public void valueChange(ValueChangeEvent event) {
            viewButton.setEnabled(table.getValue() != null);
        }
    });
    mainTab.addComponent(table);
    mainTab.setExpandRatio(table, 1.0f);

    tabs = new TabbedPanel();
    tabs.setMainTab("Executions", Icons.EXECUTION, mainTab);

    HorizontalSplitPanel split = new HorizontalSplitPanel();
    split.setSizeFull();
    split.setSplitPosition(AppConstants.DEFAULT_LEFT_SPLIT, Unit.PIXELS, false);

    manageNavigator = new ManageNavigator(FolderType.AGENT, context);
    manageNavigator.addValueChangeListener(new ValueChangeListener() {
        public void valueChange(ValueChangeEvent event) {
            refreshUI(getBackgroundData());
        }
    });
    split.setFirstComponent(manageNavigator);

    VerticalLayout container = new VerticalLayout();
    container.setSizeFull();
    container.addComponent(tabs);
    split.setSecondComponent(container);

    addComponent(split);
    setSizeFull();
    context.getBackgroundRefresherService().register(this);
}

From source file:org.jumpmind.vaadin.ui.common.ConfirmDialog.java

License:Open Source License

public ConfirmDialog(String caption, String text, final IConfirmListener confirmListener) {
    setCaption(caption);//w w  w.  j a va2s . c om
    setModal(true);
    setResizable(true);
    setWidth(300, Unit.PIXELS);
    setHeight(200, Unit.PIXELS);
    setClosable(false);

    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();
    layout.setSpacing(true);
    layout.setMargin(true);
    setContent(layout);

    if (isNotBlank(text)) {
        Label textLabel = new Label(text);
        layout.addComponent(textLabel);
        layout.setExpandRatio(textLabel, 1);
    }

    HorizontalLayout buttonLayout = new HorizontalLayout();
    buttonLayout.setStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
    buttonLayout.setSpacing(true);
    buttonLayout.setWidth(100, Unit.PERCENTAGE);

    Label spacer = new Label(" ");
    buttonLayout.addComponent(spacer);
    buttonLayout.setExpandRatio(spacer, 1);

    Button cancelButton = new Button("Cancel");
    cancelButton.setClickShortcut(KeyCode.ESCAPE);
    cancelButton.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            UI.getCurrent().removeWindow(ConfirmDialog.this);
        }
    });
    buttonLayout.addComponent(cancelButton);

    Button okButton = new Button("Ok");
    okButton.setStyleName(ValoTheme.BUTTON_PRIMARY);
    okButton.setClickShortcut(KeyCode.ENTER);
    okButton.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            if (confirmListener.onOk()) {
                UI.getCurrent().removeWindow(ConfirmDialog.this);
            }
        }
    });
    buttonLayout.addComponent(okButton);

    layout.addComponent(buttonLayout);

    okButton.focus();

}

From source file:org.jumpmind.vaadin.ui.sqlexplorer.QueryPanel.java

License:Open Source License

public QueryPanel(IDb db, ISettingsProvider settingsProvider, IButtonBar buttonBar, String user) {
    this.settingsProvider = settingsProvider;
    this.db = db;
    this.user = user;
    this.buttonBar = buttonBar;
    this.sqlArea = buildSqlEditor();
    this.shortCutListeners.add(createExecuteSqlShortcutListener());

    VerticalLayout resultsLayout = new VerticalLayout();
    resultsLayout.setSizeFull();

    resultsTabs = CommonUiUtils.createTabSheet();
    resultStatuses = new HashMap<Component, String>();

    HorizontalLayout statusBar = new HorizontalLayout();
    statusBar.addStyleName(ValoTheme.PANEL_WELL);
    statusBar.setMargin(new MarginInfo(true, true, true, true));
    statusBar.setWidth(100, Unit.PERCENTAGE);

    status = new Label("No Results");
    statusBar.addComponent(status);/*  w  ww  .java  2 s . c o m*/

    setSelectedTabChangeListener();

    resultsLayout.addComponents(resultsTabs, statusBar);
    resultsLayout.setExpandRatio(resultsTabs, 1);

    addComponents(sqlArea, resultsLayout);

    setSplitPosition(400, Unit.PIXELS);

    emptyResults = new VerticalLayout();
    emptyResults.setSizeFull();
    Label label = new Label("New results will appear here");
    label.setWidthUndefined();
    emptyResults.addComponent(label);
    emptyResults.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
    resultStatuses.put(emptyResults, "No Results");

    if (!settingsProvider.get().getProperties().is(SQL_EXPLORER_SHOW_RESULTS_IN_NEW_TABS)) {
        createGeneralResultsTab();
    }
}

From source file:org.jumpmind.vaadin.ui.sqlexplorer.QueryPanel.java

License:Open Source License

public void createGeneralResultsTab() {
    if (generalResultsTab == null) {
        VerticalLayout generalResultsPanel = new VerticalLayout();
        generalResultsPanel.setSizeFull();
        generalResultsTab = resultsTabs.addTab(generalResultsPanel, "Results", null, 0);
        resetGeneralResultsTab();/*from   w ww .  ja v a 2 s .c om*/
    }
}