List of usage examples for com.vaadin.ui Alignment MIDDLE_RIGHT
Alignment MIDDLE_RIGHT
To view the source code for com.vaadin.ui Alignment MIDDLE_RIGHT.
Click Source Link
From source file:org.escidoc.browser.ui.mainpage.HeaderContainer.java
License:Open Source License
private void addNormalLayout() { headerContainer = new HorizontalLayout(); headerContainer.setStyleName(Reindeer.LAYOUT_WHITE); headerContainer.setWidth("100%"); headerContainer.setHeight("55px"); headerContainer.addStyleName("header"); HorizontalLayout hlLogo = new HorizontalLayout(); Resource res = new ThemeResource("images/escidoc-logo-klein.jpg"); Embedded e = new Embedded(null, res); e.setHeight(50 + "px"); hlLogo.addComponent(e);//from ww w. ja v a 2s.c o m headerContainer.addComponent(hlLogo); headerContainer.setExpandRatio(hlLogo, 0.2f); hl = new HorizontalLayout(); headerContainer.addComponent(hl); headerContainer.setExpandRatio(hl, 0.8f); this.addComponent(headerContainer); headerContainer.setComponentAlignment(hl, Alignment.MIDDLE_RIGHT); }
From source file:org.escidoc.browser.ui.mainpage.HeaderContainer.java
License:Open Source License
public void setUser(final CurrentUser user) { Component name;/*w w w . ja va 2s . c om*/ if (user.getLoginName().equals(ViewConstants.GUEST)) { name = new Label(ViewConstants.GUEST); } else { name = new Button(user.getRealName()); name.setStyleName(BaseTheme.BUTTON_LINK); name.addStyleName("paddingright10"); ((Button) name).addListener(new Button.ClickListener() { @Override public void buttonClick(@SuppressWarnings("unused") ClickEvent event) { ResourceProxy userProxy; try { userProxy = repositories.user().findById(user.getUserId()); UserAccountController controller = new UserAccountController(repositories, router, userProxy); router.openControllerView(controller, Boolean.FALSE); } catch (EscidocClientException e) { LOG.error("Can not find user " + e.getMessage()); router.getMainWindow().showNotification(ViewConstants.ERROR + "Can not find user ", e.getMessage(), Window.Notification.TYPE_ERROR_MESSAGE); } } }); } Label lblCurrentUser = new Label("<b>" + ViewConstants.CURRENT_USER + "</b>", Label.CONTENT_XHTML); lblCurrentUser.addStyleName("paddingright10"); hl.addComponent(lblCurrentUser); hl.setComponentAlignment(lblCurrentUser, Alignment.MIDDLE_RIGHT); name.addStyleName("paddingright10"); hl.addComponent(name); hl.addComponent(new Label(" ", Label.CONTENT_RAW)); hl.setComponentAlignment(name, Alignment.MIDDLE_RIGHT); if (user.isGuest()) { hl.removeComponent(logout); hl.addComponent(login); hl.setComponentAlignment(login, Alignment.MIDDLE_RIGHT); } else { logout.addStyleName("paddingright10"); hl.addComponent(logout); hl.setComponentAlignment(logout, Alignment.MIDDLE_RIGHT); } }
From source file:org.escidoc.browser.ui.mainpage.HeaderContainer.java
License:Open Source License
private void createSearchForm() { final Form form = new Form(); searchField.setImmediate(true);/*from w w w .jav a 2s . c o m*/ form.getLayout().addComponent(searchField); form.addStyleName("paddingright10"); hl.addComponent(form); hl.setComponentAlignment(form, Alignment.MIDDLE_RIGHT); final Button btnSearch = new Button("Go", this, "onClickSearch"); // btnSearch.setClickShortcut(KeyCode.ENTER); btnSearch.addStyleName("primary"); btnSearch.removeStyleName("v-button"); btnSearch.addStyleName("paddingright10"); hl.addComponent(btnSearch); hl.setComponentAlignment(btnSearch, Alignment.MIDDLE_RIGHT); // Create the content for the popup final Label content = new Label( "<ul><li>» The default search operator is AND</li><li>» To search for a phrase place the text in double quotes</li></ul>", Label.CONTENT_RAW); // The PopupView popup will be as large as needed by the content content.setWidth("300px"); // Construct the PopupView with simple HTML text representing the // minimized view final PopupView popup = new PopupView("?", content); popup.setHideOnMouseOut(true); popup.addListener(this); popup.addStyleName("paddingright10"); hl.addComponent(popup); hl.setComponentAlignment(popup, Alignment.MIDDLE_RIGHT); }
From source file:org.escidoc.browser.ui.role.RoleAssignView.java
License:Open Source License
private void addGroupFooter() { groupFooter.addComponent(saveGroupBtn); groupFooterLayout.addComponent(groupFooter); groupFooterLayout.setComponentAlignment(groupFooter, Alignment.MIDDLE_RIGHT); groupFooter.setVisible(true);/* w w w. j a v a2s . co m*/ mainLayoutGroupRoles.addComponent(groupFooterLayout); }
From source file:org.escidoc.browser.ui.role.RoleAssignView.java
License:Open Source License
private void addFooter() { footer.addComponent(saveBtn);/*from w ww .j av a2s.c o m*/ footerLayout.addComponent(footer); footerLayout.setComponentAlignment(footer, Alignment.MIDDLE_RIGHT); footer.setVisible(true); mainLayout.addComponent(footerLayout); }
From source file:org.fossa.vaadin.auth.ui.FossaAuthorizerFrameBuilder.java
License:Open Source License
public FossaAuthorizerFrameBuilder(FossaAuthorizer fossaAuthorizer, FossaUserLaso user) { this.fossaAuthorizer = fossaAuthorizer; if (user == null) { return;/*from w ww. ja va 2s.com*/ } this.user = user; TextField loginUser = new TextField(); loginUser.setValue("Angemeldet als: " + user.getFirstname() + " " + user.getLastname()); loginUser.setReadOnly(true); loginUser.setStyleName("loginUser"); loginUser.setWidth("400px"); logout = new Button("Ausloggen"); logout.addListener((Button.ClickListener) this); logout.setWidth("150px"); editUser = new Button("Benutzerkonto"); editUser.addListener((Button.ClickListener) this); editUser.setWidth("150px"); setSpacing(true); addComponent(loginUser); HorizontalLayout buttonBattery = new HorizontalLayout(); buttonBattery.addComponent(editUser); buttonBattery.addComponent(logout); addComponent(buttonBattery); setComponentAlignment(loginUser, Alignment.MIDDLE_RIGHT); setComponentAlignment(buttonBattery, Alignment.MIDDLE_RIGHT); }
From source file:org.generationcp.breeding.manager.crosses.NurseryTemplateConditionsComponent.java
License:Open Source License
protected void initializeLayout() { setMargin(true); setSpacing(true); setComponentAlignment(buttonArea, Alignment.MIDDLE_RIGHT); }
From source file:org.generationcp.breeding.manager.crosses.NurseryTemplateImportFileComponent.java
License:Open Source License
protected void initializeLayout() { setMargin(true);//from w w w . j a v a2s.c om setSpacing(true); setSizeFull(); uploadComponents.setWidth("600px"); setComponentAlignment(buttonArea, Alignment.MIDDLE_RIGHT); }
From source file:org.generationcp.breeding.manager.crossingmanager.SelectGermplasmListWindow.java
License:Open Source License
protected void initializeLayout() { // set as modal window, other components are disabled while window is open setModal(true);/* w w w . j a v a2 s . c om*/ // define window size, set as not resizable setWidth("800px"); setHeight("540px"); setResizable(false); setCaption("Select Germplasm List"); // center window within the browser center(); buttonArea.setMargin(false, true, false, true); buttonArea.setSpacing(true); buttonArea.addComponent(cancelButton); buttonArea.addComponent(doneButton); mainLayout.addComponent(selectGermplasmList); mainLayout.addComponent(buttonArea); mainLayout.setComponentAlignment(buttonArea, Alignment.MIDDLE_RIGHT); this.setContent(mainLayout); }
From source file:org.hip.vif.admin.groupadmin.ui.QuestionView.java
License:Open Source License
private Component createQuestionActionButtons(final AdminQuestionShowTask inTask, final IMessages inMessages) { final AbstractDialogWindow lDialogPublish = Dialog.openQuestion( inMessages.getMessage("ui.discussion.dialog.title"), //$NON-NLS-1$ inMessages.getMessage("ui.discussion.dialog.question.publish"), new Dialog.ICommand() { //$NON-NLS-1$ @Override//from w w w. ja va 2 s.c o m public void execute() { if (!inTask.publish()) { Notification.show(inMessages.getMessage("errmsg.contribution.publish"), //$NON-NLS-1$ Type.WARNING_MESSAGE); } } }); final AbstractDialogWindow lDialogDelete = Dialog.openQuestion( inMessages.getMessage("ui.discussion.dialog.title"), //$NON-NLS-1$ inMessages.getMessage("ui.discussion.dialog.question.delete"), new Dialog.ICommand() { //$NON-NLS-1$ @Override public void execute() { if (!inTask.delete()) { Notification.show(inMessages.getMessage("errmsg.contribution.delete"), //$NON-NLS-1$ Type.WARNING_MESSAGE); } } }); final HorizontalLayout outButtons = new HorizontalLayout(); outButtons.setSpacing(true); outButtons.setWidth("100%"); //$NON-NLS-1$ final Button lEdit = new Button(inMessages.getMessage("ui.discussion.question.button.edit")); //$NON-NLS-1$ lEdit.addClickListener(new Button.ClickListener() { @Override public void buttonClick(final ClickEvent inEvent) { inTask.editQuestion(); } }); outButtons.addComponent(lEdit); final Button lPublish = new Button(inMessages.getMessage("ui.discussion.contribution.button.publish")); //$NON-NLS-1$ lPublish.addClickListener(Dialog.createClickListener(lDialogPublish, this)); outButtons.addComponent(lPublish); final Button lDelete = new Button(inMessages.getMessage("ui.discussion.contribution.button.delete")); //$NON-NLS-1$ lDelete.addClickListener(Dialog.createClickListener(lDialogDelete, this)); outButtons.addComponent(lDelete); outButtons.setExpandRatio(lEdit, 1); outButtons.setComponentAlignment(lEdit, Alignment.MIDDLE_RIGHT); return outButtons; }