private void init() {
this.setLayout(new BorderLayout());
JToolBar toolBar = new JToolBar();
Application app = Application.getInstance();
toolBar
.add(app
.getAction(CreateRelationshipAction.getActionName())
.buildButton());
toolBar.add(app.getAction(ObjEntitySyncAction.getActionName()).buildButton());
toolBar.addSeparator();
Icon ico = ModelerUtil.buildIcon("icon-info.gif");
resolve = new JButton();
resolve.setIcon(ico);
resolve.setToolTipText("Edit Relationship");
toolBar.add(resolve);
toolBar.addSeparator();
toolBar.add(app.getAction(RemoveRelationshipAction.getActionName()).buildButton());
toolBar.addSeparator();
toolBar.add(app.getAction(CutRelationshipAction.getActionName()).buildButton());
toolBar.add(app.getAction(CopyRelationshipAction.getActionName()).buildButton());
toolBar.add(app.getAction(PasteAction.getActionName()).buildButton());
add(toolBar, BorderLayout.NORTH);
table = new CayenneTable();
table.setDefaultRenderer(String.class, new StringRenderer());
table.setDefaultRenderer(ObjEntity.class, new EntityRenderer());
/**
* Create and install a popup
*/
resolveMenu = new JMenuItem("Database Mapping", ico);
JPopupMenu popup = new JPopupMenu();
popup.add(resolveMenu);
popup.add(app.getAction(RemoveRelationshipAction.getActionName()).buildMenu());
popup.addSeparator();
popup.add(app.getAction(CutRelationshipAction.getActionName()).buildMenu());
popup.add(app.getAction(CopyRelationshipAction.getActionName()).buildMenu());
popup.add(app.getAction(PasteAction.getActionName()).buildMenu());
TablePopupHandler.install(table, popup);
add(PanelFactory.createTablePanel(table, null), BorderLayout.CENTER);
}