use of org.apache.cayenne.map.Embeddable in project cayenne by apache.
the class FindAction method jumpToEmbeddableAttributeResult.
private static void jumpToEmbeddableAttributeResult(EmbeddableAttribute attribute, EditorView editor, DataChannelDescriptor domain) {
Embeddable embeddable = attribute.getEmbeddable();
DataMap map = embeddable.getDataMap();
buildAndSelectTreePath(map, embeddable, editor);
EmbeddableAttributeDisplayEvent event = new EmbeddableAttributeDisplayEvent(editor.getProjectTreeView(), embeddable, attribute, map, domain);
event.setMainTabFocus(true);
editor.getEmbeddableView().currentEmbeddableAttributeChanged(event);
}
use of org.apache.cayenne.map.Embeddable in project cayenne by apache.
the class ProjectUtil method setEmbeddableAttributeName.
/**
* Changes the name of the embeddable attribute and all references to this embeddable attribute.
*/
public static void setEmbeddableAttributeName(EmbeddableAttribute attribute, String newName) {
String oldName = attribute.getName();
attribute.setName(newName);
Embeddable embeddable = attribute.getEmbeddable();
if (embeddable != null) {
embeddable.removeAttribute(oldName);
embeddable.addAttribute(attribute);
}
}
use of org.apache.cayenne.map.Embeddable 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);
}
Aggregations