@Override protected Widget onExtendedInitialization() { Requirement requirement = getObject(); requirementWidget = new RequirementWidget(requirement, false, false, true, false, false, false, false); taskList = new BlockListWidget<Task>(TaskInRequirementBlock.FACTORY); taskList.setAutoSorter(requirement.getTasksOrderComparator()); if (requirement.getProject().isTeamMember(getCurrentUser())) { taskList.setDndSorting(true); taskList.setMoveObserver(new MoveObserver()); } createTaskButton = new ButtonWidget(new CreateTaskAction(requirement)); changeHistoryWidget = new ChangeHistoryWidget(requirement); FlowPanel left = new FlowPanel(); left.add(requirementWidget); left.add(taskList); left.add(Gwt.createDiv("CreateTaskButtonWrapper", createTaskButton)); left.add(changeHistoryWidget); right = new FlowPanel(); if (requirement.isDecidable() && requirement.getProject().isProductOwner(getCurrentUser())) { right.add(RequirementWidget.createActionsPanelForCompletedRequirement(requirement)); right.add(Gwt.createSpacer(1, 10)); } right.add(ScrumGwt.createEmoticonsAndComments(requirement)); bodyWidget = TableBuilder.row(20, left, right); return bodyWidget; }
@Override protected void onUpdateBody() { requirementWidget.update(); taskList.setObjects(getObject().getTasks()); taskList.update(); Gwt.update(right, createTaskButton); changeHistoryWidget.update(); }
private Widget createEventList(Date date) { BlockListWidget<SimpleEvent> list = new BlockListWidget<SimpleEvent>( SimpleEventBlock.FACTORY, new ChangeSimpleEventDateDropAction(date)); list.setSelectionManager(selectionManager); list.setAutoSorter(SimpleEvent.TIME_COMPARATOR); lists.put(date, list); return list; }
@Override protected Widget onInitialization() { list = new BlockListWidget<Task>(new TaskBlock.TaskBlockFactory(container), this.dropAction); list.setSelectionManager(container.getSelectionManager()); list.setMinHeight(100); list.setAutoSorter(requirement.getTasksOrderComparator()); if (requirement.getProject().isTeamMember(getCurrentUser())) { list.setDndSorting(createTaskButton); list.setMoveObserver(new MoveObserver()); } FlowPanel panel = new FlowPanel(); panel.add(list); if (createTaskButton) panel.add( Gwt.createDiv( "CreateTaskButtonWrapper", new ButtonWidget(new CreateTaskAction(requirement)).update())); return panel; }
public void setTaskHighlighting(ElementPredicate<Task> predicate) { list.setTaskHighlighting(predicate); }
public void setTasks(List<Task> tasks) { initialize(); list.setObjects(tasks); }
public boolean selectTask(Task task) { if (!list.contains(task)) update(); return list.showObject(task); }
public Task getSelectedTask() { return list == null ? null : list.getExtendedObject(); }
public void clearTaskHighlighting() { list.clearTaskHighlighting(); }
public void selectTask(Task task) { taskList.showObject(task); }