本文整理匯總了Java中com.vaadin.ui.Label.setPrimaryStyleName方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setPrimaryStyleName方法的具體用法?Java Label.setPrimaryStyleName怎麽用?Java Label.setPrimaryStyleName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.Label
的用法示例。
在下文中一共展示了Label.setPrimaryStyleName方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addItem
import com.vaadin.ui.Label; //導入方法依賴的package包/類
public void addItem(Object... values) {
FlexLayout item = new FlexLayout();
item.setPrimaryStyleName("md-datatable-row");
item.addStyleName(Spacings.Right.LARGE);
item.addStyleName(Paddings.Vertical.TABLE);
for (Object value : values) {
if (value instanceof String) {
Label lbl = new Label((String) value);
lbl.setContentMode(ContentMode.HTML);
lbl.setPrimaryStyleName(Typography.Dark.Table.Row.PRIMARY);
item.addComponent(lbl);
} else if (value instanceof Component) {
item.addComponent((Component) value);
}
}
items.addComponent(item);
}
示例2: SimpleDialog
import com.vaadin.ui.Label; //導入方法依賴的package包/類
public SimpleDialog(String title, String message, boolean lightTheme) {
super(title);
addStyleName(lightTheme ? Styles.Windows.LIGHT : Styles.Windows.DARK);
label = new Label(message);
label.setPrimaryStyleName(lightTheme ? Typography.Dark.Subheader.SECONDARY : Typography.Light.Subheader.SECONDARY);
label.addStyleName(Paddings.Horizontal.LARGE + " " + Paddings.Bottom.LARGE);
// Footer
cancel = new Button("Cancel");
cancel.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK);
cancel.addClickListener(e -> close());
ok = new Button("OK");
ok.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK);
ok.addClickListener(e -> close());
footer = new FlexLayout(cancel, ok);
footer.setJustifyContent(FlexLayout.JustifyContent.FLEX_END);
footer.addStyleName(Paddings.All.SMALL + " " + Spacings.Right.SMALL + " " + FlexItem.FlexShrink.SHRINK_0);
footer.setWidth(100, Unit.PERCENTAGE);
// Content wrapper
content = new FlexLayout(FlexLayout.FlexDirection.COLUMN, label, footer);
setContent(content);
}
示例3: AccordionItemMenu
import com.vaadin.ui.Label; //導入方法依賴的package包/類
/**
* Constructeur
*
* @param title
* @param parent
*/
public AccordionItemMenu(String title, AccordionMenu parent,
Boolean isExpandable) {
super();
setWidth(100, Unit.PERCENTAGE);
/*
* Les labels n'etant pas cliquable, on passe par un layout
* intermediaire
*/
VerticalLayout layoutClickable = new VerticalLayout();
layoutClickable.setWidth(100, Unit.PERCENTAGE);
/* Label */
Label label = new Label(title);
label.setPrimaryStyleName(ValoTheme.MENU_SUBTITLE);
label.setSizeUndefined();
layoutClickable.addComponent(label);
layoutClickable.addStyleName(StyleConstants.VALO_MENUACCORDEON);
addComponent(layoutClickable);
if (isExpandable) {
layoutClickable.addStyleName(StyleConstants.CLICKABLE);
layoutClickable.addLayoutClickListener(e -> {
parent.changeItem((String) getData());
});
}
vlButton = new VerticalLayout();
vlButton.addStyleName(StyleConstants.VALO_MENUACCORDEON);
vlButton.setWidth(100, Unit.PERCENTAGE);
addComponent(vlButton);
}
示例4: AppBar
import com.vaadin.ui.Label; //導入方法依賴的package包/類
public AppBar() {
super();
setPrimaryStyleName("md-appbar");
addStyleName(MaterialColor.BLUE_500.getBackgroundColorStyle());
naviIcon.setIcon(MaterialIcons.MENU);
naviIcon.setPrimaryStyleName(Styles.Buttons.NAV_ICON);
Label appBarTitle = new Label("Material Design");
appBarTitle.setPrimaryStyleName(Typography.Light.Title.PRIMARY);
appBarTitle.setSizeUndefined();
addComponents(naviIcon, appBarTitle);
}
示例5: setHeaders
import com.vaadin.ui.Label; //導入方法依賴的package包/類
public void setHeaders(String... headers) {
for (String header : headers) {
Label lbl = new Label(header);
lbl.setContentMode(ContentMode.HTML);
lbl.setPrimaryStyleName(Typography.Dark.Table.Header.SECONDARY);
this.headers.addComponent(lbl);
}
}
示例6: createLabel
import com.vaadin.ui.Label; //導入方法依賴的package包/類
private Label createLabel(String style) {
Label lbl = new Label();
lbl.setPrimaryStyleName(style);
style = style.substring(3).replace("-", " ");
style = style.substring(0, 1).toUpperCase() + style.substring(1);
lbl.setValue(style);
return lbl;
}
示例7: createCaption
import com.vaadin.ui.Label; //導入方法依賴的package包/類
private Label createCaption(String text) {
Label lbl = new Label(text);
lbl.setPrimaryStyleName(Typography.Dark.Caption.SECONDARY);
lbl.addStyleName(FlexItem.FlexShrink.SHRINK_0);
lbl.setWidth(120, Unit.PIXELS);
return lbl;
}
示例8: createInfoText
import com.vaadin.ui.Label; //導入方法依賴的package包/類
private Label createInfoText(String text) {
Label lbl = new Label(text);
lbl.setPrimaryStyleName(Typography.Dark.Subheader.SECONDARY);
lbl.addStyleName(Margins.Bottom.LARGE);
return lbl;
}
示例9: createTableRow
import com.vaadin.ui.Label; //導入方法依賴的package包/類
private Label createTableRow(String text) {
Label lbl = new Label(text);
lbl.setPrimaryStyleName(Typography.Dark.Table.Row.PRIMARY);
return lbl;
}