/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*
* ident "%Z%%M% %I% %E% SMI"
*
* Copyright(c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*
* Search help keywords
*/
controller = ctrl;
// build subpanels
queryPanel = new pmHelpSearchQueryPanel(this);
resultPanel = new pmHelpSearchResultPanel(this);
// lay out top panel
this.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
c.weightx = 1.0;
c.weighty = 0.0;
p.setLayout(new GridBagLayout());
// pc.fill = GridBagConstraints.HORIZONTAL;
// p.add(textPanels[2]);
this.add(p, c);
p = new JPanel();
p.setLayout(new BorderLayout());
// p.setBorder(BorderFactory.createEtchedBorder());
c.gridy = 1;
// new stuff
c.gridheight = 0;
c.weighty = 1.0;
c.weightx = 0.0;
// end new stuff
this.add(p, c);
// figure out when we are tabbed or un-tabbed
public void stateChanged(ChangeEvent e) {
if (!(tp.getSelectedComponent() instanceof
/*
* controller.frame.getRootPane().
* setDefaultButton(
* controller.frame.dismiss);
*/
/*
* System.out.println(controller);
* System.out.println(controller.frame);
* System.out.println(controller.frame.dismiss);
*/
} else {
// better to have the tab itself keep focus.
// queryPanel.query.requestFocus();
}
}
});
}
// place item titles in search result panel
resultPanel.setListEmpty(true);
} else {
while (e.hasMoreElements()) {
v.addElement(i);
}
resultPanel.setListEmpty(false);
}
}
}
protected boolean listEmpty = true;
parentPanel = par;
this.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
/*
* MNEMONIC
* promptLabel.setDisplayedMnemonic(
* pmUtility.getIntResource("Search.Results:.mnemonic"));
*/
this.add(promptLabel, c);
selectButton = new pmButton(
selectButton.setEnabled(false);
// load the selected item into view panel
public void actionPerformed(ActionEvent e) {
}
});
c.gridy = 1;
this.add(selectButton, c);
public void valueChanged(ListSelectionEvent e) {
if (!listEmpty) {
selectButton.setEnabled(true);
/*
* parentPanel.controller.frame.
* getRootPane().setDefaultButton(selectButton);
*/
}
}});
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
int i = l.locationToIndex(e.getPoint());
if (!listEmpty && i >= 0) {
getElementAt(i);
}
}
}
});
c.gridwidth = 2;
c.gridx = 1;
c.gridy = 0;
this.add(scrollPane, c);
}
}
void setListEmpty(boolean e) {
listEmpty = e;
selectButton.setEnabled(false);
/*
* parentPanel.controller.frame.getRootPane().
* setDefaultButton(parentPanel.controller.frame.dismiss);
*/
}
}
parentPanel = par;
this.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
c.gridwidth = 1;
c.gridheight = 1;
/*
* MNEMONIC
* promptLabel.setDisplayedMnemonic(
* pmUtility.getIntResource("Keywords:.mnemonic"));
*/
this.add(promptLabel, c);
public void actionPerformed(ActionEvent e) {
// parse the keyword strings
if (s != null) {
v = new Vector();
st = new StringTokenizer(s);
while (st.hasMoreTokens())
v = getItemsForKeywords(v);
} else {
}
}
}
});
c.gridx = 2;
query = new JTextField();
query.setEditable(true);
public void actionPerformed(ActionEvent e) {
}
});
public void changedUpdate(DocumentEvent e) {
// ignore
}
public void insertUpdate(DocumentEvent e) {
// make search the default button
/*
* parentPanel.controller.frame.
* getRootPane().setDefaultButton(
* pmHelpSearchQueryPanel.this.search);
*/
pmHelpSearchQueryPanel.this.search.
}
public void removeUpdate(DocumentEvent e) {
// restore the default button
/*
* parentPanel.controller.frame.
* getRootPane().setDefaultButton(
* parentPanel.controller.frame.dismiss);
*/
}
}
});
c.gridx = 1;
c.weightx = 1.0;
}
while (words.hasMoreElements()) {
while (items.hasMoreElements()) {
result.addElement(i);
}
}
}
return result;
}
}