public JComponent createDialogButtonComponent(ViewerFactory factory)
throws Exception {
JPanel buttonPanel = new JPanel(new GridBagLayout());
JComponent button = null;
DataModelCommand command;
DataViewer buttonViewer;
DataModelCommandVector commandVector = clientMethods;
GridBagConstraints buttonConstr = new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 2, 0, 2), 0, 0);
if (commandVector == null && popupDialogModel != null) {
commandVector = popupDialogModel.getMethods();
}
if (commandVector != null) {
for (command = commandVector.firstItem(); command != null; command = commandVector.nextItem()) {
buttonViewer = factory.createDefaultEditor(command);
button = buttonViewer.getJComponent();
buttonPanel.add(button, buttonConstr);
++buttonConstr.gridx;
if (command.isDefaultButton()) {
dialog.getRootPane().setDefaultButton((JButton) button);