private void init() {
this.setLayout(new BorderLayout());
JToolBar toolBar = new JToolBar();
Application app = Application.getInstance();
toolBar.add(app
.getActionManager()
.getAction(CreateObjEntityAction.class)
.buildButton());
toolBar.add(app
.getActionManager()
.getAction(CreateAttributeAction.class)
.buildButton());
toolBar.add(app
.getActionManager()
.getAction(DbEntitySyncAction.class)
.buildButton());
toolBar.addSeparator();
toolBar.addSeparator();
toolBar.add(app
.getActionManager()
.getAction(RemoveAttributeAction.class)
.buildButton());
toolBar.addSeparator();
toolBar.add(app
.getActionManager()
.getAction(CutAttributeAction.class)
.buildButton());
toolBar.add(app
.getActionManager()
.getAction(CopyAttributeAction.class)
.buildButton());
toolBar.add(app.getActionManager().getAction(PasteAction.class).buildButton());
add(toolBar, BorderLayout.NORTH);
// Create table with two columns and no rows.
table = new CayenneTable();
tablePreferences = new TableColumnPreferences(
DbAttributeTableModel.class,
"attributeTable");
/**
* Create and install a popup
*/
JPopupMenu popup = new JPopupMenu();
popup.add(app
.getActionManager()
.getAction(RemoveAttributeAction.class)
.buildMenu());
popup.addSeparator();
popup.add(app.getActionManager().getAction(CutAttributeAction.class).buildMenu());
popup
.add(app
.getActionManager()
.getAction(CopyAttributeAction.class)
.buildMenu());
popup.add(app.getActionManager().getAction(PasteAction.class).buildMenu());
TablePopupHandler.install(table, popup);
add(PanelFactory.createTablePanel(table, null), BorderLayout.CENTER);