@Override public DashletComponent getDashboardComponent(final UI ui) { return new AbstractDashletComponent() { private Label label = new Label(m_name + " dashboard view"); public void refresh() { } public Component getComponent() { return label; } }; } }
protected Component createFieldsetTitle(String title) { Label fieldsetTitle = new Label(title); fieldsetTitle.addStyleName("fieldset-title"); return fieldsetTitle; }
private Label createInfoLabel(String caption, String propertyName, Item fileItem) throws RepositoryException { Label label = new Label("", ContentMode.TEXT); label.setCaption(caption + ": "); label.setValue(fileItem.getItemProperty(propertyName).getValue().toString()); 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; } });
/** * Creates a new instance of Label with text-contents. * * @param content * @param contentMode */ public Label(String content, ContentMode contentMode) { setValue(content); setContentMode(contentMode); setWidth(100, Unit.PERCENTAGE); }
public NameEditForm(MBeansController controller) { initFields(); this.controller = controller; captionLabel = new Label(); captionLabel.setContentMode(ContentMode.HTML); addComponent(captionLabel); addComponent(contentLayout); setWidth(100, Unit.PERCENTAGE); }
@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; }
/** * 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; }
labelTitle = new Label(" "); labelTitle.setContentMode(ContentMode.HTML); } else { labelTitle = new Label(graph.getTitle()); labelTitle.addStyleName("text"); Label labelFrom = new Label("From: " + m_timeformatService.format(beginTime.getTime(), userTimeZoneId)); labelFrom.addStyleName("text"); Label labelTo = new Label("To: " + m_timeformatService.format(endTime.getTime(), userTimeZoneId)); labelTo.addStyleName("text"); Label labelNodeLabel = new Label(data.get("nodeLabel")); labelNodeLabel.addStyleName("text"); Label labelResourceLabel = new Label(data.get("resourceTypeLabel") + ": " + data.get("resourceLabel")); labelResourceLabel.addStyleName("text");
horizontalLayout.addStyleName(onmsAlarm.getSeverity().name().toLowerCase()); Label labelAgo = new Label(); labelAgo.setSizeUndefined(); labelAgo.addStyleName("alerts-font"); labelAgo.setValue(ago); Label labelId = new Label(); labelId.setSizeUndefined(); labelId.addStyleName("alerts-font"); if (onmsNode != null) { labelId.setValue(onmsNode.getLabel() + " (" + onmsNode.getNodeId() + ")"); } else { labelId.setValue("-"); Label labelUei = new Label(); labelUei.setSizeUndefined(); labelUei.addStyleName("alerts-font"); labelUei.setValue(onmsAlarm.getUei());
private Layout createMainArea(final String description) { HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.setMargin(true); layout.setWidth(100, Unit.PERCENTAGE); Label label = new Label(description, ContentMode.PREFORMATTED); label.setWidth(100, Unit.PERCENTAGE); layout.addComponent(label); return layout; }
Label label = new Label("No alarms found!"); label.addStyleName("alert-details-noalarms-font"); component.addComponent(label); } else { Label label = new Label(sb.toString()); label.setSizeFull(); label.setContentMode(ContentMode.HTML); component.addComponent(label);
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; }
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; }
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; }
Label link = new Label(); link.setContentMode(ContentMode.HTML); link.setValue("<a href=\"/opennms/index.jsp\" id=\"onmslogo\"></a>"); addComponent(link); setExpandRatio(link, 1.0f);
public static Label createLabel(String caption, String content) { Label label = new Label(content); label.setCaption(caption); return label; }
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 createAutomaticUpdatePeriodControl(NativeSelect combo) { final CssLayout wrapper = new CssLayout() { @Override protected String getCss(Component c) { StringBuilder sb = new StringBuilder("display: inline-block; min-width: 50px;"); if (getComponentIndex(c) > 0) { sb.append("margin-left: 5px"); } return sb.toString(); } }; wrapper.setWidth("100%"); Label captionLabel = new Label(translator.translate(REPEAT_EVERY)); captionLabel.setSizeUndefined(); wrapper.addComponent(captionLabel); wrapper.addComponent(combo); Label minutesLabel = new Label(translator.translate(MINUTES)); minutesLabel.setSizeUndefined(); wrapper.addComponent(minutesLabel); return wrapper; } }
@Override public Object generateCell(Table source, Object itemId, Object columnId) { final HorizontalLayout layout = new HorizontalLayout(); final BusinessServiceStateMachine stateMachine = businessServiceManager.getStateMachine(); final BusinessService businessService = getItem(itemId).getBean().getBusinessService(); final Status status = stateMachine.getOperationalStatus(businessService); if (status != null) { final String topologyLink = new TopologyLinkBuilder() .focus(businessService.getId().toString()) .szl(1) .layout(Layout.HIERARCHY) .provider(TopologyProvider.BUSINESS_SERVICE) .getLink(); // Generate the link final Link link = new Link("View in Topology UI", new ExternalResource(topologyLink)); link.setIcon(FontAwesome.EXTERNAL_LINK_SQUARE); // This app is typically access in an iframe, so we open the URL in a new window/tab link.setTargetName("_blank"); layout.addComponent(link); layout.setComponentAlignment(link, Alignment.MIDDLE_CENTER); } else { Label label = new Label("N/A"); label.setDescription("Try reloading the daemon and refreshing the table."); label.setWidth(null); layout.addComponent(label); } return layout; } });