use of org.activiti.explorer.ui.event.ConfirmationEvent 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.event.ConfirmationEvent in project Activiti by Activiti.
the class ConfirmationDialogPopupWindow method initButtons.
protected void initButtons(I18nManager i18nManager) {
yesButton = new Button(i18nManager.getMessage(Messages.CONFIRMATION_DIALOG_YES));
layout.addComponent(yesButton, 0, 1);
layout.setComponentAlignment(yesButton, Alignment.BOTTOM_RIGHT);
yesButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
close();
fireEvent(new ConfirmationEvent(ConfirmationDialogPopupWindow.this, true));
}
});
noButton = new Button(i18nManager.getMessage(Messages.CONFIRMATION_DIALOG_NO));
layout.addComponent(noButton, 1, 1);
layout.setComponentAlignment(noButton, Alignment.BOTTOM_LEFT);
noButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
close();
fireEvent(new ConfirmationEvent(ConfirmationDialogPopupWindow.this, false));
}
});
}
use of org.activiti.explorer.ui.event.ConfirmationEvent 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.event.ConfirmationEvent 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.event.ConfirmationEvent 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);
}
});
}
Aggregations