use of org.apache.cayenne.modeler.event.ProcedureDisplayEvent in project cayenne by apache.
the class ProcedureParameterErrorMsg method displayField.
public void displayField(ProjectController mediator, JFrame frame) {
Object object = super.validationFailure.getSource();
DataChannelDescriptor domain = (DataChannelDescriptor) mediator.getProject().getRootNode();
ProcedureParameter procedureParameter = (ProcedureParameter) object;
Procedure procedure = procedureParameter.getProcedure();
DataMap map = procedure.getDataMap();
// Race condition between the two events...?
// first display the stored procedure
// for whatever reason, other validators do not require this step
// (E.g. DbAttributeErrorMsg)
ProcedureDisplayEvent procedureEvent = new ProcedureDisplayEvent(frame, procedure, map, domain);
procedureEvent.setTabReset(true);
mediator.fireProcedureDisplayEvent(procedureEvent);
// now show the failed parameter
ProcedureParameterDisplayEvent event = new ProcedureParameterDisplayEvent(frame, procedureParameter, procedure, map, domain);
event.setTabReset(true);
mediator.fireProcedureParameterDisplayEvent(event);
}
use of org.apache.cayenne.modeler.event.ProcedureDisplayEvent in project cayenne by apache.
the class CreateProcedureAction method fireProcedureEvent.
/**
* Fires events when a procedure was added
*/
static void fireProcedureEvent(Object src, ProjectController mediator, DataMap dataMap, Procedure procedure) {
mediator.fireProcedureEvent(new ProcedureEvent(src, procedure, MapEvent.ADD));
mediator.fireProcedureDisplayEvent(new ProcedureDisplayEvent(src, procedure, mediator.getCurrentDataMap(), (DataChannelDescriptor) mediator.getProject().getRootNode()));
}
use of org.apache.cayenne.modeler.event.ProcedureDisplayEvent in project cayenne by apache.
the class CreateProcedureParameterUndoableEdit method undo.
@Override
public void undo() throws CannotUndoException {
RemoveProcedureParameterAction action = actionManager.getAction(RemoveProcedureParameterAction.class);
if (procedure != null) {
action.removeProcedureParameters(procedure, new ProcedureParameter[] { parameter });
controller.fireProcedureDisplayEvent(new ProcedureDisplayEvent(this, procedure, dataMap, domain));
}
}
use of org.apache.cayenne.modeler.event.ProcedureDisplayEvent in project cayenne by apache.
the class ProcedureDisplayEventType 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);
}
use of org.apache.cayenne.modeler.event.ProcedureDisplayEvent in project cayenne by apache.
the class ProcedureTab method processExistingSelection.
public void processExistingSelection(EventObject e) {
ProcedureDisplayEvent pde = new ProcedureDisplayEvent(this, eventController.getCurrentProcedure(), eventController.getCurrentDataMap(), (DataChannelDescriptor) eventController.getProject().getRootNode());
eventController.fireProcedureDisplayEvent(pde);
}
Aggregations