Here are the examples of the java api com.vaadin.ui.themes.ValoTheme.BUTTON_PRIMARY taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
8 Examples
19
Source : ZookeeperProviderAddUI.java
with Apache License 2.0
from learningtcc
with Apache License 2.0
from learningtcc
/**
* 创建保存按钮
* @return
*/
private Button createSaveButton() {
Button saveButton = new Button("保存", FontAwesome.CHECK);
saveButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
saveButton.addClickListener((Button.ClickListener) clickEvent -> {
String name = nameField.getValue();
if (StringUtils.isEmpty(name)) {
Notification.show("提供者名称不能为空!", Notification.Type.ERROR_MESSAGE);
return;
}
String ip = ipField.getValue();
if (StringUtils.isEmpty(ip)) {
Notification.show("IP不能为空!", Notification.Type.ERROR_MESSAGE);
return;
}
String port = portField.getValue();
if (StringUtils.isEmpty(port)) {
Notification.show("端口不能为空!", Notification.Type.ERROR_MESSAGE);
return;
}
ZookeeperProvider provider = new ZookeeperProvider();
provider.setName(name);
provider.setIp(ip);
provider.setPort(Integer.parseInt(port));
zookeeperProviderRepository.save(provider);
isAddSuccess = true;
close();
});
return saveButton;
}
19
Source : ZookeeperConsumerAddUI.java
with Apache License 2.0
from learningtcc
with Apache License 2.0
from learningtcc
/**
* 创建保存按钮
* @return
*/
private Button createSaveButton() {
Button saveButton = new Button("保存", FontAwesome.CHECK);
saveButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
saveButton.addClickListener((Button.ClickListener) clickEvent -> {
String name = nameField.getValue();
if (StringUtils.isEmpty(name)) {
Notification.show("消费者名称不能为空!", Notification.Type.ERROR_MESSAGE);
return;
}
String ip = ipField.getValue();
if (StringUtils.isEmpty(ip)) {
Notification.show("IP不能为空!", Notification.Type.ERROR_MESSAGE);
return;
}
String port = portField.getValue();
if (StringUtils.isEmpty(port)) {
Notification.show("端口不能为空!", Notification.Type.ERROR_MESSAGE);
return;
}
ZookeeperConsumer consumer = new ZookeeperConsumer();
consumer.setName(name);
consumer.setIp(ip);
consumer.setPort(Integer.parseInt(port));
zookeeperConsumerRepository.save(consumer);
isAddSuccess = true;
close();
});
return saveButton;
}
19
Source : ZookeeperAppManageUI.java
with Apache License 2.0
from learningtcc
with Apache License 2.0
from learningtcc
/**
* 创建查询按钮
* @return
*/
private Button createSearchButton() {
searchButton = new Button("查询", FontAwesome.SEARCH);
searchButton.setStyleName(ValoTheme.BUTTON_PRIMARY);
searchButton.addClickListener((Button.ClickListener) clickEvent -> {
search();
});
return searchButton;
}
19
Source : ZookeeperAppAddUI.java
with Apache License 2.0
from learningtcc
with Apache License 2.0
from learningtcc
/**
* 创建保存按钮
* @return
*/
private Button createSaveButton() {
Button saveButton = new Button("保存", FontAwesome.CHECK);
saveButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
saveButton.addClickListener((Button.ClickListener) clickEvent -> {
String name = nameField.getValue();
if (StringUtils.isEmpty(name)) {
Notification.show("服务名称不能为空!", Notification.Type.ERROR_MESSAGE);
return;
}
ZookeeperApp zookeeperApp = new ZookeeperApp();
zookeeperApp.setName(name);
zookeeperAppRepository.save(zookeeperApp);
isAddSuccess = true;
close();
});
return saveButton;
}
14
Source : InlineTextEditor.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
private Component buildEditor() {
final RichTextArea rta = new RichTextArea(property);
rta.setWidth(100.0f, Unit.PERCENTAGE);
rta.addAttachListener(new AttachListener() {
@Override
public void attach(final AttachEvent event) {
rta.focus();
rta.selectAll();
}
});
Button save = new Button("Save");
save.setDescription("Edit");
save.addStyleName(ValoTheme.BUTTON_PRIMARY);
save.addStyleName(ValoTheme.BUTTON_SMALL);
save.addClickListener(new ClickListener() {
@Override
public void buttonClick(final ClickEvent event) {
setCompositionRoot(readOnly);
}
});
CssLayout result = new CssLayout(rta, save);
result.addStyleName("edit");
result.setSizeFull();
return result;
}
11
Source : DashboardEdit.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
private Component buildFooter() {
MHorizontalLayout footer = new MHorizontalLayout();
footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
footer.setWidth(100.0f, Unit.PERCENTAGE);
Button cancel = new Button("Cancel");
cancel.addClickListener(new ClickListener() {
@Override
public void buttonClick(final ClickEvent event) {
close();
}
});
cancel.setClickShortcut(KeyCode.ESCAPE, null);
Button save = new Button("Save");
save.addStyleName(ValoTheme.BUTTON_PRIMARY);
save.addClickListener(new ClickListener() {
@Override
public void buttonClick(final ClickEvent event) {
listener.dashboardNameEdited(nameField.getValue());
close();
}
});
save.setClickShortcut(KeyCode.ENTER, null);
footer.addComponents(cancel, save);
footer.setExpandRatio(cancel, 1);
footer.setComponentAlignment(cancel, Alignment.TOP_RIGHT);
return footer;
}
7
Source : VaadinAbstractLoginComponent.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
private Component buildFields(TextField userNameField, PreplacedwordField preplacedwordField, Button loginButton) {
MHorizontalLayout fields = new MHorizontalLayout();
fields.addStyleName("fields");
userNameField.setIcon(FontAwesome.USER);
userNameField.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
preplacedwordField.setIcon(FontAwesome.LOCK);
preplacedwordField.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
loginButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
loginButton.setClickShortcut(KeyCode.ENTER);
userNameField.focus();
fields.addComponents(userNameField, preplacedwordField, loginButton);
fields.setComponentAlignment(loginButton, Alignment.BOTTOM_LEFT);
// signin.addClickListener(new ClickListener() {
// @Override
// public void buttonClick(final ClickEvent event) {
// DashboardEventBus.sessionInstance().post(new
// UserLoginRequestedEvent(username.getValue(), preplacedword.getValue()));
// }
// });
return fields;
}
4
Source : LoginComponent.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
private Component buildFields(TextField userNameField, PreplacedwordField preplacedwordField, Button loginButton) {
MHorizontalLayout fields = new MHorizontalLayout().withSpacing(true);
fields.addStyleName("fields");
userNameField.setIcon(FontAwesome.USER);
userNameField.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
preplacedwordField.setIcon(FontAwesome.LOCK);
preplacedwordField.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
loginButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
loginButton.setClickShortcut(KeyCode.ENTER);
userNameField.focus();
fields.addComponents(userNameField, preplacedwordField, loginButton);
fields.setComponentAlignment(loginButton, Alignment.BOTTOM_LEFT);
// signin.addClickListener(new ClickListener() {
// @Override
// public void buttonClick(final ClickEvent event) {
// DashboardEventBus.sessionInstance().post(new
// UserLoginRequestedEvent(username.getValue(), preplacedword.getValue()));
// }
// });
return fields;
}