List of usage examples for com.vaadin.ui Label setWidth
@Override public void setWidth(String width)
From source file:org.escidoc.browser.ui.GroupRolesView.java
License:Open Source License
private VerticalLayout addRoleExcludeInformation() { VerticalLayout rlexclude = new VerticalLayout(); final Label content = new Label("<ul><li>The following Roles have been excluded from this view: <br />" + ViewConstants.roleExcludeList.toString() + "</li></ul>", Label.CONTENT_RAW); content.setWidth("300px"); final PopupView popup = new PopupView("?", content); popup.setHideOnMouseOut(true);// w ww .j a v a 2s . c o m popup.addListener(new PopupVisibilityListener() { @Override public void popupVisibilityChange(PopupVisibilityEvent event) { } }); popup.addStyleName("paddingright10"); rlexclude.addComponent(popup); rlexclude.setComponentAlignment(popup, Alignment.MIDDLE_RIGHT); rlexclude.setMargin(true); return rlexclude; }
From source file:org.escidoc.browser.ui.helper.ViewHelper.java
License:Open Source License
public static Label buildCreateAndModifyLabel(ResourceProxy resourceProxy) { final Label createAndMofidyLabel = new Label(ViewConstants.CREATED_BY + " " + resourceProxy.getCreator() + " on " + resourceProxy.getCreatedOn() + "<br/>" + ViewConstants.LAST_MODIFIED_BY + " " + resourceProxy.getModifier() + " on " + resourceProxy.getModifiedOn(), Label.CONTENT_XHTML); createAndMofidyLabel.setStyleName("floatright columnheight50"); createAndMofidyLabel.setWidth("65%"); return createAndMofidyLabel; }
From source file:org.escidoc.browser.ui.maincontent.ContainerMetadataRecordsView.java
License:Open Source License
private static void buildPanelHeader(CssLayout cssLayout, String name) { cssLayout.addStyleName("v-accordion-item-caption v-caption v-captiontext"); cssLayout.setWidth("100%"); cssLayout.setMargin(false);//from w ww. ja va 2 s .c om final Label nameofPanel = new Label(name, Label.CONTENT_RAW); nameofPanel.setStyleName("accordion v-captiontext"); nameofPanel.setWidth("70%"); cssLayout.addComponent(nameofPanel); }
From source file:org.escidoc.browser.ui.maincontent.ContainerView.java
License:Open Source License
/** * Building the Header Element that shows the title of the Container *///from w w w. j av a 2 s .c o m private void bindNameToHeader(CssLayout cssLayout) { final Label headerContext = new Label(ViewConstants.RESOURCE_NAME_CONTAINER + resourceProxy.getName()); headerContext.setStyleName("h1 fullwidth floatleft"); headerContext.setWidth("80%"); headerContext.setDescription(ViewConstants.DESC_HEADER); cssLayout.addComponent(headerContext); }
From source file:org.escidoc.browser.ui.maincontent.ItemContent.java
License:Open Source License
private void initView() { final CssLayout cssLayout = new CssLayout(); cssLayout.setHeight("20px"); buildPanelHeader(cssLayout, ViewConstants.COMPONENTS); ThemeResource ICON = new ThemeResource("images/assets/plus.png"); if (true) {/* w w w . j a v a 2 s. c o m*/ final Button btnAddNew = new Button(); btnAddNew.addListener(new Button.ClickListener() { @Override public void buttonClick(com.vaadin.ui.Button.ClickEvent event) { Window modalWindow = new Window("Select a file to add."); modalWindow.setWidth("25%"); modalWindow.setHeight("20%"); modalWindow.setModal(true); modalWindow.addComponent(new ComponentUploadView(repositories, controller, itemProxy, ItemContent.this, mainWindow)); mainWindow.addWindow(modalWindow); } }); btnAddNew.setStyleName(BaseTheme.BUTTON_LINK); btnAddNew.addStyleName("floatright paddingtop3"); btnAddNew.setWidth("20px"); btnAddNew.setIcon(ICON); cssLayout.addComponent(btnAddNew); } verticalLayout.addComponent(cssLayout); wrap(verticalLayout); if (controller.hasComponents()) { verticalLayout.addComponent(buildTable()); } else { final Label lblNoComponents = new Label( "No components in this Item. You can drag n'drop some file from your computer to this box to add new components!"); lblNoComponents.setWidth("90%"); lblNoComponents.setStyleName("skybluetext"); verticalLayout.addComponent(lblNoComponents); } }
From source file:org.escidoc.browser.ui.maincontent.ItemContent.java
License:Open Source License
private void buildPanelHeader(CssLayout cssLayout, String name) { cssLayout.addStyleName("v-accordion-item-caption v-caption v-captiontext"); cssLayout.setWidth("100%"); cssLayout.setMargin(false);//from w ww .j av a2s . c o m final Label nameofPanel = new Label(name, Label.CONTENT_RAW); nameofPanel.setStyleName("accordion v-captiontext"); nameofPanel.setWidth("70%"); cssLayout.addComponent(nameofPanel); }
From source file:org.escidoc.browser.ui.maincontent.OrgUnitView.java
License:Open Source License
private HorizontalLayout bindProperties() { HorizontalLayout hlProperties = new HorizontalLayout(); hlProperties.setWidth("100%"); vlLeft = new VerticalLayout(); VerticalLayout vlRight = new VerticalLayout(); final Label descMetadata1 = new Label("ID: " + resourceProxy.getId()); status = resourceProxy.getType().getLabel() + " is "; lblStatus = new Label(status + resourceProxy.getStatus(), Label.CONTENT_RAW); if (orgUnitController.hasAccess()) { lblStatus.setDescription(ViewConstants.DESC_STATUS); lblStatus.setStyleName("inset"); }//from w w w. jav a2 s . c o m lblStatus.setDescription(ViewConstants.DESC_STATUS); vlLeft.addComponent(descMetadata1); vlLeft.addComponent(lblStatus); // RIGHT SIDE final Label descMetadata2 = new Label(ViewConstants.CREATED_BY + " " + resourceProxy.getCreator() + " on " + resourceProxy.getCreatedOn() + "<br/>" + ViewConstants.LAST_MODIFIED_BY + " " + resourceProxy.getModifier() + " on " + resourceProxy.getModifiedOn(), Label.CONTENT_XHTML); descMetadata2.setStyleName("floatright columnheight50"); descMetadata2.setWidth("65%"); vlRight.addComponent(descMetadata2); hlProperties.addComponent(vlLeft); hlProperties.setExpandRatio(vlLeft, 0.4f); hlProperties.addComponent(vlRight); hlProperties.setExpandRatio(vlRight, 0.6f); return hlProperties; }
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);/* ww w. j a va 2 s . 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.view.helpers.DirectMember.java
License:Open Source License
@SuppressWarnings("serial") private CssLayout headerButton() throws EscidocClientException { CssLayout cssLayout = new CssLayout(); cssLayout.addStyleName("v-accordion-item-caption v-caption v-captiontext"); cssLayout.setWidth("100%"); cssLayout.setMargin(false);/* w w w . j av a2 s. c o m*/ final Label nameofPanel = new Label(ViewConstants.DIRECT_MEMBERS, Label.CONTENT_RAW); nameofPanel.setStyleName("accordion v-captiontext"); nameofPanel.setWidth("70%"); cssLayout.addComponent(nameofPanel); ThemeResource plusIcon = new ThemeResource("images/assets/plus.png"); if (resourceType == ResourceType.CONTAINER.toString()) { resourceProxy = new ContainerProxyImpl( router.getRepositories().container().findContainerById(parentId)); contextId = resourceProxy.getContext().getObjid(); } else { // It has to be a context resourceProxy = router.getRepositories().context().findById(parentId); } final Button addResourceButton = new Button(); addResourceButton.setStyleName(BaseTheme.BUTTON_LINK); addResourceButton.addStyleName("floatright paddingtop3"); addResourceButton.setWidth("20px"); addResourceButton.setIcon(plusIcon); addResourceButton.addListener(new ClickListener() { @Override public void buttonClick(@SuppressWarnings("unused") final ClickEvent event) { try { new ResourceAddViewImpl(resourceProxy, contextId, router).openSubWindow(); } catch (final EscidocClientException e) { mainWindow.showNotification(e.getMessage(), Window.Notification.TYPE_ERROR_MESSAGE); } } }); cssLayout.addComponent(nameofPanel); cssLayout.addComponent(addResourceButton); return cssLayout; }
From source file:org.generationcp.breeding.manager.crosses.NurseryTemplateMain.java
License:Open Source License
public void setTitleContent(String guideMessage) { titleLayout.removeAllComponents();/*from w w w . j av a 2 s . c o m*/ String title = "<h1>Crossing Manager:</h1> <h1>Nursery Template File</h1> <h2>" + VERSION + "</h2>"; nurseryTemplateTitle = new Label(); nurseryTemplateTitle.setStyleName("gcp-window-title"); nurseryTemplateTitle.setContentMode(Label.CONTENT_XHTML); nurseryTemplateTitle.setValue(title); titleLayout.addComponent(nurseryTemplateTitle); Label descLbl = new Label(guideMessage); descLbl.setWidth("300px"); PopupView popup = new PopupView("?", descLbl); popup.setStyleName("gcp-popup-view"); titleLayout.addComponent(popup); titleLayout.setComponentAlignment(popup, Alignment.MIDDLE_LEFT); }