本文整理了Java中com.vaadin.v7.ui.Label.<init>()
方法的一些代码示例,展示了Label.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.<init>()
方法的具体详情如下:
包路径:com.vaadin.v7.ui.Label
类名称:Label
方法名:<init>
[英]Creates an empty Label.
[中]创建一个空标签。
代码示例来源:origin: OpenNMS/opennms
@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;
}
};
}
}
代码示例来源:origin: OpenNMS/opennms
@Override
public DashletComponent getWallboardComponent(final UI ui) {
return new AbstractDashletComponent() {
private Label label = new Label(m_name + " wallboard view");
public void refresh() {
}
public Component getComponent() {
return label;
}
};
}
代码示例来源:origin: OpenNMS/opennms
public static Label createLabel(String caption, String content) {
Label label = new Label(content);
label.setCaption(caption);
return label;
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework
/**
* Opens a notification of given {@link MessageStyleType type}, with given body text; it can close automatically after a timeout.
*/
@Override
public void openNotification(MessageStyleType type, boolean doesTimeout, final String title) {
openNotification(type, doesTimeout, new ViewAdapter(new Label(title, ContentMode.HTML)));
}
代码示例来源:origin: info.magnolia.activation/magnolia-module-activation
protected Component createFieldsetTitle(String title) {
Label fieldsetTitle = new Label(title);
fieldsetTitle.addStyleName("fieldset-title");
return fieldsetTitle;
}
代码示例来源:origin: OpenNMS/opennms
@Override
public Component getComponent() {
return new Label(this.renderResult.getOutput(), ContentMode.HTML);
}
代码示例来源:origin: OpenNMS/opennms
@Override
public Object generateCell(Table table, final Object itemId, Object columnId) {
Label label = new Label((String) itemId);
label.setSizeFull();
label.addStyleName("white");
return label;
}
});
代码示例来源:origin: OpenNMS/opennms
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
Property<OnmsSeverity> property = source.getContainerProperty(itemId, columnId);
if (property == null || property.getValue() == null) {
return null;
} else {
OnmsSeverity severity = property.getValue();
String label = severity.getLabel();
label = label.toLowerCase();
label = new String(label.substring(0, 1)).toUpperCase() + label.substring(1);
return new Label(" " + escapeHtml(label), Label.CONTENT_XML);
}
}
代码示例来源:origin: info.magnolia.dam/magnolia-dam-app
/**
* 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;
}
代码示例来源:origin: OpenNMS/opennms
@Override
public Component getComponent() {
VerticalLayout verticalLayout = new VerticalLayout();
Label label = new Label("The specified dashlet could not be found!");
verticalLayout.addComponent(label);
verticalLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
return verticalLayout;
}
};
代码示例来源:origin: info.magnolia.contacts/magnolia-contacts
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;
}
代码示例来源:origin: OpenNMS/opennms
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;
}
});
代码示例来源:origin: OpenNMS/opennms
public NameEditForm(MBeansController controller) {
initFields();
this.controller = controller;
captionLabel = new Label();
captionLabel.setContentMode(ContentMode.HTML);
addComponent(captionLabel);
addComponent(contentLayout);
setWidth(100, Unit.PERCENTAGE);
}
代码示例来源:origin: info.magnolia.dam/magnolia-dam-app
/**
* 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;
}
}
代码示例来源:origin: info.magnolia.dam/magnolia-dam-app
/**
* 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;
}
代码示例来源:origin: info.magnolia.dam/magnolia-dam-app
@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;
}
代码示例来源:origin: info.magnolia.dam/magnolia-dam-app
/**
* 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;
}
代码示例来源:origin: OpenNMS/opennms
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;
}
代码示例来源:origin: OpenNMS/opennms
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;
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework
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);
}
内容来源于网络,如有侵权,请联系作者删除!