use of org.apache.cayenne.modeler.event.DbAttributeDisplayListener in project cayenne by apache.
the class ProjectController method fireDbAttributeDisplayEvent.
public void fireDbAttributeDisplayEvent(AttributeDisplayEvent e) {
boolean changed = !Arrays.equals(e.getAttributes(), currentState.dbAttrs);
if (changed) {
if (e.getEntity() != currentState.dbEntity) {
clearState();
currentState.domain = e.getDomain();
currentState.map = e.getDataMap();
currentState.dbEntity = (DbEntity) e.getEntity();
}
currentState.dbAttrs = new DbAttribute[e.getAttributes().length];
System.arraycopy(e.getAttributes(), 0, currentState.dbAttrs, 0, currentState.dbAttrs.length);
}
for (EventListener listener : listenerList.getListeners(DbAttributeDisplayListener.class)) {
DbAttributeDisplayListener temp = (DbAttributeDisplayListener) listener;
temp.currentDbAttributeChanged(e);
}
}
Aggregations