本文整理汇总了Java中com.vaadin.ui.Button.setPrimaryStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setPrimaryStyleName方法的具体用法?Java Button.setPrimaryStyleName怎么用?Java Button.setPrimaryStyleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.Button
的用法示例。
在下文中一共展示了Button.setPrimaryStyleName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SimpleDialog
import com.vaadin.ui.Button; //导入方法依赖的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);
}
示例2: DatePickerFooter
import com.vaadin.ui.Button; //导入方法依赖的package包/类
public DatePickerFooter(InlineDateField field, boolean lightTheme) {
setAlignItems(FlexLayout.AlignItems.CENTER);
setJustifyContent(FlexLayout.JustifyContent.FLEX_END);
addStyleName(Paddings.All.SMALL);
addStyleName(Spacings.Right.SMALL);
addStyleName(FlexItem.FlexShrink.SHRINK_0);
cancel = new Button("Cancel");
cancel.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK);
ok = new Button("OK");
ok.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK);
ok.setEnabled(field.getValue() != null);
this.field = field;
this.field.addValueChangeListener(event -> ok.setEnabled(this.field.getValue() != null));
addComponents(cancel, ok);
}
示例3: addToggleButton
import com.vaadin.ui.Button; //导入方法依赖的package包/类
public Button addToggleButton(Resource icon) {
Button button = new Button(icon);
button.setPrimaryStyleName(Styles.Buttons.Toggle.BUTTON);
button.addClickListener(event -> selectToggleButton(button));
buttons.add(button);
addComponent(button);
return button;
}
示例4: addTab
import com.vaadin.ui.Button; //导入方法依赖的package包/类
public Button addTab(MaterialIcons icon, String text) {
Button button = new Button(text);
button.setPrimaryStyleName(lightTheme ? Styles.Tabs.IconText.LIGHT : Styles.Tabs.IconText.DARK);
button.setIcon(icon);
button.addClickListener(event -> selectTab(button));
buttons.add(button);
addComponent(button);
return button;
}
示例5: ScrollableDialog
import com.vaadin.ui.Button; //导入方法依赖的package包/类
public ScrollableDialog(String title, boolean lightTheme) {
super(title);
setPrimaryStyleName(lightTheme ? Styles.Windows.LIGHT : Styles.Windows.DARK);
addStyleName(Styles.Windows.SCROLLABLE);
scrollableLayout = new FlexLayout(FlexLayout.FlexDirection.COLUMN);
scrollableLayout.setOverflow(FlexLayout.Overflow.AUTO);
scrollableLayout.addStyleName(Paddings.Horizontal.LARGE);
scrollableLayout.addStyleName(FlexItem.FlexGrow.GROW_1);
// 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.addStyleName(lightTheme ? Borders.Light.TOP : Borders.Dark.TOP);
footer.setWidth(100, Sizeable.Unit.PERCENTAGE);
// Content wrapper
content = new FlexLayout(FlexLayout.FlexDirection.COLUMN, scrollableLayout, footer);
content.addStyleName(MaxHeights.MH_FULL);
setContent(content);
}