Package org.apache.cayenne.modeler

Examples of org.apache.cayenne.modeler.Application$ModelerContext


    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);
    }
View Full Code Here


    protected void init() {
        this.setLayout(new BorderLayout());

        JToolBar toolBar = new JToolBar();
        Application app = Application.getInstance();
        toolBar.add(app.getAction(CreateObjEntityAction.getActionName()).buildButton());
        toolBar
                .add(app
                        .getAction(CreateRelationshipAction.getActionName())
                        .buildButton());
        toolBar.add(app.getAction(DbEntitySyncAction.getActionName()).buildButton());

        toolBar.addSeparator();

        resolve = new JButton();
       
        Icon ico = ModelerUtil.buildIcon("icon-info.gif");
       
        resolve.setIcon(ico);
        resolve.setToolTipText("Database Mapping");
        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(DbEntity.class, CellRenderers.entityTableRendererWithIcons(mediator));
       
        /**
         * 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);
       
View Full Code Here

    private void init() {
        this.setLayout(new BorderLayout());

        JToolBar toolBar = new JToolBar();
        Application app = Application.getInstance();

        toolBar.add(app.getAction(CreateAttributeAction.getActionName()).buildButton());
        toolBar.addSeparator();

        toolBar.add(app.getAction(RemoveAttributeAction.getActionName()).buildButton());
        toolBar.addSeparator();

        toolBar.add(app.getAction(CutAttributeAction.getActionName()).buildButton());
        toolBar.add(app.getAction(CopyAttributeAction.getActionName()).buildButton());
        toolBar.add(app.getAction(PasteAction.getActionName()).buildButton());

        add(toolBar, BorderLayout.NORTH);

        table = new CayenneTable();

        /**
         * Create and install a popup
         */
        JPopupMenu popup = new JPopupMenu();
        popup.add(app.getAction(RemoveAttributeAction.getActionName()).buildMenu());

        popup.addSeparator();

        popup.add(app.getAction(CutAttributeAction.getActionName()).buildMenu());
        popup.add(app.getAction(CopyAttributeAction.getActionName()).buildMenu());
        popup.add(app.getAction(PasteAction.getActionName()).buildMenu());

        TablePopupHandler.install(table, popup);
        add(PanelFactory.createTablePanel(table, null), BorderLayout.CENTER);
    }
View Full Code Here

    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.add(app
                .getActionManager()
                .getAction(DbEntityCounterpartAction.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);

View Full Code Here

    private void init() {
        this.setLayout(new BorderLayout());

        JToolBar toolBar = new JToolBar();
        Application app = Application.getInstance();
        toolBar.add(app.getAction(CreateAttributeAction.getActionName()).buildButton());
        toolBar.add(app.getAction(ObjEntitySyncAction.getActionName()).buildButton());
        toolBar.addSeparator();
        toolBar.add(app.getAction(RemoveAttributeAction.getActionName()).buildButton());
        add(toolBar, BorderLayout.NORTH);

        table = new CayenneTable();
        table.setDefaultRenderer(String.class, new CellRenderer());
View Full Code Here

    private void initView() {
        this.setLayout(new BorderLayout());

        JToolBar toolBar = new JToolBar();
        Application app = Application.getInstance();
        toolBar.add(app.getAction(ObjEntitySyncAction.getActionName()).buildButton());
        toolBar.add(app.getAction(CreateAttributeAction.getActionName()).buildButton());
        toolBar
                .add(app
                        .getAction(CreateRelationshipAction.getActionName())
                        .buildButton());
        add(toolBar, BorderLayout.NORTH);

        // create widgets
View Full Code Here

    protected void init() {
        this.setLayout(new BorderLayout());

        JToolBar toolBar = new JToolBar();
        Application app = Application.getInstance();
        toolBar.add(app.getAction(CreateObjEntityAction.getActionName()).buildButton());
        toolBar
                .add(app
                        .getAction(CreateRelationshipAction.getActionName())
                        .buildButton());
        toolBar.add(app.getAction(DbEntitySyncAction.getActionName()).buildButton());

        toolBar.addSeparator();

        resolve = new JButton();
        resolve.setIcon(ModelerUtil.buildIcon("icon-info.gif"));
        resolve.setToolTipText("Database Mapping");
        toolBar.add(resolve);

        toolBar.addSeparator();

        toolBar
                .add(app
                        .getAction(RemoveRelationshipAction.getActionName())
                        .buildButton());
        add(toolBar, BorderLayout.NORTH);

        table = new CayenneTable();
View Full Code Here

    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();

        resolve = new JButton();
        resolve.setIcon(ModelerUtil.buildIcon("icon-info.gif"));
        resolve.setToolTipText("Edit Relationship");
        toolBar.add(resolve);

        toolBar.addSeparator();

        toolBar
                .add(app
                        .getAction(RemoveRelationshipAction.getActionName())
                        .buildButton());
        add(toolBar, BorderLayout.NORTH);

        table = new CayenneTable();
View Full Code Here

        addChangeListener(this);
    }

    /** Reset the remove buttons */
    private void resetRemoveButtons(){
        Application app = Application.getInstance();
        app.getAction(RemoveAttributeAction.getActionName()).setEnabled(false);
        app.getAction(RemoveRelationshipAction.getActionName()).setEnabled(false);
    }
View Full Code Here

    protected void init() {
        setLayout(new BorderLayout());

        JToolBar toolBar = new JToolBar();

        Application app = Application.getInstance();
        toolBar.add(app.getAction(CreateProcedureParameterAction.getActionName()).buildButton());
        removeParameterButton = app.getAction(RemoveProcedureParameterAction.getActionName()).buildButton();
        toolBar.add(removeParameterButton);
        toolBar.addSeparator();

        moveUp = new JButton();
        moveUp.setIcon(ModelerUtil.buildIcon("icon-move_up.gif"));
View Full Code Here

TOP

Related Classes of org.apache.cayenne.modeler.Application$ModelerContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.