Example usage for com.vaadin.ui Alignment BOTTOM_RIGHT

List of usage examples for com.vaadin.ui Alignment BOTTOM_RIGHT

Introduction

In this page you can find the example usage for com.vaadin.ui Alignment BOTTOM_RIGHT.

Prototype

Alignment BOTTOM_RIGHT

To view the source code for com.vaadin.ui Alignment BOTTOM_RIGHT.

Click Source Link

Usage

From source file:org.investovator.ui.utils.dashboard.dataplayback.BasicMainView.java

License:Open Source License

private Component setupBuySellForm() {
    VerticalLayout formContent = new VerticalLayout();

    FormLayout form = new FormLayout();

    //account balance
    this.accBalance = new Label("");
    this.accBalance.setCaption("Account Balance");

    //stocks list
    final ComboBox stocksList = new ComboBox();
    stocksList.setCaption("Stock");
    stocksList.setNullSelectionAllowed(false);
    for (String stock : DataPlaybackEngineStates.playingSymbols) {
        stocksList.addItem(stock);/*from w ww .  ja  va 2 s .com*/
    }
    //stocksList.setWidth("75%");

    //side
    final NativeSelect orderSide = new NativeSelect();
    orderSide.setCaption("Side");
    orderSide.addItem(OrderType.BUY);
    orderSide.addItem(OrderType.SELL);
    //orderSide.setWidth("90%");
    orderSide.setSizeFull();
    orderSide.select(OrderType.BUY);
    orderSide.setNullSelectionAllowed(false);
    orderSide.setImmediate(true);

    //Quantity
    final TextField quantity = new TextField("Amount");
    //quantity.setWidth("75%");

    form.addComponent(accBalance);
    form.addComponent(stocksList);
    form.addComponent(orderSide);
    form.addComponent(quantity);

    formContent.addComponent(form);

    HorizontalLayout bBar = getBuySellForumButtons(stocksList, quantity, orderSide);
    formContent.addComponent(bBar);
    formContent.setComponentAlignment(bBar, Alignment.BOTTOM_RIGHT);
    //content.setComponentAlignment(nextDayB, Alignment.MIDDLE_CENTER);

    return formContent;
}

From source file:org.jpos.qi.Header.java

License:Open Source License

public Header(QI app) {
    super();//from  w  w w .  j av  a 2s  .  c o m
    this.app = app;
    setSizeFull();
    setPrimaryStyleName("valo-menuitems");

    //        if (QIResources.JPOS_LOGO_TINY != null){
    //            Link homeLink = createLogo();
    //            addComponent(homeLink);
    //            setComponentAlignment(homeLink, Alignment.TOP_LEFT);
    //            setExpandRatio(homeLink, 0.1f);
    //        }

    //        Layout search = createSearch();

    MenuBar mb = createMenu();
    if (mb != null) {
        addComponent(mb);
        setComponentAlignment(mb, Alignment.BOTTOM_RIGHT);
        setExpandRatio(mb, 0f);
    }
}

From source file:org.jpos.qi.InfoDialog.java

License:Open Source License

public InfoDialog(String caption, String info) {
    super(caption);
    setWidth("350px");
    setModal(true);/*  w w  w . j av a2  s  .  c o  m*/
    setResizable(false);
    close.setStyleName(ValoTheme.BUTTON_SMALL);

    VerticalLayout content = new VerticalLayout();
    content.setMargin(true);
    content.setSpacing(true);
    setContent(content);
    if (info != null) {
        Label l = new Label(info);
        l.setContentMode(ContentMode.HTML);
        content.addComponent(l);
    }
    HorizontalLayout hl = new HorizontalLayout();
    hl.setMargin(new MarginInfo(true, false, false, false));
    hl.setSpacing(true);
    hl.setWidth("100%");
    hl.addComponent(close);
    hl.setComponentAlignment(close, Alignment.BOTTOM_RIGHT);
    content.addComponent(hl);
}

From source file:org.jpos.qi.QIEntityView.java

License:Open Source License

protected HorizontalLayout createHeader(String title) {
    HorizontalLayout header = new HorizontalLayout();
    header.setWidth("100%");
    header.setSpacing(false);//from   w w  w  . jav a  2  s .c  o  m
    header.setMargin(new MarginInfo(false, true, false, true));
    Label lbl = new Label(title);
    lbl.addStyleName("h2");
    lbl.setSizeUndefined();
    lbl.setContentMode(ContentMode.HTML);
    header.addComponent(lbl);
    header.setComponentAlignment(lbl, Alignment.MIDDLE_LEFT);
    if (isGeneralView() && canAdd()) {
        Button addBtn = new Button(getApp().getMessage("add"));
        addBtn.addStyleName("borderless-colored");
        addBtn.setIcon(VaadinIcons.PLUS);
        addBtn.addClickListener(event -> navigateToNewRoute());
        header.addComponent(addBtn);
        header.setComponentAlignment(addBtn, Alignment.BOTTOM_RIGHT);
    }
    return header;
}

From source file:org.jumpmind.metl.ui.init.LoginDialog.java

License:Open Source License

public LoginDialog(ApplicationContext context, LoginListener loginListener) {
    super("Login to Metl");
    this.context = context;
    this.loginListener = loginListener;
    setWidth(300, Unit.PIXELS);//from   www  .  java 2 s .c  o  m
    setResizable(false);
    setReadOnly(true);
    setModal(true);
    setClosable(false);

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

    userField = new TextField("User Id");
    userField.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(userField);

    passwordField = new PasswordField("Password");
    passwordField.setImmediate(true);
    passwordField.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(passwordField);

    HorizontalLayout buttonLayout = new HorizontalLayout();
    Button loginButton = new Button("Login");
    loginButton.addClickListener(new LoginClickListener());
    loginButton.setStyleName("primary");
    loginButton.setClickShortcut(KeyCode.ENTER);
    buttonLayout.addComponent(loginButton);
    buttonLayout.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(buttonLayout);
    buttonLayout.addComponent(loginButton);
    buttonLayout.setComponentAlignment(loginButton, Alignment.BOTTOM_RIGHT);

    setContent(layout);
    userField.focus();
}

From source file:org.jumpmind.metl.ui.views.admin.LoggingPanel.java

License:Open Source License

public LoggingPanel(ApplicationContext context, TabbedPanel tabbedPanel) {
    this.context = context;
    this.tabbedPanel = tabbedPanel;
    this.backgroundRefresherService = context.getBackgroundRefresherService();
    if (LogUtils.isFileEnabled()) {
        logFile = new File(LogUtils.getLogFilePath());
    }//  w w  w.  j  a  v a  2 s  .c om
    setSizeFull();
    setSpacing(true);
    setMargin(true);

    HorizontalLayout topPanelLayout = new HorizontalLayout();
    topPanelLayout.setWidth(100, Unit.PERCENTAGE);
    topPanelLayout.setSpacing(true);

    Button refreshButton = new Button("Refresh");
    refreshButton.addClickListener(new ClickListener() {
        public void buttonClick(ClickEvent event) {
            refresh();
        }
    });
    topPanelLayout.addComponent(refreshButton);
    topPanelLayout.setComponentAlignment(refreshButton, Alignment.BOTTOM_LEFT);

    bufferSize = new TextField();
    bufferSize.setImmediate(true);
    bufferSize.setWidth(5, Unit.EM);
    bufferSize.setValue("1000");
    bufferSize.addValueChangeListener(new ValueChangeListener() {
        public void valueChange(ValueChangeEvent event) {
            refresh();
        }
    });
    topPanelLayout.addComponent(bufferSize);

    filter = new TextField();
    filter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    filter.setInputPrompt("Filter");
    filter.setIcon(FontAwesome.SEARCH);
    filter.setNullRepresentation("");
    filter.setImmediate(true);
    filter.setTextChangeEventMode(TextChangeEventMode.LAZY);
    filter.setTextChangeTimeout(200);
    filter.addValueChangeListener(new ValueChangeListener() {
        public void valueChange(ValueChangeEvent event) {
            refresh();
        }
    });
    topPanelLayout.addComponent(filter);
    topPanelLayout.setComponentAlignment(filter, Alignment.BOTTOM_LEFT);

    autoRefreshOn = new CheckBox("Auto Refresh");
    autoRefreshOn.setValue(true);
    autoRefreshOn.setImmediate(true);
    topPanelLayout.addComponent(autoRefreshOn);
    topPanelLayout.setComponentAlignment(autoRefreshOn, Alignment.BOTTOM_LEFT);

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

    if (logFile != null && logFile.exists()) {
        Button downloadButton = new Button("Download log file");
        downloadButton.addStyleName(ValoTheme.BUTTON_LINK);
        downloadButton.addStyleName(ValoTheme.BUTTON_SMALL);

        FileDownloader fileDownloader = new FileDownloader(getLogFileResource());
        fileDownloader.extend(downloadButton);
        topPanelLayout.addComponent(downloadButton);
        topPanelLayout.setComponentAlignment(downloadButton, Alignment.BOTTOM_RIGHT);
    }

    addComponent(topPanelLayout);

    logPanel = new Panel("Log Output");
    logPanel.setSizeFull();
    logView = new Label("", ContentMode.HTML);
    logView.setSizeUndefined();
    logPanel.setContent(logView);
    addComponent(logPanel);
    setExpandRatio(logPanel, 1);
    refresh();
    backgroundRefresherService.register(this);
}

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

License:Open Source License

@SuppressWarnings("serial")
@PostConstruct/*ww  w.ja  v  a  2 s.  c om*/
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.ReadOnlyTextAreaDialog.java

License:Open Source License

public ReadOnlyTextAreaDialog(final String title, final String value, Table table, Object[] primaryKeys,
        IDatabasePlatform platform, boolean isEncodedInHex, boolean isLob) {
    super(title);
    this.table = table;
    this.primaryKeys = primaryKeys;
    this.platform = platform;
    this.column = table == null ? null : table.getColumnWithName(title);

    wrapper = new VerticalLayout();
    wrapper.setMargin(true);/*  ww  w  .  ja va  2 s.  c o  m*/
    wrapper.setSizeFull();
    textField = new TextArea();
    textField.setSizeFull();
    textField.setWordwrap(false);
    wrapper.addComponent(textField);
    addComponent(wrapper, 1);

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

    if (value != null && isEncodedInHex) {
        displayBox = new ComboBox("Display As");
        displayBox.addItem("Hex");
        displayBox.addItem("Text");
        displayBox.addItem("Decimal");
        displayBox.setNullSelectionAllowed(false);
        displayBox.select("Hex");
        displayBox.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            @Override
            public void valueChange(ValueChangeEvent event) {
                updateTextField((String) displayBox.getValue(), value);
            }
        });
        buttonLayout.addComponent(displayBox);
    }

    if (table != null && isLob) {
        buildUploadButton(title, value);
        buildDownloadButton(title);
    }

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

    Button closeButton = buildCloseButton();
    buttonLayout.addComponent(closeButton);
    buttonLayout.setComponentAlignment(closeButton, Alignment.BOTTOM_RIGHT);

    textField.setValue(value);
    textField.addTextChangeListener(new TextChangeListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void textChange(TextChangeEvent event) {
            if (displayBox != null) {
                updateTextField((String) displayBox.getValue(), value);
            } else {
                textField.setValue(value);
            }
        }
    });
}

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

License:Open Source License

protected void createTableSelectionLayout(String titleKey) {

    this.addComponent(new Label(titleKey));

    HorizontalLayout schemaChooserLayout = new HorizontalLayout();
    schemaChooserLayout.setWidth(100, Unit.PERCENTAGE);
    schemaChooserLayout.setSpacing(true);
    this.addComponent(schemaChooserLayout);

    catalogSelect = new ComboBox("Catalog");
    catalogSelect.setImmediate(true);/*w  ww .j  a v  a 2  s .c o  m*/
    CommonUiUtils.addItems(getCatalogs(), catalogSelect);
    schemaChooserLayout.addComponent(catalogSelect);
    if (selectedTablesSet.iterator().hasNext()) {
        catalogSelect.select(selectedTablesSet.iterator().next().getCatalog());
    } else {
        catalogSelect.select(databasePlatform.getDefaultCatalog());
    }
    schemaSelect = new ComboBox("Schema");
    schemaSelect.setImmediate(true);
    CommonUiUtils.addItems(getSchemas(), schemaSelect);
    schemaChooserLayout.addComponent(schemaSelect);
    if (selectedTablesSet.iterator().hasNext()) {
        schemaSelect.select(selectedTablesSet.iterator().next().getSchema());
    } else {
        schemaSelect.select(databasePlatform.getDefaultSchema());
    }

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

    filterField = new TextField();
    filterField.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    filterField.setIcon(FontAwesome.SEARCH);
    filterField.setInputPrompt("Filter Tables");
    filterField.setNullRepresentation("");
    filterField.setImmediate(true);
    filterField.setTextChangeEventMode(TextChangeEventMode.LAZY);
    filterField.setTextChangeTimeout(200);
    filterField.addTextChangeListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;

        public void textChange(TextChangeEvent event) {
            filterField.setValue(event.getText());
            refreshTableOfTables();
        }
    });

    schemaChooserLayout.addComponent(filterField);
    schemaChooserLayout.setComponentAlignment(filterField, Alignment.BOTTOM_RIGHT);

    listOfTablesTable = CommonUiUtils.createTable();
    listOfTablesTable.setImmediate(true);
    listOfTablesTable.addItemClickListener(new ItemClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void itemClick(ItemClickEvent event) {
            CheckBox checkBox = (CheckBox) event.getItem().getItemProperty("selected").getValue();
            checkBox.setValue(!checkBox.getValue());
        }
    });
    listOfTablesTable.addContainerProperty("selected", CheckBox.class, null);
    listOfTablesTable.setColumnWidth("selected", UiConstants.TABLE_SELECTED_COLUMN_WIDTH);
    listOfTablesTable.setColumnHeader("selected", "");
    listOfTablesTable.addContainerProperty("table", String.class, null);
    listOfTablesTable.setColumnHeader("table", "");
    listOfTablesTable.setSizeFull();
    this.addComponent(listOfTablesTable);
    this.setExpandRatio(listOfTablesTable, 1);

    schemaSelect.addValueChangeListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {
            refreshTableOfTables();
        }
    });

    catalogSelect.addValueChangeListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {
            refreshTableOfTables();
        }
    });

    refreshTableOfTables();

}

From source file:org.lunifera.mobile.vaadin.ecview.presentation.internal.NavigationPagePresentation.java

License:Open Source License

/**
 * Sets the alignment to the component.//from  w  w w.  j av a  2 s.  c  o m
 * 
 * @param child
 * @param yAlignment
 */
protected void applyAlignment(Component child, YAlignment yAlignment) {

    if (yAlignment != null) {
        child.setSizeUndefined();
        switch (yAlignment) {
        case BOTTOM_CENTER:
            verticalLayout.setComponentAlignment(child, Alignment.BOTTOM_CENTER);
            break;
        case BOTTOM_FILL:
            verticalLayout.setComponentAlignment(child, Alignment.BOTTOM_LEFT);
            child.setWidth("100%");
            break;
        case BOTTOM_LEFT:
            verticalLayout.setComponentAlignment(child, Alignment.BOTTOM_LEFT);
            break;
        case BOTTOM_RIGHT:
            verticalLayout.setComponentAlignment(child, Alignment.BOTTOM_RIGHT);
            break;
        case MIDDLE_CENTER:
            verticalLayout.setComponentAlignment(child, Alignment.MIDDLE_CENTER);
            break;
        case MIDDLE_FILL:
            verticalLayout.setComponentAlignment(child, Alignment.MIDDLE_LEFT);
            child.setWidth("100%");
            break;
        case MIDDLE_LEFT:
            verticalLayout.setComponentAlignment(child, Alignment.MIDDLE_LEFT);
            break;
        case MIDDLE_RIGHT:
            verticalLayout.setComponentAlignment(child, Alignment.MIDDLE_RIGHT);
            break;
        case TOP_CENTER:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_CENTER);
            break;
        case TOP_FILL:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setWidth("100%");
            break;
        case TOP_LEFT:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            break;
        case TOP_RIGHT:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_RIGHT);
            break;
        case FILL_CENTER:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_CENTER);
            child.setHeight("100%");
            break;
        case FILL_FILL:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setWidth("100%");
            child.setHeight("100%");
            break;
        case FILL_LEFT:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setHeight("100%");
            break;
        case FILL_RIGHT:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_RIGHT);
            child.setHeight("100%");
            break;
        default:
            break;
        }
    }
}