Package org.apache.cayenne.modeler.event

Examples of org.apache.cayenne.modeler.event.QueryDisplayEvent


        } else if (de instanceof ProcedureDisplayEvent) {
            ProcedureDisplayEvent pde = (ProcedureDisplayEvent) de;
            pde.setProcedureChanged(true);
            fireProcedureDisplayEvent(pde);
        } else if (de instanceof QueryDisplayEvent) {
            QueryDisplayEvent qde = (QueryDisplayEvent) de;
            qde.setQueryChanged(true);
            fireQueryDisplayEvent(qde);
        } else if (de instanceof DataMapDisplayEvent) {
            DataMapDisplayEvent dmde = (DataMapDisplayEvent) de;
            dmde.setDataMapChanged(true);
            fireDataMapDisplayEvent(dmde);
View Full Code Here


                    (DataMap) data[data.length - 2],
                    (DataDomain) data[data.length - 3]);
            mediator.fireProcedureDisplayEvent(e);
        }
        else if (obj instanceof Query) {
            QueryDisplayEvent e = new QueryDisplayEvent(
                    this,
                    (Query) obj,
                    (DataMap) data[data.length - 2],
                    (DataDomain) data[data.length - 3]);
            mediator.fireQueryDisplayEvent(e);
View Full Code Here

        dataMap.addQuery(query);

        // notify listeners
        mediator.fireQueryEvent(new QueryEvent(this, query, MapEvent.ADD));
        mediator
                .fireQueryDisplayEvent(new QueryDisplayEvent(this, query, dataMap, domain));
        shutdown();
    }
View Full Code Here

        ProjectPath path = super.validationInfo.getPath();
        DataDomain domain = (DataDomain) path.firstInstanceOf(DataDomain.class);
        DataMap map = (DataMap) path.firstInstanceOf(DataMap.class);
        Query query = (Query) path.firstInstanceOf(Query.class);

        QueryDisplayEvent event = new QueryDisplayEvent(frame, query, map, domain);
        mediator.fireQueryDisplayEvent(event);
    }
View Full Code Here

            ProcedureDisplayEvent pde = (ProcedureDisplayEvent) de;
            pde.setProcedureChanged(true);
            fireProcedureDisplayEvent(pde);
        }
        else if (de instanceof QueryDisplayEvent) {
            QueryDisplayEvent qde = (QueryDisplayEvent) de;
            qde.setQueryChanged(true);
            fireQueryDisplayEvent(qde);
        }
        else if (de instanceof DataMapDisplayEvent) {
            DataMapDisplayEvent dmde = (DataMapDisplayEvent) de;
            dmde.setDataMapChanged(true);
View Full Code Here

   */
  public static void fireQueryEvent(Object src, ProjectController mediator,
      DataMap dataMap, Query query) {
    mediator.fireQueryEvent(new QueryEvent(src, query, MapEvent.ADD,
        dataMap));
    mediator.fireQueryDisplayEvent(new QueryDisplayEvent(src, query,
        dataMap, (DataChannelDescriptor)mediator.getProject().getRootNode()));
  }
View Full Code Here

     * Fires events when a query was added
     */
    public static void fireQueryEvent(Object src, ProjectController mediator, DataChannelDescriptor domain,
            DataMap dataMap, Query query) {
        mediator.fireQueryEvent(new QueryEvent(src, query, MapEvent.ADD, dataMap));
        mediator.fireQueryDisplayEvent(new QueryDisplayEvent(src, query, dataMap, domain));
    }
View Full Code Here

        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 static void fireQueryEvent(Object src, ProjectController mediator,
      DataDomain domain, DataMap dataMap, Query query) {
    mediator.fireQueryEvent(new QueryEvent(src, query, MapEvent.ADD,
        dataMap));
    mediator.fireQueryDisplayEvent(new QueryDisplayEvent(src, query,
        dataMap, domain));
  }
View Full Code Here

        ProjectPath path = super.validationInfo.getPath();
        DataDomain domain = path.firstInstanceOf(DataDomain.class);
        DataMap map = path.firstInstanceOf(DataMap.class);
        Query query = path.firstInstanceOf(Query.class);

        QueryDisplayEvent event = new QueryDisplayEvent(frame, query, map, domain);
        mediator.fireQueryDisplayEvent(event);
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.modeler.event.QueryDisplayEvent

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.