Search in sources :

Example 1 with CayenneModelerFrame

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);
}
Also used : DomainDisplayEvent(org.apache.cayenne.modeler.event.DomainDisplayEvent) EntityDisplayEvent(org.apache.cayenne.modeler.event.EntityDisplayEvent) EditorView(org.apache.cayenne.modeler.editor.EditorView) CayenneModelerFrame(org.apache.cayenne.modeler.CayenneModelerFrame)

Example 2 with CayenneModelerFrame

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);
        }
    }
}
Also used : SQLTemplateTabbedView(org.apache.cayenne.modeler.editor.SQLTemplateTabbedView) EditorView(org.apache.cayenne.modeler.editor.EditorView) CayenneModelerFrame(org.apache.cayenne.modeler.CayenneModelerFrame)

Example 3 with CayenneModelerFrame

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);
    }
}
Also used : ObjEntity(org.apache.cayenne.map.ObjEntity) DetectedDbEntity(org.apache.cayenne.map.DetectedDbEntity) Entity(org.apache.cayenne.map.Entity) DbEntity(org.apache.cayenne.map.DbEntity) EJBQLQueryDescriptor(org.apache.cayenne.map.EJBQLQueryDescriptor) SelectQueryDescriptor(org.apache.cayenne.map.SelectQueryDescriptor) QueryDescriptor(org.apache.cayenne.map.QueryDescriptor) ProcedureQueryDescriptor(org.apache.cayenne.map.ProcedureQueryDescriptor) DataChannelDescriptor(org.apache.cayenne.configuration.DataChannelDescriptor) DbAttribute(org.apache.cayenne.map.DbAttribute) ObjAttribute(org.apache.cayenne.map.ObjAttribute) Attribute(org.apache.cayenne.map.Attribute) EmbeddableAttribute(org.apache.cayenne.map.EmbeddableAttribute) Relationship(org.apache.cayenne.map.Relationship) DbRelationship(org.apache.cayenne.map.DbRelationship) ObjRelationship(org.apache.cayenne.map.ObjRelationship) EditorView(org.apache.cayenne.modeler.editor.EditorView) EmbeddableAttribute(org.apache.cayenne.map.EmbeddableAttribute) CayenneModelerFrame(org.apache.cayenne.modeler.CayenneModelerFrame) Embeddable(org.apache.cayenne.map.Embeddable)

Aggregations

CayenneModelerFrame (org.apache.cayenne.modeler.CayenneModelerFrame)3 EditorView (org.apache.cayenne.modeler.editor.EditorView)3 DataChannelDescriptor (org.apache.cayenne.configuration.DataChannelDescriptor)1 Attribute (org.apache.cayenne.map.Attribute)1 DbAttribute (org.apache.cayenne.map.DbAttribute)1 DbEntity (org.apache.cayenne.map.DbEntity)1 DbRelationship (org.apache.cayenne.map.DbRelationship)1 DetectedDbEntity (org.apache.cayenne.map.DetectedDbEntity)1 EJBQLQueryDescriptor (org.apache.cayenne.map.EJBQLQueryDescriptor)1 Embeddable (org.apache.cayenne.map.Embeddable)1 EmbeddableAttribute (org.apache.cayenne.map.EmbeddableAttribute)1 Entity (org.apache.cayenne.map.Entity)1 ObjAttribute (org.apache.cayenne.map.ObjAttribute)1 ObjEntity (org.apache.cayenne.map.ObjEntity)1 ObjRelationship (org.apache.cayenne.map.ObjRelationship)1 ProcedureQueryDescriptor (org.apache.cayenne.map.ProcedureQueryDescriptor)1 QueryDescriptor (org.apache.cayenne.map.QueryDescriptor)1 Relationship (org.apache.cayenne.map.Relationship)1 SelectQueryDescriptor (org.apache.cayenne.map.SelectQueryDescriptor)1 SQLTemplateTabbedView (org.apache.cayenne.modeler.editor.SQLTemplateTabbedView)1