Package org.apache.cayenne.modeler.action

Examples of org.apache.cayenne.modeler.action.CreateRelationshipAction


        registerAction(new CreateProcedureParameterAction(application));
        registerAction(new RemoveProcedureParameterAction(application));
        registerAction(new CreateQueryAction(application));
        registerAction(new CreateAttributeAction(application));
        registerAction(new RemoveAttributeAction(application));
        registerAction(new CreateRelationshipAction(application));
        registerAction(new RemoveRelationshipAction(application));
        registerAction(new DbEntitySyncAction(application));
        registerAction(new ObjEntitySyncAction(application));
        registerAction(new DerivedEntitySyncAction(application));
        registerAction(new ImportDBAction(application));
View Full Code Here


        registerAction(new CreateProcedureParameterAction(application));
        registerAction(new RemoveProcedureParameterAction(application));
        registerAction(new CreateQueryAction(application));
        registerAction(new CreateAttributeAction(application));
        registerAction(new RemoveAttributeAction(application));
        registerAction(new CreateRelationshipAction(application));
        registerAction(new RemoveRelationshipAction(application));
        // start callback-related actions
        registerAction(new CreateCallbackMethodAction(application)).setAlwaysOn(true);
        registerAction(new CreateCallbackMethodForListenerAction(application));
        registerAction(new CreateCallbackMethodForDataMapListenerAction(application));
View Full Code Here

        return "Create Relationship";
    }

    @Override
    public void redo() throws CannotRedoException {
        CreateRelationshipAction action = (CreateRelationshipAction) actionManager
                .getAction(CreateRelationshipAction.getActionName());

        if (objEnt != null) {
            for (ObjRelationship rel : objectRel) {
                action.createObjRelationship(objEnt, rel);
            }
        }

        if (dbEnt != null) {
            for (DbRelationship rel : dbRel) {
                action.createDbRelationship(dbEnt, rel);
            }
        }
    }
View Full Code Here

    }
  }

  @Override
  public void undo() throws CannotUndoException {
    CreateRelationshipAction action = (CreateRelationshipAction) actionManager
        .getAction(CreateRelationshipAction.getActionName());
    if (objEntity != null) {
      for (ObjRelationship r : rels) {
        action.createObjRelationship(objEntity, r);
      }
    } else {
      for (DbRelationship dr : dbRels) {
        action.createDbRelationship(dbEntity, dr);
      }
    }
  }
View Full Code Here

    }

    @Override
    public void undo() throws CannotUndoException {

        CreateRelationshipAction relationshipAction = (CreateRelationshipAction) actionManager
                .getAction(CreateRelationshipAction.getActionName());

        switch (this.mode) {
            case OBJECT_ENTITY: {
                for (Entry<ObjEntity, List<ObjRelationship>> entry : objRelationshipMap
                        .entrySet()) {

                    ObjEntity objEntity = entry.getKey();
                    for (ObjRelationship rel : entry.getValue()) {
                        relationshipAction.createObjRelationship(objEntity, rel);
                    }
                }

                CreateObjEntityAction action = (CreateObjEntityAction) actionManager
                        .getAction(CreateObjEntityAction.getActionName());
                action.createObjEntity(map, objEntity);

                break;
            }
            case DB_ENTITY: {

                for (Entry<DbEntity, List<DbRelationship>> entry : dbRelationshipMap
                        .entrySet()) {
                    DbEntity dbEntity = entry.getKey();
                    for (DbRelationship rel : entry.getValue()) {
                        relationshipAction.createDbRelationship(dbEntity, rel);
                    }
                }

                CreateDbEntityAction action = (CreateDbEntityAction) actionManager
                        .getAction(CreateDbEntityAction.getActionName());
View Full Code Here

    }

    @Override
    public void undo() throws CannotUndoException {

        CreateRelationshipAction relationshipAction = actionManager
                .getAction(CreateRelationshipAction.class);

        switch (this.mode) {
            case OBJECT_ENTITY: {
                for (Entry<ObjEntity, List<ObjRelationship>> entry : objRelationshipMap
                        .entrySet()) {

                    ObjEntity objEntity = entry.getKey();
                    for (ObjRelationship rel : entry.getValue()) {
                        relationshipAction.createObjRelationship(objEntity, rel);
                    }
                }

                CreateObjEntityAction action = actionManager
                        .getAction(CreateObjEntityAction.class);
                action.createObjEntity(map, objEntity);

                break;
            }
            case DB_ENTITY: {

                for (Entry<DbEntity, List<DbRelationship>> entry : dbRelationshipMap
                        .entrySet()) {
                    DbEntity dbEntity = entry.getKey();
                    for (DbRelationship rel : entry.getValue()) {
                        relationshipAction.createDbRelationship(dbEntity, rel);
                    }
                }

                CreateDbEntityAction action = actionManager
                        .getAction(CreateDbEntityAction.class);
View Full Code Here

        return "Create Relationship";
    }

    @Override
    public void redo() throws CannotRedoException {
        CreateRelationshipAction action = actionManager
                .getAction(CreateRelationshipAction.class);

        if (objEnt != null) {
            for (ObjRelationship rel : objectRel) {
                action.createObjRelationship(objEnt, rel);
            }
        }

        if (dbEnt != null) {
            for (DbRelationship rel : dbRel) {
                action.createDbRelationship(dbEnt, rel);
            }
        }
    }
View Full Code Here

        }
    }

    @Override
    public void undo() throws CannotUndoException {
        CreateRelationshipAction action = actionManager
                .getAction(CreateRelationshipAction.class);
        if (objEntity != null) {
            for (ObjRelationship r : rels) {
                action.createObjRelationship(objEntity, r);
            }
        }
        else {
            for (DbRelationship dr : dbRels) {
                action.createDbRelationship(dbEntity, dr);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.modeler.action.CreateRelationshipAction

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.