01: // IndexersServerHelper.java
02: // $Id: IndexersServerHelper.java,v 1.13 1999/03/05 13:34:55 bmahe Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1998.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.jigadmin.editors;
07:
08: import javax.swing.JPanel;
09: import javax.swing.JInternalFrame;
10: import javax.swing.JScrollPane;
11: import javax.swing.JTabbedPane;
12: import javax.swing.JOptionPane;
13:
14: import java.awt.Component;
15:
16: import java.util.Properties;
17: import java.util.Vector;
18: import java.util.Enumeration;
19: import java.util.Hashtable;
20:
21: import org.w3c.jigadmin.PropertyManager;
22: import org.w3c.jigadmin.RemoteResourceWrapper;
23: import org.w3c.jigadmin.widgets.DraggableList;
24:
25: import org.w3c.tools.sorter.Sorter;
26:
27: /**
28: * The server helper dedicated to the indexers.
29: * @version $Revision: 1.13 $
30: * @author Benoît Mahé (bmahe@w3.org)
31: */
32: public class IndexersServerHelper extends SpaceServerHelper {
33:
34: /**
35: * Return a new ResourceTreeBrowser.
36: * @return a ResourceTreeBrowser instance
37: */
38: protected ResourceTreeBrowser getTreeBrowser() {
39: return ResourceTreeBrowser.getResourceTreeBrowser(root,
40: "Indexers");
41: }
42:
43: /**
44: * Get the Internal Frame containing frame & resource lists
45: * @return A JInternalFrame instance
46: */
47: protected JInternalFrame getInternalFrame() {
48: JInternalFrame fr = super .getInternalFrame();
49: PropertyManager pm = PropertyManager.getPropertyManager();
50: Hashtable indexers = pm.getIndexers();
51: Enumeration e = (Sorter.sortStringEnumeration(indexers.keys()))
52: .elements();
53: Vector cells = new Vector(10);
54: while (e.hasMoreElements()) {
55: String name = (String) e.nextElement();
56: ResourceCell cell = new ResourceCell(name,
57: (String) indexers.get(name));
58: cells.addElement(cell);
59: }
60: DraggableList list = getResourceList(cells);
61: JScrollPane scroll = new JScrollPane(list);
62: tabbedPane.addTab("Indexers", null, scroll,
63: "Indexers available");
64: tabbedPane.setSelectedComponent(scroll);
65: return fr;
66: }
67:
68: /**
69: * Constructor.
70: */
71: public IndexersServerHelper() {
72: super();
73: }
74:
75: }
|