List of usage examples for com.vaadin.ui Label setHeight
@Override public void setHeight(String height)
From source file:jp.primecloud.auto.ui.WinServerAddSimple.java
License:Open Source License
private void showClouds() { cloudTable.removeAllItems();//from www . j a v a 2 s . c o m // ? for (int i = 0; i < platforms.size(); i++) { PlatformDto platform = platforms.get(i); if (BooleanUtils.isNotTrue(platform.getPlatform().getSelectable())) { //?????? continue; } // ???componetTypeNo??? boolean available = false; for (ImageDto image : platform.getImages()) { // ???????? if (BooleanUtils.isNotTrue(image.getImage().getSelectable())) { continue; } for (ComponentType componentType : image.getComponentTypes()) { if (componentTypeNo.equals(componentType.getComponentTypeNo())) { available = true; break; } } if (available) { break; } } if (!available) { continue; } //???? Icons icon = CommonUtils.getPlatformIcon(platform); String description = platform.getPlatform().getPlatformNameDisp(); Label slbl = new Label( "<img src=\"" + VaadinUtils.getIconPath(apl, icon) + "\"><div>" + description + "</div>", Label.CONTENT_XHTML); slbl.setHeight(COLUMN_HEIGHT); cloudTable.addItem(new Object[] { (i + 1), slbl }, platform.getPlatform().getPlatformNo()); } Long platformNo = null; if (cloudTable.getItemIds().size() > 0) { platformNo = (Long) cloudTable.getItemIds().toArray()[0]; } // ??? cloudTable.select(platformNo); }
From source file:jp.primecloud.auto.ui.WinServiceAdd.java
License:Open Source License
private void showServices() { serviceTable.removeAllItems();//from www. java2 s .c o m // ???? for (int i = 0; i < componentTypes.size(); i++) { ComponentTypeDto componentType = componentTypes.get(i); if (BooleanUtils.isNotTrue(componentType.getComponentType().getSelectable())) { //???????? continue; } // ?? String name = componentType.getComponentType().getComponentTypeNameDisp(); Icons nameIcon = Icons.fromName(componentType.getComponentType().getComponentTypeName()); Label slbl = new Label( "<img src=\"" + VaadinUtils.getIconPath(apl, nameIcon) + "\"><div>" + name + "</div>", Label.CONTENT_XHTML); slbl.setHeight(COLUMN_HEIGHT); // String description = componentType.getComponentType().getLayerDisp(); serviceTable.addItem(new Object[] { (i + 1), slbl, description }, componentType.getComponentType().getComponentTypeNo()); } Long componentTypeNo = null; if (serviceTable.getItemIds().size() > 0) { componentTypeNo = (Long) serviceTable.getItemIds().toArray()[0]; } // ??? serviceTable.select(componentTypeNo); }
From source file:nl.amc.biolab.nsg.display.component.DataElementForm.java
License:Open Source License
public void setDataElement(DataElement dataElement, List<NsgProperty> metadata) { if (dataElement == null) { return;/*from ww w . j a v a 2 s. co m*/ } removeAllComponents(); setDataSource(dataElement); Map<String, String> fields = fieldService.getFieldHeaders(DataElement.class.getName()); for (String k : fields.keySet()) { addLabelField(k, fields.get(k)); } //metadata if (metadata != null) { Label space = new Label("<div> </div>", Label.CONTENT_XHTML); space.setWidth("100%"); space.setHeight("10px"); getLayout().addComponent(space); Table table = new Table(); table.setWidth("100%"); table.setHeight("360px"); table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN); table.setSelectable(false); table.setCaption("properties"); table.addContainerProperty("key", String.class, null); table.addContainerProperty("value", String.class, null); for (NsgProperty p : metadata) { table.addItem(new Object[] { p.getDescription(), p.getValue() }, p); } getLayout().addComponent(table); } }
From source file:nl.amc.biolab.nsg.display.component.MainUI.java
License:Open Source License
private VerticalLayout buildMainLayout() { // common part: create layout mainLayout = new VerticalLayout(); mainLayout.setImmediate(false);// ww w . j av a 2s .c o m mainLayout.setWidth("100%"); mainLayout.setHeight("100%"); mainLayout.setMargin(false); mainLayout.setSpacing(true); // top-level component properties setWidth("100.0%"); setHeight("100.0%"); // topPanel topPanel = buildTopPanel(); mainLayout.addComponent(topPanel); mainLayout.setExpandRatio(topPanel, 1.0f); mainLayout.setComponentAlignment(topPanel, new Alignment(33)); // horizontal rule Label hr = new Label("<hr/>", Label.CONTENT_XHTML); hr.addStyleName("horizontal-separator"); hr.setWidth("100%"); hr.setHeight("2px"); mainLayout.addComponent(hr); mainLayout.setComponentAlignment(hr, new Alignment(33)); // mainSplitPanel mainSplitPanel = buildMainSplitPanel(); mainLayout.addComponent(mainSplitPanel); mainLayout.setExpandRatio(mainSplitPanel, 1.0f); return mainLayout; }
From source file:nl.amc.biolab.nsg.display.component.ProcessingStatusForm.java
License:Open Source License
@Override public void attach() { super.attach(); final VaadinTestApplication app = (VaadinTestApplication) getApplication(); logger.info("Getting attached to. Displaying " + processingStatus); final Processing processing = processingStatus.getProcessing(); if (processingStatus == null || processing == null) { return;//from w w w.j a v a2s . c o m } setDataSource(processingStatus); setData(processingStatus); logger.info("Continuing being attached to. Displaying " + processingStatus.getStatus() + " for " + processing.getDescription() + " with status " + processing.getStatus()); removeAllComponents(); addLabelField("processing.description", "Description"); addLabelField("processing.date", "Creation date"); final String processingUpdateDate = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss") .format(userDataService.getLastestUpdate(processing)); // when the status is last updated //dataelements if (processingStatus.getSubmissionIOs().size() != 0) { Label space = new Label("<div> </div>", Label.CONTENT_XHTML); space.setWidth("100%"); space.setHeight("10px"); getLayout().addComponent(space); submissionTable = new Table(); submissionTable.setWidth("100%"); submissionTable.setHeight("300px"); submissionTable.setSelectable(true); submissionTable.setMultiSelect(true); submissionTable.setImmediate(true); submissionTable.addContainerProperty("input", Label.class, null); submissionTable.addContainerProperty("output", Label.class, null); submissionTable.addContainerProperty("view history", VerticalLayout.class, null); submissionTable.addContainerProperty("status", VerticalLayout.class, null); submissionTable.setColumnExpandRatio("input", 30f); submissionTable.setColumnExpandRatio("output", 20f); submissionTable.setColumnExpandRatio("view history", 20f); submissionTable.setColumnExpandRatio("status", 30f); for (Map<List<SubmissionIO>, List<SubmissionIO>> map : processingStatus.getSubmissionIOs()) { for (List<SubmissionIO> submissionIOinputs : map.keySet()) { if (submissionIOinputs.isEmpty()) { logger.error("Skipping a submission with no inputs in processing: " + processingStatus.getProcessing().getDbId()); continue; } //inputs StringBuffer inputValue = new StringBuffer(); for (SubmissionIO submissionIOinput : submissionIOinputs) { DataElement inputElement = submissionIOinput.getDataElement(); inputValue.append("<a href='" + userDataService.getDownloadURI(inputElement.getDbId()) + "' target='_blank'>" + inputElement.getName() + "</a><br />"); } Label input = new Label(inputValue.toString(), Label.CONTENT_XHTML); input.setWidth("-1px"); //outputs VerticalLayout historyLayout = new VerticalLayout(); historyLayout.setWidth("100%"); StringBuffer downloadValue = new StringBuffer(); Label download = null; final List<SubmissionIO> outputs = map.get(submissionIOinputs); if (outputs.isEmpty()) { download = new Label("No output available", Label.CONTENT_XHTML); } else { for (SubmissionIO submissionIOoutput : outputs) { final DataElement outputElement = submissionIOoutput.getDataElement(); if (submissionIOoutput.getDataElement().getExisting()) { downloadValue.append("<a href='") .append(userDataService.getDownloadURI(outputElement.getDbId())) .append("' target='_blank'>download output</a><br />"); } NativeButton viewHistoryButton = new NativeButton("history"); viewHistoryButton.addListener(new Button.ClickListener() { private static final long serialVersionUID = 4280267926508263057L; @Override public void buttonClick(ClickEvent event) { final String htmlContent = userDataService .getDataHistory(outputElement.getDbId()); showHTML(htmlContent, app); } }); historyLayout.addComponent(viewHistoryButton); } download = new Label(downloadValue.toString(), Label.CONTENT_XHTML); download.setWidth("-1px"); } // status VerticalLayout statusLayout = makeSubmissionStatusLayout(submissionIOinputs, processing, app); //add table item submissionTable.addItem(new Object[] { input, download, historyLayout, statusLayout }, null); } } getLayout().addComponent(submissionTable); } //total status Label space = new Label("<div> </div>", Label.CONTENT_XHTML); space.setWidth("100%"); space.setHeight("10px"); getLayout().addComponent(space); LabelField f = new LabelField(); LabelField lastUpdateDateFieled = new LabelField(); lastUpdateDateFieled.setLabelValue("<span style='font-size: 12px'><b>Last updated on:</b> </span>", processingUpdateDate); f.setLabelValue("<span style='font-size: 12px'><b>Overall status:</b> </span>", getStatus(processingStatus.getStatus(), null, false)); getLayout().addComponent(f); getLayout().addComponent(lastUpdateDateFieled); }
From source file:org.activiti.kickstart.ui.panel.KickstartWorkflowPanel.java
License:Apache License
protected void initTitle() { VerticalLayout verticalLayout = new VerticalLayout(); if (existingAdhocWorkflow == null) { titleLabel = new Label(NEW_ADHOC_WORKFLOW_TITLE); } else {// w w w .j av a 2s. c om titleLabel = new Label(EXISTING_ADHOC_WORKFLOW_TITLE + " '" + existingAdhocWorkflow.getName() + "'"); } titleLabel.setStyleName(Reindeer.LABEL_H1); verticalLayout.addComponent(titleLabel); // add some empty space Label emptyLabel = new Label(""); emptyLabel.setHeight("1.5em"); verticalLayout.addComponent(emptyLabel); addComponent(verticalLayout); }
From source file:org.activiti.kickstart.ui.panel.SelectAdhocWorkflowPanel.java
License:Apache License
private void initTitle() { titleLabel = new Label(TITLE); titleLabel.setStyleName(Reindeer.LABEL_H1); addComponent(titleLabel);//from w ww . j ava 2 s . co m // add some empty space Label emptyLabel = new Label(""); emptyLabel.setHeight("1.5em"); layout.addComponent(emptyLabel); }
From source file:org.eclipse.hawkbit.ui.common.builder.LabelBuilder.java
License:Open Source License
/** * Build label.// w ww . j a v a 2s. c o m * * @return Label */ public Label buildLabel() { final Label label = createLabel(); label.setImmediate(false); label.setWidth("-1px"); label.setHeight("-1px"); if (StringUtils.hasText(caption)) { label.setCaption(caption); } return label; }
From source file:org.ikasan.dashboard.ui.framework.panel.PersistanceSetupPanel.java
License:BSD License
protected void createNotCreatedView() { VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setWidth("100%"); verticalLayout.setHeight("100%"); verticalLayout.setMargin(true);// w w w.ja v a2s . co m Label ikasanWelcomeLabel1 = new Label("Welcome to Ikasan!"); ikasanWelcomeLabel1.setStyleName("xlarge"); ikasanWelcomeLabel1.setWidth("100%"); ikasanWelcomeLabel1.setHeight("30px"); Label ikasanWelcomeLabel2 = new Label("It appears that you are setting up Ikasan for the" + " first time and we need to create some database tables. If this is not the first time accessing the " + "Ikasan Console, it appears that there is an issue with the Ikasan database. If this is the case please " + "contact your local database administrator."); ikasanWelcomeLabel2.setStyleName("large"); ikasanWelcomeLabel2.setWidth("60%"); ikasanWelcomeLabel2.setHeight("70px"); verticalLayout.addComponent(ikasanWelcomeLabel1); verticalLayout.addComponent(ikasanWelcomeLabel2); verticalLayout.addComponent(persistanceStoreTypeCombo); persistanceStoreTypeCombo.setHeight("30px"); Button button = new Button("Create"); button.setStyleName(ValoTheme.BUTTON_SMALL); button.setHeight("30px"); button.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { String persistenceProvider = (String) PersistanceSetupPanel.this.persistanceStoreTypeCombo .getValue(); if (persistenceProvider == null) { Notification.show("Please select a database type!"); return; } PersistenceService persistanceService = persistenceServiceFactory .getPersistenceService(persistenceProvider); try { persistanceService.createPersistence(); persistanceService.createAdminAccount(); } catch (RuntimeException e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); Notification.show("Error trying to create Ikasan database!", sw.toString(), Notification.Type.ERROR_MESSAGE); } Notification.show("Database successfully created!"); } }); verticalLayout.addComponent(button); this.setContent(verticalLayout); }
From source file:org.ikasan.dashboard.ui.framework.panel.PersistanceSetupPanel.java
License:BSD License
protected void createAlreadyCreatedView() { VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setWidth("100%"); verticalLayout.setHeight("100%"); verticalLayout.setMargin(true);/* w w w . ja va 2 s. co m*/ Label ikasanWelcomeLabel1 = new Label("Welcome to Ikasan!"); ikasanWelcomeLabel1.setStyleName("xlarge"); ikasanWelcomeLabel1.setWidth("100%"); ikasanWelcomeLabel1.setHeight("30px"); Label ikasanWelcomeLabel2 = new Label( "It appears as thoug the Ikasan database has already been created. If you believe that this is not the case there may be an issue. " + "Please contact your local database administrator or Ikasan/Middleware support."); ikasanWelcomeLabel2.setStyleName("large"); ikasanWelcomeLabel2.setWidth("60%"); ikasanWelcomeLabel2.setHeight("60px"); verticalLayout.addComponent(ikasanWelcomeLabel1); verticalLayout.addComponent(ikasanWelcomeLabel2); // verticalLayout.addComponent(persistanceStoreTypeCombo); this.setContent(verticalLayout); }