use of org.apache.cayenne.modeler.ProjectController in project cayenne by apache.
the class RemoveAttributeAction method removeDbAttributes.
public void removeDbAttributes(DataMap dataMap, DbEntity entity, DbAttribute[] attribs) {
ProjectController mediator = getProjectController();
for (DbAttribute attrib : attribs) {
entity.removeAttribute(attrib.getName());
AttributeEvent e = new AttributeEvent(Application.getFrame(), attrib, entity, MapEvent.REMOVE);
mediator.fireDbAttributeEvent(e);
}
ProjectUtil.cleanObjMappings(dataMap);
}
use of org.apache.cayenne.modeler.ProjectController in project cayenne by apache.
the class RemoveCallbackMethodAction method removeCallbackMethods.
/**
* base logic for callback method removing
* @param actionEvent event
*/
private void removeCallbackMethods(ActionEvent actionEvent) {
ProjectController mediator = getProjectController();
CallbackType callbackType = mediator.getCurrentCallbackType();
ObjCallbackMethod[] callbackMethods = mediator.getCurrentCallbackMethods();
for (ObjCallbackMethod callbackMethod : callbackMethods) {
removeCallbackMethod(callbackType, callbackMethod.getName());
}
Application.getInstance().getUndoManager().addEdit(new RemoveCallbackMethodUndoableEdit(callbackType, callbackMethods));
}
use of org.apache.cayenne.modeler.ProjectController 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.modeler.ProjectController in project cayenne by apache.
the class RemoveProcedureParameterAction method removeProcedureParameters.
protected void removeProcedureParameters() {
ProjectController mediator = getProjectController();
ProcedureParameter[] parameters = mediator.getCurrentProcedureParameters();
removeProcedureParameters(mediator.getCurrentProcedure(), parameters);
}
use of org.apache.cayenne.modeler.ProjectController in project cayenne by apache.
the class RemoveRelationshipAction method removeDbRelationships.
public void removeDbRelationships(DbEntity entity, DbRelationship[] rels) {
ProjectController mediator = getProjectController();
for (DbRelationship rel : rels) {
entity.removeRelationship(rel.getName());
RelationshipEvent e = new RelationshipEvent(Application.getFrame(), rel, entity, MapEvent.REMOVE);
mediator.fireDbRelationshipEvent(e);
}
ProjectUtil.cleanObjMappings(mediator.getCurrentDataMap());
}
Aggregations