use of org.apache.cayenne.map.Procedure 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));
}
}
use of org.apache.cayenne.map.Procedure in project cayenne by apache.
the class ProjectUtil method setProcedureParameterName.
public static void setProcedureParameterName(ProcedureParameter parameter, String newName) {
String oldName = parameter.getName();
// If name hasn't changed, just return
if (Util.nullSafeEquals(oldName, newName)) {
return;
}
Procedure procedure = parameter.getProcedure();
procedure.removeCallParameter(parameter.getName());
parameter.setName(newName);
procedure.addCallParameter(parameter);
}
use of org.apache.cayenne.map.Procedure in project cayenne by apache.
the class ProcedureParameterDisplayEventType method fireLastDisplayEvent.
@Override
public void fireLastDisplayEvent() {
DataChannelDescriptor dataChannel = (DataChannelDescriptor) controller.getProject().getRootNode();
if (!dataChannel.getName().equals(preferences.getDomain())) {
return;
}
DataMap dataMap = dataChannel.getDataMap(preferences.getDataMap());
if (dataMap == null) {
return;
}
Procedure procedure = dataMap.getProcedure(preferences.getProcedure());
if (procedure == null) {
return;
}
ProcedureDisplayEvent procedureDisplayEvent = new ProcedureDisplayEvent(this, procedure, dataMap, dataChannel);
controller.fireProcedureDisplayEvent(procedureDisplayEvent);
ProcedureParameter[] procedureParameters = getLastProcedureParameters(procedure);
ProcedureParameterDisplayEvent procedureParameterDisplayEvent = new ProcedureParameterDisplayEvent(this, procedureParameters, procedure, dataMap, dataChannel);
controller.fireProcedureParameterDisplayEvent(procedureParameterDisplayEvent);
}
Aggregations