Search in sources :

Example 1 with EmbeddableDisplayListener

use of org.apache.cayenne.modeler.event.EmbeddableDisplayListener in project cayenne by apache.

the class ProjectController method fireEmbeddableDisplayEvent.

public void fireEmbeddableDisplayEvent(EmbeddableDisplayEvent e) {
    boolean changed = e.getEmbeddable() != currentState.embeddable;
    if (!e.isRefired()) {
        e.setEmbeddableChanged(changed);
        if (changed) {
            clearState();
            currentState.domain = e.getDomain();
            currentState.node = e.getDataNode();
            currentState.map = e.getDataMap();
            currentState.embeddable = e.getEmbeddable();
        }
    }
    if (changed) {
        saveState(e);
    }
    for (EventListener listener : listenerList.getListeners(EmbeddableDisplayListener.class)) {
        EmbeddableDisplayListener temp = (EmbeddableDisplayListener) listener;
        temp.currentEmbeddableChanged(e);
    }
}
Also used : EmbeddableDisplayListener(org.apache.cayenne.modeler.event.EmbeddableDisplayListener) EventListener(java.util.EventListener)

Aggregations

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