Package org.apache.cayenne.modeler.pref

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


        if (node == null) {
            return null;
        }

        // if node has local DS set, use it
        DataNodeDefaults nodeDefaults = (DataNodeDefaults) getProjectController()
                .getPreferenceDomainForDataDomain()
                .getDetail(node.getName(), DataNodeDefaults.class, false);

        String key = (nodeDefaults != null) ? nodeDefaults.getLocalDataSource() : null;
        if (key != null) {
            DBConnectionInfo info = (DBConnectionInfo) getApplication()
                    .getPreferenceDomain()
                    .getDetail(key, DBConnectionInfo.class, false);
            if (info != null) {
View Full Code Here


        if (node == null) {
            return null;
        }

        // if node has local DS set, use it
        DataNodeDefaults nodeDefaults = (DataNodeDefaults) getProjectController()
                .getPreferenceDomainForDataDomain()
                .getDetail(node.getName(), DataNodeDefaults.class, false);

        String key = (nodeDefaults != null) ? nodeDefaults.getLocalDataSource() : null;
        if (key != null) {
            DBConnectionInfo info = (DBConnectionInfo) getApplication()
                    .getPreferenceDomain()
                    .getDetail(key, DBConnectionInfo.class, false);
            if (info != null) {
View Full Code Here

        if (node == null) {
            return null;
        }

        // if node has local DS set, use it
        DataNodeDefaults nodeDefaults = (DataNodeDefaults) getApplication()
                .getCayenneProjectPreferences()
                .getProjectDetailObject(
                        DataNodeDefaults.class,
                        getProjectController().getPreferenceForDataDomain().node(
                                "DataNode").node(node.getName()));

        String key = (nodeDefaults != null) ? nodeDefaults.getLocalDataSource() : null;
        if (key != null) {
            DBConnectionInfo info = (DBConnectionInfo) getApplication()
                    .getCayenneProjectPreferences()
                    .getDetailObject(DBConnectionInfo.class)
                    .getObject(key);
View Full Code Here

        if (newName == null) {
            throw new ValidationException("Empty DataNode Name");
        }

        ProjectController parent = (ProjectController) getParent();
        DataNodeDefaults oldPref = parent.getDataNodePreferences();
        DataChannelDescriptor dataChannelDescriptor = (DataChannelDescriptor) getApplication()
                .getProject()
                .getRootNode();

        Collection<DataNodeDescriptor> matchingNode = dataChannelDescriptor
                .getNodeDescriptors();

        Iterator<DataNodeDescriptor> it = matchingNode.iterator();
        while (it.hasNext()) {
            DataNodeDescriptor node = it.next();
            if (node.getName().equals(newName)) {
                // there is an entity with the same name
                throw new ValidationException("There is another DataNode named '"
                        + newName
                        + "'. Use a different name.");
            }
        }

        // passed validation, set value...

        // TODO: fixme....there is a slight chance that domain is different than the one
        // cached node belongs to
        ProjectUtil.setDataNodeName((DataChannelDescriptor) parent
                .getProject()
                .getRootNode(), node, newName);

        oldPref.copyPreferences(newName);
    }
View Full Code Here

TOP

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

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.