Package org.apache.cayenne.modeler

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


    /**
     * @return create callback method action
     */
    protected CayenneAction getCreateCallbackMethodAction() {
        Application app = Application.getInstance();
        return app.getActionManager().getAction(CreateCallbackMethodAction.class);
    }
View Full Code Here


    /**
     * @return remove callback method action
     */
    protected AbstractRemoveCallbackMethodAction getRemoveCallbackMethodAction() {
        Application app = Application.getInstance();
        return app.getActionManager().getAction(RemoveCallbackMethodAction.class);
    }
View Full Code Here

    /**
     * Creates a DbAdapter based on configured values.
     */
    public DbAdapter makeAdapter(ClassLoadingService classLoader) throws Exception {
        String adapterClassName = getDbAdapter();
        Application appInstance = Application.getInstance();

        if (adapterClassName == null
                || AutoAdapter.class.getName().equals(adapterClassName)) {
            return appInstance
                    .getInjector()
                    .getInstance(DbAdapterFactory.class)
                    .createAdapter(null, makeDataSource(classLoader));
        }

        try {
            return appInstance
                    .getInjector()
                    .getInstance(AdhocObjectFactory.class)
                    .newInstance(DbAdapter.class, adapterClassName);
        }
        catch (Throwable th) {
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.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

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.