19 package org.turro.dossier.graph;
22 import java.util.stream.Collectors;
23 import org.turro.command.Context;
24 import org.turro.dossier.entity.Dossier;
25 import org.turro.dossier.zul.menu.DossierMenu;
26 import org.turro.elephant.context.Application;
27 import org.turro.util.Cached;
28 import org.zkoss.bind.BindUtils;
29 import org.zkoss.bind.annotation.BindingParam;
30 import org.zkoss.bind.annotation.Command;
31 import org.zkoss.bind.annotation.ExecutionArgParam;
32 import org.zkoss.bind.annotation.Init;
33 import org.zkoss.bind.annotation.NotifyChange;
41 private final boolean show, all, addNew;
44 private boolean onlyOpen =
false, onlyMilestones =
true;
54 public void init(@ExecutionArgParam(
"dossier")
Dossier dossier) {
58 @NotifyChange(
"leafs")
62 @NotifyChange(
"leafs")
65 this.dossier = dossier;
69 @NotifyChange(
"leafs")
72 this.onlyMilestones = onlyMilestones;
76 @NotifyChange(
"leafs")
78 public void setOnlyOpen(@BindingParam(
"onlyOpen") Boolean onlyOpen) {
79 this.onlyOpen = onlyOpen;
86 BindUtils.postNotifyChange(
null,
null,
IssueGraphVM.this,
"leafs");
97 return onlyMilestones;
105 return graph.get().vertexSet().stream()
106 .filter(m -> m.isLeaf() && (!onlyOpen || !m.isAchieved()))
107 .collect(Collectors.toSet());
114 private final Cached<IssueGraph> graph = Cached.instance(() -> {
void selectDossier(@BindingParam("dossier") Dossier dossier)
void setOnlyOpen(@BindingParam("onlyOpen") Boolean onlyOpen)
boolean isOnlyMilestones()
IssueVertex getSelected()
Set< IssueVertex > getLeafs()
void init(@ExecutionArgParam("dossier") Dossier dossier)
void setOnlyMilestones(@BindingParam("onlyMilestones") Boolean onlyMilestones)
static IssueGraph milestones(Dossier dossier)
static IssueGraph load(Dossier dossier)
boolean isInRole(String role)
static Application getApplication()