/*
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Prompt for root password from printmgr.
* This a helper for printmgr which echoes YES, NO, or CANCEL to stdout.
*/
public class pmAuthOptions {
boolean done = false;
o.setVisible(true);
switch (o.getValue()) {
case JOptionPane.YES_OPTION:
break;
case JOptionPane.NO_OPTION:
break;
case JOptionPane.CANCEL_OPTION:
default:
break;
}
while (!done) {
d.setVisible(true);
done = true;
else {
boolean ok = false;
try {
ok = true;
} catch (Exception x) {
}
if (!ok) {
m.setVisible(true);
done = true;
} else {
done = true;
rv = "YES";
}
}
}
}
}
/*
*/
super(f, title, true); // modal
JLabel l;
JPanel p;
// initialize constraints
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridwidth = 1;
c.gridheight = 1;
// top panel contains the desired message
p = new JPanel();
p.setLayout(new GridBagLayout());
p.add(l, c);
// middle panel contains username and password
p = new JPanel();
p.setLayout(new GridBagLayout());
p.add(l, c);
p.add(l, c);
public void actionPerformed(ActionEvent e) {
okPressed();
}
});
// for consistency, don't implement this until all are...
// l.setDisplayedMnemonic(
// pmUtility.getIntResource("Password.mnemonic"));
c.gridx = 1;
c.weightx = 1.0;
try {
}
p.add(l, c);
p.add(passwordField, c);
// bottom panel contains buttons
c.gridx = 0;
c.weightx = 1.0;
c.weighty = 0.0;
okPressed();
}
});
cancelButton = new pmButton(
}
});
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
setVisible(false);
}
});
// handle Esc as cancel in any case
public void actionPerformed(ActionEvent e) {
}},
// lay out the dialog
this.pack();
// set focus and defaults after packing...
// this.getRootPane().setDefaultButton(okButton);
}
public int getValue() {
return returnValue;
}
public void okPressed() {
setVisible(false);
}
public void cancelPressed() {
setVisible(false);
}
public void clearPressed() {
}
public char[] getPassword() {
return passwordField.getPassword();
}
}
super(f, title, true); // modal
JPanel p;
// initialize constraints
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridwidth = 1;
c.gridheight = 1;
// top panel contains the desired message
p = new JPanel();
p.setLayout(new GridBagLayout());
public boolean isFocusable() {
return false;
}
};
// pathetic hacks to make the list look the same as a label
try {
while (st.hasMoreTokens())
} catch (Exception x) {
}
l.setListData(v);
}
p.add(l, c);
// bottom panel contains buttons
c.gridx = 0;
c.weightx = 1.0;
c.weighty = 0.0;
authPressed();
}
});
contPressed();
}
});
}
});
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
setVisible(false);
}
});
// handle Esc as cancel in any case
public void actionPerformed(ActionEvent e) {
}},
// lay out the dialog
this.pack();
// set focus and defaults after packing...
}
public int getValue() {
return returnValue;
}
public void authPressed() {
setVisible(false);
}
public void cancelPressed() {
setVisible(false);
}
public void contPressed() {
setVisible(false);
}
}