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:de.catma.ui.dialog.FormDialog.java

License:Open Source License

private void initComponents(String caption, final PropertysetItem propertysetItem,
        FormFieldFactory formFieldFactory) {

    setSizeFull();/* ww  w  .j a v a  2 s.  c  o  m*/
    setSpacing(true);

    dialogWindow = new Window(caption);
    dialogWindow.setModal(true);

    form = new Form();
    if (formFieldFactory != null) {
        form.setFormFieldFactory(formFieldFactory);
    }
    form.setSizeFull();
    form.setWriteThrough(false);
    form.setInvalidCommitted(false);
    form.setItemDataSource(propertysetItem);

    addComponent(form);

    HorizontalLayout buttonPanel = new HorizontalLayout();
    buttonPanel.setSpacing(true);

    btSave = new Button("Save");

    btSave.setClickShortcut(KeyCode.ENTER);

    btCancel = new Button("Cancel");
    buttonPanel.addComponent(btSave);
    buttonPanel.addComponent(btCancel);

    addComponent(buttonPanel);
    this.setComponentAlignment(buttonPanel, Alignment.BOTTOM_RIGHT);

    dialogWindow.addComponent(this);

    form.focus();
}

From source file:de.catma.ui.dialog.UploadDialog.java

License:Open Source License

private void initComponents() {
    setSizeFull();// w w  w  .  j  av  a  2s.  c om
    setSpacing(true);

    dialogWindow = new Window(caption);
    dialogWindow.setModal(true);

    upload = new Upload("Please select a file to upload", new DataReceiver(data));
    upload.setButtonCaption("Select file");
    upload.setImmediate(true);

    addComponent(upload);
    pi = new ProgressIndicator();
    pi.setVisible(false);
    addComponent(pi);

    HorizontalLayout buttonPanel = new HorizontalLayout();
    buttonPanel.setSpacing(true);

    btCancel = new Button("Cancel");
    buttonPanel.addComponent(btCancel);

    addComponent(buttonPanel);
    this.setComponentAlignment(buttonPanel, Alignment.BOTTOM_RIGHT);

    dialogWindow.addComponent(this);

    upload.focus();

}

From source file:de.catma.ui.repository.AuthenticationDialog.java

License:Open Source License

private void initComponents() {
    setSizeFull();/*from w w w  . j  a va 2s .  com*/
    setSpacing(true);

    dialogWindow = new Window(caption);
    dialogWindow.setModal(true);

    HorizontalLayout buttonPanel = new HorizontalLayout();
    buttonPanel.setSpacing(true);

    btCancel = new Button("Cancel");
    buttonPanel.addComponent(btCancel);

    addComponent(buttonPanel);
    this.setComponentAlignment(buttonPanel, Alignment.BOTTOM_RIGHT);

    dialogWindow.addComponent(this);

}

From source file:de.catma.ui.tagger.PropertyEditDialog.java

License:Open Source License

private void initComponents() {
    VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setMargin(true);//  w  w  w.j  a  v  a2s.c o m
    mainLayout.setSpacing(true);
    mainLayout.setSizeFull();

    hintText = new Label("Please use the check boxes to set or unset values.");
    mainLayout.addComponent(hintText);

    propertyTree = new TreeTable();
    propertyTree.setSelectable(true);

    propertyTree.setSizeFull();
    propertyTree.setPageLength(10);
    propertyTree.setImmediate(true);

    propertyTree.focus();
    propertyTree.addShortcutListener(
            new AbstractField.FocusShortcut(propertyTree, KeyCode.ARROW_UP, ModifierKey.CTRL));

    propertyTree.addContainerProperty(TreePropertyName.property, String.class, "");
    propertyTree.setColumnHeader(TreePropertyName.property, "Property");

    propertyTree.addContainerProperty(TreePropertyName.icon, Resource.class, "");

    propertyTree.addContainerProperty(TreePropertyName.value, String.class, "");
    propertyTree.setColumnHeader(TreePropertyName.value, "Value");

    propertyTree.addContainerProperty(TreePropertyName.assigned, CheckBox.class, "");
    propertyTree.setColumnHeader(TreePropertyName.assigned, "Assigned");

    propertyTree.setItemCaptionPropertyId(TreePropertyName.property);
    propertyTree.setItemIconPropertyId(TreePropertyName.icon);

    propertyTree.setVisibleColumns(
            new Object[] { TreePropertyName.property, TreePropertyName.value, TreePropertyName.assigned });

    mainLayout.addComponent(propertyTree);
    mainLayout.setExpandRatio(propertyTree, 1.0f);
    HorizontalLayout comboBox = new HorizontalLayout();
    comboBox.setSpacing(true);

    newValueInput = new FilterExposingComboBox("Add ad hoc value");
    newValueInput.setTextInputAllowed(true);
    newValueInput.setNewItemsAllowed(true);

    newValueInput.setImmediate(true);
    newValueInput.addShortcutListener(
            new AbstractField.FocusShortcut(newValueInput, KeyCode.ARROW_DOWN, ModifierKey.CTRL));

    comboBox.addComponent(newValueInput);

    btAdd = new Button("+");
    btAdd.setClickShortcut(KeyCode.INSERT);
    comboBox.addComponent(btAdd);
    comboBox.setComponentAlignment(btAdd, Alignment.BOTTOM_RIGHT);

    mainLayout.addComponent(comboBox);

    hintText = new Label("New property values, that are created ad hoc, exist only for this tag instance! "
            + "For the creation of new systematic values use the Tag Type Manager.");
    mainLayout.addComponent(hintText);

    HorizontalLayout buttonPanel = new HorizontalLayout();
    buttonPanel.setSpacing(true);

    btSave = new Button("Save");
    btSave.setClickShortcut(KeyCode.ENTER, ModifierKey.ALT);
    buttonPanel.addComponent(btSave);
    buttonPanel.setComponentAlignment(btSave, Alignment.MIDDLE_RIGHT);

    btCancel = new Button("Cancel");
    btCancel.setClickShortcut(KeyCode.ESCAPE);
    buttonPanel.addComponent(btCancel);
    buttonPanel.setComponentAlignment(btCancel, Alignment.MIDDLE_RIGHT);

    mainLayout.addComponent(buttonPanel);
    mainLayout.setComponentAlignment(buttonPanel, Alignment.MIDDLE_RIGHT);

    setContent(mainLayout);
    setWidth("40%");
    setHeight("80%");
    setModal(true);
    center();
}

From source file:de.decidr.ui.view.TenantSettingsComponent.java

License:Apache License

/**
 * This method changes the view from advanced to basic. So only the basic
 * information are visible and the tenant can choose a given background or
 * font./*  ww w.ja  v a2  s  .  co  m*/
 */
public void changeToBasic() {
    backgroundSelect = new NativeSelect("Background");
    foregroundSelect = new NativeSelect("Foreground");
    fontSelect = new NativeSelect("Font");
    fontSizeSelect = new NativeSelect("Font Size");

    fillSelects();

    showAdvancedOptionsButton = new Button("Show CSS (advanced)");
    showAdvancedOptionsButton.setSwitchMode(true);
    showAdvancedOptionsButton.addListener(new Button.ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            changeToAdvanced();
        }
    });

    getSchemeHorizontalLayout().removeAllComponents();
    getSchemeHorizontalLayout().addComponent(backgroundSelect);
    getSchemeHorizontalLayout().addComponent(foregroundSelect);
    getSchemeHorizontalLayout().addComponent(fontSelect);
    getSchemeHorizontalLayout().addComponent(fontSizeSelect);
    getSchemeHorizontalLayout().addComponent(showAdvancedOptionsButton);
    getSchemeHorizontalLayout().setComponentAlignment(showAdvancedOptionsButton, Alignment.BOTTOM_RIGHT);

    advancedMode = false;
}

From source file:de.dimm.vsm.vaadin.VSMCMain.java

public <T> void SelectObject(Class<T> t, String caption, String buttonCaption, List<T> list,
        final SelectObjectCallback cb) {

    if (list.size() == 1) {
        cb.SelectedAction(list.get(0));/*  w w  w. ja  va  2 s .  co  m*/
        return;
    }
    final NativeSelect sel = new NativeSelect(caption);
    sel.setNewItemsAllowed(false);
    sel.setInvalidAllowed(false);
    sel.setNullSelectionAllowed(false);

    for (int i = 0; i < list.size(); i++) {
        Object object = list.get(i);
        sel.addItem(object);
    }
    if (!list.isEmpty())
        sel.setValue(list.get(0));

    VerticalLayout vl = new VerticalLayout();
    vl.setSpacing(true);
    NativeButton ok = new NativeButton(buttonCaption);

    final Window win = new Window(Txt("Auswahl") + " " + caption);
    win.setWidth("350px");
    win.center();

    ok.addListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            getRootWin().removeWindow(win);

            cb.SelectedAction(sel.getValue());
        }
    });

    vl.addComponent(sel);
    sel.setWidth("80%");
    vl.addComponent(ok);
    vl.setComponentAlignment(ok, Alignment.BOTTOM_RIGHT);

    vl.setSizeFull();
    win.addComponent(vl);
    getRootWin().addWindow(win);
}

From source file:de.escidoc.admintool.view.contentmodel.ContentModelEditView.java

License:Open Source License

private void addButtons(final HorizontalLayout footerLayout) {
    addSaveButton();//ww w.  jav a  2s  .  com
    addCancelButton();

    footerLayout.addComponent(buttonLayout);
    footerLayout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT);
}

From source file:de.escidoc.admintool.view.user.UserAddView.java

License:Open Source License

private Component createLayout(final String nameLabel, final AbstractTextField textField, final int leftMargin,
        final boolean required) {

    final HorizontalLayout hor = new HorizontalLayout();
    hor.setHeight(37, UNITS_PIXELS);/* w ww.ja  v a2s  .  c om*/
    hor.addComponent(new Label(" "));

    final String text = Constants.P_ALIGN_RIGHT + nameLabel + Constants.P;
    Label l;
    hor.addComponent(l = new Label(text, Label.CONTENT_XHTML));
    l.setWidth(leftMargin + Constants.PX);

    if (required) {
        hor.addComponent(new Label("&nbsp;<span style=\"color:red; position:relative; top:13px;\">*</span>",
                Label.CONTENT_XHTML));
    } else {
        hor.addComponent(new Label("&nbsp;&nbsp;", Label.CONTENT_XHTML));
    }
    hor.addComponent(textField);
    hor.setComponentAlignment(textField, Alignment.BOTTOM_RIGHT);
    hor.addComponent(new Label(" "));
    hor.setSpacing(false);
    return hor;
}

From source file:de.escidoc.admintool.view.util.LayoutHelper.java

License:Open Source License

/**
 * Helper method. Puts a blank in front of a component.
 * //from w w w. j ava 2  s  .co  m
 * @param label
 *            The label in front of the control.
 * @param comp
 *            The component to display.
 * @param width
 *            the fixed size of the label. The parameter has to be in CSS style, i.e. 400px for instance.
 * @param required
 *            should it be marked with an asterisk.
 * @return The component in an horizontal layout. A blank in front and afterwards is inserted.
 */
public static synchronized HorizontalLayout create(final String label, final Component comp, final int width,
        final boolean required) {

    final HorizontalLayout hor = new HorizontalLayout();
    hor.setHeight(Constants.DEFAULT_HEIGHT);
    hor.addComponent(new Label(" "));

    final String text = Constants.P_ALIGN_RIGHT + label + Constants.P;
    Label l;
    hor.addComponent(l = new Label(text, Label.CONTENT_XHTML));
    l.setSizeUndefined();
    l.setWidth(width + Constants.PX);
    hor.setComponentAlignment(l, Alignment.BOTTOM_RIGHT);

    if (required) {
        hor.addComponent(new Label("&nbsp;<span style=\"color:red; position:relative; top:13px;\">*</span>",
                Label.CONTENT_XHTML));
    } else {
        hor.addComponent(new Label("&nbsp;&nbsp;", Label.CONTENT_XHTML));
    }
    hor.addComponent(comp);
    hor.setComponentAlignment(comp, Alignment.BOTTOM_RIGHT);
    hor.addComponent(new Label(" "));
    hor.setSpacing(false);
    return hor;
}

From source file:de.escidoc.admintool.view.util.LayoutHelper.java

License:Open Source License

/**
 * Helper method. Puts a blank in front of a component.
 * //from   ww  w  .  jav a 2 s  . co  m
 * @param label
 *            The label in front of the control.
 * @param comp
 *            The component to display.
 * @param width
 *            the fixed size of the label. The parameter has to be in CSS style, i.e. 400px for instance.
 * @param required
 *            should it be marked with an asterisk.
 * @return The component in an horizontal layout. A blank in front and afterwards is inserted.
 */
public static synchronized HorizontalLayout create(final String label, final CheckBox comp, final int width,
        final boolean required) {
    final HorizontalLayout hor = new HorizontalLayout();
    hor.setHeight(Constants.DEFAULT_HEIGHT);
    hor.addComponent(new Label(" "));
    final String text = Constants.P_ALIGN_RIGHT + label + Constants.P;
    Label l;
    hor.addComponent(l = new Label(text, Label.CONTENT_XHTML));
    l.setSizeUndefined();
    l.setWidth(width + Constants.PX);
    hor.setComponentAlignment(l, Alignment.MIDDLE_RIGHT);

    if (required) {
        hor.addComponent(new Label("&nbsp;<span style=\"color:red; position:relative; top:13px;\">*</span>",
                Label.CONTENT_XHTML));
    } else {
        hor.addComponent(new Label("&nbsp;&nbsp;", Label.CONTENT_XHTML));
    }
    hor.addComponent(comp);
    hor.setComponentAlignment(comp, Alignment.BOTTOM_RIGHT);
    hor.addComponent(new Label(" "));
    hor.setSpacing(false);
    return hor;
}