private void debug() { if (!debugEnabled) { return; } String debug = "#" + iteration + ", i=" + index + ", w=" + waitFor; debugLabel.setValue(debug); }
public ConfirmationDialog withDescription(String description) { label.setValue(description); return this; }
public void setLabelText(String label) { label = String.format("%s. This may take a while ...", label); this.label.setValue(label); } }
public void setSemanticZoomLevelLabel(int semanticZoomLevel) { m_zoomLevelLabel.setValue(String.valueOf(semanticZoomLevel)); m_szlOutBtn.setEnabled(semanticZoomLevel > 0); }
private void render() { if (text != null) { setContentMode(ContentMode.HTML); StringBuilder sb = new StringBuilder("<h"); sb.append(headerLevel); sb.append(">"); sb.append(Jsoup.clean(text, getWhitelist())); sb.append("</h"); sb.append(headerLevel); sb.append(">"); super.setValue(sb.toString()); text = null; } }
/** * 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); }
/** * 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; }
protected void updateLabel() { String caption; if (captionGenerator != null) { caption = captionGenerator.getCaption(getValue()); } else { caption = getValue().toString(); } label.setValue(caption); }
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; }
public void setMessage(String message) { this.message = message; if (getContent() != null && getContent() instanceof Label) { ((Label) getContent()).setValue(message); } }
/** * Add File Name.<br> */ protected Component getFileDetailFileName() { Label label = new Label(); label.setCaption(i18n.translate("dam.assets.filePreview.title")); label.setValue(PathUtil.stripExtension(currentAsset.getFileName())); return label; }
/** * Add File Format.<br> */ protected Component getFileDetailFileFormat() { Label label = new Label(); label.setCaption(i18n.translate("dam.assets.filePreview.format")); label.setValue(PathUtil.getExtension(currentAsset.getFileName())); return label; } }
@Override public void readDesign(Element design, DesignContext designContext) { super.readDesign(design, designContext); String innerHtml = design.html(); boolean plainText = design.hasAttr(DESIGN_ATTR_PLAIN_TEXT); if (plainText) { setContentMode(ContentMode.TEXT); } else { setContentMode(ContentMode.HTML); } if (innerHtml != null && !"".equals(innerHtml)) { if (plainText) { innerHtml = DesignFormatter.decodeFromTextNode(innerHtml); } setValue(innerHtml); } }
/** * Add File Info. */ protected Component getFileDetailSize() { Label label = new Label(); label.setCaption(i18n.translate("dam.assets.filePreview.size")); label.setValue(FileUtils.byteCountToDisplaySize(currentAsset.getFileSize())); return label; }
/** * Add File Info. */ @Override protected Component getFileDetailSize() { Label label = new Label(); label.setCaption(i18n.translate(fileDetailSizeCaption)); StringBuilder sb = new StringBuilder(); if (getValue().isImage()) { sb.append(getValue().getWidth() + " x " + getValue().getHeight() + ", "); } sb.append(FileUtils.byteCountToDisplaySize(getValue().getFileSize())); if (getValue().getDuration() > 0) { sb.append("(x:x min)"); } label.setValue(sb.toString()); return label; }
private void updateLabel(String viewName) { label.setValue(generateLabel(viewName)); UiState uiState = UiState.valueOf(viewName); if (uiState.hasUi()) { helpPopupView.setContent(new HelpContent(UiState.valueOf(viewName))); } }
private void updateItemDescription() { String description = null; final Object itemId = getValue(); final Item item = getContainerDataSource().getItem(itemId); boolean isDescriptionBlank = true; if (item != null) { Property property = item.getItemProperty(descriptionPropertyName); if (property != null && property.getValue() != null) { description = property.getValue().toString(); } isDescriptionBlank = StringUtils.isBlank(description); descriptionLabel.setValue(isDescriptionBlank ? "" : description); } if (isDescriptionBlank) { mainLayout.removeStyleName("has-description"); } else { mainLayout.addStyleName("has-description"); } descriptionLabel.setVisible(!isDescriptionBlank); } }
@Override public void selectionChanged(SelectionChangedEvent event) { Object selectedBean = event.getSelectedBean(); if (selectedBean instanceof Mbean) { captionLabel.setValue(String.format(CAPTION_FORMAT, "MBean Attributes")); nameEditForm.setParameter(MBEAN_FORM_PARAMETER); nameEditForm.selectionChanged(event); attributesTable.modelChanged(event.getSelectedItem(), event.getSelectedBean(), controller.getContainer(Attrib.class, selectedBean)); setContent(contentLayout); return; } if (selectedBean instanceof CompAttrib) { captionLabel.setValue(String.format(CAPTION_FORMAT, "Composite Members")); nameEditForm.setParameter(COMPOSITE_FORM_PARAMETER); nameEditForm.selectionChanged(event); attributesTable.modelChanged(event.getSelectedItem(), event.getSelectedBean(), controller.getContainer(CompMember.class, selectedBean)); setContent(contentLayout); return; } setContent(emptyLayout); }
/** * 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; }
public InfoDialog(String caption, String description) { setCaption(caption); setModal(true); setResizable(false); setClosable(false); setWidth(400, Unit.PIXELS); setHeight(200, Unit.PIXELS); okButton = UIHelper.createButton("ok", null, null, event -> InfoDialog.this.close()); okButton.setId("infoDialog.button.ok"); label.setValue(description); final HorizontalLayout buttonLayout = new HorizontalLayout(okButton); buttonLayout.setSpacing(true); layout.setSpacing(true); layout.setMargin(true); layout.setSizeFull(); layout.addComponent(label); layout.addComponent(buttonLayout); layout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT); setContent(layout); center(); }