示例#1
0
文件: GitModel.java 项目: sebap/jwt
 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
文件: GitModel.java 项目: sebap/jwt
 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
文件: GitModel.java 项目: sebap/jwt
 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
文件: GitModel.java 项目: sebap/jwt
 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());
 }