use of org.apache.cayenne.modeler.event.AttributeDisplayEvent in project cayenne by apache.
the class ObjAttributeInfoDialog method changeAttributeObject.
private void changeAttributeObject() {
if (attributeSaved instanceof EmbeddedAttribute && embeddableModel.isAttributeOverrideChange()) {
Map<String, String> overrides = ((EmbeddedAttribute) attributeSaved).getAttributeOverrides();
Map<String, String> currentOverrAttr = getCurrentOverrideAttribute();
compareAndSetOverrideInEmbeddedAttribute(attributeSaved, overrides, currentOverrAttr);
}
if (attributeSaved instanceof EmbeddedAttribute) {
attributeSaved.setDbAttributePath(null);
model.setUpdatedValueAt(attributeSaved.getDbAttributePath(), row, 3);
}
model.getEntity().removeAttribute(attribute.getName());
model.getEntity().addAttribute(attributeSaved);
mediator.fireObjEntityEvent(new EntityEvent(this, model.getEntity(), MapEvent.CHANGE));
EntityDisplayEvent event = new EntityDisplayEvent(this, mediator.getCurrentObjEntity(), mediator.getCurrentDataMap(), (DataChannelDescriptor) mediator.getProject().getRootNode());
mediator.fireObjEntityDisplayEvent(event);
mediator.fireObjAttributeEvent(new AttributeEvent(this, attributeSaved, model.getEntity(), MapEvent.CHANGE));
AttributeDisplayEvent eventAttr = new AttributeDisplayEvent(this, attributeSaved, mediator.getCurrentObjEntity(), mediator.getCurrentDataMap(), (DataChannelDescriptor) mediator.getProject().getRootNode());
mediator.fireObjAttributeDisplayEvent(eventAttr);
}
use of org.apache.cayenne.modeler.event.AttributeDisplayEvent in project cayenne by apache.
the class CreateAttributeAction method fireObjAttributeEvent.
/**
* Fires events when an obj attribute was added
*/
static void fireObjAttributeEvent(Object src, ProjectController mediator, DataMap map, ObjEntity objEntity, ObjAttribute attr) {
mediator.fireObjAttributeEvent(new AttributeEvent(src, attr, objEntity, MapEvent.ADD));
DataChannelDescriptor domain = (DataChannelDescriptor) mediator.getProject().getRootNode();
AttributeDisplayEvent ade = new AttributeDisplayEvent(src, attr, objEntity, map, domain);
mediator.fireObjAttributeDisplayEvent(ade);
}
Aggregations