本文整理匯總了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);
}