Search in sources :

Example 1 with DbEntityDisplayListener

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);
    }
}
Also used : EventListener(java.util.EventListener) DbEntityDisplayListener(org.apache.cayenne.modeler.event.DbEntityDisplayListener)

Aggregations

EventListener (java.util.EventListener)1 DbEntityDisplayListener (org.apache.cayenne.modeler.event.DbEntityDisplayListener)1