use of org.apache.cayenne.modeler.CayenneModelerFrame in project cayenne by apache.
the class ShowGraphEntityAction method showEntity.
void showEntity(Entity entity) {
// we're always in same domain
EditorView editor = ((CayenneModelerFrame) Application.getInstance().getFrameController().getView()).getView();
editor.getProjectTreeView().getSelectionModel().setSelectionPath(editor.getProjectTreeView().getSelectionPath().getParentPath().getParentPath());
DomainDisplayEvent event = new EntityDisplayEvent(editor.getProjectTreeView(), entity, entity.getDataMap(), (DataChannelDescriptor) getProjectController().getProject().getRootNode());
getProjectController().fireDomainDisplayEvent(event);
}
use of org.apache.cayenne.modeler.CayenneModelerFrame in project cayenne by apache.
the class TextCompoundEdit method restoreSelections.
private void restoreSelections() {
EditorView editorView = ((CayenneModelerFrame) Application.getInstance().getFrameController().getView()).getView();
editorView.getProjectTreeView().getSelectionModel().setSelectionPath(treePath);
if (tabbedPane != null) {
tabbedPane.setSelectedIndex(selectedTabIndex);
if (tabbedPane instanceof SQLTemplateTabbedView) {
((SQLTemplateTabbedView) tabbedPane).getScriptsTab().setSelectedIndex(selectedItem);
}
}
}
use of org.apache.cayenne.modeler.CayenneModelerFrame in project cayenne by apache.
the class FindAction method jumpToResult.
/**
* Navigate to search result
* Used also in {@link org.apache.cayenne.modeler.graph.action.EntityDisplayAction}
*/
public static void jumpToResult(FindAction.SearchResultEntry searchResultEntry) {
EditorView editor = ((CayenneModelerFrame) Application.getInstance().getFrameController().getView()).getView();
DataChannelDescriptor domain = (DataChannelDescriptor) Application.getInstance().getProject().getRootNode();
if (searchResultEntry.getObject() instanceof Entity) {
jumpToEntityResult((Entity) searchResultEntry.getObject(), editor, domain);
} else if (searchResultEntry.getObject() instanceof QueryDescriptor) {
jumpToQueryResult((QueryDescriptor) searchResultEntry.getObject(), editor, domain);
} else if (searchResultEntry.getObject() instanceof Embeddable) {
jumpToEmbeddableResult((Embeddable) searchResultEntry.getObject(), editor, domain);
} else if (searchResultEntry.getObject() instanceof EmbeddableAttribute) {
jumpToEmbeddableAttributeResult((EmbeddableAttribute) searchResultEntry.getObject(), editor, domain);
} else if (searchResultEntry.getObject() instanceof Attribute || searchResultEntry.getObject() instanceof Relationship) {
jumpToAttributeResult(searchResultEntry, editor, domain);
}
}
Aggregations