Search in sources :

Example 16 with ConfigurationNode

use of org.apache.cayenne.configuration.ConfigurationNode in project cayenne by apache.

the class MultipleObjectsDisplayEventType method getLastMultipleObjects.

protected ConfigurationNode[] getLastMultipleObjects(DataChannelDescriptor dataChannel) {
    List<ConfigurationNode> configurationNodeList = new ArrayList<>();
    ConfigurationNode[] nodes = new ConfigurationNode[0];
    String multipleObjects = preferences.getMultipleObjects();
    if (multipleObjects.isEmpty()) {
        return configurationNodeList.toArray(nodes);
    }
    for (String objectName : multipleObjects.split(",")) {
        ConfigurationNode configNode = getConfigNode(dataChannel, objectName);
        if (configNode != null) {
            configurationNodeList.add(configNode);
        }
    }
    return configurationNodeList.toArray(nodes);
}
Also used : ConfigurationNode(org.apache.cayenne.configuration.ConfigurationNode) ArrayList(java.util.ArrayList)

Aggregations

ConfigurationNode (org.apache.cayenne.configuration.ConfigurationNode)16 ArrayList (java.util.ArrayList)5 DataMap (org.apache.cayenne.map.DataMap)5 DataChannelDescriptor (org.apache.cayenne.configuration.DataChannelDescriptor)4 MultipleObjectsDisplayEvent (org.apache.cayenne.modeler.event.MultipleObjectsDisplayEvent)3 URLResource (org.apache.cayenne.resource.URLResource)3 File (java.io.File)2 URL (java.net.URL)2 EventObject (java.util.EventObject)2 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)2 TreePath (javax.swing.tree.TreePath)2 CayenneRuntimeException (org.apache.cayenne.CayenneRuntimeException)2 ProjectController (org.apache.cayenne.modeler.ProjectController)2 Resource (org.apache.cayenne.resource.Resource)2 Rectangle (java.awt.Rectangle)1 IOException (java.io.IOException)1 BackingStoreException (java.util.prefs.BackingStoreException)1 TreeSelectionEvent (javax.swing.event.TreeSelectionEvent)1 TreeSelectionListener (javax.swing.event.TreeSelectionListener)1 CompoundEdit (javax.swing.undo.CompoundEdit)1