1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  *
23  * ident	"%Z%%M%	%I%	%E% SMI"
24  *
25  * Copyright (c) 1999 by Sun Microsystems, Inc.
26  * All rights reserved.
27  *
28  * pmHelpController.java
29  * Help subsystem implementation
30  */
31 
32 package com.sun.admin.pm.client;
33 
34 import java.awt.*;
35 import java.awt.event.*;
36 import java.util.*;
37 import java.io.*;
38 import javax.swing.JPanel;
39 import javax.swing.border.*;
40 import javax.swing.*;
41 
42 import com.sun.admin.pm.server.*;
43 
44 class pmHelpController {
45 
46     public pmHelpFrame frame = null;
47 
48     /*
49      * request presentation of the specified help item.
50      */
showHelpItem(String tag)51     public void showHelpItem(String tag) {
52         Debug.info("HELP: controller.showHelpitem "  + tag);
53         if (tag != null) {
54             pmHelpItem item = viewPanel.loadItemForTag(tag);
55             outerPanel.setSelectedComponent(viewPanel);
56         }
57     }
58 
showHelpItem(pmHelpItem item)59     public void showHelpItem(pmHelpItem item) {
60         if (item != null)
61             showHelpItem(item.tag);
62     }
63 
64     JTabbedPane outerPanel;
65     pmHelpDetailPanel viewPanel;
66     pmHelpIndexPanel indexPanel;
67     pmHelpSearchPanel searchPanel;
68 
69     Vector history;
70 
getTopPane()71     public JTabbedPane getTopPane() {
72         return outerPanel;
73     }
74 
pmHelpController(pmHelpFrame f)75     public pmHelpController(pmHelpFrame f) {
76 
77         frame = f;
78 
79         outerPanel = new JTabbedPane();
80 
81         viewPanel = new pmHelpDetailPanel(this);
82         indexPanel = new pmHelpIndexPanel(this);
83         searchPanel = new pmHelpSearchPanel(this);
84 
85         outerPanel.add(pmUtility.getResource("View"), viewPanel);
86         outerPanel.add(pmUtility.getResource("Index"), indexPanel);
87         outerPanel.add(pmUtility.getResource("Search"), searchPanel);
88 
89         pmHelpRepository.populateHelpItemDB();
90         pmHelpRepository.populateHelpKeywordDB();
91         pmHelpRepository.populateHelpTitleDB();
92 
93 	indexPanel.queryPanel.handleText("");	// prime it... ugly.
94 
95         history = new Vector();
96 
97         frame.setDefaultComponent(outerPanel);
98     }
99 
100 
101 }
102