Example usage for com.vaadin.ui VerticalLayout addStyleName

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

Introduction

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

Prototype

@Override
    public void addStyleName(String style) 

Source Link

Usage

From source file:org.investovator.ui.nngaming.DashboardPlayingView.java

License:Open Source License

private void createUI() {

    //Setup Layout
    content = new VerticalLayout();
    content.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);

    HorizontalLayout row1 = new HorizontalLayout();
    HorizontalLayout row2 = new HorizontalLayout();
    HorizontalLayout row3 = new HorizontalLayout();

    row1.setWidth("100%");
    row2.setWidth("100%");
    row3.setWidth("100%");

    row1.setHeight(50, Unit.PERCENTAGE);
    row2.setHeight(20, Unit.PERCENTAGE);
    row3.setHeight(30, Unit.PERCENTAGE);

    row1.setMargin(new MarginInfo(true, true, false, true));
    row2.setMargin(new MarginInfo(true, true, false, true));
    row3.setMargin(new MarginInfo(true, true, true, true));

    content.addComponent(row1);//ww w . j  a va 2 s.co  m
    content.addComponent(row2);
    content.addComponent(row3);

    currentPriceChart = new BasicChart();
    quantityChart = new QuantityChart();
    orderBookSell = getSellSideTable();
    orderBookSell.addStyleName("center-caption");
    orderBookBuy = getBuySideTable();
    orderBookBuy.addStyleName("center-caption");
    quoteUI = new QuoteUI();
    userPortfolio = new UserPortfolio();

    HorizontalLayout orderBookLayout = new HorizontalLayout();
    orderBookLayout.setWidth("100%");
    orderBookLayout.addComponent(orderBookSell);
    orderBookLayout.addComponent(orderBookBuy);
    orderBookLayout.setComponentAlignment(orderBookSell, Alignment.MIDDLE_RIGHT);
    orderBookLayout.setComponentAlignment(orderBookBuy, Alignment.MIDDLE_LEFT);

    VerticalLayout orderBook = new VerticalLayout();
    orderBook.addComponent(orderBookLayout);

    orderBook.setCaption("Order Book");
    quoteUI.setCaption("Quote UI");
    userPortfolio.setCaption(Session.getCurrentUser().toUpperCase(Locale.US) + " - Portfolio Summary");

    orderBook.addStyleName("center-caption");
    quoteUI.addStyleName("center-caption");
    userPortfolio.addStyleName("center-caption");

    row1.addComponent(currentPriceChart);
    row2.addComponent(quantityChart);
    row3.setSpacing(true);
    row3.addComponent(orderBook);
    row3.addComponent(quoteUI);
    row3.addComponent(userPortfolio);
    row3.setExpandRatio(orderBook, 1.2f);
    row3.setExpandRatio(quoteUI, 1.0f);
    row3.setExpandRatio(userPortfolio, 1.0f);

    row1.setComponentAlignment(currentPriceChart, Alignment.MIDDLE_CENTER);
    row2.setComponentAlignment(quantityChart, Alignment.MIDDLE_CENTER);

    content.setSizeFull();
    this.setContent(content);

}

From source file:org.jdal.vaadin.ui.form.SimpleBoxFormBuilder.java

License:Apache License

/**
 * Gets current column pointed to cursor, create one if none.
 * @return a new or existent column Box.
 *//*  w  ww  .ja va 2 s.c  om*/
private VerticalLayout getColumn() {
    VerticalLayout column = null;
    if (index < columns.size()) {
        column = (VerticalLayout) columns.get(index);
    } else {
        column = Box.createVerticalBox();
        column.setSpacing(spacing);
        column.addStyleName("jd-box-column");

        if (debug)
            column.addStyleName("jd-box-column-debug");

        columns.add(column);
        container.addComponent(column);
        columnsWidth.add(SIZE_UNDEFINED);
    }

    return column;
}

From source file:org.jpos.qi.login.LoginView.java

License:Open Source License

private VerticalLayout createMainPanel(Component... components) {
    VerticalLayout vl = new VerticalLayout();
    vl.setSizeUndefined();/*from   ww w  .  java 2  s.c o m*/
    vl.addStyleName("login-panel");
    addComponent(vl);
    setComponentAlignment(vl, Alignment.MIDDLE_CENTER);

    for (Component c : components)
        vl.addComponent(c);
    return vl;
}

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

License:Open Source License

@PostConstruct
protected void init() {
    setSizeFull();/*from   w  w  w.  j  a  v  a2 s .  c o  m*/

    tabbedPanel = new TabbedPanel();

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

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

    table = new TreeTable();
    table.addStyleName(ValoTheme.TREETABLE_NO_HORIZONTAL_LINES);
    table.addStyleName(ValoTheme.TREETABLE_NO_STRIPES);
    table.addStyleName(ValoTheme.TREETABLE_NO_VERTICAL_LINES);
    table.addStyleName(ValoTheme.TREETABLE_BORDERLESS);
    table.setColumnHeaderMode(ColumnHeaderMode.HIDDEN);
    table.setSizeFull();
    table.setCacheRate(100);
    table.setPageLength(100);
    table.setImmediate(true);
    table.setSelectable(true);
    table.addItemClickListener(this);
    table.addStyleName("noselect");
    table.addContainerProperty("id", String.class, null);
    table.setVisibleColumns(new Object[] { "id" });
    table.setColumnExpandRatio("id", 1);
    addItem("Users", Icons.USER);
    addItem("Groups", Icons.GROUP);
    addItem("REST", Icons.REST);
    addItem("General Settings", Icons.SETTINGS);
    addItem("Mail Server", Icons.EMAIL);
    addItem("Notifications", Icons.NOTIFICATION);
    addItem("Logging", Icons.LOGGING);
    addItem("About", FontAwesome.QUESTION);

    VerticalLayout navigator = new VerticalLayout();
    navigator.addStyleName(ValoTheme.MENU_ROOT);
    navigator.setSizeFull();
    leftSplit.setFirstComponent(navigator);

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

    navigator.addComponent(table);
    navigator.setExpandRatio(table, 1);

    addComponent(leftSplit);

}

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

License:Open Source License

public ImportXmlTemplateWindow(ImportXmlListener listener) {
    this.listener = listener;
    setCaption("Import XML Template");
    setModal(true);/*from   w  w w  .j  a va  2 s.  c o  m*/
    setWidth(600.0f, Unit.PIXELS);
    setHeight(500.0f, Unit.PIXELS);

    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);
    layout.setMargin(true);
    layout.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
    setContent(layout);

    layout.addComponent(new Label("Import XML from either an XSD or WSDL source."));

    optionGroup = new OptionGroup("Select the location of the XSD or WSDL.");
    optionGroup.addItem(OPTION_TEXT);
    optionGroup.addItem(OPTION_FILE);
    optionGroup.addItem(OPTION_URL);
    optionGroup.setNullSelectionAllowed(false);
    optionGroup.setImmediate(true);
    optionGroup.select(OPTION_TEXT);
    optionGroup.addValueChangeListener(this);
    layout.addComponent(optionGroup);

    optionLayout = new VerticalLayout();
    editor = new AceEditor();
    editor.setCaption("Enter the XML text:");
    editor.setMode(AceMode.xml);
    editor.setWidth(100f, Unit.PERCENTAGE);
    editor.setHighlightActiveLine(true);
    editor.setShowPrintMargin(false);

    upload = new Upload(null, this);
    upload.addSucceededListener(this);
    upload.setButtonCaption(null);
    urlTextField = new TextField("Enter the URL:");
    urlTextField.setWidth(100.0f, Unit.PERCENTAGE);
    layout.addComponent(optionLayout);
    layout.setExpandRatio(optionLayout, 1.0f);
    rebuildOptionLayout();

    Button importButton = new Button("Import");
    importButton.addClickListener(this);
    layout.addComponent(importButton);
}

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

License:Open Source License

protected AbstractLayout createSettingsLayout() {
    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();// ww w . j a va 2  s . com
    layout.setMargin(new MarginInfo(false, true, false, true));
    layout.addStyleName("v-scrollable");
    FormLayout settingsLayout = new FormLayout();

    Settings settings = settingsProvider.get();
    TypedProperties properties = settings.getProperties();

    rowsToFetchField = new TextField("Max Results");
    rowsToFetchField.setColumns(6);
    rowsToFetchField.setValidationVisible(true);
    rowsToFetchField.setConverter(Integer.class);
    rowsToFetchField.setValue(properties.getProperty(SQL_EXPLORER_MAX_RESULTS, "100"));
    settingsLayout.addComponent(rowsToFetchField);

    delimiterField = new TextField("Delimiter");
    delimiterField.setValue(properties.getProperty(SQL_EXPLORER_DELIMITER, ";"));
    settingsLayout.addComponent(delimiterField);

    excludeTablesWithPrefixField = new TextField("Hide Tables (regex)");
    excludeTablesWithPrefixField.setValue(properties.getProperty(SQL_EXPLORER_EXCLUDE_TABLES_REGEX));
    settingsLayout.addComponent(excludeTablesWithPrefixField);

    resultAsTextBox = new CheckBox("Result As Text");
    String resultAsTextValue = (properties.getProperty(SQL_EXPLORER_RESULT_AS_TEXT, "false"));
    if (resultAsTextValue.equals("true")) {
        resultAsTextBox.setValue(true);
    } else {
        resultAsTextBox.setValue(false);
    }
    settingsLayout.addComponent(resultAsTextBox);

    ignoreErrorsWhenRunningScript = new CheckBox("Ignore Errors When Running Scripts");
    String ignoreErrorsWhenRunningScriptTextValue = (properties
            .getProperty(SQL_EXPLORER_IGNORE_ERRORS_WHEN_RUNNING_SCRIPTS, "false"));
    if (ignoreErrorsWhenRunningScriptTextValue.equals("true")) {
        ignoreErrorsWhenRunningScript.setValue(true);
    } else {
        ignoreErrorsWhenRunningScript.setValue(false);
    }
    settingsLayout.addComponent(ignoreErrorsWhenRunningScript);

    autoCommitBox = new CheckBox("Auto Commit");
    String autoCommitValue = (properties.getProperty(SQL_EXPLORER_AUTO_COMMIT, "true"));
    if (autoCommitValue.equals("true")) {
        autoCommitBox.setValue(true);
    } else {
        autoCommitBox.setValue(false);
    }
    settingsLayout.addComponent(autoCommitBox);

    showRowNumbersBox = new CheckBox("Show Row Numbers");
    String showRowNumbersValue = (properties.getProperty(SQL_EXPLORER_SHOW_ROW_NUMBERS, "true"));
    if (showRowNumbersValue.equals("true")) {
        showRowNumbersBox.setValue(true);
    } else {
        showRowNumbersBox.setValue(false);
    }
    settingsLayout.addComponent(showRowNumbersBox);

    showResultsInNewTabsBox = new CheckBox("Always Put Results In New Tabs");
    String showResultsInNewTabsValue = (properties.getProperty(SQL_EXPLORER_SHOW_RESULTS_IN_NEW_TABS, "false"));
    if (showResultsInNewTabsValue.equals("true")) {
        showResultsInNewTabsBox.setValue(true);
    } else {
        showResultsInNewTabsBox.setValue(false);
    }
    settingsLayout.addComponent(showResultsInNewTabsBox);

    layout.addComponent(settingsLayout);
    return layout;

}

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

License:Open Source License

public SqlExplorer(String configDir, IDbProvider databaseProvider, ISettingsProvider settingsProvider,
        String user, float leftSplitSize, IDbMenuItem... additionalMenuItems) {
    this.databaseProvider = databaseProvider;
    this.settingsProvider = settingsProvider;
    this.savedSplitPosition = leftSplitSize;
    this.additionalMenuItems = additionalMenuItems;

    setSizeFull();//from w w  w.  j a v a 2s.  c  om
    addStyleName("sqlexplorer");

    VerticalLayout leftLayout = new VerticalLayout();
    leftLayout.setSizeFull();
    leftLayout.addStyleName(ValoTheme.MENU_ROOT);

    leftLayout.addComponent(buildLeftMenu());

    Panel scrollable = new Panel();
    scrollable.setSizeFull();

    dbTree = buildDbTree();
    scrollable.setContent(dbTree);

    leftLayout.addComponent(scrollable);
    leftLayout.setExpandRatio(scrollable, 1);

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

    VerticalLayout rightMenuWrapper = new VerticalLayout();
    rightMenuWrapper.setWidth(100, Unit.PERCENTAGE);
    rightMenuWrapper.addStyleName(ValoTheme.MENU_ROOT);
    contentMenuBar = new MenuBar();
    contentMenuBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
    contentMenuBar.setWidth(100, Unit.PERCENTAGE);
    addShowButton(contentMenuBar);

    rightMenuWrapper.addComponent(contentMenuBar);
    rightLayout.addComponent(rightMenuWrapper);

    contentTabs = new SqlExplorerTabPanel();
    contentTabs.addSelectedTabChangeListener(new SelectedTabChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            selectContentTab((IContentTab) contentTabs.getSelectedTab());
        }
    });
    rightLayout.addComponent(contentTabs);
    rightLayout.setExpandRatio(contentTabs, 1);

    addComponents(leftLayout, rightLayout);

    setSplitPosition(savedSplitPosition, Unit.PIXELS);
}

From source file:org.lucidj.vaadinui.Login.java

License:Apache License

@Override // LoginForm
protected Component createContent(TextField userNameField, PasswordField passwordField, Button loginButton) {
    // Save the predefined components
    this.userNameField = userNameField;
    this.passwordField = passwordField;
    this.loginButton = loginButton;

    // Make LoginForm container full-screen
    setSizeFull();//  ww w  .  ja  v a  2s  .  c om

    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();
    layout.addStyleName("login-wallpaper");

    final VerticalLayout loginPanel = new VerticalLayout();
    loginPanel.setSizeUndefined();
    loginPanel.setMargin(true);
    loginPanel.setSpacing(true);
    Responsive.makeResponsive(loginPanel);
    loginPanel.addStyleName("card");

    //--------
    // HEADER
    //--------

    final HorizontalLayout labels = new HorizontalLayout();
    labels.setWidth("100%");

    final Label title = new Label("<h3><strong>LucidJ</strong> Console</h3>", ContentMode.HTML);
    labels.addComponent(title);
    labels.setExpandRatio(title, 1);

    loginPanel.addComponent(labels);

    //--------
    // FIELDS
    //--------

    HorizontalLayout fields = new HorizontalLayout();
    fields.setSpacing(true);
    fields.addStyleName("fields");

    userNameField.setImmediate(true);
    userNameField.setTextChangeEventMode(AbstractTextField.TextChangeEventMode.EAGER);
    final ShortcutListener username_enter_listener = new ShortcutListener("Next field (Tab)",
            ShortcutAction.KeyCode.ENTER, null) {
        @Override
        public void handleAction(Object o, Object o1) {
            passwordField.setValue("");
            passwordField.focus();
        }
    };
    userNameField.addTextChangeListener(new FieldEvents.TextChangeListener() {
        @Override
        public void textChange(FieldEvents.TextChangeEvent textChangeEvent) {
            show_default_message();

            int new_username_length = textChangeEvent.getText().length();

            // Check for autofill
            if (userNameField.isEmpty() && new_username_length > 1 && !userNameField_filling) {
                // This is autofill
                userNameField.removeShortcutListener(username_enter_listener);
                userNameField.setCursorPosition(new_username_length);
                userNameField.setSelectionRange(0, new_username_length);
            } else {
                userNameField_filling = true;
                passwordField.setValue("");
                userNameField.addShortcutListener(username_enter_listener);
            }
        }
    });
    userNameField.addFocusListener(new FieldEvents.FocusListener() {
        @Override
        public void focus(FieldEvents.FocusEvent focusEvent) {
            // Cursor on username, Enter jump to password
            loginButton.removeClickShortcut();
            userNameField.addShortcutListener(username_enter_listener);
        }
    });
    userNameField.addBlurListener(new FieldEvents.BlurListener() {
        @Override
        public void blur(FieldEvents.BlurEvent blurEvent) {
            // Cursor on password or elsewhere, enter submits
            userNameField.removeShortcutListener(username_enter_listener);
            loginButton.setClickShortcut(ShortcutAction.KeyCode.ENTER);
        }
    });

    passwordField.setImmediate(true);
    passwordField.setTextChangeEventMode(AbstractTextField.TextChangeEventMode.EAGER);
    passwordField.addTextChangeListener(new FieldEvents.TextChangeListener() {
        @Override
        public void textChange(FieldEvents.TextChangeEvent textChangeEvent) {
            show_default_message();
        }
    });

    loginButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
    loginButton.setDisableOnClick(true);

    fields.addComponents(userNameField, passwordField, loginButton);
    fields.setComponentAlignment(loginButton, Alignment.BOTTOM_LEFT);

    loginPanel.addComponent(fields);

    //--------
    // FOOTER
    //--------

    loginPanel.addComponent(new CheckBox("Remember me", true));

    loginPanel.addComponent(message_label);
    show_default_message();

    layout.addComponent(loginPanel);
    layout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
    return (layout);
}

From source file:org.opencms.ui.components.CmsBasicDialog.java

License:Open Source License

/**
 * Creates a resource list panel.<p>
 *
 * @param caption the caption to use/*from w  ww  .j  a v a  2  s . c o  m*/
 * @param resources the resources
 *
 * @return the panel
 */
protected Panel createResourceListPanel(String caption, List<CmsResource> resources) {

    Panel result = new Panel(caption);
    result.addStyleName("v-scrollable");
    result.setSizeFull();
    VerticalLayout resourcePanel = new VerticalLayout();
    result.setContent(resourcePanel);
    resourcePanel.addStyleName(OpenCmsTheme.REDUCED_MARGIN);
    resourcePanel.addStyleName(OpenCmsTheme.REDUCED_SPACING);
    resourcePanel.setSpacing(true);
    resourcePanel.setMargin(true);
    for (CmsResource resource : resources) {
        resourcePanel.addComponent(new CmsResourceInfo(resource));
    }
    return result;
}

From source file:org.opencms.ui.editors.messagebundle.CmsMessageBundleEditor.java

License:Open Source License

/**
 * Creates the main component of the editor with all sub-components.
 * @return the completely filled main component of the editor.
 * @throws IOException thrown if setting the table's content data source fails.
 * @throws CmsException thrown if setting the table's content data source fails.
 *///  w w w. j a  v a2 s. c om
private Component createMainComponent() throws IOException, CmsException {

    VerticalLayout mainComponent = new VerticalLayout();
    mainComponent.setSizeFull();
    mainComponent.addStyleName("o-message-bundle-editor");
    m_table = createTable();
    Panel navigator = new Panel();
    navigator.setSizeFull();
    navigator.setContent(m_table);
    navigator.addActionHandler(new CmsMessageBundleEditorTypes.TableKeyboardHandler(m_table));
    navigator.addStyleName("v-panel-borderless");

    mainComponent.addComponent(m_options.getOptionsComponent());
    mainComponent.addComponent(navigator);
    mainComponent.setExpandRatio(navigator, 1f);
    m_options.updateShownOptions(m_model.hasMasterMode(), m_model.canAddKeys());
    return mainComponent;
}