コード例 #1
0
ファイル: InfiniteList.java プロジェクト: juriad/artique
 /**
  * Sets the currently selected row by key of its {@link UserItem}.
  *
  * @param key key of {@link UserItem}
  * @param forceExpand whether the selected row shall be expanded
  */
 public void setSelectedKey(Key key, boolean forceExpand) {
   if (key == null) {
     RowWidget old = rows.get(selected);
     old.collapse();
     old.removeStyleDependentName("selected");
     selected = null;
     SelectionChangeEvent.fire(this);
   } else if (key.equals(selected)) {
     // was selected and is selected
   } else {
     boolean expand = true;
     // selected changed
     if (selected != null) {
       RowWidget old = rows.get(selected);
       old.removeStyleDependentName("selected");
       if (old.isExpanded()) {
         old.collapse();
       } else {
         expand = false;
       }
     }
     RowWidget newly = rows.get(key);
     if (expand || forceExpand) {
       newly.expand();
     }
     selected = key;
     newly.addStyleDependentName("selected");
     SelectionChangeEvent.fire(this);
   }
 }
コード例 #2
0
ファイル: MemoStorable.java プロジェクト: almende/memo-nodes
 @Override
 public int compareTo(MemoStorable other) {
   if (myKey != null && other.myKey != null && myKey.equals(other.myKey)) {
     return 0;
   }
   if (this.storeTime == other.storeTime) {
     return (int) ((this.nanoTime - other.nanoTime) % Integer.MAX_VALUE);
   }
   return (int) ((this.storeTime - other.storeTime) % Integer.MAX_VALUE);
 }
コード例 #3
0
ファイル: MemoStorable.java プロジェクト: almende/memo-nodes
 @Override
 public boolean equals(Object o) {
   if (o instanceof MemoStorable) {
     MemoStorable other = (MemoStorable) o;
     if (myKey != null && other.myKey != null && myKey.equals(other.myKey)) {
       return true;
     }
     if ((myKey == null || other.myKey == null) && this.storeTime == other.storeTime) {
       return (this.nanoTime == other.nanoTime);
     }
   }
   return false;
 }
コード例 #4
0
ファイル: MemoStorable.java プロジェクト: almende/memo-nodes
 public void delete(Key key) {
   if (deletedCache.getIfPresent(key) != null) return;
   if (myKey.equals(key)) {
     deletedCache.put(key, this);
   }
   try {
     Entity ent = datastore.get(key);
     if (ent.hasProperty("next")) {
       delete((Key) ent.getProperty("next")); // recurse
     }
     datastore.delete(key);
     try {
       datastore.get(myKey);
     } catch (EntityNotFoundException e) {
     }
   } catch (Exception e) {
     // e.printStackTrace();
   }
 }
コード例 #5
0
ファイル: TechnicalInfo.java プロジェクト: softem/softem-apps
 @Override
 public boolean equals(Object obj) {
   if (this == obj) {
     return true;
   }
   if (obj == null) {
     return false;
   }
   if (getClass() != obj.getClass()) {
     return false;
   }
   TechnicalInfo other = (TechnicalInfo) obj;
   if (key == null) {
     if (other.key != null) {
       return false;
     }
   } else if (!key.equals(other.key)) {
     return false;
   }
   return true;
 }
コード例 #6
0
ファイル: Attendance.java プロジェクト: nkawano/attend
 @Override
 public boolean equals(Object obj) {
   if (this == obj) {
     return true;
   }
   if (obj == null) {
     return false;
   }
   if (getClass() != obj.getClass()) {
     return false;
   }
   Attendance other = (Attendance) obj;
   if (key == null) {
     if (other.key != null) {
       return false;
     }
   } else if (!key.equals(other.key)) {
     return false;
   }
   return true;
 }
コード例 #7
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) {
     return true;
   }
   if (obj == null) {
     return false;
   }
   if (getClass() != obj.getClass()) {
     return false;
   }
   AnswerSessionModel other = (AnswerSessionModel) obj;
   if (key == null) {
     if (other.key != null) {
       return false;
     }
   } else if (!key.equals(other.key)) {
     return false;
   }
   return true;
 }