本文整理汇总了Java中com.vaadin.shared.ui.label.ContentMode类的典型用法代码示例。如果您正苦于以下问题:Java ContentMode类的具体用法?Java ContentMode怎么用?Java ContentMode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ContentMode类属于com.vaadin.shared.ui.label包,在下文中一共展示了ContentMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NamedQueryResultsPanel
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
public NamedQueryResultsPanel(PageableList<HttpArticle> results) {
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
Label countLabel = new Label(String.format("%s documents matched", results.getTotalCount()));
countLabel.addStyleName(ValoTheme.LABEL_LARGE);
countLabel.setSizeFull();
layout.addComponent(countLabel);
for (HttpArticle article : results.getItems()) {
String labelHtml = String.format("%s <a href=\"%s\" target=\"_blank\">%s</a> - <strong>%s</strong>",
DataUtils.formatInUTC(article.getPublished()), article.getUrl(), article.getTitle(), article.getSource());
Label articleLabel = new Label(labelHtml);
articleLabel.setContentMode(ContentMode.HTML);
articleLabel.setSizeFull();
layout.addComponent(articleLabel);
}
setContent(layout);
}
示例2: init
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
/**
* Initialise la vue
*/
@PostConstruct
public void init() {
/* Style */
setMargin(true);
setSpacing(true);
/* Titre */
Label title = new Label(applicationContext.getMessage(NAME + ".title", null, UI.getCurrent().getLocale()));
title.addStyleName(StyleConstants.VIEW_TITLE);
addComponent(title);
/* Texte */
Label label = new Label("", ContentMode.HTML);
String msg = messageController.getMessage(NomenclatureUtils.COD_MSG_MAINTENANCE);
if (msg != null){
label.setValue(msg);
}else{
label.setValue(applicationContext.getMessage(NAME + ".text", null, UI.getCurrent().getLocale()));
}
addComponent(label);
}
示例3: getVarLayout
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
private void getVarLayout(String title, List<String> liste, HorizontalLayout hlContent){
if (liste==null || liste.size()==0){
return;
}
VerticalLayout vl = new VerticalLayout();
if (title!=null){
Label labelTitle = new Label(title);
vl.addComponent(labelTitle);
vl.setComponentAlignment(labelTitle, Alignment.MIDDLE_CENTER);
}
StringBuilder txt = new StringBuilder("<ul>");
liste.forEach(e->txt.append("<li><input type='text' value='${"+e+"}'></li>"));
txt.append("</ul>");
Label labelSearch = new Label(txt.toString(),ContentMode.HTML);
vl.addComponent(labelSearch);
hlContent.addComponent(vl);
}
示例4: updateCandidaturePresentation
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
/**
* Met a jour le panel d'info
*
* @param listePresentation
*/
private void updateCandidaturePresentation(final List<SimpleTablePresentation> listePresentation) {
int i = 0;
gridInfoLayout.removeAllComponents();
gridInfoLayout.setRows(listePresentation.size());
for (SimpleTablePresentation e : listePresentation) {
Label title = new Label(e.getTitle());
title.addStyleName(ValoTheme.LABEL_BOLD);
title.setSizeUndefined();
gridInfoLayout.addComponent(title, 0, i);
Label value = new Label((String) e.getValue(), ContentMode.HTML);
if ((e.getCode().equals("candidature." + ConstanteUtils.CANDIDATURE_LIB_LAST_DECISION)
&& e.getShortValue() != null && !e.getShortValue().equals(NomenclatureUtils.TYP_AVIS_ATTENTE))
|| (e.getCode().equals("candidature." + ConstanteUtils.CANDIDATURE_LIB_STATUT)
&& e.getShortValue() != null
&& !e.getShortValue().equals(NomenclatureUtils.TYPE_STATUT_ATT))) {
title.addStyleName(ValoTheme.LABEL_COLORED);
value.addStyleName(ValoTheme.LABEL_COLORED);
value.addStyleName(ValoTheme.LABEL_BOLD);
}
value.setWidth(100, Unit.PERCENTAGE);
gridInfoLayout.addComponent(value, 1, i);
i++;
}
}
示例5: addMentionCnil
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
/**
* ajoute la mention CNIL
*/
private void addMentionCnil() {
panelCnil.setWidth(100, Unit.PERCENTAGE);
panelCnil.setHeight(100, Unit.PIXELS);
addComponent(panelCnil);
setComponentAlignment(panelCnil, Alignment.BOTTOM_LEFT);
VerticalLayout vlContentLabelCnil = new VerticalLayout();
vlContentLabelCnil.setSizeUndefined();
vlContentLabelCnil.setWidth(100, Unit.PERCENTAGE);
vlContentLabelCnil.setMargin(true);
labelCnil.setContentMode(ContentMode.HTML);
labelCnil.addStyleName(ValoTheme.LABEL_TINY);
labelCnil.addStyleName(StyleConstants.LABEL_JUSTIFY);
labelCnil.addStyleName(StyleConstants.LABEL_SAUT_LIGNE);
vlContentLabelCnil.addComponent(labelCnil);
panelCnil.setContent(vlContentLabelCnil);
}
示例6: init
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
Label title = new Label("Live Image Editor add-on for Vaadin");
title.addStyleName(ValoTheme.LABEL_H2);
title.addStyleName(ValoTheme.LABEL_COLORED);
instructions.setContentMode(ContentMode.HTML);
instructions.setWidth(600, Unit.PIXELS);
upload.addSucceededListener(this::uploadSucceeded);
imageEditor.setWidth(100, Unit.PERCENTAGE);
imageEditor.setBackgroundColor(0, 52, 220);
VerticalLayout layout = new VerticalLayout(title, upload, instructions, imageEditor, send, result, editedImage);
layout.setSizeUndefined();
layout.setMargin(true);
layout.setSpacing(true);
setContent(layout);
setupUploadStep();
}
示例7: Footer
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
public Footer() {
addStyleName("footer");
String version = Footer.class.getPackage().getImplementationVersion();
final Label content = new Label(
"<strong>BBPlay</strong> (v. <a href=\"https://github.com/Horuss/bbplay/releases/tag/"
+ version + "\" target=\"_blank\">" + version + "</a>) \u00a9 2016"
+ (Year.now().getValue() != 2016 ? " - " + Year.now().getValue() : "")
+ " by <a href=\"http://www.horuss.pl\" target=\"_blank\">Horuss</a> | "
+ I18n.t("footer.text")
+ " <a href=\"https://github.com/Horuss/bbplay/issues\" target=\"_blank\">"
+ I18n.t("footer.linkText") + "</a>");
content.setContentMode(ContentMode.HTML);
content.setWidthUndefined();
addComponent(content);
}
示例8: ConfigUpdaterView
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
public ConfigUpdaterView() {
Label caption = new Label(ServiceContextManager.getServiceContext()
.getService(MessageProvider.class).getMessage("view.edit.name"));
Label description = new Label(ServiceContextManager.getServiceContext()
.getService(MessageProvider.class).getMessage("view.edit.description"),
ContentMode.HTML);
caption.addStyleName(UIConstants.LABEL_HUGE);
description.addStyleName(UIConstants.LABEL_LARGE);
logWidget.print("INFO: Writable Property Sources: ");
for(MutablePropertySource ps:mutableConfig.getMutablePropertySources()){
logWidget.print(ps.getName(), ", ");
}
logWidget.println();
logWidget.setHeight(100, Unit.PERCENTAGE);
HorizontalLayout hl = new HorizontalLayout(taDetails, logPopup);
hl.setSpacing(true);
addComponents(caption, description, editorWidget, hl);
}
示例9: generateStatusFields
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
private Label[] generateStatusFields() {
statusFields = new ArrayList<>();
Label solrStatus = new Label("Offline " + FontAwesome.TIMES_CIRCLE.getHtml(), ContentMode.HTML);
solrStatus.addStyleName("red-icon");
solrStatus.setCaption("Status");
statusFields.add(solrStatus);
Label numberOfDocs = new Label("100");
numberOfDocs.setCaption("Library");
statusFields.add(numberOfDocs);
Label sizeOnDisk = new Label("73MB");
sizeOnDisk.setCaption("Size");
statusFields.add(sizeOnDisk);
Label[] result = new Label[statusFields.size()];
return statusFields.toArray(result);
}
示例10: postInit
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
@PostConstruct
private void postInit() {
addStyleName("product-form-wrapper");
addStyleName("product-form");
titleLabel = new Label("Title - Author");
titleLabel.addStyleName(ValoTheme.LABEL_COLORED);
titleLabel.addStyleName(ValoTheme.LABEL_BOLD);
descriptionLabel = new Label("Description", ContentMode.HTML);
descriptionLabel.addStyleName(ValoTheme.LABEL_LIGHT);
descriptionLabel.setValue("Keine Beschreibung vorhanden");
cancelButton = new Button("close", new Button.ClickListener() {
@Override
public void buttonClick(Button.ClickEvent event) {
setLayoutVisible(false);
}
});
cancelButton.setClickShortcut(ShortcutAction.KeyCode.ESCAPE);
cancelButton.addStyleName(ValoTheme.BUTTON_DANGER);
VerticalLayout rootLayout = new VerticalLayout(titleLabel,createImageLayout(),descriptionLabel,cancelButton);
rootLayout.setSpacing(true);
addComponent(rootLayout);
}
示例11: AboutView
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
public AboutView() {
CustomLayout aboutContent = new CustomLayout("aboutview");
aboutContent.setStyleName("about-content");
// you can add Vaadin components in predefined slots in the custom
// layout
aboutContent.addComponent(
new Label(FontAwesome.INFO_CIRCLE.getHtml()
+ " This application is using Vaadin "
+ Version.getFullVersion(), ContentMode.HTML), "info");
setSizeFull();
setStyleName("about-view");
addComponent(aboutContent);
setComponentAlignment(aboutContent, Alignment.MIDDLE_CENTER);
}
示例12: createDropAreaLayout
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
private static VerticalLayout createDropAreaLayout() {
final VerticalLayout dropAreaLayout = new VerticalLayout();
final Label dropHereLabel = new Label("Drop files to upload");
dropHereLabel.setWidth(null);
final Label dropIcon = new Label(FontAwesome.ARROW_DOWN.getHtml(), ContentMode.HTML);
dropIcon.addStyleName("drop-icon");
dropIcon.setWidth(null);
dropAreaLayout.addComponent(dropIcon);
dropAreaLayout.setComponentAlignment(dropIcon, Alignment.BOTTOM_CENTER);
dropAreaLayout.addComponent(dropHereLabel);
dropAreaLayout.setComponentAlignment(dropHereLabel, Alignment.TOP_CENTER);
dropAreaLayout.setSizeFull();
dropAreaLayout.setStyleName("upload-drop-area-layout-info");
dropAreaLayout.setSpacing(false);
return dropAreaLayout;
}
示例13: createComponents
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
private void createComponents(final String labelSoftwareModule) {
titleOfArtifactDetails = new LabelBuilder().id(UIComponentIdProvider.ARTIFACT_DETAILS_HEADER_LABEL_ID)
.name(HawkbitCommonUtil.getArtifactoryDetailsLabelId(labelSoftwareModule)).buildCaptionLabel();
titleOfArtifactDetails.setContentMode(ContentMode.HTML);
titleOfArtifactDetails.setSizeFull();
titleOfArtifactDetails.setImmediate(true);
maxMinButton = createMaxMinButton();
artifactDetailsTable = createArtifactDetailsTable();
artifactDetailsTable.setContainerDataSource(createArtifactLazyQueryContainer());
addGeneratedColumn(artifactDetailsTable);
if (!readOnly) {
addGeneratedColumnButton(artifactDetailsTable);
}
setTableColumnDetails(artifactDetailsTable);
}
示例14: populateArtifactDetails
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
/**
* Populate artifact details.
*
* @param baseSwModuleId
* software module id
* @param swModuleName
* software module name
*/
public void populateArtifactDetails(final Long baseSwModuleId, final String swModuleName) {
if (!readOnly) {
if (StringUtils.isEmpty(swModuleName)) {
setTitleOfLayoutHeader();
} else {
titleOfArtifactDetails.setValue(HawkbitCommonUtil.getArtifactoryDetailsLabelId(swModuleName));
titleOfArtifactDetails.setContentMode(ContentMode.HTML);
}
}
final Map<String, Object> queryConfiguration;
if (baseSwModuleId != null) {
queryConfiguration = Maps.newHashMapWithExpectedSize(1);
queryConfiguration.put(SPUIDefinitions.BY_BASE_SOFTWARE_MODULE, baseSwModuleId);
} else {
queryConfiguration = Collections.emptyMap();
}
final LazyQueryContainer artifactContainer = getArtifactLazyQueryContainer(queryConfiguration);
artifactDetailsTable.setContainerDataSource(artifactContainer);
if (fullWindowMode && maxArtifactDetailsTable != null) {
maxArtifactDetailsTable.setContainerDataSource(artifactContainer);
}
setTableColumnDetails(artifactDetailsTable);
}
示例15: getSecurityTokenLayout
import com.vaadin.shared.ui.label.ContentMode; //导入依赖的package包/类
private HorizontalLayout getSecurityTokenLayout(final String securityToken) {
final HorizontalLayout securityTokenLayout = new HorizontalLayout();
final Label securityTableLbl = new Label(
SPUIComponentProvider.getBoldHTMLText(getI18n().getMessage("label.target.security.token")),
ContentMode.HTML);
securityTableLbl.addStyleName(SPUIDefinitions.TEXT_STYLE);
securityTableLbl.addStyleName("label-style");
final TextField securityTokentxt = new TextField();
securityTokentxt.addStyleName(ValoTheme.TEXTFIELD_BORDERLESS);
securityTokentxt.addStyleName(ValoTheme.TEXTFIELD_TINY);
securityTokentxt.addStyleName("targetDtls-securityToken");
securityTokentxt.addStyleName(SPUIDefinitions.TEXT_STYLE);
securityTokentxt.setCaption(null);
securityTokentxt.setNullRepresentation("");
securityTokentxt.setValue(securityToken);
securityTokentxt.setReadOnly(true);
securityTokenLayout.addComponent(securityTableLbl);
securityTokenLayout.addComponent(securityTokentxt);
return securityTokenLayout;
}