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:com.foc.vaadin.gui.layouts.FVTableWrapperLayout.java

License:Apache License

public void addHeaderComponent_BeforeViewSelector(Component comp) {
    try {//from ww  w  .ja va2s . com
        if (getHeaderRightLayout() != null) {
            if (viewSelector != null) {
                int viewSelectorIndex = getHeaderRightLayout().getComponentIndex(viewSelector);
                getHeaderRightLayout().addComponent(comp, viewSelectorIndex);
                getHeaderRightLayout().setComponentAlignment(comp, Alignment.BOTTOM_RIGHT);
            } else {
                addHeaderComponent(comp);
            }
        }
    } catch (Exception ex) {
        addHeaderComponent(comp);
    }
}

From source file:com.foc.vaadin.gui.layouts.FVTableWrapperLayout.java

License:Apache License

public void addHeaderComponent(Component comp) {
    if (getHeaderRightLayout() != null) {
        getHeaderRightLayout().addComponent(comp);
        getHeaderRightLayout().setComponentAlignment(comp, Alignment.BOTTOM_RIGHT);
        addComponentToFocXMLLayoutMap(comp);
    }/*from   w  ww . j ava2  s.c  o  m*/
}

From source file:com.foc.vaadin.gui.layouts.FVTableWrapperLayout.java

License:Apache License

public void setFilterBoxListenerIfNecessary() {
    if (withFilterBox() && filter == null && getTableOrTree() != null
            && getTableOrTree().getFocDataWrapper() != null) {// !(tableOrTree
                                                                                                                                // instanceof
                                                                                                                                // FVPivotTable)
                                                                                                                                // &&
        filter = new Filter() {
            @Override/*from   w  w w  . j  a v a  2  s  .c  o  m*/
            public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException {
                boolean passes = true;

                if (getFilterText() != null && !getFilterText().isEmpty()) {
                    FocObject focObject = (FocObject) item;
                    passes = isIncludeObject(focObject);

                    if (!passes && getTableOrTree() != null && (getTableOrTree() instanceof FVTreeTable)
                            || (getTableOrTree() instanceof FVTreeGrid)) {
                        FTree tree = null;
                        if (getTableOrTree() instanceof FVTreeTable) {
                            FVTreeTable treeTable = (FVTreeTable) getTableOrTree();
                            tree = treeTable != null ? treeTable.getFTree() : null;
                        } else {
                            FVTreeGrid treeGrid = (FVTreeGrid) getTableOrTree();
                            tree = treeGrid != null ? treeGrid.getFTree() : null;
                        }

                        FNode node = tree != null ? tree.findNode_UsingMapOnly(focObject) : null;
                        if (node != null) {
                            node = node.getFatherNode();
                            focObject = node != null ? (FocObject) node.getObject() : null;
                            while (!passes && focObject != null) {
                                passes = isIncludeObject(focObject);
                                node = node.getFatherNode();
                                focObject = node != null ? (FocObject) node.getObject() : null;
                            }
                        }
                    }

                    // if(!passes && getTableOrTree() != null && getTableOrTree()
                    // instanceof FVTreeTable){
                    // FVTreeTable treeTable = (FVTreeTable) getTableOrTree();
                    // FTree tree = treeTable.getFTree();
                    //
                    // FNode node = tree.findNode_UsingMapOnly(focObject);
                    // if(node != null){
                    // node = node.getFatherNode();
                    // focObject = node != null ? (FocObject) node.getObject() : null;
                    // while(!passes && focObject != null){
                    // passes = isIncludeObject(focObject);
                    // node = node.getFatherNode();
                    // focObject = node != null ? (FocObject) node.getObject() : null;
                    // }
                    // }
                    // }
                }
                return passes;
            }

            @Override
            public boolean appliesToProperty(Object propertyId) {
                return false;
            }
        };

        FocDataWrapper dataWrapper = getTableOrTree().getFocDataWrapper();

        /*
         * if(getTableOrTree() instanceof FVPivotTable){ FVPivotTable pivotTable =
         * (FVPivotTable) getTableOrTree();
         * pivotTable.setFocData(pivotTable.getFTree()); dataWrapper =
         * pivotTable.getFocDataWrapper(); // FocPivotWrapper focPivotWrapper =
         * new FocPivotWrapper(pivotTable.getFTree()); // dataWrapper =
         * focPivotWrapper; }
         */
        dataWrapper.addContainerFilter(filter);

        filterTextField = new FVTextField();

        filterTextField.setInputPrompt(
                getFocXMLLayout() != null && getFocXMLLayout().isArabic() ? " " : "Search");
        filterTextField.setStyleName("filtertextField");
        filterTextField.addStyleName(FocXMLGuiComponentStatic.STYLE_NO_PRINT);
        filterTextField.addTextChangeListener(new TextChangeListener() {
            public void textChange(TextChangeEvent event) {
                String newFilterString = event.getText();
                quickFilterExecute(newFilterString);
            }
        });
        getHeaderRightLayout().addComponent(filterTextField);
        getHeaderRightLayout().setComponentAlignment(filterTextField, Alignment.BOTTOM_RIGHT);
    }
}

From source file:com.foc.vaadin.gui.layouts.FVTableWrapperLayout.java

License:Apache License

public void enableReplace() {
    if (replaceCheckBox == null) {
        replaceCheckBox = new FVCheckBox("Rep.");
        // replaceCheckBox.addStyleName("border");
        replaceCheckBox.setDescription(/* w w  w .j a va2  s .  c  o  m*/
                "Check to 'Replace' a line content upon Drag and Drop instead of inserting a new child line.");
        getHeaderRightLayout().addComponent(replaceCheckBox);
        getHeaderRightLayout().setComponentAlignment(replaceCheckBox, Alignment.BOTTOM_RIGHT);
    }
}

From source file:com.foc.vaadin.gui.layouts.FVWrapperLayout.java

License:Apache License

public FVWrapperLayout(Component component, String label, String width) {
    this.caption = new Label(label);
    caption.setWidth(width);//from   ww w .j  av  a  2 s .  co  m

    addComponent(this.caption);
    setComponentAlignment(caption, Alignment.BOTTOM_RIGHT);
    addComponent(component);
}

From source file:com.foc.vaadin.gui.layouts.validationLayout.FVValidationLayout.java

License:Apache License

public void addApplyDiscardButtons(boolean showBackButton) {
    boolean showValidationAndSave = validationSettings != null && validationSettings.isWithApply();
    boolean showSave = validationSettings != null && validationSettings.isWithSave();
    boolean showDiscard = validationSettings != null && validationSettings.isWithDiscard();
    boolean showGoBack = validationSettings == null && showBackButton;

    ICentralPanel centralPanel = getCentralPanel();
    if (centralPanel instanceof FocXMLLayout) {
        FocXMLLayout layout = (FocXMLLayout) centralPanel;

        if (Globals.isValo()) {
            Component comp = valo_GetNotCompletedYet(true);
            if (comp != null) {
                mainHorizontalLayout.addComponent(comp);
                mainHorizontalLayout.setComponentAlignment(comp, Alignment.MIDDLE_RIGHT);
            }// ww w .  jav a  2s  . c  om
        }

        if (layout.getTableTreeThatOpenedThisForm() != null
                && layout.getTableTreeThatOpenedThisForm().getTableTreeDelegate() != null
                && layout.getTableTreeThatOpenedThisForm().getTableTreeDelegate().isDeleteEnabled()
                && getFocObject() != null) {
            if (Globals.isValo()) {
                AbstractComponent deleteButtton = valo_GetDeleteEmbedded(true);
                if (deleteButtton != null) {
                    mainHorizontalLayout.addComponent(deleteButtton);
                    mainHorizontalLayout.setComponentAlignment(deleteButtton, Alignment.BOTTOM_LEFT);
                }
            } else {
                Button deleteButtton = getDeleteButton(true);
                if (deleteButtton != null) {
                    mainHorizontalLayout.addComponentAsFirst(deleteButtton);
                    mainHorizontalLayout.setComponentAlignment(deleteButtton, Alignment.BOTTOM_LEFT);
                }
            }
        }
    }

    Component discardOrGoBackButton = null;

    if (showDiscard) {
        if (Globals.isValo()) {
            discardOrGoBackButton = valo_GetDiscardButton(true);
        } else {
            discardOrGoBackButton = getDiscardButton(true);
        }
    } else if (showGoBack) {
        if (Globals.isValo()) {
            discardOrGoBackButton = valo_GetGoBackEmbedded(true);
        } else {
            discardOrGoBackButton = getGoBackButton(true);
        }
    }

    if (discardOrGoBackButton != null) {
        mainHorizontalLayout.addComponent(discardOrGoBackButton);
        if (Globals.isValo()) {
            mainHorizontalLayout.setComponentAlignment(discardOrGoBackButton, Alignment.MIDDLE_RIGHT);
        } else {
            mainHorizontalLayout.setComponentAlignment(discardOrGoBackButton, Alignment.BOTTOM_RIGHT);
        }

        if (titleLabel == null) {
        }
    }

    if (showValidationAndSave) {
        if (showSave) {
            if (Globals.isValo()) {
                mainHorizontalLayout.addComponent(valo_GetSaveButton(true));
                mainHorizontalLayout.setComponentAlignment(valo_GetSaveButton(false), Alignment.MIDDLE_LEFT);
            } else {
                mainHorizontalLayout.addComponent(getSaveButton(true));
                mainHorizontalLayout.setComponentAlignment(getSaveButton(false), Alignment.BOTTOM_LEFT);
            }
        }

        if (Globals.isValo()) {
            mainHorizontalLayout.addComponent(valo_GetApplyButton(true));
            mainHorizontalLayout.setComponentAlignment(valo_GetApplyButton(false), Alignment.MIDDLE_LEFT);
        } else {
            mainHorizontalLayout.addComponent(getApplyButton(true));
            mainHorizontalLayout.setComponentAlignment(getApplyButton(false), Alignment.BOTTOM_LEFT);
        }
    }
}

From source file:com.foc.web.modules.workflow.gui.WFConsole_Form.java

License:Apache License

public void adjustButtonsVisibility() {
    FocObject focObj = getFocObject();//from   w ww .  j  a  v a  2  s .  c  om

    FVButton signButton = getSignButton();
    FVButton rejectButton = getRejectButton();
    FVButton undoButton = getUndoMySigButton();
    FVButton nextButton = getNextButton();

    if (undoButton != null) {
        undoButton.setVisible(focObj != null && focObj.workflow_IsLastSignatureDoneByThisUser(true));
    }

    if (nextButton != null) {
        nextButton.setVisible(getTransactionWrapperForm() != null);
    }

    if (focObj != null && rejectButton != null) {
        rejectButton.setCaption(focObj.workflow_GetRejectButtonCaption(false));
    }

    if (focObj != null && signButton != null) {
        WFSignatureNeededResult result = focObj.workflow_NeedsSignatureOfThisUser_AsTitleIndex(null);
        if (result != null && result.getTitleIndex() >= 0) {
            if (result.isOnBehalfOf()) {
                signButton.setCaption(focObj.workflow_GetSignButtonCaption(true));
                signButton.setDescription(
                        isArabic() ? "?  ? " + result.getTitle()
                                : "Sign per procurationement as " + result.getTitle());
            } else {
                signButton.setCaption(focObj.workflow_GetSignButtonCaption(false));
                signButton.setDescription(isArabic() ? "? ? " + result.getTitle()
                        : "Sign as " + result.getTitle());
            }
            signButton.setVisible(!isForceHideSignCancel());
            rejectButton.setVisible(!isForceHideSignCancel() && focObj.workflow_IsRejectButtonVisible());
        } else {
            signButton.setVisible(false);
            rejectButton.setVisible(false);
        }
    }

    //When Arabic and the 3 buttons are visible make the undo my signature bigger 
    if (isArabic() && undoButton != null && signButton != null && rejectButton != null && undoButton.isVisible()
            && signButton.isVisible() && rejectButton.isVisible()) {
        FVHorizontalLayout hLay = (FVHorizontalLayout) getComponentByName("_BUTTONS_HORIZONTAL_LAYOUT");
        hLay.setComponentAlignment(signButton, Alignment.BOTTOM_RIGHT);
        signButton.setWidth("-1px");
        hLay.setComponentAlignment(rejectButton, Alignment.BOTTOM_RIGHT);
        rejectButton.setWidth("-1px");
        hLay.setComponentAlignment(undoButton, Alignment.BOTTOM_RIGHT);
        hLay.setExpandRatio(undoButton, 1);
    }
}

From source file:com.foc.web.modules.workflow.WFTransactionWrapper_Form.java

License:Apache License

private FVHorizontalLayout newSlideShowControlPanelToValidationLayout() {
    FVHorizontalLayout controlPanel = new FVHorizontalLayout(null);
    //      controlPanel.setWidth("100%");

    FVLabel label = newStageNameLabel();
    label.setWidth("100px");
    controlPanel.addComponent(label);/*from w  w  w . j  av  a2s  .  c  om*/
    controlPanel.setComponentAlignment(label, Alignment.BOTTOM_LEFT);

    FVCommentLayout commentLayout = new FVCommentLayout(this, controlPanel, getTransactionFocObject());
    commentLayout.setWidth("200px");
    controlPanel.addComponent(commentLayout);
    controlPanel.setComponentAlignment(commentLayout, Alignment.BOTTOM_RIGHT);
    //      controlPanel.setExpandRatio(commentLayout, 1);

    //      FVTextField txtFld = new FVTextField("Comment");
    //      txtFld.setValue("-- Under development --");
    //      controlPanel.addComponent(txtFld);
    //      txtFld.setWidth("100%");
    //      controlPanel.setExpandRatio(txtFld, 1);

    controlPanel.addComponent(getSignButton());
    controlPanel.setComponentAlignment(getSignButton(), Alignment.BOTTOM_RIGHT);

    controlPanel.addComponent(getSkipForTheMomentButton());
    controlPanel.setComponentAlignment(getSkipForTheMomentButton(), Alignment.BOTTOM_RIGHT);

    controlPanel.addComponent(getHideButton());
    controlPanel.setComponentAlignment(getHideButton(), Alignment.BOTTOM_RIGHT);

    WFLog log = getTransactionWrapper().getWorkflow().iWorkflow_getWorkflow().getLastSignatureEvent(false);
    if (log != null) {
        controlPanel.addComponent(getCancelPreviousSignatureButton());
        controlPanel.setComponentAlignment(getCancelPreviousSignatureButton(), Alignment.BOTTOM_RIGHT);
    }

    //      if(getStageLogMap().size() > 1){
    //         controlPanel.addComponent(getRejectSignatureToButton());
    //         controlPanel.setComponentAlignment(getRejectSignatureToButton(), Alignment.BOTTOM_RIGHT);
    //      }

    if (getStageLogMap().size() >= 1) {
        controlPanel.addComponent(getCancelAllPreviousSignaturesButton());
        controlPanel.setComponentAlignment(getCancelAllPreviousSignaturesButton(), Alignment.BOTTOM_RIGHT);
    }

    if (((FocObject) getIWorkflow()).workflow_IsAllowCancel()) {
        controlPanel.addComponent(getCancelTransactionButton());
        controlPanel.setComponentAlignment(getCancelTransactionButton(), Alignment.BOTTOM_RIGHT);
    }

    controlPanel.addComponent(getExitSlideShowButton());
    controlPanel.setComponentAlignment(getExitSlideShowButton(), Alignment.BOTTOM_RIGHT);
    return controlPanel;
}

From source file:com.github.djabry.platform.vaadin.view.BannerView.java

License:Open Source License

@PostConstruct
public void initView() {
    title = buildTitle();//from  ww  w . j  a  va2s. c  o m
    logoutButton = this.buildLogoutButton();
    this.addComponent(title);
    this.addComponent(title);
    this.addComponent(logoutButton);
    this.setComponentAlignment(logoutButton, Alignment.BOTTOM_RIGHT);
    this.setExpandRatio(title, 1);
    this.addStyleName(ValoTheme.MENU_TITLE);
    this.setWidth("100%");

}

From source file:com.github.lsiu.MyVaadinApplication.java

private void initTopBar(HorizontalLayout topBar) {
    topBar.setWidth("100%");
    final CheckBox editableCheckBox = new CheckBox("Editable");
    topBar.addComponent(editableCheckBox);
    topBar.setComponentAlignment(editableCheckBox, Alignment.BOTTOM_RIGHT);
    editableCheckBox.setValue(table.isEditable());
    editableCheckBox.setImmediate(true);
    editableCheckBox.addListener(new ValueChangeListener() {
        @Override/* w  ww . ja  v a  2s  .c  o m*/
        public void valueChange(ValueChangeEvent event) {
            table.setEditable((Boolean) editableCheckBox.getValue());
        }
    });
}