use of org.activiti.explorer.I18nManager 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.I18nManager in project Activiti by Activiti.
the class PrettyTimeLabel method init.
protected void init() {
final I18nManager i18nManager = ExplorerApp.get().getI18nManager();
if (date != null) {
DateFormat dateFormat = null;
if (showTime) {
dateFormat = new SimpleDateFormat(Constants.DEFAULT_TIME_FORMAT);
} else {
dateFormat = new SimpleDateFormat(Constants.DEFAULT_DATE_FORMAT);
}
if (labelTemplate != null) {
super.setValue(MessageFormat.format(labelTemplate, new HumanTime(i18nManager).format(date)));
} else {
super.setValue(new HumanTime(i18nManager).format(date));
}
setDescription(dateFormat.format(date));
} else {
super.setValue(noDateCaption);
setDescription(noDateCaption);
}
}
use of org.activiti.explorer.I18nManager 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.I18nManager in project Activiti by Activiti.
the class MonthFormPropertyRenderer method getPropertyField.
public Field getPropertyField(FormProperty formProperty) {
ComboBox comboBox = new MonthCombobox(getPropertyLabel(formProperty));
comboBox.setRequired(formProperty.isRequired());
comboBox.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty)));
comboBox.setEnabled(formProperty.isWritable());
// Fill combobox
I18nManager i18nManager = ExplorerApp.get().getI18nManager();
for (int i = 0; i < 12; i++) {
comboBox.addItem(i);
comboBox.setItemCaption(i, i18nManager.getMessage(Messages.MONTH_PREFIX + i));
}
// Select first
comboBox.setNullSelectionAllowed(false);
Calendar cal = Calendar.getInstance();
comboBox.select(cal.get(Calendar.MONTH));
return comboBox;
}
use of org.activiti.explorer.I18nManager 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);
}
Aggregations