Example usage for com.vaadin.ui Alignment TOP_RIGHT

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

Introduction

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

Prototype

Alignment TOP_RIGHT

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

Click Source Link

Usage

From source file:pt.ist.vaadinframework.ui.PaginatedSorterViewer.java

License:Open Source License

public void setFilter(Object[] filterIds, String[] filterLabels) {
    setFilter(Alignment.TOP_RIGHT, filterIds, filterLabels);
}

From source file:ru.codeinside.gses.webui.form.GridForm.java

License:Mozilla Public License

void buildControls(final FieldTree.Entry entry, int level) {
    switch (entry.type) {
    case ITEM:/*from   w  ww. ja v a2 s .co m*/
    case BLOCK:
        if (!entry.readable)
            break; // ?   ? ? ?,       
        if (isNotBlank(entry.caption)) {
            Label caption = new Label(entry.caption);
            caption.setStyleName("right");
            if (entry.type == FieldTree.Type.BLOCK) {
                caption.addStyleName("bold");
            }
            caption.setWidth(300, UNITS_PIXELS);
            caption.setHeight(100, UNITS_PERCENTAGE);
            gridLayout.addComponent(caption, level, entry.index, valueColumn - 1, entry.index);
            gridLayout.setComponentAlignment(caption, Alignment.TOP_RIGHT);
        }
        final Component sign = entry.sign;
        if (sign != null) {
            gridLayout.addComponent(sign, valueColumn + 1, entry.index);
            gridLayout.setComponentAlignment(sign, Alignment.TOP_LEFT);
            if (!entry.readOnly) {
                entry.field.addListener(new ValueChangeListener() {
                    @Override
                    public void valueChange(Property.ValueChangeEvent event) {
                        entry.field.removeListener(this);
                        gridLayout.removeComponent(sign);
                        entry.sign = null;
                    }
                });
            }
        }
        // ???  
        addField(entry.path, entry.field);
        break;
    case CONTROLS:
        HorizontalLayout layout = new HorizontalLayout();
        layout.setImmediate(true);
        layout.setSpacing(true);
        layout.setMargin(false, false, true, false);
        Button plus = createButton("+");
        Button minus = createButton("-");
        layout.addComponent(plus);
        layout.addComponent(minus);
        FieldTree.Entry block = getBlock(entry);
        plus.addListener(new AppendAction(entry, minus));
        minus.addListener(new RemoveAction(entry, plus));
        if (block.field != null) {
            final StringBuilder sb = new StringBuilder();
            if (!isBlank(block.caption)) {
                sb.append(' ').append('\'').append(block.caption).append('\'');
            }
            if (block.field.getDescription() != null) {
                sb.append(' ').append('(').append(block.field.getDescription()).append(')');
            }
            plus.setDescription("" + sb);
            minus.setDescription("" + sb);
        }
        updateCloneButtons(plus, minus, block);
        gridLayout.addComponent(layout, valueColumn, entry.index, valueColumn, entry.index);
        break;
    case CLONE:
        int y = entry.index;
        int dy = entry.getControlsCount() - 1;
        Label cloneCaption = new Label(entry.cloneIndex + ")");
        cloneCaption.setWidth(20, UNITS_PIXELS);
        cloneCaption.setStyleName("right");
        cloneCaption.addStyleName("bold");
        gridLayout.addComponent(cloneCaption, level - 1, y, level - 1, y + dy);
        gridLayout.setComponentAlignment(cloneCaption, Alignment.TOP_RIGHT);
        break;
    case ROOT:
        break;
    default:
        throw new IllegalStateException(
                "??? ?  ? " + entry.type);
    }

    if (entry.items != null) { //  ?  ?
        if (entry.type == FieldTree.Type.BLOCK) {
            level++;
        }
        for (FieldTree.Entry child : entry.items) {
            buildControls(child, level);
        }
    }
}

From source file:uk.co.intec.keyDatesApp.components.Pager.java

License:Apache License

/**
 * Load the pager components/*from  w  ww . j a va 2 s  .c  o  m*/
 */
public void loadContent() {
    final HorizontalLayout pagerSizePanel = loadPagerSizesButtons();
    // loadPagerPagesButtons(); No point, data has not yet been loaded
    addComponents(pagerSizePanel, getPagerPagesPanel());
    setSizeFull();
    setComponentAlignment(getPagerPagesPanel(), Alignment.TOP_RIGHT);
}

From source file:VaadinIRC.GUI.channelGUI.java

License:Open Source License

/**
 * Creates the GUI for a channel.//from   w ww . jav a2  s  .  c  o  m
 */
public void createChannelGUI() {
    panel = new Panel();
    panel.setCaption(channelName);
    panel.setSizeFull();
    panel.getContent().setSizeFull();
    AbstractLayout panelLayout = (AbstractLayout) panel.getContent();
    panelLayout.setMargin(false);
    panel.setImmediate(true);
    labelTitle.setValue("<b>" + channelName + "</b>");

    VerticalLayout mainVerticalLayout = new VerticalLayout();
    mainVerticalLayout.setSizeFull();
    // Top bar containing channel title & topright buttons
    GridLayout topGrid = new GridLayout(2, 1);
    topGrid.setStyleName("topBar");
    topGrid.addComponent(labelTitle);
    topGrid.setSizeFull();
    labelTitle.setSizeFull();
    HorizontalLayout hori = new HorizontalLayout();
    hori.setStyleName("rightTopBar");
    hori.setWidth(100, Sizeable.UNITS_PIXELS);
    hori.addComponent(buttonSettings);
    hori.addComponent(buttonChangeNick);
    hori.addComponent(buttonRefreshUsernames);
    topGrid.addComponent(hori);
    topGrid.setComponentAlignment(hori, Alignment.TOP_RIGHT);
    mainVerticalLayout.addComponent(topGrid);
    mainVerticalLayout.setExpandRatio(topGrid, 0.05f);
    // Message area & table of nicknames
    HorizontalLayout horizontal = new HorizontalLayout();
    horizontal.setSpacing(false);
    horizontal.setMargin(false);
    horizontal.setSizeFull();
    horizontal.addComponent(panelMessages);
    mainVerticalLayout.addComponent(horizontal);
    mainVerticalLayout.setExpandRatio(horizontal, 0.90f);
    if (channelName.startsWith("#")) {
        horizontal.addComponent(tableNicknames);
        horizontal.setExpandRatio(panelMessages, 0.8f);
        horizontal.setExpandRatio(tableNicknames, 0.2f);
    }
    // Send message textfield & send button
    HorizontalLayout bottomBar = new HorizontalLayout();
    //bottomBar.setWidth(100, Sizeable.UNITS_PERCENTAGE);
    bottomBar.setSizeFull();
    //bottomBar.setSpacing(true);
    //bottomBar.setMargin(true, false, false, false);
    bottomBar.addComponent(textfieldMessagefield);
    bottomBar.addComponent(buttonSendMessage);
    bottomBar.setExpandRatio(textfieldMessagefield, 1f);
    bottomBar.setExpandRatio(buttonSendMessage, 0f);
    mainVerticalLayout.addComponent(bottomBar);
    mainVerticalLayout.setExpandRatio(bottomBar, 0.05f);

    horizontal.setImmediate(true);
    panelMessages.setImmediate(true);
    tableNicknames.setImmediate(true);
    textfieldMessagefield.setImmediate(true);
    tableNicknames.addContainerProperty("Rights", String.class, null);
    tableNicknames.addContainerProperty("Nicknames", String.class, null);
    tableNicknames.setSelectable(true);

    textfieldMessagefield.focus();

    //mainVerticalLayout.setSizeFull();
    panel.addComponent(mainVerticalLayout);
}