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());
}
}
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);
}
}
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);
}
}
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);
}
}
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();
}
}
Aggregations