1
|
/*******************************************************************************
|
2
|
* Copyright (c) 2000, 2009 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.internal.navigator.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
|
* @since 3.4
|
17
|
*/
|
18
|
public class Frame {
|
19
|
|
20
|
private int index = -1;
|
21
|
|
22
|
private FrameList parent;
|
23
|
|
24
|
private String name = ""; //$NON-NLS-1$
|
25
|
|
26
|
private String toolTipText;
|
27
|
|
28
|
/**
|
29
|
* Constructs a new frame. <p>
|
30
|
*
|
31
|
* This implementation does nothing.
|
32
|
*/
|
33
|
public Frame() {
|
34
|
}
|
35
|
|
36
|
/**
|
37
|
* Returns the index of the frame in the frame list.
|
38
|
* Only valid once the frame has been added to the frame list.
|
39
|
*
|
40
|
* @return the index of the frame in the frame list.
|
41
|
*/
|
42
|
public int getIndex() {
|
43
|
return index;
|
44
|
}
|
45
|
|
46
|
/**
|
47
|
* Returns the displayable name for the frame.
|
48
|
*
|
49
|
* @return the displayable name for the frame.
|
50
|
*/
|
51
|
public String getName() {
|
52
|
return name;
|
53
|
}
|
54
|
|
55
|
/**
|
56
|
* Returns the frame list.
|
57
|
*
|
58
|
* @return the frame list
|
59
|
*/
|
60
|
public FrameList getParent() {
|
61
|
return parent;
|
62
|
}
|
63
|
|
64
|
/**
|
65
|
* Returns the tool tip text to show for the frame.
|
66
|
* This can form part of the tool tip for actions like the back and forward
|
67
|
* actions.
|
68
|
*
|
69
|
* @return the tool tip text to show for the frame
|
70
|
*/
|
71
|
public String getToolTipText() {
|
72
|
return toolTipText;
|
73
|
}
|
74
|
|
75
|
/**
|
76
|
* Sets the index of the frame in the frame list.
|
77
|
* Should only be called by the frame list.
|
78
|
*
|
79
|
* @param index the index of the frame in the frame list
|
80
|
*/
|
81
|
public void setIndex(int index) {
|
82
|
this.index = index;
|
83
|
}
|
84
|
|
85
|
/**
|
86
|
* Sets the displayable name for the frame.
|
87
|
*
|
88
|
* @param name the displayable name
|
89
|
*/
|
90
|
public void setName(String name) {
|
91
|
this.name = name;
|
92
|
}
|
93
|
|
94
|
/**
|
95
|
* Sets the frame list.
|
96
|
*
|
97
|
* @param parent the frame list
|
98
|
*/
|
99
|
public void setParent(FrameList parent) {
|
100
|
this.parent = parent;
|
101
|
}
|
102
|
|
103
|
/**
|
104
|
* Sets the tool tip text to show for the frame.
|
105
|
* This can form part of the tool tip for actions like the back and forward
|
106
|
* actions.
|
107
|
*
|
108
|
* @param toolTipText the tool tip text to show for the frame.
|
109
|
*/
|
110
|
public void setToolTipText(String toolTipText) {
|
111
|
this.toolTipText = toolTipText;
|
112
|
}
|
113
|
}
|