Search in sources :

Example 6 with ConfirmationEvent

use of org.activiti.explorer.ui.event.ConfirmationEvent in project Activiti by Activiti.

the class UserDetailPanel method initDeleteButton.

protected void initDeleteButton(VerticalLayout actionLayout) {
    Button deleteButton = new Button(i18nManager.getMessage(Messages.USER_DELETE));
    deleteButton.addStyleName(Reindeer.BUTTON_SMALL);
    actionLayout.addComponent(deleteButton);
    deleteButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            ConfirmationDialogPopupWindow confirmPopup = new ConfirmationDialogPopupWindow(i18nManager.getMessage(Messages.USER_CONFIRM_DELETE, user.getId()));
            confirmPopup.addListener(new ConfirmationEventListener() {

                protected void rejected(ConfirmationEvent event) {
                }

                protected void confirmed(ConfirmationEvent event) {
                    // Delete user from database
                    identityService.deleteUser(user.getId());
                    // Update ui
                    userPage.refreshSelectNext();
                }
            });
            ExplorerApp.get().getViewManager().showPopupWindow(confirmPopup);
        }
    });
}
Also used : ConfirmationEventListener(org.activiti.explorer.ui.event.ConfirmationEventListener) ConfirmationEvent(org.activiti.explorer.ui.event.ConfirmationEvent) Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ConfirmationDialogPopupWindow(org.activiti.explorer.ui.custom.ConfirmationDialogPopupWindow) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 7 with ConfirmationEvent

use of org.activiti.explorer.ui.event.ConfirmationEvent in project Activiti by Activiti.

the class RemoveInvolvedPersonListener method buttonClick.

public void buttonClick(ClickEvent event) {
    User user = identityService.createUserQuery().userId(identityLink.getUserId()).singleResult();
    String name = user.getFirstName() + " " + user.getLastName();
    ConfirmationDialogPopupWindow confirmationPopup = new ConfirmationDialogPopupWindow(i18nManager.getMessage(Messages.TASK_INVOLVED_REMOVE_CONFIRMATION_TITLE, name), i18nManager.getMessage(Messages.TASK_INVOLVED_REMOVE_CONFIRMATION_DESCRIPTION, name, task.getName()));
    confirmationPopup.addListener(new ConfirmationEventListener() {

        private static final long serialVersionUID = 1L;

        protected void rejected(ConfirmationEvent event) {
        }

        protected void confirmed(ConfirmationEvent event) {
            taskService.deleteUserIdentityLink(identityLink.getTaskId(), identityLink.getUserId(), identityLink.getType());
            taskDetailPanel.notifyPeopleInvolvedChanged();
        }
    });
    viewManager.showPopupWindow(confirmationPopup);
}
Also used : ConfirmationEventListener(org.activiti.explorer.ui.event.ConfirmationEventListener) User(org.activiti.engine.identity.User) ConfirmationEvent(org.activiti.explorer.ui.event.ConfirmationEvent) ConfirmationDialogPopupWindow(org.activiti.explorer.ui.custom.ConfirmationDialogPopupWindow)

Aggregations

ConfirmationEvent (org.activiti.explorer.ui.event.ConfirmationEvent)7 ConfirmationDialogPopupWindow (org.activiti.explorer.ui.custom.ConfirmationDialogPopupWindow)6 ConfirmationEventListener (org.activiti.explorer.ui.event.ConfirmationEventListener)6 Button (com.vaadin.ui.Button)3 ClickEvent (com.vaadin.ui.Button.ClickEvent)3 ClickListener (com.vaadin.ui.Button.ClickListener)3 I18nManager (org.activiti.explorer.I18nManager)3 ViewManager (org.activiti.explorer.ViewManager)3 RuntimeService (org.activiti.engine.RuntimeService)1 TaskService (org.activiti.engine.TaskService)1 User (org.activiti.engine.identity.User)1