use of org.activiti.explorer.ui.custom.ConfirmationDialogPopupWindow 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);
}
use of org.activiti.explorer.ui.custom.ConfirmationDialogPopupWindow 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);
}
use of org.activiti.explorer.ui.custom.ConfirmationDialogPopupWindow 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);
}
use of org.activiti.explorer.ui.custom.ConfirmationDialogPopupWindow 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);
}
});
}
use of org.activiti.explorer.ui.custom.ConfirmationDialogPopupWindow 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);
}
});
}
Aggregations