use of org.apache.cayenne.modeler.undo.CreateDbEntityUndoableEdit in project cayenne by apache.
the class CreateDbEntityAction method performAction.
/**
* Creates new DbEntity, adds it to the current DataMap, fires DbEntityEvent and DbEntityDisplayEvent.
*/
public void performAction(ActionEvent e) {
ProjectController mediator = getProjectController();
DataMap map = mediator.getCurrentDataMap();
DbEntity entity = new DbEntity();
entity.setName(NameBuilder.builder(entity, map).name());
createEntity(map, entity);
application.getUndoManager().addEdit(new CreateDbEntityUndoableEdit(map, entity));
}
Aggregations