Search in sources :

Example 1 with CreateProcedureParameterUndoableEdit

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

the class CreateProcedureParameterAction method performAction.

/**
 * Creates ProcedureParameter depending on context.
 */
@Override
public void performAction(ActionEvent e) {
    ProjectController mediator = getProjectController();
    if (getProjectController().getCurrentProcedure() != null) {
        Procedure procedure = getProjectController().getCurrentProcedure();
        ProcedureParameter parameter = new ProcedureParameter();
        parameter.setName(NameBuilder.builder(parameter, procedure).name());
        createProcedureParameter(procedure, parameter);
        application.getUndoManager().addEdit(new CreateProcedureParameterUndoableEdit((DataChannelDescriptor) mediator.getProject().getRootNode(), mediator.getCurrentDataMap(), procedure, parameter));
    }
}
Also used : ProcedureParameter(org.apache.cayenne.map.ProcedureParameter) DataChannelDescriptor(org.apache.cayenne.configuration.DataChannelDescriptor) Procedure(org.apache.cayenne.map.Procedure) CreateProcedureParameterUndoableEdit(org.apache.cayenne.modeler.undo.CreateProcedureParameterUndoableEdit) ProjectController(org.apache.cayenne.modeler.ProjectController)

Aggregations

DataChannelDescriptor (org.apache.cayenne.configuration.DataChannelDescriptor)1 Procedure (org.apache.cayenne.map.Procedure)1 ProcedureParameter (org.apache.cayenne.map.ProcedureParameter)1 ProjectController (org.apache.cayenne.modeler.ProjectController)1 CreateProcedureParameterUndoableEdit (org.apache.cayenne.modeler.undo.CreateProcedureParameterUndoableEdit)1