Search in sources :

Example 1 with ProcedureParameterEvent

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);
    }
}
Also used : ProcedureParameter(org.apache.cayenne.map.ProcedureParameter) ProcedureParameterEvent(org.apache.cayenne.configuration.event.ProcedureParameterEvent) ProjectController(org.apache.cayenne.modeler.ProjectController)

Example 2 with ProcedureParameterEvent

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()));
}
Also used : ProcedureParameterDisplayEvent(org.apache.cayenne.modeler.event.ProcedureParameterDisplayEvent) DataChannelDescriptor(org.apache.cayenne.configuration.DataChannelDescriptor) ProcedureParameterEvent(org.apache.cayenne.configuration.event.ProcedureParameterEvent)

Example 3 with ProcedureParameterEvent

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);
}
Also used : ProcedureParameter(org.apache.cayenne.map.ProcedureParameter) ProcedureParameterEvent(org.apache.cayenne.configuration.event.ProcedureParameterEvent)

Example 4 with ProcedureParameterEvent

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);
    }
}
Also used : ProcedureParameter(org.apache.cayenne.map.ProcedureParameter) ProcedureParameterEvent(org.apache.cayenne.configuration.event.ProcedureParameterEvent) ProjectController(org.apache.cayenne.modeler.ProjectController)

Aggregations

ProcedureParameterEvent (org.apache.cayenne.configuration.event.ProcedureParameterEvent)4 ProcedureParameter (org.apache.cayenne.map.ProcedureParameter)3 ProjectController (org.apache.cayenne.modeler.ProjectController)2 DataChannelDescriptor (org.apache.cayenne.configuration.DataChannelDescriptor)1 ProcedureParameterDisplayEvent (org.apache.cayenne.modeler.event.ProcedureParameterDisplayEvent)1