Пример #1
0
 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());
   }
 }
Пример #2
0
 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);
 }
Пример #3
0
 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();
 }
Пример #4
0
 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());
 }