Search in sources :

Example 6 with EmbeddableDisplayEvent

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

the class EmbeddableAttributeDisplayEventType method fireLastDisplayEvent.

@Override
public void fireLastDisplayEvent() {
    DataChannelDescriptor dataChannel = (DataChannelDescriptor) controller.getProject().getRootNode();
    if (!dataChannel.getName().equals(preferences.getDomain())) {
        return;
    }
    DataMap dataMap = dataChannel.getDataMap(preferences.getDataMap());
    if (dataMap == null) {
        return;
    }
    Embeddable embeddable = dataMap.getEmbeddable(preferences.getEmbeddable());
    if (embeddable == null) {
        return;
    }
    EmbeddableDisplayEvent embeddableDisplayEvent = new EmbeddableDisplayEvent(this, embeddable, dataMap, dataChannel);
    controller.fireEmbeddableDisplayEvent(embeddableDisplayEvent);
    EmbeddableAttribute[] embeddableAttributes = getLastEmbeddableAttributes(embeddable);
    EmbeddableAttributeDisplayEvent attributeDisplayEvent = new EmbeddableAttributeDisplayEvent(this, embeddable, embeddableAttributes, dataMap, dataChannel);
    controller.fireEmbeddableAttributeDisplayEvent(attributeDisplayEvent);
}
Also used : DataChannelDescriptor(org.apache.cayenne.configuration.DataChannelDescriptor) EmbeddableAttributeDisplayEvent(org.apache.cayenne.modeler.event.EmbeddableAttributeDisplayEvent) EmbeddableDisplayEvent(org.apache.cayenne.modeler.event.EmbeddableDisplayEvent) EmbeddableAttribute(org.apache.cayenne.map.EmbeddableAttribute) DataMap(org.apache.cayenne.map.DataMap) Embeddable(org.apache.cayenne.map.Embeddable)

Aggregations

EmbeddableDisplayEvent (org.apache.cayenne.modeler.event.EmbeddableDisplayEvent)6 DataMap (org.apache.cayenne.map.DataMap)4 DataChannelDescriptor (org.apache.cayenne.configuration.DataChannelDescriptor)3 Embeddable (org.apache.cayenne.map.Embeddable)3 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1 DataNodeDescriptor (org.apache.cayenne.configuration.DataNodeDescriptor)1 DbEntity (org.apache.cayenne.map.DbEntity)1 EmbeddableAttribute (org.apache.cayenne.map.EmbeddableAttribute)1 Entity (org.apache.cayenne.map.Entity)1 ObjEntity (org.apache.cayenne.map.ObjEntity)1 Procedure (org.apache.cayenne.map.Procedure)1 QueryDescriptor (org.apache.cayenne.map.QueryDescriptor)1 EmbeddableEvent (org.apache.cayenne.map.event.EmbeddableEvent)1 DataMapDisplayEvent (org.apache.cayenne.modeler.event.DataMapDisplayEvent)1 DataNodeDisplayEvent (org.apache.cayenne.modeler.event.DataNodeDisplayEvent)1 DomainDisplayEvent (org.apache.cayenne.modeler.event.DomainDisplayEvent)1 EmbeddableAttributeDisplayEvent (org.apache.cayenne.modeler.event.EmbeddableAttributeDisplayEvent)1 EntityDisplayEvent (org.apache.cayenne.modeler.event.EntityDisplayEvent)1 ProcedureDisplayEvent (org.apache.cayenne.modeler.event.ProcedureDisplayEvent)1 QueryDisplayEvent (org.apache.cayenne.modeler.event.QueryDisplayEvent)1