@Test public void testEquals() { ContentProvider cp = new FakeContentProvider(); TreeItem ti1 = new TreeItemImpl(cp, "foo"); TreeItem ti2 = new TreeItemImpl(cp, "foo"); TreeItem ti3 = new TreeItemImpl(cp, "bar"); assertEquals(ti1, ti2); assertFalse(ti1.equals(ti3)); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof TreeItem) { return getObject().equals(((TreeItem) obj).getObject()); } return false; }
TreeItemImpl implements TreeItem { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof TreeItem) { return getObject().equals(((TreeItem) obj).getObject()); } return false; } }
TreeItemImpl implements TreeItem { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof TreeItem) { return getObject().equals(((TreeItem) obj).getObject()); } return false; } TreeItemImpl(TreeItem parent, ContentProvider provider, Object data);  TreeItemImpl(ContentProvider provider, Object data);  TreeItemImpl(TreeItem parent, Object data); }
TreeItemImpl implements TreeItem { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof TreeItem) { return getObject().equals(((TreeItem) obj).getObject()); } return false; } TreeItemImpl(TreeItem parent, ContentProvider provider, Object data);  TreeItemImpl(ContentProvider provider, Object data);  TreeItemImpl(TreeItem parent, Object data); @Override boolean hasChildren(); @Override TreeItem[] getChildren(); @Override Object getObject(); @Override Path getPath(); @Override TreeItem getParent(); @Override ContentProvider getContentProvider(); @Override String getName(); @Override String getLabel(); String[] getFacets(); @Override boolean isContainer(); @Override TreeItem find(Path path); @Override TreeItem findAndReveal(Path path); @Override TreeItem getChild(String name); @Override TreeItem[] expand(); void validateData(); void validateChildren(); @Override void collapse(); @Override boolean isExpanded(); @Override void refresh(int type); @Override void validate(); @Override void invalidate(int type); @Override int getValidationState(); @Override Object accept(TreeItemVisitor visitor); @Override String toString(); @Override boolean equals(Object obj); }
TreeItemImpl implements TreeItem { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof TreeItem) { return getObject().equals(((TreeItem) obj).getObject()); } return false; } TreeItemImpl(TreeItem parent, ContentProvider provider, Object data);  TreeItemImpl(ContentProvider provider, Object data);  TreeItemImpl(TreeItem parent, Object data); @Override boolean hasChildren(); @Override TreeItem[] getChildren(); @Override Object getObject(); @Override Path getPath(); @Override TreeItem getParent(); @Override ContentProvider getContentProvider(); @Override String getName(); @Override String getLabel(); String[] getFacets(); @Override boolean isContainer(); @Override TreeItem find(Path path); @Override TreeItem findAndReveal(Path path); @Override TreeItem getChild(String name); @Override TreeItem[] expand(); void validateData(); void validateChildren(); @Override void collapse(); @Override boolean isExpanded(); @Override void refresh(int type); @Override void validate(); @Override void invalidate(int type); @Override int getValidationState(); @Override Object accept(TreeItemVisitor visitor); @Override String toString(); @Override boolean equals(Object obj); static final int F_CONTAINER; static final int F_EXPANDED; static final TreeItem[] EMPTY_CHILDREN; static final TreeItem[] HAS_CHILDREN; }