Search in sources :

Example 1 with ConfirmationEventListener

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

the class DeleteSubTaskClickListener method click.

public void click(ClickEvent event) {
    I18nManager i18nManager = ExplorerApp.get().getI18nManager();
    ViewManager viewManager = ExplorerApp.get().getViewManager();
    final TaskService taskService = ProcessEngines.getDefaultProcessEngine().getTaskService();
    ConfirmationDialogPopupWindow popup = new ConfirmationDialogPopupWindow(i18nManager.getMessage(Messages.TASK_CONFIRM_DELETE_SUBTASK, subTask.getName()));
    popup.addListener(new ConfirmationEventListener() {

        private static final long serialVersionUID = 1L;

        protected void rejected(ConfirmationEvent event) {
        }

        protected void confirmed(ConfirmationEvent event) {
            // delete subtask
            taskService.deleteTask(subTask.getId());
            // Refresh UI
            subTaskComponent.refreshSubTasks();
        }
    });
    viewManager.showPopupWindow(popup);
}
Also used : ConfirmationEventListener(org.activiti.explorer.ui.event.ConfirmationEventListener) ConfirmationEvent(org.activiti.explorer.ui.event.ConfirmationEvent) TaskService(org.activiti.engine.TaskService) ViewManager(org.activiti.explorer.ViewManager) ConfirmationDialogPopupWindow(org.activiti.explorer.ui.custom.ConfirmationDialogPopupWindow) I18nManager(org.activiti.explorer.I18nManager)

Example 2 with ConfirmationEventListener

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

the class DeleteMembershipListener method click.

public void click(ClickEvent event) {
    I18nManager i18nManager = ExplorerApp.get().getI18nManager();
    ViewManager viewManager = ExplorerApp.get().getViewManager();
    // Add listener to confirmation window. If confirmed, membership is deleted
    ConfirmationDialogPopupWindow confirmationPopup = new ConfirmationDialogPopupWindow(i18nManager.getMessage(Messages.USER_CONFIRM_DELETE_GROUP, userId, groupId));
    confirmationPopup.addListener(new ConfirmationEventListener() {

        protected void rejected(ConfirmationEvent event) {
        }

        protected void confirmed(ConfirmationEvent event) {
            identityService.deleteMembership(userId, groupId);
            membershipChangeListener.notifyMembershipChanged();
        }
    });
    // Show popup
    viewManager.showPopupWindow(confirmationPopup);
}
Also used : ConfirmationEventListener(org.activiti.explorer.ui.event.ConfirmationEventListener) ConfirmationEvent(org.activiti.explorer.ui.event.ConfirmationEvent) ViewManager(org.activiti.explorer.ViewManager) ConfirmationDialogPopupWindow(org.activiti.explorer.ui.custom.ConfirmationDialogPopupWindow) I18nManager(org.activiti.explorer.I18nManager)

Example 3 with ConfirmationEventListener

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

the class DeleteProcessInstanceClickListener method buttonClick.

public void buttonClick(ClickEvent event) {
    I18nManager i18nManager = ExplorerApp.get().getI18nManager();
    ViewManager viewManager = ExplorerApp.get().getViewManager();
    final ConfirmationDialogPopupWindow confirmPopup = new ConfirmationDialogPopupWindow(i18nManager.getMessage(Messages.PROCESS_INSTANCE_DELETE_POPUP_TITLE, processInstanceId), i18nManager.getMessage(Messages.PROCESS_INSTANCE_DELETE_POPUP_DESCRIPTION, processInstanceId));
    confirmPopup.addListener(new ConfirmationEventListener() {

        private static final long serialVersionUID = 1L;

        protected void confirmed(ConfirmationEvent event) {
            RuntimeService runtimeService = ProcessEngines.getDefaultProcessEngine().getRuntimeService();
            runtimeService.deleteProcessInstance(processInstanceId, null);
            processInstancePage.refreshSelectNext();
        }
    });
    viewManager.showPopupWindow(confirmPopup);
}
Also used : ConfirmationEventListener(org.activiti.explorer.ui.event.ConfirmationEventListener) ConfirmationEvent(org.activiti.explorer.ui.event.ConfirmationEvent) RuntimeService(org.activiti.engine.RuntimeService) ViewManager(org.activiti.explorer.ViewManager) ConfirmationDialogPopupWindow(org.activiti.explorer.ui.custom.ConfirmationDialogPopupWindow) I18nManager(org.activiti.explorer.I18nManager)

Example 4 with ConfirmationEventListener

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

the class GroupDetailPanel method initDeleteButton.

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

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

                protected void rejected(ConfirmationEvent event) {
                }

                protected void confirmed(ConfirmationEvent event) {
                    // Delete group from database
                    identityService.deleteGroup(group.getId());
                    // Update ui
                    groupPage.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 5 with ConfirmationEventListener

use of org.activiti.explorer.ui.event.ConfirmationEventListener 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)

Aggregations

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