Package org.apache.cayenne.modeler.pref

Examples of org.apache.cayenne.modeler.pref.DBConnectionInfo


    /**
     * Tests that the entered information is valid and can be used to open a conneciton.
     * Does not store the open connection.
     */
    public void okAction() {
        DBConnectionInfo info = getConnectionInfo();
        ClassLoadingService classLoader = getApplication().getClassLoadingService();

        // try making an adapter...
        try {
            info.makeAdapter(classLoader);
        }
        catch (Throwable th) {
            reportError("DbAdapter Error", th);
            return;
        }

        // doing connection testing...
        // attempt opening the connection, and close it right away
        try {
            Connection connection = info.makeDataSource(classLoader).getConnection();
            try {
                connection.close();
            }
            catch (SQLException ex) {
                // ignore close error
View Full Code Here


        super(getActionName(), application);
    }

    public void performAction(ActionEvent e) {

        DBConnectionInfo nodeInfo = preferredDataSource();
        String nodeKey = preferredDataSourceLabel(nodeInfo);

        DataSourceWizard connectWizard = new DataSourceWizard(
                getProjectController(),
                "Generate DB Schema: Connect to Database",
View Full Code Here

     * Overrides superclass to keep an open connection around for the caller's use.
     */
    public void okAction() {
        // build connection and adapter...

        DBConnectionInfo info = getConnectionInfo();
        ClassLoadingService classLoader = getApplication().getClassLoadingService();

        try {
            this.adapter = info.makeAdapter(classLoader);
        }
        catch (Throwable th) {
            reportError("DbAdapter Error", th);
            return;
        }

        try {
            this.connection = info.makeDataSource(classLoader).getConnection();
        }
        catch (Throwable th) {
            reportError("Connection Error", th);
            return;
        }
View Full Code Here

        if (key == null) {
            mainController.updateStatus("No Local DataSource selected for node...");
            return;
        }

        DBConnectionInfo dataSource = (DBConnectionInfo) parent
                .getApplicationPreferenceDomain()
                .getDetail(key, DBConnectionInfo.class, false);

        if (dataSource != null) {
            if (dataSource.copyTo(projectDS.getDataSourceInfo())) {
                refreshView();
                super.nodeChangeProcessor.modelUpdated(null, null, null);
                mainController.updateStatus(null);
            }
            else {
View Full Code Here

        // a slight chance that a real datasource is called NO_LOCAL_DATA_SOURCE...
        keys[0] = NO_LOCAL_DATA_SOURCE;
        Iterator it = sources.iterator();
        for (int i = 1; i <= len; i++) {
            DBConnectionInfo info = (DBConnectionInfo) it.next();
            keys[i] = info.getKey();
            localDataSources.put(keys[i], info);
        }

        view.getLocalDataSources().setModel(new DefaultComboBoxModel(keys));
        localDataSourceBinding.updateView();
View Full Code Here

        super(getActionName(), application);
    }

    public void performAction(ActionEvent e) {

        DBConnectionInfo nodeInfo = preferredDataSource();
        String nodeKey = preferredDataSourceLabel(nodeInfo);

        DataSourceWizard connectWizard = new DataSourceWizard(
                getProjectController(),
                "Generate DB Schema: Connect to Database",
View Full Code Here

        if (key == null) {
            mainController.updateStatus("No Local DataSource selected for node...");
            return;
        }

        DBConnectionInfo dataSource = (DBConnectionInfo) getApplication()
            .getCayenneProjectPreferences()
            .getDetailObject(DBConnectionInfo.class)
            .getObject(key);

        if (dataSource != null) {
            if (dataSource.copyTo(projectDSI)) {
                refreshView();
                super.nodeChangeProcessor.modelUpdated(null, null, null);
                mainController.updateStatus(null);
            }
            else {
View Full Code Here

        if (key == null) {
            mainController.updateStatus("No Local DataSource selected for node...");
            return;
        }

        DBConnectionInfo dataSource = (DBConnectionInfo) parent
                .getApplicationPreferenceDomain()
                .getDetail(key, DBConnectionInfo.class, false);

        if (dataSource != null) {
            if (dataSource.copyTo(projectDS.getDataSourceInfo())) {
                refreshView();
                super.nodeChangeProcessor.modelUpdated(null, null, null);
                mainController.updateStatus(null);
            }
            else {
View Full Code Here

        // a slight chance that a real datasource is called NO_LOCAL_DATA_SOURCE...
        keys[0] = NO_LOCAL_DATA_SOURCE;
        Iterator it = sources.iterator();
        for (int i = 1; i <= len; i++) {
            DBConnectionInfo info = (DBConnectionInfo) it.next();
            keys[i] = info.getKey();
            localDataSources.put(keys[i], info);
        }

        view.getLocalDataSources().setModel(new DefaultComboBoxModel(keys));
        localDataSourceBinding.updateView();
View Full Code Here

    protected DBConnectionInfo createDataSource() {
        if (canceled) {
            return null;
        }

        DBConnectionInfo prototype = (DBConnectionInfo) dataSources.get(prototypeKey);
        DBConnectionInfo dataSource = (DBConnectionInfo) editor.createDetail(
                domain,
                getName(),
                DBConnectionInfo.class);

        prototype.copyTo(dataSource);
View Full Code Here

TOP

Related Classes of org.apache.cayenne.modeler.pref.DBConnectionInfo

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.