use of org.apache.cayenne.configuration.event.ProcedureEvent in project cayenne by apache.
the class ProcedureTab method setSchema.
void setSchema(String text) {
if (text != null && text.trim().length() == 0) {
text = null;
}
Procedure procedure = eventController.getCurrentProcedure();
if (procedure != null && !Util.nullSafeEquals(procedure.getSchema(), text)) {
procedure.setSchema(text);
eventController.fireProcedureEvent(new ProcedureEvent(this, procedure));
}
}
use of org.apache.cayenne.configuration.event.ProcedureEvent in project cayenne by apache.
the class ProcedureTab method initController.
private void initController() {
returnsValue.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
Procedure procedure = eventController.getCurrentProcedure();
if (procedure != null && !ignoreChange) {
procedure.setReturningValue(returnsValue.isSelected());
eventController.fireProcedureEvent(new ProcedureEvent(ProcedureTab.this, procedure));
}
}
});
eventController.addProcedureDisplayListener(this);
}
use of org.apache.cayenne.configuration.event.ProcedureEvent in project cayenne by apache.
the class ProcedureTab method setCatalog.
void setCatalog(String text) {
if (text != null && text.trim().length() == 0) {
text = null;
}
Procedure procedure = eventController.getCurrentProcedure();
if (procedure != null && !Util.nullSafeEquals(procedure.getCatalog(), text)) {
procedure.setCatalog(text);
eventController.fireProcedureEvent(new ProcedureEvent(this, procedure));
}
}
use of org.apache.cayenne.configuration.event.ProcedureEvent in project cayenne by apache.
the class SchemaUpdateController method updateSchema.
protected void updateSchema() {
boolean doAll = isAllEntities();
String defaultSchema = dataMap.getDefaultSchema();
// set schema for DbEntities
for (DbEntity entity : dataMap.getDbEntities()) {
if (doAll || Util.isEmptyString(entity.getSchema())) {
if (!Util.nullSafeEquals(defaultSchema, entity.getSchema())) {
entity.setSchema(defaultSchema);
// any way to batch events, a big change will flood the app with
// entity events..?
mediator.fireDbEntityEvent(new EntityEvent(this, entity));
}
}
}
// set schema for procedures...
for (Procedure procedure : dataMap.getProcedures()) {
if (doAll || Util.isEmptyString(procedure.getSchema())) {
if (!Util.nullSafeEquals(defaultSchema, procedure.getSchema())) {
procedure.setSchema(defaultSchema);
// any way to batch events, a big change will flood the app with
// procedure events..?
mediator.fireProcedureEvent(new ProcedureEvent(this, procedure));
}
}
}
view.dispose();
}
use of org.apache.cayenne.configuration.event.ProcedureEvent in project cayenne by apache.
the class RemoveAction method removeProcedure.
/**
* Removes current Procedure from its DataMap and fires "remove" ProcedureEvent.
*/
public void removeProcedure(DataMap map, Procedure procedure) {
ProjectController mediator = getProjectController();
ProcedureEvent e = new ProcedureEvent(Application.getFrame(), procedure, MapEvent.REMOVE);
e.setDomain((DataChannelDescriptor) mediator.getProject().getRootNode());
map.removeProcedure(procedure.getName());
mediator.fireProcedureEvent(e);
}
Aggregations