use of org.apache.cayenne.modeler.event.EmbeddableAttributeDisplayEvent in project cayenne by apache.
the class EmbeddableAttributeErrorMsg method displayField.
@Override
public void displayField(ProjectController mediator, JFrame frame) {
EmbeddableAttributeDisplayEvent event = new EmbeddableAttributeDisplayEvent(frame, embeddable, embeddableAttribute, map, domain);
mediator.fireEmbeddableDisplayEvent(event);
mediator.fireEmbeddableAttributeDisplayEvent(event);
}
use of org.apache.cayenne.modeler.event.EmbeddableAttributeDisplayEvent in project cayenne by apache.
the class CreateAttributeAction method fireEmbeddableAttributeEvent.
static void fireEmbeddableAttributeEvent(Object src, ProjectController mediator, Embeddable embeddable, EmbeddableAttribute attr) {
mediator.fireEmbeddableAttributeEvent(new EmbeddableAttributeEvent(src, attr, embeddable, MapEvent.ADD));
EmbeddableAttributeDisplayEvent e = new EmbeddableAttributeDisplayEvent(src, embeddable, attr, mediator.getCurrentDataMap(), (DataChannelDescriptor) mediator.getProject().getRootNode());
mediator.fireEmbeddableAttributeDisplayEvent(e);
}
use of org.apache.cayenne.modeler.event.EmbeddableAttributeDisplayEvent in project cayenne by apache.
the class EmbeddableAttributeTab method processExistingSelection.
public void processExistingSelection(EventObject e) {
if (e instanceof ChangeEvent) {
table.clearSelection();
}
EmbeddableAttribute[] attrs = new EmbeddableAttribute[0];
if (table.getSelectedRow() >= 0) {
EmbeddableAttributeTableModel model = (EmbeddableAttributeTableModel) table.getModel();
int[] sel = table.getSelectedRows();
attrs = new EmbeddableAttribute[sel.length];
for (int i = 0; i < sel.length; i++) {
attrs[i] = model.getEmbeddableAttribute(sel[i]);
}
if (sel.length == 1) {
UIUtil.scrollToSelectedRow(table);
}
}
EmbeddableAttributeDisplayEvent ev = new EmbeddableAttributeDisplayEvent(this, mediator.getCurrentEmbeddable(), attrs, mediator.getCurrentDataMap(), (DataChannelDescriptor) mediator.getProject().getRootNode());
mediator.fireEmbeddableAttributeDisplayEvent(ev);
}
use of org.apache.cayenne.modeler.event.EmbeddableAttributeDisplayEvent 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);
editor.getEmbeddableView().repaint();
}
use of org.apache.cayenne.modeler.event.EmbeddableAttributeDisplayEvent 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