use of org.apache.cayenne.configuration.event.DataNodeEvent in project cayenne by apache.
the class ProjectController method addDataMap.
public void addDataMap(Object src, DataMap map, boolean makeCurrent) {
map.setDataChannelDescriptor(currentState.domain);
// new map was added.. link it to domain (and node if possible)
currentState.domain.getDataMaps().add(map);
if (currentState.node != null && !currentState.node.getDataMapNames().contains(map.getName())) {
currentState.node.getDataMapNames().add(map.getName());
fireDataNodeEvent(new DataNodeEvent(this, currentState.node));
}
fireDataMapEvent(new DataMapEvent(src, map, MapEvent.ADD));
if (makeCurrent) {
fireDataMapDisplayEvent(new DataMapDisplayEvent(src, map, currentState.domain, currentState.node));
}
}
use of org.apache.cayenne.configuration.event.DataNodeEvent in project cayenne by apache.
the class CreateNodeAction method createDataNode.
public void createDataNode(DataNodeDescriptor node) {
DataChannelDescriptor domain = (DataChannelDescriptor) getProjectController().getProject().getRootNode();
domain.getNodeDescriptors().add(node);
getProjectController().fireDataNodeEvent(new DataNodeEvent(this, node, MapEvent.ADD));
getProjectController().fireDataNodeDisplayEvent(new DataNodeDisplayEvent(this, domain, node));
}
Aggregations