KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > views > framelist > Frame


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.views.framelist;
12
13 /**
14  * Generic frame, which captures the state for one frame in the frame list.
15  * Clients may subclass this frame to add their own state.
16  */

17 public class Frame {
18
19     private int index = -1;
20
21     private FrameList parent;
22
23     private String JavaDoc name = ""; //$NON-NLS-1$
24

25     private String JavaDoc toolTipText;
26
27     /**
28      * Constructs a new frame. <p>
29      *
30      * This implementation does nothing.
31      */

32     public Frame() {
33     }
34
35     /**
36      * Returns the index of the frame in the frame list.
37      * Only valid once the frame has been added to the frame list.
38      *
39      * @return the index of the frame in the frame list.
40      */

41     public int getIndex() {
42         return index;
43     }
44
45     /**
46      * Returns the displayable name for the frame.
47      *
48      * @return the displayable name for the frame.
49      */

50     public String JavaDoc getName() {
51         return name;
52     }
53
54     /**
55      * Returns the frame list.
56      *
57      * @return the frame list
58      */

59     public FrameList getParent() {
60         return parent;
61     }
62
63     /**
64      * Returns the tool tip text to show for the frame.
65      * This can form part of the tool tip for actions like the back and forward
66      * actions.
67      *
68      * @return the tool tip text to show for the frame
69      */

70     public String JavaDoc getToolTipText() {
71         return toolTipText;
72     }
73
74     /**
75      * Sets the index of the frame in the frame list.
76      * Should only be called by the frame list.
77      *
78      * @param index the index of the frame in the frame list
79      */

80     public void setIndex(int index) {
81         this.index = index;
82     }
83
84     /**
85      * Sets the displayable name for the frame.
86      *
87      * @param name the displayable name
88      */

89     public void setName(String JavaDoc name) {
90         this.name = name;
91     }
92
93     /**
94      * Sets the frame list.
95      *
96      * @param parent the frame list
97      */

98     public void setParent(FrameList parent) {
99         this.parent = parent;
100     }
101
102     /**
103      * Sets the tool tip text to show for the frame.
104      * This can form part of the tool tip for actions like the back and forward
105      * actions.
106      *
107      * @param toolTipText the tool tip text to show for the frame.
108      */

109     public void setToolTipText(String JavaDoc toolTipText) {
110         this.toolTipText = toolTipText;
111     }
112 }
113
Popular Tags