use of javax.swing.JPopupMenu in project cayenne by apache.
the class ObjEntityRelationshipPanel method init.
private void init() {
this.setLayout(new BorderLayout());
ActionManager actionManager = Application.getInstance().getActionManager();
table = new CayenneTable();
table.setDefaultRenderer(String.class, new StringRenderer());
table.setDefaultRenderer(ObjEntity.class, new EntityRenderer());
tablePreferences = new TableColumnPreferences(ObjRelationshipTableModel.class, "objEntity/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);
}
use of javax.swing.JPopupMenu 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 javax.swing.JPopupMenu in project cayenne by apache.
the class AbstractCallbackMethodsTab method createPopup.
private JPopupMenu createPopup() {
JPopupMenu popup = new JPopupMenu();
popup.add(getRemoveCallbackMethodAction().buildMenu());
popup.addSeparator();
popup.add(getCopyCallbackMethodAction().buildMenu());
popup.add(getCutCallbackMethodAction().buildMenu());
popup.add(getPasteCallbackMethodAction().buildMenu());
return popup;
}
use of javax.swing.JPopupMenu in project cayenne by apache.
the class EmbeddableAttributeTab method init.
private void init() {
this.setLayout(new BorderLayout());
JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
ActionManager actionManager = Application.getInstance().getActionManager();
toolBar.add(actionManager.getAction(CreateAttributeAction.class).buildButton());
toolBar.addSeparator();
toolBar.add(actionManager.getAction(RemoveAttributeAction.class).buildButton());
toolBar.addSeparator();
toolBar.add(actionManager.getAction(CutAttributeAction.class).buildButton(1));
toolBar.add(actionManager.getAction(CopyAttributeAction.class).buildButton(2));
toolBar.add(actionManager.getAction(PasteAction.class).buildButton(3));
add(toolBar, BorderLayout.NORTH);
table = new CayenneTable();
tablePreferences = new TableColumnPreferences(this.getClass(), "embeddable/attributeTable");
// Create and install a popup
JPopupMenu popup = new JPopupMenu();
popup.add(actionManager.getAction(RemoveAttributeAction.class).buildMenu());
popup.addSeparator();
popup.add(actionManager.getAction(CutAttributeAction.class).buildMenu());
popup.add(actionManager.getAction(CopyAttributeAction.class).buildMenu());
popup.add(actionManager.getAction(PasteAction.class).buildMenu());
TablePopupHandler.install(table, popup);
add(PanelFactory.createTablePanel(table, null), BorderLayout.CENTER);
}
use of javax.swing.JPopupMenu 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