Package org.apache.cayenne.modeler.editor

Examples of org.apache.cayenne.modeler.editor.EditorView


     */
    public void projectOpenedAction(Project project) {

        projectController.setProject(project);

        frame.setView(new EditorView(projectController));

        projectController.projectOpened();
        application.getActionManager().projectOpened();

        // do status update AFTER the project is actually opened...
View Full Code Here


     */
    public void projectOpenedAction(Project project) {

        projectController.setProject(project);

        frame.setView(new EditorView(projectController));

        projectController.projectOpened();
        application.getActionManager().projectOpened();

        // do status update AFTER the project is actually opened...
View Full Code Here

     */
    public void projectOpenedAction(Project project) {

        projectController.setProject(project);

        frame.setView(new EditorView(projectController));

        projectController.projectOpened();
        application.getActionManager().projectOpened();

        // do status update AFTER the project is actually opened...
View Full Code Here

    public TextCompoundEdit(JTextComponent editor, JTextFieldUndoListener listener) {

        this.editor = editor;
        this.listener = listener;

        EditorView editorView = ((CayenneModelerFrame) Application
                .getInstance()
                .getFrameController()
                .getView()).getView();

        treePath = editorView.getProjectTreeView().getSelectionPath();

        DefaultMutableTreeNode newPath = (DefaultMutableTreeNode) treePath
                .getLastPathComponent();

        targetObject = newPath.getUserObject();

        if (targetObject instanceof ObjEntity) {
            tabbedPane = editorView.getObjDetailView();
        }

        if (targetObject instanceof DbEntity) {
            tabbedPane = editorView.getDbDetailView();
        }

        if (targetObject instanceof Embeddable) {
            tabbedPane = editorView.getEmbeddableView();
        }

        if (targetObject instanceof SQLTemplate) {
            tabbedPane = editorView.getSqlTemplateView();
        }

        if (targetObject instanceof EJBQLQuery) {
            tabbedPane = editorView.getEjbqlQueryView();
        }

        if (targetObject instanceof DataNodeDescriptor) {
            tabbedPane = editorView.getDataNodeView();
        }

        if (targetObject instanceof DataMap) {
            tabbedPane = editorView.getDataMapView();
        }

        if (targetObject instanceof DataChannelDescriptor) {
            tabbedPane = editorView.getDataDomainView();
        }

        if (tabbedPane != null) {
            selectedTabIndex = tabbedPane.getSelectedIndex();
        }
View Full Code Here

        }
    }

    private void restoreSelections() {

        EditorView editorView = ((CayenneModelerFrame) Application
                .getInstance()
                .getFrameController()
                .getView()).getView();

        editorView.getProjectTreeView().getSelectionModel().setSelectionPath(treePath);

        if (tabbedPane != null) {
            tabbedPane.setSelectedIndex(selectedTabIndex);
        }
    }
View Full Code Here

        table.addMouseListener(new JumpToResultActionListener());
        table.getSelectionModel().setSelectionInterval(0, 0);
    }

    public static void jumpToResult(Object[] path) {
      EditorView editor = ((CayenneModelerFrame) Application.getInstance()
                .getFrameController()
                .getView()).getView();
     
        if (path[path.length - 1] instanceof Entity) {

            /** Make selection in a project tree, open correspondent entity tab */
            editor.getProjectTreeView().getSelectionModel().setSelectionPath(
                    buildTreePath(path, editor));
            EntityDisplayEvent event = new EntityDisplayEvent(
                    editor.getProjectTreeView(),
                    (Entity) path[path.length - 1],
                    (DataMap) path[path.length - 2],
                    (DataDomain) path[path.length - 3]);
            event.setMainTabFocus(true);

            if (path[path.length - 1] instanceof ObjEntity)
                editor.getObjDetailView().currentObjEntityChanged(event);
            if (path[path.length - 1] instanceof DbEntity)
                editor.getDbDetailView().currentDbEntityChanged(event);
        }
       
        if (path[path.length - 1] instanceof Query) {

            /** Make selection in a project tree, open correspondent entity tab */
            editor.getProjectTreeView().getSelectionModel().setSelectionPath(
                    buildTreePath(path, editor));
            QueryDisplayEvent event = new QueryDisplayEvent(
                    editor.getProjectTreeView(),
                    (Query) path[path.length - 1],
                    (DataMap) path[path.length - 2],
                    (DataDomain) path[path.length - 3]);

            editor.currentQueryChanged(event);
        }
       
        if (path[path.length - 1] instanceof Embeddable) {

            /** Make selection in a project tree, open correspondent entity tab */
            editor.getProjectTreeView().getSelectionModel().setSelectionPath(
                    buildTreePath(path, editor));
            EmbeddableDisplayEvent event = new EmbeddableDisplayEvent(
                    editor.getProjectTreeView(),
                    (Embeddable) path[path.length - 1],
                    (DataMap) path[path.length - 2],
                    (DataDomain) path[path.length - 3]);
            event.setMainTabFocus(true);

            editor.currentEmbeddableChanged(event);
        }
       
        if (path[path.length - 1] instanceof EmbeddableAttribute) {

            /** Make selection in a project tree, open correspondent embeddable tab */
            Object[] o = new Object[path.length - 1];
            for (int i = 0; i < path.length - 1; i++)
                o[i] = path[i];
            editor.getProjectTreeView().getSelectionModel().setSelectionPath(
                    buildTreePath(o, editor));
           
            EmbeddableAttributeDisplayEvent event = new EmbeddableAttributeDisplayEvent(
                    editor.getProjectTreeView(),
                    (Embeddable) path[path.length - 2],
                    (EmbeddableAttribute) path[path.length - 1],
                    (DataMap) path[path.length - 3],
                    (DataDomain) path[path.length - 4]);
            event.setMainTabFocus(true);

            editor.getEmbeddableView().currentEmbeddableAttributeChanged(event);
        }
       
        if (path[path.length - 1] instanceof Attribute
                || path[path.length - 1] instanceof Relationship) {

            /** Make selection in a project tree, open correspondent attributes tab */
            Object[] o = new Object[path.length - 1];
            for (int i = 0; i < path.length - 1; i++)
                o[i] = path[i];
            editor.getProjectTreeView().getSelectionModel().setSelectionPath(
                    buildTreePath(o, editor));

            if (path[path.length - 1] instanceof DbAttribute) {
                AttributeDisplayEvent event = new AttributeDisplayEvent(
                        editor.getProjectTreeView(),
                        (Attribute) path[path.length - 1],
                        (Entity) path[path.length - 2],
                        (DataMap) path[path.length - 3],
                        (DataDomain) path[path.length - 4]);
                event.setMainTabFocus(true);
                editor.getDbDetailView().currentDbAttributeChanged(event);
            }

            if (path[path.length - 1] instanceof ObjAttribute) {
                AttributeDisplayEvent event = new AttributeDisplayEvent(
                        editor.getProjectTreeView(),
                        (Attribute) path[path.length - 1],
                        (Entity) path[path.length - 2],
                        (DataMap) path[path.length - 3],
                        (DataDomain) path[path.length - 4]);
                event.setMainTabFocus(true);
                editor.getObjDetailView().currentObjAttributeChanged(event);
            }

            if (path[path.length - 1] instanceof DbRelationship) {
                RelationshipDisplayEvent event = new RelationshipDisplayEvent(
                        editor.getProjectTreeView(),
                        (Relationship) path[path.length - 1],
                        (Entity) path[path.length - 2],
                        (DataMap) path[path.length - 3],
                        (DataDomain) path[path.length - 4]);
                event.setMainTabFocus(true);
                editor.getDbDetailView().currentDbRelationshipChanged(event);
            }
        }

        if (path[path.length - 1] instanceof ObjRelationship) {
            RelationshipDisplayEvent event = new RelationshipDisplayEvent(
                    editor.getProjectTreeView(),
                    (Relationship) path[path.length - 1],
                    (Entity) path[path.length - 2],
                    (DataMap) path[path.length - 3],
                    (DataDomain) path[path.length - 4]);
            event.setMainTabFocus(true);
            editor.getObjDetailView().currentObjRelationshipChanged(event);
        }

    }
View Full Code Here

    public TextCompoundEdit(JTextComponent editor, JTextFieldUndoListener listener) {

        this.editor = editor;
        this.listener = listener;

        EditorView editorView = ((CayenneModelerFrame) Application
                .getInstance()
                .getFrameController()
                .getView()).getView();

        treePath = editorView.getProjectTreeView().getSelectionPath();

        DefaultMutableTreeNode newPath = (DefaultMutableTreeNode) treePath
                .getLastPathComponent();

        targetObject = newPath.getUserObject();

        if (targetObject instanceof ObjEntity) {
            tabbedPane = editorView.getObjDetailView();
        }

        if (targetObject instanceof DbEntity) {
            tabbedPane = editorView.getDbDetailView();
        }

        if (targetObject instanceof Embeddable) {
            tabbedPane = editorView.getEmbeddableView();
        }

        if (targetObject instanceof SQLTemplate) {
            tabbedPane = editorView.getSqlTemplateView();
        }

        if (targetObject instanceof EJBQLQuery) {
            tabbedPane = editorView.getEjbqlQueryView();
        }

        if (targetObject instanceof DataNode) {
            tabbedPane = editorView.getDataNodeView();
        }

        if (targetObject instanceof DataMap) {
            tabbedPane = editorView.getDataMapView();
        }

        if (tabbedPane != null) {
            selectedTabIndex = tabbedPane.getSelectedIndex();
        }
View Full Code Here

        }
    }

    private void restoreSelections() {

        EditorView editorView = ((CayenneModelerFrame) Application
                .getInstance()
                .getFrameController()
                .getView()).getView();

        editorView.getProjectTreeView().getSelectionModel().setSelectionPath(treePath);

        if (tabbedPane != null) {
            tabbedPane.setSelectedIndex(selectedTabIndex);
        }
    }
View Full Code Here

     */
    public void projectOpenedAction(Project project) {

        projectController.setProject(project);

        frame.setView(new EditorView(projectController));

        projectController.projectOpened();
        application.getActionManager().projectOpened();

        // do status update AFTER the project is actually opened...
View Full Code Here

     */
    public void projectOpenedAction(Project project) {

        projectController.setProject(project);

        frame.setView(new EditorView(projectController));

        projectController.projectOpened();
        application.getActionManager().projectOpened();

        // do status update AFTER the project is actually opened...
View Full Code Here

TOP

Related Classes of org.apache.cayenne.modeler.editor.EditorView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.