Source code: javax/ide/view/GUIPanel.java
1 package javax.ide.view;
2
3 /**
4 * A <code>GUIPanel</code> opaquely encapsulates the gui panel that is to
5 * be hosted by an IDE's service such as: the IDE preferences panel,
6 * the editor's panel, etc..
7 * There are two components in a GUI component hierarchy that need to be
8 * identified: the root component, and the focusable component. The root
9 * component will be added to the children list of the IDE host, and the
10 * focusable component will be given the focus when the IDE host becomes
11 * active.
12 * For Swing based IDE's the type of the root and focusable components
13 * should be: {@link javax.swing.JComponent}.
14 */
15 public final class GUIPanel
16 {
17 private Object _rootComponent;
18 private Object _focusableComponent;
19
20 /**
21 * Constructor.
22 *
23 * @param root The root component in the hierarchy of the panel encapsulated
24 * by this class.
25 * @param focusable The component that can take focus.
26 */
27 public GUIPanel( Object root, Object focusable )
28 {
29 _rootComponent = root;
30 _focusableComponent = focusable;
31 }
32
33 /**
34 * Get the root component in the component hierarchy of the panel encapsulated
35 * by this class.
36 * @return The root component in the hierarchy.
37 */
38 public Object getRootComponent()
39 {
40 return _rootComponent;
41 }
42
43 /**
44 * Get the component that can take input focus in the component hierarchy of
45 * the encapsulated panel.
46 * @return The component that can take input focus.
47 */
48 public Object getFocusableComponent()
49 {
50 return _focusableComponent;
51 }
52 }