}
if (fieldEdited) {
return field.get(bean);
}
AbstractViewControl editingPanel = AbstractViewControl.newInstance("",
"caption", obj.getClass(), obj);
JOptionPane op = new JOptionPane(editingPanel,
JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
StringBuffer captionBuf = new StringBuffer().append(obj.getClass()
.getName());
JDialog dlg = op.createDialog(this, captionBuf.toString());
dlg.setSize(250, 120);
FrameUtils.centerDialog(dlg);
op.setVisible(true);
op.invalidate();
dlg.setModal(true);
dlg.setVisible(true);
int selectedValue = ((Integer) op.getValue()).intValue();
if (selectedValue == JOptionPane.OK_OPTION)
return editingPanel.getValue();
else
return obj;
}