protected Component createFieldsetTitle(String title) { Label fieldsetTitle = new Label(title); fieldsetTitle.addStyleName("fieldset-title"); return fieldsetTitle; }
@Override public Component createThumbnailComponent(String description, File file, String mimeType) { Label thumbnail = new Label(); thumbnail.setSizeUndefined(); thumbnail.addStyleName("preview-image"); thumbnail.addStyleName("file-preview"); thumbnail.addStyleName("icon-" + imageProvider.resolveIconClassName(mimeType)); return thumbnail; }
public static Label createStatusLabel(final String caption, final Status status, final String text) { final Label label = createLabel(caption, text); label.setContentMode(ContentMode.HTML); label.addStyleName("severity-" + status.toString().toLowerCase()); label.addStyleName("bright"); return label; }
@Override public Object generateCell(Table table, final Object itemId, Object columnId) { Label label = new Label((String) itemId); label.setSizeFull(); label.addStyleName("white"); return label; } });
/** * Add Title. * @deprecated since 2.5 with no replacement. */ @Deprecated protected Component getFileDetailHeader() { Label label = new Label(); label.setValue(i18n.translate("dam.assets.filePreview.header")); label.addStyleName(ValoTheme.LABEL_BOLD); return label; }
/** * Returns the image severity layout for the given content. * * @param content the content * @return the label with the applied style */ protected HorizontalLayout getImageSeverityLayout(String content) { HorizontalLayout horizontalLayout = new HorizontalLayout(); Label placeholder = new Label(); placeholder.addStyleName("placeholder"); horizontalLayout.addComponent(placeholder); Label contentLabel = new Label(content); contentLabel.addStyleName("content"); horizontalLayout.addComponent(contentLabel); return horizontalLayout; }
public StubView(String iconId) { layout.addStyleName("app-stub-view"); layout.setSizeFull(); final Label icon = new Label(); icon.addStyleName("icon"); icon.setSizeUndefined(); icon.addStyleName(iconId); layout.addComponent(icon); layout.setComponentAlignment(icon, Alignment.MIDDLE_CENTER); }
public Object generateCell(Table source, final Object itemId, Object columnId) { final Optional<RowDef> rowDef = view.getRowDef((String) itemId); final Optional<ColumnDef> columnDef = view.getColumnDef((String) columnId); int rowIndex = view.getRows().indexOf(rowDef.orElse(null)); int colIndex = view.getColumns().indexOf(columnDef.orElse(null)); SurveillanceStatus surveillanceStatus = m_cells[rowIndex][colIndex]; Label label = new Label(surveillanceStatus.getDownEntityCount() + " of " + surveillanceStatus.getTotalEntityCount()); label.setSizeFull(); label.addStyleName(surveillanceStatus.getStatus().toLowerCase()); return label; } });
private HorizontalLayout createRow(BusinessService service) { HorizontalLayout rowLayout = new HorizontalLayout(); rowLayout.setSizeFull(); rowLayout.setSpacing(true); final Status severity = m_businessServiceManager.getOperationalStatus(service); Label nameLabel = new Label(service.getName()); nameLabel.setSizeFull(); nameLabel.setStyleName("h3"); nameLabel.addStyleName("bright"); nameLabel.addStyleName("severity"); nameLabel.addStyleName(severity.getLabel()); rowLayout.addComponent(nameLabel); return rowLayout; }
/** * Returns the help component for the {@link Dashlet}. * * @return the help component */ @Override public Component getHelpComponent() { VerticalLayout verticalLayout = new VerticalLayout(); Label helpContent = new Label(getHelpContentHTML(), ContentMode.HTML); helpContent.addStyleName("help-content"); Label helpParameters = new Label(getParameterDescriptionsHTML(), ContentMode.HTML); helpParameters.addStyleName("help-content"); verticalLayout.addComponent(helpContent); verticalLayout.addComponent(helpParameters); return verticalLayout; }
if (alarms.size() == 0) { Label label = new Label("No alarms found!"); label.addStyleName("alert-details-noalarms-font"); component.addComponent(label); } else {
private Component createComponent() { Label label = new Label("Simulation Mode Enabled"); label.setDescription("Simulation Mode is enabled"); label.setIcon(FontAwesome.EXCLAMATION_TRIANGLE); label.addStyleName("warning"); HorizontalLayout layout = new HorizontalLayout(); layout.addComponent(label); layout.addStyleName("simulation"); return layout; }
/** * Adds the alarms components to a {@link com.vaadin.ui.AbstractOrderedLayout} * * @param component the component to add alarms to * @param alarms the alarms list */ private void addComponents(AbstractOrderedLayout component, List<OnmsAlarm> alarms) { if (alarms.size() == 0) { Label label = new Label("No alarms found!"); label.addStyleName("alerts-noalarms-font"); component.addComponent(label); } else { for (OnmsAlarm onmsAlarm : alarms) { OnmsNode onmsNode = null; if (onmsAlarm.getNodeId() != null) { CriteriaBuilder nodeCb = new CriteriaBuilder(OnmsNode.class); nodeCb.eq("id", onmsAlarm.getNodeId()); List<OnmsNode> nodes = m_nodeDao.findMatching(nodeCb.toCriteria()); if (nodes.size() == 1) { onmsNode = nodes.get(0); } } component.addComponent(createAlarmComponent(onmsAlarm, onmsNode)); OnmsSeverity boostSeverity = OnmsSeverity.valueOf(getDashletSpec().getParameters().get("boostSeverity")); if (onmsAlarm.getSeverity().isGreaterThanOrEqual(boostSeverity)) { boosted = true; } } } }
labelAgo.addStyleName("alerts-font"); labelAgo.setValue(ago); labelId.addStyleName("alerts-font"); if (onmsNode != null) { labelId.setValue(onmsNode.getLabel() + " (" + onmsNode.getNodeId() + ")"); labelUei.addStyleName("alerts-font"); labelUei.setValue(onmsAlarm.getUei());
/** * Wraps the provided component in order to fit it better in the Info Panel. * E.g. a caption is added to better difference between components. * * @param component The component to wrap. * @param title the title of the component to wrap. * @param id the id of the wrapped component. * @return The wrapped component. */ private Component wrap(Component component, String title, String id) { Label label = new Label(); label.addStyleName("info-panel-item-label"); if (title != null) { label.setValue(title); } VerticalLayout layout = new VerticalLayout(); layout.addStyleName("info-panel-item"); layout.addComponent(label); layout.addComponent(component); layout.setMargin(true); if (id != null) { layout.setId(id); } return layout; }
labelFrom.addStyleName("text"); labelTo.addStyleName("text");
labelSeverity.addStyleName("summary-font"); Label labelAcknowledge = new Label(String.valueOf(acknowledged)); labelAcknowledge.addStyleName("summary-font"); Label labelNotAcknowledged = new Label(String.valueOf(notAcknowledged)); labelNotAcknowledged.addStyleName("summary-font"); labelTitle.addStyleName("summary-font"); labelTitle.setSizeUndefined(); labelTimeslot.addStyleName("summary-font"); labelTimeslot.setSizeUndefined();
labelSeverity.addStyleName("summary-font"); Label labelAcknowledge = new Label(String.valueOf(acknowledged)); labelAcknowledge.addStyleName("summary-font"); Label labelNotAcknowledged = new Label(String.valueOf(notAcknowledged)); labelNotAcknowledged.addStyleName("summary-font"); labelTitle.addStyleName("summary-font"); labelTitle.setSizeUndefined(); labelTimeslot.addStyleName("summary-font"); labelTimeslot.setSizeUndefined();
private void construct() { mainLayout.setPrimaryStyleName("switcher"); mainLayout.addStyleName(VARIATION_GREEN.equals(colorVariation) ? cssGreenVariationClassname : cssBlackVariationClassname); // back-arrow back = new Button(""); back.setPrimaryStyleName(cssSwitcherArrowClassname); back.addStyleName("icon-arrow2_w"); mainLayout.addComponent(back); // combobox with descriptionLabel below wrapped in verticalLayout // comboLayout.setWidth(100, Unit.PERCENTAGE); combobox.setWidth(100, Unit.PERCENTAGE); comboLayout.addComponent(combobox); // descriptionLabel descriptionLabel = new Label(""); descriptionLabel.setPrimaryStyleName("switcherItemDescription"); descriptionLabel.addStyleName("descriptionLabel"); comboLayout.addComponent(descriptionLabel); mainLayout.addComponent(comboLayout); mainLayout.setExpandRatio(comboLayout, 1.0f); // forward arrow forward = new Button(""); forward.setPrimaryStyleName(cssSwitcherArrowClassname); forward.addStyleName("icon-arrow2_e"); mainLayout.addComponent(forward); updateButtonState(getValue()); updateItemDescription(); }
private Component getLegend(String entity) { HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSpacing(true); horizontalLayout.addStyleName("summary"); horizontalLayout.addStyleName("global"); Label labelx = new Label(entity); labelx.addStyleName("summary-font-legend"); Image ackdImage = new Image(null, new ThemeResource("img/acknowledged.png")); ackdImage.setWidth(16, Sizeable.Unit.PIXELS); Image unackdImage = new Image(null, new ThemeResource("img/unacknowledged.png")); unackdImage.setWidth(16, Sizeable.Unit.PIXELS); Label dummyLabel = new Label(); dummyLabel.setWidth(32, Sizeable.Unit.PIXELS); horizontalLayout.addComponent(labelx); horizontalLayout.addComponent(ackdImage); horizontalLayout.addComponent(unackdImage); horizontalLayout.addComponent(dummyLabel); horizontalLayout.setComponentAlignment(ackdImage, Alignment.TOP_RIGHT); horizontalLayout.setComponentAlignment(unackdImage, Alignment.TOP_RIGHT); horizontalLayout.setExpandRatio(labelx, 4.0f); horizontalLayout.setExpandRatio(ackdImage, 1.0f); horizontalLayout.setExpandRatio(unackdImage, 1.0f); horizontalLayout.setExpandRatio(dummyLabel, 1.0f); horizontalLayout.setWidth(375, Sizeable.Unit.PIXELS); return horizontalLayout; }