use of org.apache.cayenne.modeler.event.DbEntityDisplayListener in project cayenne by apache.
the class ProjectController method fireDbEntityDisplayEvent.
public void fireDbEntityDisplayEvent(EntityDisplayEvent e) {
boolean changed = e.getEntity() != currentState.dbEntity;
if (!e.isRefired()) {
e.setEntityChanged(changed);
if (changed) {
clearState();
currentState.domain = e.getDomain();
currentState.node = e.getDataNode();
currentState.map = e.getDataMap();
currentState.dbEntity = (DbEntity) e.getEntity();
}
}
if (changed) {
saveState(e);
}
for (EventListener listener : listenerList.getListeners(DbEntityDisplayListener.class)) {
DbEntityDisplayListener temp = (DbEntityDisplayListener) listener;
temp.currentDbEntityChanged(e);
}
}
Aggregations