public WModelIndex getParent(final WModelIndex index) { if (!(index != null) || index.getInternalId() == 0) { return null; } else { final GitModel.Tree item = this.treeData_.get(index.getInternalId()); return this.createIndex(item.getIndex(), 0, item.getParentId()); } }
public WModelIndex getIndex(int row, int column, final WModelIndex parent) { int parentId; if (!(parent != null)) { parentId = 0; } else { int grandParentId = parent.getInternalId(); parentId = this.getTreeId(grandParentId, parent.getRow()); } return this.createIndex(row, column, parentId); }
public int getRowCount(final WModelIndex parent) { int treeId; if ((parent != null)) { if (parent.getColumn() != 0) { return 0; } Git.Object o = this.getObject(parent); if (o.type == Git.ObjectType.Tree) { treeId = this.getTreeId(parent.getInternalId(), parent.getRow()); } else { return 0; } } else { treeId = 0; } return this.treeData_.get(treeId).getRowCount(); }
private Git.Object getObject(final WModelIndex index) { int parentId = index.getInternalId(); final GitModel.Tree parentItem = this.treeData_.get(parentId); return this.git_.treeGetObject(parentItem.getTreeObject(), index.getRow()); }