Search in sources :

Example 56 with EventListener

use of java.util.EventListener in project cayenne by apache.

the class ProjectController method fireMultipleObjectsDisplayEvent.

public void fireMultipleObjectsDisplayEvent(MultipleObjectsDisplayEvent e) {
    clearState();
    currentState.paths = e.getNodes();
    currentState.parentPath = e.getParentNode();
    EventListener[] list = listenerList.getListeners(MultipleObjectsDisplayListener.class);
    for (EventListener listener : list) {
        MultipleObjectsDisplayListener temp = (MultipleObjectsDisplayListener) listener;
        temp.currentObjectsChanged(e, getApplication());
    }
}
Also used : MultipleObjectsDisplayListener(org.apache.cayenne.modeler.event.MultipleObjectsDisplayListener) EventListener(java.util.EventListener)

Example 57 with EventListener

use of java.util.EventListener 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)

Example 58 with EventListener

use of java.util.EventListener in project cayenne by apache.

the class ProjectController method fireProcedureParameterDisplayEvent.

public void fireProcedureParameterDisplayEvent(ProcedureParameterDisplayEvent e) {
    boolean changed = !Arrays.equals(e.getProcedureParameters(), currentState.procedureParameters);
    if (changed) {
        if (currentState.procedure != e.getProcedure()) {
            clearState();
            currentState.domain = e.getDomain();
            currentState.map = e.getDataMap();
            currentState.procedure = e.getProcedure();
        }
        currentState.procedureParameters = e.getProcedureParameters();
    }
    EventListener[] list = listenerList.getListeners(ProcedureParameterDisplayListener.class);
    for (EventListener eventListener : list) {
        ProcedureParameterDisplayListener listener = (ProcedureParameterDisplayListener) eventListener;
        listener.currentProcedureParameterChanged(e);
    }
}
Also used : EventListener(java.util.EventListener) ProcedureParameterDisplayListener(org.apache.cayenne.modeler.event.ProcedureParameterDisplayListener)

Example 59 with EventListener

use of java.util.EventListener 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)

Example 60 with EventListener

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

Aggregations

EventListener (java.util.EventListener)71 Test (org.junit.Test)11 ListenerInfo (io.undertow.servlet.api.ListenerInfo)5 ServletRequestListener (javax.servlet.ServletRequestListener)4 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 ServletContextListener (javax.servlet.ServletContextListener)3 HttpSessionListener (javax.servlet.http.HttpSessionListener)3 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)3 EventListenerList (org.eclipse.scout.rt.platform.util.EventListenerList)3 Bundle (org.osgi.framework.Bundle)3 BundleContext (org.osgi.framework.BundleContext)3 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 Method (java.lang.reflect.Method)2 EventObject (java.util.EventObject)2 List (java.util.List)2 NamingException (javax.naming.NamingException)2 ServletRequestEvent (javax.servlet.ServletRequestEvent)2 HttpSessionIdListener (javax.servlet.http.HttpSessionIdListener)2