Search in sources :

Example 1 with EmbeddableAttributeDisplayListener

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

the class ProjectController method fireEmbeddableAttributeDisplayEvent.

public void fireEmbeddableAttributeDisplayEvent(EmbeddableAttributeDisplayEvent ev) {
    boolean changed = !Arrays.equals(ev.getEmbeddableAttributes(), currentState.embAttrs);
    if (changed) {
        if (ev.getEmbeddable() != currentState.embeddable) {
            clearState();
            currentState.domain = ev.getDomain();
            currentState.map = ev.getDataMap();
            currentState.embeddable = ev.getEmbeddable();
        }
        currentState.embAttrs = new EmbeddableAttribute[ev.getEmbeddableAttributes().length];
        System.arraycopy(ev.getEmbeddableAttributes(), 0, currentState.embAttrs, 0, currentState.embAttrs.length);
    }
    EventListener[] list = listenerList.getListeners(EmbeddableAttributeDisplayListener.class);
    for (EventListener listener : list) {
        EmbeddableAttributeDisplayListener temp = (EmbeddableAttributeDisplayListener) listener;
        temp.currentEmbeddableAttributeChanged(ev);
    }
}
Also used : EmbeddableAttributeDisplayListener(org.apache.cayenne.modeler.event.EmbeddableAttributeDisplayListener) EventListener(java.util.EventListener)

Aggregations

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