X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=cms%2Forg.argeo.slc.client.ui%2Fsrc%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fmodel%2FResultParent.java;fp=cms%2Forg.argeo.slc.client.ui%2Fsrc%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fmodel%2FResultParent.java;h=8ea91f2a745a530c60281d417711184d3c4cb9d2;hb=ecc22e604e47533c79de9cecdcdeacbc752cbff1;hp=0000000000000000000000000000000000000000;hpb=e07ded4632e53f8b8869763bc1f1f4091361e76e;p=gpl%2Fargeo-slc.git diff --git a/cms/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/model/ResultParent.java b/cms/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/model/ResultParent.java new file mode 100644 index 000000000..8ea91f2a7 --- /dev/null +++ b/cms/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/model/ResultParent.java @@ -0,0 +1,42 @@ +package org.argeo.slc.client.ui.model; + +import org.argeo.eclipse.ui.TreeParent; + +/** + * Common base UI object to build result Tree. + */ + +public abstract class ResultParent extends TreeParent { + + public ResultParent(String name) { + super(name); + } + + private boolean isPassed = true; + + protected synchronized void setPassed(boolean isPassed) { + this.isPassed = isPassed; + } + + public boolean isPassed() { + return isPassed; + } + + @Override + public synchronized boolean hasChildren() { + // only initialize when needed : correctly called by the jface framework + if (!isLoaded()) + initialize(); + return super.hasChildren(); + } + + public void forceFullRefresh() { + // if (isDisposed) + // return; + if (hasChildren()) + clearChildren(); + initialize(); + } + + protected abstract void initialize(); +}