use of org.apache.cayenne.modeler.event.DomainDisplayListener in project cayenne by apache.
the class ProjectController method fireDomainDisplayEvent.
public void fireDomainDisplayEvent(DomainDisplayEvent e) {
boolean changed = e.getDomain() != currentState.domain;
if (!changed) {
changed = currentState.node != null || currentState.map != null || currentState.dbEntity != null || currentState.objEntity != null || currentState.procedure != null || currentState.query != null || currentState.embeddable != null;
}
if (!e.isRefired()) {
e.setDomainChanged(changed);
if (changed) {
clearState();
currentState.domain = e.getDomain();
}
}
if (changed) {
saveState(e);
}
for (EventListener listener : listenerList.getListeners(DomainDisplayListener.class)) {
DomainDisplayListener temp = (DomainDisplayListener) listener;
temp.currentDomainChanged(e);
}
// closed
if (e.getDomain() == null) {
getApplication().getActionManager().projectOpened();
} else {
getApplication().getActionManager().domainSelected();
}
}
Aggregations