Search in sources :

Example 1 with CreateDataMapUndoableEdit

use of org.apache.cayenne.modeler.undo.CreateDataMapUndoableEdit in project cayenne by apache.

the class CreateDataMapAction method performAction.

public void performAction(ActionEvent e) {
    ProjectController mediator = getProjectController();
    DataChannelDescriptor dataChannelDescriptor = (DataChannelDescriptor) mediator.getProject().getRootNode();
    DataMap map = new DataMap();
    map.setName(NameBuilder.builder(map, dataChannelDescriptor).name());
    createDataMap(map);
    application.getUndoManager().addEdit(new CreateDataMapUndoableEdit(dataChannelDescriptor, map));
}
Also used : DataChannelDescriptor(org.apache.cayenne.configuration.DataChannelDescriptor) CreateDataMapUndoableEdit(org.apache.cayenne.modeler.undo.CreateDataMapUndoableEdit) ProjectController(org.apache.cayenne.modeler.ProjectController) DataMap(org.apache.cayenne.map.DataMap)

Aggregations

DataChannelDescriptor (org.apache.cayenne.configuration.DataChannelDescriptor)1 DataMap (org.apache.cayenne.map.DataMap)1 ProjectController (org.apache.cayenne.modeler.ProjectController)1 CreateDataMapUndoableEdit (org.apache.cayenne.modeler.undo.CreateDataMapUndoableEdit)1