use of com.vaadin.ui.Button.ClickEvent in project Activiti by Activiti.
the class ChangePasswordPopupWindow method initChangePasswordButton.
protected void initChangePasswordButton() {
errorLabel = new Label(" ", Label.CONTENT_XHTML);
errorLabel.addStyleName(Reindeer.LABEL_SMALL);
errorLabel.addStyleName(ExplorerLayout.STYLE_LABEL_RED);
layout.addComponent(errorLabel);
Button changePasswordButton = new Button(i18nManager.getMessage(Messages.PASSWORD_CHANGE));
layout.addComponent(changePasswordButton);
layout.setComponentAlignment(changePasswordButton, Alignment.MIDDLE_CENTER);
changePasswordButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
handlePasswordChange();
}
});
}
use of com.vaadin.ui.Button.ClickEvent in project Activiti by Activiti.
the class ProfilePanel method initEditProfileButton.
protected Button initEditProfileButton() {
Button editProfileButton = new Button(i18nManager.getMessage(Messages.PROFILE_EDIT));
editProfileButton.setIcon(Images.EDIT);
editProfileButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
editable = true;
initUi();
}
});
return editProfileButton;
}
use of com.vaadin.ui.Button.ClickEvent in project Activiti by Activiti.
the class ProfilePanel method initSaveProfileButton.
protected Button initSaveProfileButton() {
Button saveProfileButton = new Button(i18nManager.getMessage(Messages.PROFILE_SAVE));
saveProfileButton.setIcon(Images.SAVE);
saveProfileButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
user.setFirstName((String) firstNameField.getValue());
user.setLastName((String) lastNameField.getValue());
user.setEmail((String) emailField.getValue());
identityService.saveUser(user);
identityService.setUserInfo(user.getId(), Constants.USER_INFO_JOB_TITLE, jobTitleField.getValue().toString());
if (birthDateField.getValue() != null && !"".equals(birthDateField.getValue().toString())) {
identityService.setUserInfo(user.getId(), Constants.USER_INFO_BIRTH_DATE, new SimpleDateFormat(Constants.DEFAULT_DATE_FORMAT).format(birthDateField.getValue()));
}
identityService.setUserInfo(user.getId(), Constants.USER_INFO_LOCATION, locationField.getValue().toString());
identityService.setUserInfo(user.getId(), Constants.USER_INFO_PHONE, phoneField.getValue().toString());
identityService.setUserInfo(user.getId(), Constants.USER_INFO_TWITTER, twitterField.getValue().toString());
identityService.setUserInfo(user.getId(), Constants.USER_INFO_SKYPE, skypeField.getValue().toString());
// UI
editable = false;
loadProfileData();
initUi();
}
});
return saveProfileButton;
}
use of com.vaadin.ui.Button.ClickEvent in project Activiti by Activiti.
the class FormPopupWindow method initUi.
protected void initUi() {
VerticalLayout layout = new VerticalLayout();
layout.setSpacing(true);
addComponent(layout);
// Description
layout.addComponent(new Label(DESCRIPTION));
// Property table
propertyTable = new PropertyTable();
layout.addComponent(propertyTable);
fillFormFields();
// Buttons
HorizontalLayout buttons = new HorizontalLayout();
buttons.setSpacing(true);
// Save button
Button saveButton = new Button(ExplorerApp.get().getI18nManager().getMessage(Messages.BUTTON_SAVE));
buttons.addComponent(saveButton);
saveButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = -2906886872414089331L;
public void buttonClick(ClickEvent event) {
FormDefinition form = createForm();
formModel.addForm(taskItemId, form);
close();
}
});
// Delete button
Button deleteButton = new Button(ExplorerApp.get().getI18nManager().getMessage(Messages.BUTTON_DELETE));
buttons.addComponent(deleteButton);
deleteButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 5267967369680365653L;
public void buttonClick(ClickEvent event) {
formModel.removeForm(taskItemId);
close();
}
});
layout.addComponent(new Label(""));
layout.addComponent(buttons);
}
use of com.vaadin.ui.Button.ClickEvent in project Activiti by Activiti.
the class SaveReportPopupWindow method createSaveButton.
protected void createSaveButton(final I18nManager i18nManager, final VerticalLayout layout) {
layout.addComponent(new Label(" ", Label.CONTENT_XHTML));
Button saveButton = new Button(i18nManager.getMessage(Messages.BUTTON_SAVE));
layout.addComponent(saveButton);
layout.setComponentAlignment(saveButton, Alignment.MIDDLE_CENTER);
saveButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
String reportName = null;
// Validate
String error = null;
if (nameField.getValue() == null || ((String) nameField.getValue()).length() == 0) {
error = i18nManager.getMessage(Messages.REPORTING_SAVE_POPUP_NAME_EMPTY);
} else {
reportName = ExplorerApp.get().getLoggedInUser().getId() + "_" + nameField.getValue();
if (reportName.length() > 255) {
error = i18nManager.getMessage(Messages.REPORTING_SAVE_POPUP_NAME_TOO_LONG);
} else {
boolean nameUsed = ProcessEngines.getDefaultProcessEngine().getHistoryService().createHistoricProcessInstanceQuery().processInstanceBusinessKey(reportName).count() != 0;
if (nameUsed) {
error = i18nManager.getMessage(Messages.REPORTING_SAVE_POPUP_NAME_EXISTS);
}
}
}
if (error != null) {
setHeight(185, UNITS_PIXELS);
layout.addComponent(new Label(" ", Label.CONTENT_XHTML));
Label errorLabel = new Label(error);
errorLabel.addStyleName(ExplorerLayout.STYLE_ERROR);
layout.addComponent(errorLabel);
} else {
// Re-run reports to store the data for good now (the previous process instance was deleted)
if (originalFormProperties != null) {
startProcessInstanceWithFormProperties(reportName);
} else {
startProcessInstance(reportName);
}
// Remove the popup
if (componentToDisableOnClose != null) {
componentToDisableOnClose.setEnabled(false);
}
close();
}
}
});
}
Aggregations