@@ -0,0 +1,2162 @@
+package devopsdistilled.operp.client.abstracts;%0A%0Aimport java.awt.event.ActionEvent;%0Aimport java.awt.event.ActionListener;%0A%0Aimport javax.swing.JButton;%0Aimport javax.swing.JDialog;%0Aimport javax.swing.JOptionPane;%0Aimport javax.swing.JPanel;%0A%0Aimport net.miginfocom.swing.MigLayout;%0Aimport devopsdistilled.operp.server.data.entity.Entiti;%0A%0Apublic abstract class CopyOfAbstractEntityDetailsPane%3CE extends Entiti%3C?%3E, EC extends EntityController%3CE%3E%3E %7B%0A%0A%09protected final JDialog dialog;%0A%0A%09protected JPanel btnPanel;%0A%0A%09public CopyOfAbstractEntityDetailsPane() %7B%0A%09%09dialog = new JDialog();%0A%09%09dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);%0A%09%09dialog.setTitle(getTitle());%0A%09%09dialog.setSize(400, 300);%0A%09%09dialog.getContentPane().setLayout(new MigLayout(%22fill%22, %22%5B%5D%22, %22%5B%5D%22));%0A%0A%09%09btnPanel = new JPanel();%0A%09%09btnPanel.setLayout(new MigLayout(%22%22));%0A%0A%09%09JButton btnDelete = new JButton(%22Delete%22);%0A%09%09btnDelete.addActionListener(new ActionListener() %7B%0A%09%09%09@Override%0A%09%09%09public void actionPerformed(ActionEvent e) %7B%0A%09%09%09%09if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(%0A%09%09%09%09%09%09getPane(), %22Delete %22 + getEntity() + %22 ?%22, %22Delete ?%22,%0A%09%09%09%09%09%09JOptionPane.YES_NO_OPTION)) %7B%0A%0A%09%09%09%09%09getDialog().dispose();%0A%09%09%09%09%09getEntityController().delete(getEntity());%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%0A%09%09%7D);%0A%09%09btnPanel.add(btnDelete);%0A%0A%09%09JButton btnEdit = new JButton(%22Edit%22);%0A%09%09btnEdit.addActionListener(new ActionListener() %7B%0A%09%09%09@Override%0A%09%09%09public void actionPerformed(ActionEvent e) %7B%0A%09%09%09%09getDialog().dispose();%0A%09%09%09%09getEntityController().edit(getEntity());%0A%09%09%09%7D%0A%09%09%7D);%0A%09%09btnPanel.add(btnEdit);%0A%0A%09%09JButton btnOk = new JButton(%22OK%22);%0A%09%09btnOk.addActionListener(new ActionListener() %7B%0A%09%09%09@Override%0A%09%09%09public void actionPerformed(ActionEvent e) %7B%0A%09%09%09%09getDialog().dispose();%0A%09%09%09%7D%0A%09%09%7D);%0A%09%09btnPanel.add(btnOk);%0A%09%7D%0A%0A%09public abstract EC getEntityController();%0A%0A%09protected abstract E getEntity();%0A%0A%09public abstract JPanel getPane();%0A%0A%09public abstract void show(E entity);%0A%0A%09public abstract String getTitle();%0A%0A%09public JDialog getDialog() %7B%0A%09%09return dialog;%0A%09%7D%0A%0A%09public void showDetailsPane(JPanel detailsPane) %7B%0A%09%09getPane().add(btnPanel, %22south, pad 20 100 20 20%22);%0A%09%09dialog.getContentPane().add(getPane(), %22grow%22);%0A%0A%09%7D%0A%7D%0A

Create AbstractDetailsPane with common button panel