KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > part > DrillFrame


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.part;
12
13 import java.util.List JavaDoc;
14
15 /* (non-Javadoc)
16  * A <code>DrillFrame</code> is used to record the input element and
17  * selection state for one frame in a <code>DrillDownTreeViewer</code>.
18  * This class is not intended for use beyond the package.
19  */

20 /* package */class DrillFrame {
21     Object JavaDoc fElement;
22
23     Object JavaDoc fPropertyName;
24
25     List JavaDoc fExpansion = null;
26
27     /**
28      * Allocates a new DrillFrame.
29      *
30      * @param oElement the tree input element
31      * @param strPropertyName the visible tree property
32      * @param vExpansion the current expansion state of the tree
33      */

34     public DrillFrame(Object JavaDoc oElement, Object JavaDoc strPropertyName, List JavaDoc 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 JavaDoc 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 JavaDoc 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 JavaDoc getExpansion() {
80         return fExpansion;
81     }
82
83     /**
84      * Returns the property name.
85      *
86      * @return the property name
87      */

88     public Object JavaDoc getPropertyName() {
89         return fPropertyName;
90     }
91 }
92
Popular Tags