KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > fractal > swing > JTabbedPaneImpl


1 // skeleton class automatically generated
2

3 package org.objectweb.fractal.swing;
4
5 import org.objectweb.fractal.api.control.BindingController;
6
7 import java.util.Map JavaDoc;
8 import java.util.TreeMap JavaDoc;
9 import java.util.Iterator JavaDoc;
10
11 import javax.swing.JComponent JavaDoc;
12
13 public class JTabbedPaneImpl
14   extends javax.swing.JTabbedPane JavaDoc
15   implements JTabbedPaneItf, JTabbedPaneAttributes, BindingController
16 {
17
18   // fields manually added
19
public final static String JavaDoc TABS_BINDING = "tabs";
20   private Map JavaDoc tabs = new TreeMap JavaDoc();
21
22   public JTabbedPaneImpl () {
23     super();
24   }
25   public JTabbedPaneImpl (int arg0) {
26     super(arg0);
27   }
28
29   public String JavaDoc[] listFc () {
30     // put your own code here
31
return (String JavaDoc[])tabs.keySet().toArray(new String JavaDoc[tabs.size()]);
32   }
33
34   public Object JavaDoc lookupFc (String JavaDoc clientItfName) {
35     // put your own code here
36
if (clientItfName.startsWith(TABS_BINDING)) {
37       return tabs.get(clientItfName);
38     }
39     return null;
40   }
41
42   public void bindFc (String JavaDoc clientItfName, Object JavaDoc serverItf) {
43     // put your own code here
44
if (clientItfName.startsWith(TABS_BINDING)) {
45       tabs.put(clientItfName, serverItf);
46       Iterator JavaDoc i = tabs.entrySet().iterator();
47       while (i.hasNext()) {
48         Map.Entry JavaDoc e = (Map.Entry JavaDoc)i.next();
49         remove((java.awt.Component JavaDoc)e.getValue());
50       }
51       i = tabs.entrySet().iterator();
52       while (i.hasNext()) {
53         Map.Entry JavaDoc e = (Map.Entry JavaDoc)i.next();
54         JComponent JavaDoc comp = (JComponent JavaDoc)e.getValue();
55         addTab(comp.getName(), comp);
56       }
57     }
58   }
59
60   public void unbindFc (String JavaDoc clientItfName) {
61     // put your own code here
62
if (clientItfName.startsWith(TABS_BINDING)) {
63       Object JavaDoc tab = tabs.remove(clientItfName);
64       remove((java.awt.Component JavaDoc)tab);
65     }
66   }
67
68 }
69
Popular Tags