use of org.apache.cayenne.configuration.event.ProcedureParameterEvent in project cayenne by apache.
the class RemoveProcedureParameterAction method removeProcedureParameters.
public void removeProcedureParameters(Procedure procedure, ProcedureParameter[] parameters) {
ProjectController mediator = getProjectController();
for (ProcedureParameter parameter : parameters) {
procedure.removeCallParameter(parameter.getName());
ProcedureParameterEvent e = new ProcedureParameterEvent(Application.getFrame(), parameter, MapEvent.REMOVE);
mediator.fireProcedureParameterEvent(e);
}
}
use of org.apache.cayenne.configuration.event.ProcedureParameterEvent in project cayenne by apache.
the class CreateProcedureParameterAction method fireProcedureParameterEvent.
/**
* Fires events when an proc parameter was added
*/
static void fireProcedureParameterEvent(Object src, ProjectController mediator, Procedure procedure, ProcedureParameter parameter) {
mediator.fireProcedureParameterEvent(new ProcedureParameterEvent(src, parameter, MapEvent.ADD));
mediator.fireProcedureParameterDisplayEvent(new ProcedureParameterDisplayEvent(src, parameter, procedure, mediator.getCurrentDataMap(), (DataChannelDescriptor) mediator.getProject().getRootNode()));
}
use of org.apache.cayenne.configuration.event.ProcedureParameterEvent in project cayenne by apache.
the class ProcedureParameterTableModel method setUpdatedValueAt.
@Override
public void setUpdatedValueAt(Object newVal, int rowIndex, int columnIndex) {
ProcedureParameter parameter = getParameter(rowIndex);
if (parameter == null) {
return;
}
String value = (String) newVal;
ProcedureParameterEvent event = new ProcedureParameterEvent(eventSource, parameter);
switch(columnIndex) {
case PARAMETER_NAME:
event.setOldName(parameter.getName());
setParameterName(value, parameter);
fireTableCellUpdated(rowIndex, columnIndex);
break;
case PARAMETER_DIRECTION:
setParameterDirection(value, parameter);
break;
case PARAMETER_TYPE:
setParameterType(value, parameter);
break;
case PARAMETER_LENGTH:
setMaxLength(value, parameter);
break;
case PARAMETER_PRECISION:
setPrecision(value, parameter);
break;
}
mediator.fireProcedureParameterEvent(event);
}
use of org.apache.cayenne.configuration.event.ProcedureParameterEvent in project cayenne by apache.
the class RemoveAction method removeProcedureParameters.
private void removeProcedureParameters(Procedure procedure, ProcedureParameter[] parameters) {
ProjectController mediator = getProjectController();
for (ProcedureParameter parameter : parameters) {
procedure.removeCallParameter(parameter.getName());
ProcedureParameterEvent e = new ProcedureParameterEvent(Application.getFrame(), parameter, MapEvent.REMOVE);
mediator.fireProcedureParameterEvent(e);
}
}
Aggregations