use of org.apache.cayenne.modeler.util.BoardTableCellRenderer in project cayenne by apache.
the class DbEntityAttributePanel method initView.
private void initView() {
this.setLayout(new BorderLayout());
ActionManager actionManager = Application.getInstance().getActionManager();
// Create table with two columns and no rows.
table = new CayenneTable();
tablePreferences = new TableColumnPreferences(DbAttributeTableModel.class, "attributeTable");
table.setDefaultRenderer(String.class, new BoardTableCellRenderer());
// Create and install a popup
JPopupMenu popup = new JPopupMenu();
popup.add(actionManager.getAction(RemoveAttributeRelationshipAction.class).buildMenu());
popup.addSeparator();
popup.add(actionManager.getAction(CutAttributeRelationshipAction.class).buildMenu());
popup.add(actionManager.getAction(CopyAttributeRelationshipAction.class).buildMenu());
popup.add(actionManager.getAction(PasteAction.class).buildMenu());
TablePopupHandler.install(table, popup);
add(PanelFactory.createTablePanel(table, null), BorderLayout.CENTER);
}
use of org.apache.cayenne.modeler.util.BoardTableCellRenderer in project cayenne by apache.
the class DbEntityRelationshipPanel method init.
protected void init() {
this.setLayout(new BorderLayout());
ActionManager actionManager = Application.getInstance().getActionManager();
table = new CayenneTable();
table.setDefaultRenderer(DbEntity.class, CellRenderers.entityTableRendererWithIcons(mediator));
table.setDefaultRenderer(String.class, new BoardTableCellRenderer());
tablePreferences = new TableColumnPreferences(DbRelationshipTableModel.class, "relationshipTable");
// Create and install a popup
Icon ico = ModelerUtil.buildIcon("icon-edit.png");
resolveMenu = new CayenneAction.CayenneMenuItem("Database Mapping", ico);
JPopupMenu popup = new JPopupMenu();
popup.add(resolveMenu);
popup.add(actionManager.getAction(RemoveAttributeRelationshipAction.class).buildMenu());
popup.addSeparator();
popup.add(actionManager.getAction(CutAttributeRelationshipAction.class).buildMenu());
popup.add(actionManager.getAction(CopyAttributeRelationshipAction.class).buildMenu());
popup.add(actionManager.getAction(PasteAction.class).buildMenu());
TablePopupHandler.install(table, popup);
add(PanelFactory.createTablePanel(table, null), BorderLayout.CENTER);
}
Aggregations