org.openl.rules.ui.tree.VersionedTreeNode Maven / Gradle / Ivy
package org.openl.rules.ui.tree;
import java.util.Map;
import java.util.TreeMap;
import org.openl.rules.lang.xls.binding.TableVersionComparator;
import org.openl.rules.lang.xls.syntax.TableSyntaxNode;
import org.openl.rules.ui.IProjectTypes;
/**
* Folder tree node that represents table with several versions. If node has several versions then folder node will be
* linked with one of its child. If node has only one version then it will be leaf in tree.
*
* Linked child is child with "active" table(there is only one "active" table among all version of the table) or the
* child with greatest version.
*
* @author PUdalau
*/
public class VersionedTreeNode extends ProjectTreeNode {
private TableSyntaxNode linkedChild;
VersionedTreeNode(String[] displayName, TableSyntaxNode table) {
super(displayName, String.format("%s.%s", IProjectTypes.PT_TABLE, table.getType()).intern(), null);
}
@Override
public String getType() {
return String.format("%s.%s", IProjectTypes.PT_TABLE, linkedChild.getType()).intern();
}
@Override
public TableSyntaxNode getTableSyntaxNode() {
return linkedChild;
}
@Override
public Map