getSelection((HtmlTree)event.getComponent());
}
private AbstractTreeItem getSelection(HtmlTree tree) {
ListRowKey<Integer> rowKey = (ListRowKey<Integer>)tree.getRowKey();
AbstractTreeItem sel = getNode(rowKey, treeCollection.getColl());
if (sel instanceof ItemGroup) {
getUC().setSelectedItemGroup(sel);
}
else if (sel instanceof Issue) {
setSelectedIssue(sel);
if ( sel.getParent() != null ) {
getUC().setSelectedItemGroup((ItemGroup)sel.getParent());
}
}
else if (sel instanceof Item) {
selectedItem = sel;
if ( sel.getParent() != null ) {
getUC().setSelectedItemGroup((ItemGroup)sel.getParent());
}
}
else if (sel instanceof Task) {
setSelectedTask(sel);
if ( sel.getParent() != null ) {
selectedItem = (Item)sel.getParent();
if ( selectedItem.getParent() != null ) {
getUC().setSelectedItemGroup((ItemGroup)selectedItem.getParent());
}
}
}
this.log(Level.INFO, "Selected "+sel.getClass().getName() + ": " + sel);
return sel;
}