本文整理汇总了Java中com.vaadin.v7.ui.Label.setStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setStyleName方法的具体用法?Java Label.setStyleName怎么用?Java Label.setStyleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.v7.ui.Label
的用法示例。
在下文中一共展示了Label.setStyleName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addUserLabel
import com.vaadin.v7.ui.Label; //导入方法依赖的package包/类
private void addUserLabel(AttendeeHistory history) {
String userInfo = "";
if (history.getUser() != null) {
User user = history.getUser();
if (user.getFirstName() != null || user.getLastName() != null) {
userInfo = String.format("%s %s (%s)", user.getFirstName(), user.getLastName(), user.getUsername());
} else {
userInfo = user.getUsername();
}
}
Label userLabel = new Label(userInfo);
userLabel.setStyleName(ValoTheme.LABEL_BOLD);
userLabel.setStyleName(ValoTheme.LABEL_SMALL);
userLabel.setSizeUndefined();
addComponent(userLabel, 0, 0);
setComponentAlignment(userLabel, Alignment.MIDDLE_LEFT);
}
示例2: addTimestampLabel
import com.vaadin.v7.ui.Label; //导入方法依赖的package包/类
private void addTimestampLabel(AttendeeHistory history) {
Label timestamp = new Label(format.format(history.getTimestamp()));
timestamp.setStyleName(ValoTheme.LABEL_SMALL);
timestamp.setSizeUndefined();
addComponent(timestamp, 1, 0);
setComponentAlignment(timestamp, Alignment.MIDDLE_RIGHT);
}
示例3: wrapTextInComponent
import com.vaadin.v7.ui.Label; //导入方法依赖的package包/类
protected Component wrapTextInComponent(String text, String style) {
Panel panel = new Panel();
VerticalLayout content = new VerticalLayout();
content.setMargin(true);
panel.setContent(content);
Label label = new Label("<pre>" + text.toString() + "</pre>", ContentMode.HTML);
if (StringUtils.isNotBlank(style)) {
label.setStyleName(style);
}
content.addComponent(label);
return panel;
}
示例4: QueryPanel
import com.vaadin.v7.ui.Label; //导入方法依赖的package包/类
public QueryPanel(IDb db, ISettingsProvider settingsProvider, IButtonBar buttonBar, String user) {
this.settingsProvider = settingsProvider;
this.db = db;
this.user = user;
this.buttonBar = buttonBar;
this.sqlArea = buildSqlEditor();
this.shortCutListeners.add(createExecuteSqlShortcutListener());
this.shortCutListeners.add(createExecuteSqlScriptShortcutListener());
VerticalLayout resultsLayout = new VerticalLayout();
resultsLayout.setMargin(false);
resultsLayout.setSpacing(false);
resultsLayout.setSizeFull();
resultsTabs = CommonUiUtils.createTabSheet();
resultStatuses = new HashMap<Component, String>();
HorizontalLayout statusBar = new HorizontalLayout();
statusBar.setMargin(false);
statusBar.addStyleName(ValoTheme.PANEL_WELL);
statusBar.setWidth(100, Unit.PERCENTAGE);
status = new Label("No Results");
status.setStyleName(ValoTheme.LABEL_SMALL);
statusBar.addComponent(status);
setSelectedTabChangeListener();
resultsLayout.addComponents(resultsTabs, statusBar);
resultsLayout.setExpandRatio(resultsTabs, 1);
addComponents(sqlArea, resultsLayout);
setSplitPosition(400, Unit.PIXELS);
emptyResults = new VerticalLayout();
emptyResults.setSizeFull();
Label label = new Label("New results will appear here");
label.setWidthUndefined();
emptyResults.addComponent(label);
emptyResults.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
resultStatuses.put(emptyResults, "No Results");
if (!settingsProvider.get().getProperties().is(SQL_EXPLORER_SHOW_RESULTS_IN_NEW_TABS)) {
createGeneralResultsTab();
}
}