KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > spi > navigator > NavigatorPanel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.spi.navigator;
21
22 import javax.swing.JComponent JavaDoc;
23 import org.openide.util.Lookup;
24
25 /** Navigation related view description.
26  *
27  * Implementors of this interface, also registered in layer,
28  * will be plugged into Navigator UI.
29  *
30  * @author Dafe Simonek
31  */

32 public interface NavigatorPanel {
33
34     /** Name of the view which will be shown in navigator UI.
35      *
36      * @return Displayable name of the view
37      */

38     public String JavaDoc getDisplayName ();
39
40     /** Description of the view, explaining main purpose of the view.
41      * Will be shown in Navigator UI.
42      *
43      * @return String description of the view.
44      */

45     public String JavaDoc getDisplayHint ();
46     
47     /** JComponent representation of this view. System will ask
48      * multiple times and it is strongly recommended to
49      * return the same JComponent instance each call for performance
50      * reasons.<p>
51      *
52      * This method is always called in event dispatch thread.
53      *
54      * @return JComponent representation of this view.
55      */

56     public JComponent JavaDoc getComponent ();
57     
58     /** Called when this panel's component is about to being displayed.
59      * Right place to attach listeners to current navigation data context,
60      * as clients are responsible for listening to context changes when active
61      * (in the time between panelActivated - panelDeactivated calls).
62      *
63      * This method is always called in event dispatch thread.
64      *
65      * @param context Lookup instance representing current context to take
66      * data from
67      */

68     public void panelActivated (Lookup context);
69     
70     /** Called when this panel's component is about to being hidden.
71      * Right place to detach, remove listeners from data context, that
72      * were added in panelActivated impl.
73      *
74      * This method is always called in event dispatch thread.
75      */

76     public void panelDeactivated ();
77     
78     
79     /** Returns Lookup that will be integrated into Lookup of Navigator UI
80      * TopComponent. Allows clients for example to specify activated Node
81      * of Navigator UI TopComponent when this panel is active.<p></p>
82      *
83      * Method may return null, signalizing that default mechanism should be enabled.
84      * Default mechanism chooses first Node from Utilities.actionsGlobalContext()
85      * as activated Node for Navigator's TopComponent.
86      *
87      * @return Lookup instance or null
88      */

89     public Lookup getLookup ();
90     
91     
92 }
93
Popular Tags