use of org.activiti.explorer.ui.task.data.InboxListQuery in project Activiti by Activiti.
the class TaskMenuBar method initItems.
protected void initItems() {
setWidth("100%");
// TODO: the counts should be done later by eg a Refresher component
// Inbox
long inboxCount = new InboxListQuery().size();
ToolbarEntry inboxEntry = addToolbarEntry(ENTRY_INBOX, i18nManager.getMessage(Messages.TASK_MENU_INBOX), new ToolbarCommand() {
public void toolBarItemSelected() {
viewManager.showInboxPage();
}
});
inboxEntry.setCount(inboxCount);
// Tasks
LoggedInUser user = ExplorerApp.get().getLoggedInUser();
long tasksCount = new TasksListQuery().size();
ToolbarEntry tasksEntry = addToolbarEntry(ENTRY_TASKS, i18nManager.getMessage(Messages.TASK_MENU_TASKS), new ToolbarCommand() {
public void toolBarItemSelected() {
viewManager.showTasksPage();
}
});
tasksEntry.setCount(tasksCount);
// Queued
List<Group> groups = user.getGroups();
ToolbarPopupEntry queuedItem = addPopupEntry(ENTRY_QUEUED, (i18nManager.getMessage(Messages.TASK_MENU_QUEUED)));
long queuedCount = 0;
for (final Group group : groups) {
long groupCount = new QueuedListQuery(group.getId()).size();
queuedItem.addMenuItem(group.getName() + " (" + groupCount + ")", new ToolbarCommand() {
public void toolBarItemSelected() {
viewManager.showQueuedPage(group.getId());
}
});
queuedCount += groupCount;
}
queuedItem.setCount(queuedCount);
// Involved
long involvedCount = new InvolvedListQuery().size();
ToolbarEntry involvedEntry = addToolbarEntry(ENTRY_INVOLVED, i18nManager.getMessage(Messages.TASK_MENU_INVOLVED), new ToolbarCommand() {
public void toolBarItemSelected() {
viewManager.showInvolvedPage();
}
});
involvedEntry.setCount(involvedCount);
// Archived
long archivedCount = new ArchivedListQuery().size();
ToolbarEntry archivedEntry = addToolbarEntry(ENTRY_ARCHIVED, i18nManager.getMessage(Messages.TASK_MENU_ARCHIVED), new ToolbarCommand() {
public void toolBarItemSelected() {
viewManager.showArchivedPage();
}
});
archivedEntry.setCount(archivedCount);
}
Aggregations