use of com.vaadin.ui.Button.ClickListener in project Activiti by Activiti.
the class NewGroupPopupWindow method initCreateButton.
protected void initCreateButton() {
HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.setWidth(100, UNITS_PERCENTAGE);
form.getFooter().setWidth(100, UNITS_PERCENTAGE);
form.getFooter().addComponent(buttonLayout);
Button createButton = new Button(i18nManager.getMessage(Messages.GROUP_CREATE));
buttonLayout.addComponent(createButton);
buttonLayout.setComponentAlignment(createButton, Alignment.BOTTOM_RIGHT);
createButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
handleFormSubmit();
}
});
}
use of com.vaadin.ui.Button.ClickListener in project Activiti by Activiti.
the class NewUserPopupWindow method initCreateButton.
protected void initCreateButton() {
HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.setWidth(100, UNITS_PERCENTAGE);
form.getFooter().setWidth(100, UNITS_PERCENTAGE);
form.getFooter().addComponent(buttonLayout);
Button createButton = new Button(i18nManager.getMessage(Messages.USER_CREATE));
buttonLayout.addComponent(createButton);
buttonLayout.setComponentAlignment(createButton, Alignment.BOTTOM_RIGHT);
createButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
handleFormSubmit();
}
});
}
use of com.vaadin.ui.Button.ClickListener in project Activiti by Activiti.
the class UserDetailPanel method initSaveButton.
protected void initSaveButton(VerticalLayout actionLayout) {
Button saveButton = new Button(i18nManager.getMessage(Messages.USER_SAVE));
saveButton.addStyleName(Reindeer.BUTTON_SMALL);
actionLayout.addComponent(saveButton);
saveButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
String originalFirstName = user.getFirstName();
String originalLastName = user.getLastName();
// Change data
user.setFirstName(firstNameField.getValue().toString());
user.setLastName(lastNameField.getValue().toString());
user.setEmail(emailField.getValue().toString());
if (passwordField.getValue() != null && !"".equals(passwordField.getValue().toString())) {
user.setPassword(passwordField.getValue().toString());
}
identityService.saveUser(user);
// Refresh detail panel
editingDetails = false;
userDetailsLayout.removeAllComponents();
populateUserDetails();
// Refresh task list (only if name was changed)
if (nameChanged(originalFirstName, originalLastName)) {
userPage.notifyUserChanged(user.getId());
}
}
});
}
use of com.vaadin.ui.Button.ClickListener in project Activiti by Activiti.
the class UserDetailPanel method initAddGroupsButton.
protected void initAddGroupsButton(HorizontalLayout groupHeader) {
Button addRelatedContentButton = new Button();
addRelatedContentButton.addStyleName(ExplorerLayout.STYLE_ADD);
groupHeader.addComponent(addRelatedContentButton);
groupHeader.setComponentAlignment(addRelatedContentButton, Alignment.MIDDLE_RIGHT);
addRelatedContentButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
final GroupSelectionPopupWindow selectionPopup = new GroupSelectionPopupWindow(identityService, user.getId());
selectionPopup.addListener(new SubmitEventListener() {
private static final long serialVersionUID = 1L;
protected void submitted(SubmitEvent event) {
Set<String> selectedGroups = selectionPopup.getSelectedGroupIds();
if (!selectedGroups.isEmpty()) {
for (String groupId : selectedGroups) {
identityService.createMembership(user.getId(), groupId);
}
notifyMembershipChanged();
}
}
protected void cancelled(SubmitEvent event) {
}
});
ExplorerApp.get().getViewManager().showPopupWindow(selectionPopup);
}
});
}
use of com.vaadin.ui.Button.ClickListener in project Activiti by Activiti.
the class UserDetailPanel method initEditButton.
protected void initEditButton(VerticalLayout actionLayout) {
Button editButton = new Button(i18nManager.getMessage(Messages.USER_EDIT));
editButton.addStyleName(Reindeer.BUTTON_SMALL);
actionLayout.addComponent(editButton);
editButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
editingDetails = true;
userDetailsLayout.removeAllComponents();
// the layout will be populated differently since the 'editingDetails' boolean is set
populateUserDetails();
}
});
}
Aggregations