/*
* 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.
*
* Login dialog
*/
/*
* a panel dialog which captures a username and password.
*/
}
super(f, title, true); // modal
theTop = t;
theTag = h;
theFrame = f;
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);
// NIS middle panel
// contains username and password
p = new JPanel();
p.setLayout(new GridBagLayout());
p.add(l, c);
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 {
} catch (Exception e) {
}
p.add(l, c);
p.add(l, c);
p.add(passwordField, c);
// middle panel contains LDAP server name, distinguished name,
// and password
p = new JPanel();
p.setLayout(new GridBagLayout());
// LDAP Server Name
p.add(l, c);
public void actionPerformed(ActionEvent e) {
okPressed();
}
});
try {
} catch (Exception e) {
"pmLdap: getLDAPMaster() returns exception: " + e);
}
c.gridx = 1;
p.add(serverField, c);
// Distinguished Name
c.gridx = 0;
p.add(l, c);
public void actionPerformed(ActionEvent e) {
okPressed();
}
});
try {
} catch (Exception e) {
"pmLdap: getDefaultAdminDN() returns exception: " + e);
}
c.gridx = 1;
// Password
c.gridx = 0;
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;
p.add(passwordField, c);
}
// bottom panel contains buttons
c.gridx = 0;
c.weightx = 1.0;
c.weighty = 0.0;
okPressed();
}
});
cancelButton = new pmButton(
}
});
helpButton = new pmButton(
p.add(helpButton);
helpPressed();
}
});
}
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
pmLogin.this.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;
}
// LDAP Server name is required
throw new pmIncompleteFormException(
}
}
// LDAP Distinguished name is required
throw new pmIncompleteFormException(
}
}
// LDAP password is required
throw new pmIncompleteFormException(
}
}
public void okPressed() {
// For LDAP, Check Server, Distinguished Name and Password
boolean complete = true;
complete = false;
try {
getLDAPDN();
complete = true;
} catch (pmIncompleteFormException fe) {
pmMessageDialog m = new pmMessageDialog(
m.setVisible(true);
}
}
if (complete) {
pmLogin.this.setVisible(false);
}
}
public void cancelPressed() {
pmLogin.this.setVisible(false);
}
public void clearPressed() {
}
public void helpPressed() {
}
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
}
});
f.setVisible(true);
while (true) {
d.setVisible(true);
}
// System.exit(0);
}
}