use of org.activiti.explorer.ui.event.SubmitEvent in project Activiti by Activiti.
the class AccountSelectionPopup method initImapComponent.
protected void initImapComponent() {
imapForm = new Form();
imapForm.setDescription(i18nManager.getMessage(Messages.IMAP_DESCRIPTION));
final TextField imapServer = new TextField(i18nManager.getMessage(Messages.IMAP_SERVER));
imapForm.getLayout().addComponent(imapServer);
final TextField imapPort = new TextField(i18nManager.getMessage(Messages.IMAP_PORT));
imapPort.setWidth(30, UNITS_PIXELS);
// Default imap port (non-ssl)
imapPort.setValue(143);
imapForm.getLayout().addComponent(imapPort);
final CheckBox useSSL = new CheckBox(i18nManager.getMessage(Messages.IMAP_SSL));
useSSL.setValue(false);
useSSL.setImmediate(true);
imapForm.getLayout().addComponent(useSSL);
useSSL.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
imapPort.setValue(((Boolean) useSSL.getValue()) ? 993 : 143);
}
});
final TextField imapUserName = new TextField(i18nManager.getMessage(Messages.IMAP_USERNAME));
imapForm.getLayout().addComponent(imapUserName);
final PasswordField imapPassword = new PasswordField(i18nManager.getMessage(Messages.IMAP_PASSWORD));
imapForm.getLayout().addComponent(imapPassword);
// Matching listener
imapClickListener = new ClickListener() {
public void buttonClick(ClickEvent event) {
Map<String, Object> accountDetails = createAccountDetails("imap", imapUserName.getValue().toString(), imapPassword.getValue().toString(), "server", imapServer.getValue().toString(), "port", imapPort.getValue().toString(), "ssl", imapPort.getValue().toString());
fireEvent(new SubmitEvent(AccountSelectionPopup.this, SubmitEvent.SUBMITTED, accountDetails));
}
};
}
use of org.activiti.explorer.ui.event.SubmitEvent in project Activiti by Activiti.
the class GroupDetailPanel method initAddMembersButton.
protected void initAddMembersButton(HorizontalLayout membersHeader) {
Button addButton = new Button();
addButton.addStyleName(ExplorerLayout.STYLE_ADD);
membersHeader.addComponent(addButton);
membersHeader.setComponentAlignment(addButton, Alignment.MIDDLE_RIGHT);
addButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
final SelectUsersPopupWindow selectUsersPopup = new SelectUsersPopupWindow(i18nManager.getMessage(Messages.GROUP_SELECT_MEMBERS, group.getId()), true, false, getCurrentMembers());
ExplorerApp.get().getViewManager().showPopupWindow(selectUsersPopup);
// Listen to submit events (that contain the selected users)
selectUsersPopup.addListener(new SubmitEventListener() {
protected void submitted(SubmitEvent event) {
Collection<String> userIds = selectUsersPopup.getSelectedUserIds();
if (!userIds.isEmpty()) {
for (String userId : userIds) {
identityService.createMembership(userId, group.getId());
}
notifyMembershipChanged();
}
}
protected void cancelled(SubmitEvent event) {
}
});
}
});
}
use of org.activiti.explorer.ui.event.SubmitEvent in project Activiti by Activiti.
the class GroupSelectionPopupWindow method initSelectButton.
protected void initSelectButton() {
final Button selectButton = new Button(i18nManager.getMessage(Messages.USER_SELECT_GROUPS));
addComponent(selectButton);
((VerticalLayout) getContent()).setComponentAlignment(selectButton, Alignment.BOTTOM_RIGHT);
selectButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
fireEvent(new SubmitEvent(selectButton, SubmitEvent.SUBMITTED));
close();
}
});
}
use of org.activiti.explorer.ui.event.SubmitEvent 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 org.activiti.explorer.ui.event.SubmitEvent 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));
}
};
}
Aggregations