/*
* 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.
*
* Common dialog
*/
protected boolean defaultIsOK = true;
}
}
}
super(f, title, true); // modal
theTop = t;
theTag = h;
defaultIsOK = ok;
// initialize constraints
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridwidth = 1;
c.gridheight = 1;
// top panel
p.setLayout(new GridBagLayout());
this.getContentPane().add(
"South");
this.pack();
this.addWindowListener(new WindowAdapter() {
pmOKCancelDialog.this.setVisible(false);
}
});
if (defaultIsOK) {
// this.getRootPane().setDefaultButton(okButton);
} else {
// this.getRootPane().setDefaultButton(cancelButton);
}
// handle Esc as cancel in any case
public void actionPerformed(ActionEvent e) {
}},
}
GridBagConstraints c = new GridBagConstraints();
c.gridheight = 1;
c.gridwidth = 1;
c.gridy = 0;
if (okDefault)
c.gridx = 0;
else
c.gridx = 1;
if (okDefault)
c.gridx = 1;
else
c.gridx = 0;
cancelButton = new pmButton(
helpButton = null;
if (useHelp) {
c.gridx = 2;
helpButton = new pmButton(
}
}
});
}
});
if (helpButton != null) {
}
});
}
c.gridx = 0;
c.gridx = 1;
c.gridx = 2;
if (helpButton != null)
return panel;
}
protected void actionOKButton() {
pmOKCancelDialog.this.setVisible(false);
}
protected void actionCancelButton() {
pmOKCancelDialog.this.setVisible(false);
}
public int getValue() {
return returnValue;
}
f.addWindowListener(new WindowAdapter() {
}
});
f.setVisible(true);
while (true) {
pmOKCancelDialog d =
new pmOKCancelDialog(
d.setVisible(true);
d.dispose();
}
}
}