01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.part;
11:
12: import java.util.List;
13:
14: /* (non-Javadoc)
15: * A <code>DrillFrame</code> is used to record the input element and
16: * selection state for one frame in a <code>DrillDownTreeViewer</code>.
17: * This class is not intended for use beyond the package.
18: */
19: /* package */class DrillFrame {
20: Object fElement;
21:
22: Object fPropertyName;
23:
24: List fExpansion = null;
25:
26: /**
27: * Allocates a new DrillFrame.
28: *
29: * @param oElement the tree input element
30: * @param strPropertyName the visible tree property
31: * @param vExpansion the current expansion state of the tree
32: */
33: public DrillFrame(Object oElement, Object strPropertyName,
34: List vExpansion) {
35: fElement = oElement;
36: fPropertyName = strPropertyName;
37: fExpansion = vExpansion;
38: }
39:
40: /**
41: * Compares two Objects for equality.
42: * <p>
43: *
44: * @param obj the reference object with which to compare.
45: * @return <code>true</code> if this object is the same as the obj
46: * argument; <code>false</code> otherwise.
47: */
48: public boolean equals(Object obj) {
49: // Compare handles.
50: if (this == obj) {
51: return true;
52: }
53:
54: // Compare class.
55: if (!(obj instanceof DrillFrame)) {
56: return false;
57: }
58:
59: // Compare contents.
60: DrillFrame oOther = (DrillFrame) obj;
61: return ((fElement == oOther.fElement) && (fPropertyName
62: .equals(oOther.fPropertyName)));
63: }
64:
65: /**
66: * Returns the input element.
67: *
68: * @return the input element
69: */
70: public Object getElement() {
71: return fElement;
72: }
73:
74: /**
75: * Returns the expansion state for a tree.
76: *
77: * @return the expansion state for a tree
78: */
79: public List getExpansion() {
80: return fExpansion;
81: }
82:
83: /**
84: * Returns the property name.
85: *
86: * @return the property name
87: */
88: public Object getPropertyName() {
89: return fPropertyName;
90: }
91: }
|