KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > windows > view > ui > Tabbed


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
21 package org.netbeans.core.windows.view.ui;
22
23
24 import org.openide.windows.TopComponent;
25
26 import javax.swing.*;
27 import javax.swing.event.ChangeListener JavaDoc;
28 import java.awt.*;
29 import java.awt.event.ActionListener JavaDoc;
30
31
32 /**
33  * Interface describing component which is used inside <code>SimpleContainer</code>.
34  * There will be at two implementations one for view and second one for editor type.
35  *
36  * @author Peter Zavadsky
37  */

38 public interface Tabbed {
39
40     public void requestAttention(TopComponent tc);
41
42     public void cancelRequestAttention(TopComponent tc);
43     
44     public void addTopComponent(String JavaDoc name, Icon icon, TopComponent tc, String JavaDoc toolTip);
45
46     public void insertComponent(String JavaDoc name, Icon icon, Component comp, String JavaDoc toolTip, int position);
47     
48     public void setTopComponents(TopComponent[] tcs, TopComponent selected);
49     
50     public int getTabCount();
51     
52     public TopComponent[] getTopComponents();
53     
54     public TopComponent getTopComponentAt(int index);
55     
56     public int indexOf(Component tc);
57     
58     public void removeComponent(Component comp);
59     
60     public void setTitleAt(int index, String JavaDoc title);
61     
62     public void setIconAt(int index, Icon icon);
63     
64     public void setToolTipTextAt(int index, String JavaDoc toolTip);
65     
66     public void setSelectedComponent(Component comp);
67     
68     public TopComponent getSelectedTopComponent();
69
70     public void addChangeListener(ChangeListener JavaDoc listener);
71     
72     public void removeChangeListener(ChangeListener JavaDoc listener);
73
74     public void addActionListener (ActionListener JavaDoc al);
75
76     public void removeActionListener (ActionListener JavaDoc al);
77
78     public void setActive(boolean active);
79     
80     public int tabForCoordinate(Point p);
81    
82     public Shape getIndicationForLocation(Point location, TopComponent startingTransfer,
83             Point startingPoint, boolean attachingPossible);
84     
85     public Object JavaDoc getConstraintForLocation(Point location, boolean attachingPossible);
86     
87     public Image createImageOfTab (int tabIndex);
88
89     /** Accessor for visual component holding components */
90     public Component getComponent();
91     
92     /** Allows tabbed implementors to speficy content of popup menu on tab
93      * with given index. Incoming actions are default set by winsys
94      */

95     public Action[] getPopupActions(Action[] defaultActions, int tabIndex);
96     
97     /** Returns bounds of tab with given index */
98     public Rectangle getTabBounds(int tabIndex);
99     
100     /** Interface for simple accessing of Tabbed instance */
101     public interface Accessor {
102
103         public Tabbed getTabbed ();
104
105     } // end of Accessor
106

107 }
108
109
Popular Tags