use of org.apache.cayenne.modeler.action.LinkDataMapAction in project cayenne by apache.
the class LinkDataMapUndoableEdit method redo.
@Override
public void redo() throws CannotRedoException {
LinkDataMapAction action = actionManager.getAction(LinkDataMapAction.class);
action.linkDataMap(map, node);
}
use of org.apache.cayenne.modeler.action.LinkDataMapAction in project cayenne by apache.
the class DataMapView method setDataNode.
void setDataNode() {
DataNodeDescriptor node = (DataNodeDescriptor) nodeSelector.getSelectedItem();
DataMap map = eventController.getCurrentDataMap();
LinkDataMapAction action = eventController.getApplication().getActionManager().getAction(LinkDataMapAction.class);
action.linkDataMap(map, node);
}
use of org.apache.cayenne.modeler.action.LinkDataMapAction in project cayenne by apache.
the class TreeDropTarget method drop.
public void drop(DropTargetDropEvent dtde) {
if (targetPath != null) {
try {
dtde.acceptDrop(dtde.getDropAction());
DefaultMutableTreeNode target = (DefaultMutableTreeNode) targetPath.getLastPathComponent();
DefaultMutableTreeNode parent = (DefaultMutableTreeNode) parentPath.getLastPathComponent();
if (target.getUserObject() instanceof DataNodeDescriptor && parent.getUserObject() instanceof DataMap) {
DataNodeDescriptor currentDataNode = (DataNodeDescriptor) target.getUserObject();
DataMap currentDataMap = (DataMap) parent.getUserObject();
LinkDataMapAction action = eventController.getApplication().getActionManager().getAction(LinkDataMapAction.class);
action.linkDataMap(currentDataMap, currentDataNode);
targetTree.makeVisible(targetPath.pathByAddingChild(target));
dtde.dropComplete(true);
}
} catch (Exception e) {
e.printStackTrace();
dtde.rejectDrop();
}
}
}
Aggregations