use of org.apache.cayenne.configuration.event.DataNodeEvent in project cayenne by apache.
the class AdapterEditor method setAdapterName.
public void setAdapterName(String name) {
if (node == null) {
return;
}
// ModelerDbAdapter adapter = new ModelerDbAdapter(name, node.getDataSource());
// adapter.validate();
node.setAdapterType(name);
DataNodeEvent e = new DataNodeEvent(AdapterEditor.this, node);
((ProjectController) getParent()).fireDataNodeEvent(e);
}
use of org.apache.cayenne.configuration.event.DataNodeEvent in project cayenne by apache.
the class LinkDataMapUndoableEdit method undo.
@Override
public void undo() throws CannotUndoException {
if (node != null) {
node.getDataMapNames().remove(map.getName());
mediator.fireDataNodeEvent(new DataNodeEvent(this, node));
}
if (!unlinkedNodes.isEmpty()) {
for (DataNodeDescriptor unlinkedNode : unlinkedNodes) {
unlinkedNode.getDataMapNames().add(map.getName());
mediator.fireDataNodeEvent(new DataNodeEvent(this, unlinkedNode));
}
}
}
use of org.apache.cayenne.configuration.event.DataNodeEvent in project cayenne by apache.
the class LinkDataMapsUndoableEdit method redo.
@Override
public void redo() throws CannotRedoException {
for (DataMap dataMap : ((DataChannelDescriptor) mediator.getProject().getRootNode()).getDataMaps()) {
if (!linkedDataMaps.contains(dataMap.getName())) {
dataNodeDescriptor.getDataMapNames().add(dataMap.getName());
mediator.fireDataNodeEvent(new DataNodeEvent(this, dataNodeDescriptor));
}
}
}
use of org.apache.cayenne.configuration.event.DataNodeEvent in project cayenne by apache.
the class RemoveAction method removeDataNode.
public void removeDataNode(DataNodeDescriptor node) {
ProjectController mediator = getProjectController();
DataChannelDescriptor domain = (DataChannelDescriptor) mediator.getProject().getRootNode();
DataNodeEvent e = new DataNodeEvent(Application.getFrame(), node, MapEvent.REMOVE);
e.setDomain((DataChannelDescriptor) mediator.getProject().getRootNode());
domain.getNodeDescriptors().remove(node);
mediator.fireDataNodeEvent(e);
}
use of org.apache.cayenne.configuration.event.DataNodeEvent in project cayenne by apache.
the class RemoveAction method removeDataMapFromDataNode.
public void removeDataMapFromDataNode(DataNodeDescriptor node, DataMap map) {
ProjectController mediator = getProjectController();
DataNodeEvent e = new DataNodeEvent(Application.getFrame(), node);
e.setDomain((DataChannelDescriptor) mediator.getProject().getRootNode());
node.getDataMapNames().remove(map.getName());
// Force reloading of the data node in the browse view
mediator.fireDataNodeEvent(e);
}
Aggregations