use of java.util.EventListener in project cayenne by apache.
the class ProjectController method fireProcedureDisplayEvent.
public void fireProcedureDisplayEvent(ProcedureDisplayEvent e) {
boolean changed = e.getProcedure() != currentState.procedure;
if (!e.isRefired()) {
e.setProcedureChanged(changed);
if (changed) {
clearState();
currentState.domain = e.getDomain();
currentState.map = e.getDataMap();
currentState.procedure = e.getProcedure();
}
}
if (changed) {
saveState(e);
}
for (EventListener eventListener : listenerList.getListeners(ProcedureDisplayListener.class)) {
ProcedureDisplayListener listener = (ProcedureDisplayListener) eventListener;
listener.currentProcedureChanged(e);
}
}
use of java.util.EventListener in project cayenne by apache.
the class ProjectController method fireProjectOnSaveEvent.
public void fireProjectOnSaveEvent(ProjectOnSaveEvent e) {
for (EventListener listener : listenerList.getListeners(ProjectOnSaveListener.class)) {
ProjectOnSaveListener temp = (ProjectOnSaveListener) listener;
temp.beforeSaveChanges(e);
}
}
use of java.util.EventListener in project cayenne by apache.
the class ProjectController method fireQueryDisplayEvent.
public void fireQueryDisplayEvent(QueryDisplayEvent e) {
boolean changed = e.getQuery() != currentState.query;
if (!e.isRefired()) {
e.setQueryChanged(changed);
if (changed) {
clearState();
currentState.domain = e.getDomain();
currentState.map = e.getDataMap();
currentState.query = e.getQuery();
}
}
if (changed) {
saveState(e);
}
for (EventListener eventListener : listenerList.getListeners(QueryDisplayListener.class)) {
QueryDisplayListener listener = (QueryDisplayListener) eventListener;
listener.currentQueryChanged(e);
}
}
use of java.util.EventListener in project cayenne by apache.
the class ProjectController method fireDataNodeDisplayEvent.
public void fireDataNodeDisplayEvent(DataNodeDisplayEvent e) {
boolean changed = e.getDataNode() != currentState.node;
if (!changed) {
changed = currentState.map != null || currentState.dbEntity != null || currentState.objEntity != null || currentState.procedure != null || currentState.query != null || currentState.embeddable != null;
}
if (!e.isRefired()) {
e.setDataNodeChanged(changed);
if (changed) {
clearState();
currentState.domain = e.getDomain();
currentState.node = e.getDataNode();
}
}
if (changed) {
saveState(e);
}
EventListener[] list = listenerList.getListeners(DataNodeDisplayListener.class);
for (EventListener listener : list) {
((DataNodeDisplayListener) listener).currentDataNodeChanged(e);
}
}
use of java.util.EventListener in project cayenne by apache.
the class ProjectController method fireObjRelationshipDisplayEvent.
public void fireObjRelationshipDisplayEvent(RelationshipDisplayEvent e) {
boolean changed = !Arrays.equals(e.getRelationships(), currentState.objRels);
e.setRelationshipChanged(changed);
if (changed) {
if (e.getEntity() != currentState.objEntity) {
clearState();
currentState.domain = e.getDomain();
currentState.map = e.getDataMap();
currentState.objEntity = (ObjEntity) e.getEntity();
}
currentState.objRels = new ObjRelationship[e.getRelationships().length];
System.arraycopy(e.getRelationships(), 0, currentState.objRels, 0, currentState.objRels.length);
}
EventListener[] list = listenerList.getListeners(ObjRelationshipDisplayListener.class);
for (EventListener listener : list) {
ObjRelationshipDisplayListener temp = (ObjRelationshipDisplayListener) listener;
temp.currentObjRelationshipChanged(e);
}
}
Aggregations