use of com.vaadin.ui.Button.ClickListener in project Activiti by Activiti.
the class AccountSelectionPopup method initAlfrescoComponent.
protected void initAlfrescoComponent() {
alfrescoForm = new Form();
alfrescoForm.setDescription(i18nManager.getMessage(Messages.ALFRESCO_DESCRIPTION));
final TextField alfrescoServer = new TextField(i18nManager.getMessage(Messages.ALFRESCO_SERVER));
alfrescoForm.getLayout().addComponent(alfrescoServer);
final TextField alfrescoUserName = new TextField(i18nManager.getMessage(Messages.ALFRESCO_USERNAME));
alfrescoForm.getLayout().addComponent(alfrescoUserName);
final PasswordField alfrescoPassword = new PasswordField(i18nManager.getMessage(Messages.ALFRESCO_PASSWORD));
alfrescoForm.getLayout().addComponent(alfrescoPassword);
// Matching listener
alfrescoClickListener = new ClickListener() {
public void buttonClick(ClickEvent event) {
Map<String, Object> accountDetails = createAccountDetails("alfresco", alfrescoUserName.getValue().toString(), alfrescoPassword.getValue().toString(), "server", alfrescoServer.getValue().toString());
fireEvent(new SubmitEvent(AccountSelectionPopup.this, SubmitEvent.SUBMITTED, accountDetails));
}
};
}
use of com.vaadin.ui.Button.ClickListener 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.ClickListener 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.ClickListener 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.ClickListener 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