Package org.apache.cayenne.modeler.action

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


        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));
        registerAction(new ImportEOModelAction(application));
View Full Code Here


        RemoveAttributeAction rAttributeAction = actionManager
                .getAction(RemoveAttributeAction.class);

        RemoveAction rAction = actionManager.getAction(RemoveAction.class);

        RemoveRelationshipAction rRelationShipAction = actionManager
                .getAction(RemoveRelationshipAction.class);

        RemoveProcedureParameterAction rProcedureParamAction = actionManager
                .getAction(RemoveProcedureParameterAction.class);

        if (content instanceof DataMap) {
            if (where instanceof DataChannelDescriptor) {
                rAction.removeDataMap((DataMap) content);
            }
            else if (where instanceof DataNodeDescriptor) {
                rAction.removeDataMapFromDataNode(
                        (DataNodeDescriptor) where,
                        (DataMap) content);
            }
        }
        else if (where instanceof DataMap) {
            if (content instanceof DbEntity) {
                rAction.removeDbEntity(map, (DbEntity) content);
            }
            else if (content instanceof ObjEntity) {
                rAction.removeObjEntity(map, (ObjEntity) content);
            }
            else if (content instanceof Query) {
                rAction.removeQuery(map, (Query) content);
            }
            else if (content instanceof Procedure) {
                rAction.removeProcedure(map, (Procedure) content);
            }
        }
        else if (where instanceof DbEntity) {
            if (content instanceof DbAttribute) {
                rAttributeAction.removeDbAttributes(
                        map,
                        (DbEntity) where,
                        new DbAttribute[] {
                            (DbAttribute) content
                        });
            }
            else if (content instanceof DbRelationship) {
                rRelationShipAction.removeDbRelationships(
                        (DbEntity) where,
                        new DbRelationship[] {
                            (DbRelationship) content
                        });
            }
        }
        else if (where instanceof ObjEntity) {
            if (content instanceof ObjAttribute) {
                rAttributeAction.removeObjAttributes(
                        (ObjEntity) where,
                        new ObjAttribute[] {
                            (ObjAttribute) content
                        });
            }
            else if (content instanceof ObjRelationship) {
                rRelationShipAction.removeObjRelationships(
                        (ObjEntity) where,
                        new ObjRelationship[] {
                            (ObjRelationship) content
                        });
            }
View Full Code Here

        RemoveAttributeAction rAttributeAction = actionManager
                .getAction(RemoveAttributeAction.class);

        RemoveAction rAction = actionManager.getAction(RemoveAction.class);

        RemoveRelationshipAction rRelationShipAction = actionManager
                .getAction(RemoveRelationshipAction.class);

        RemoveProcedureParameterAction rProcedureParamAction = actionManager
                .getAction(RemoveProcedureParameterAction.class);

        if (content instanceof DataMap) {
            if (where instanceof DataChannelDescriptor) {
                rAction.removeDataMap((DataMap) content);
            }
            else if (where instanceof DataNodeDescriptor) {
                rAction.removeDataMapFromDataNode(
                        (DataNodeDescriptor) where,
                        (DataMap) content);
            }
        }
        else if (where instanceof DataMap) {
            if (content instanceof DbEntity) {
                rAction.removeDbEntity(map, (DbEntity) content);
            }
            else if (content instanceof ObjEntity) {
                rAction.removeObjEntity(map, (ObjEntity) content);
            }
            else if (content instanceof Query) {
                rAction.removeQuery(map, (Query) content);
            }
            else if (content instanceof Procedure) {
                rAction.removeProcedure(map, (Procedure) content);
            }
        }
        else if (where instanceof DbEntity) {
            if (content instanceof DbEntity) {
                rAction.removeDbEntity(map, (DbEntity) content);
            }
            else if (content instanceof DbAttribute) {
                rAttributeAction.removeDbAttributes(
                        map,
                        (DbEntity) where,
                        new DbAttribute[] {
                            (DbAttribute) content
                        });
            }
            else if (content instanceof DbRelationship) {
                rRelationShipAction.removeDbRelationships(
                        (DbEntity) where,
                        new DbRelationship[] {
                            (DbRelationship) content
                        });
            }
        }
        else if (where instanceof ObjEntity) {
            if (content instanceof ObjEntity) {
                rAction.removeObjEntity(map, (ObjEntity) content);
            }
            else if (content instanceof ObjAttribute) {
                rAttributeAction.removeObjAttributes(
                        (ObjEntity) where,
                        new ObjAttribute[] {
                            (ObjAttribute) content
                        });
            }
            else if (content instanceof ObjRelationship) {
                rRelationShipAction.removeObjRelationships(
                        (ObjEntity) where,
                        new ObjRelationship[] {
                            (ObjRelationship) content
                        });
            }
View Full Code Here

        }
    }

    @Override
    public void undo() throws CannotUndoException {
        RemoveRelationshipAction action = (RemoveRelationshipAction) actionManager
                .getAction(RemoveRelationshipAction.getActionName());

        if (objEnt != null) {
            action.removeObjRelationships(objEnt, objectRel);
            controller.fireObjEntityDisplayEvent(new EntityDisplayEvent(
                    this,
                    objEnt,
                    objEnt.getDataMap(),
                    controller.getCurrentDataDomain()));
        }

        if (dbEnt != null) {
            action.removeDbRelationships(dbEnt, dbRel);
            controller.fireDbEntityDisplayEvent(new EntityDisplayEvent(this, dbEnt, dbEnt
                    .getDataMap(), controller.getCurrentDataDomain()));
        }
    }
View Full Code Here

        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));
        registerAction(new RemoveCallbackMethodAction(application));
View Full Code Here

    }
  }

  @Override
  public void redo() throws CannotRedoException {
    RemoveRelationshipAction action = (RemoveRelationshipAction) actionManager
        .getAction(RemoveRelationshipAction.getActionName());
    if (objEntity != null) {
      action.removeObjRelationships(objEntity, rels);
    } else {
      action.removeDbRelationships(dbEntity, dbRels);
    }
  }
View Full Code Here

                .getAction(RemoveAttributeAction.getActionName());

        RemoveAction rAction = (RemoveAction) actionManager.getAction(RemoveAction
                .getActionName());

        RemoveRelationshipAction rRelationShipAction = (RemoveRelationshipAction) actionManager
                .getAction(RemoveRelationshipAction.getActionName());

        RemoveProcedureParameterAction rProcedureParamAction = (RemoveProcedureParameterAction) actionManager
                .getAction(RemoveProcedureParameterAction.getActionName());

        if (content instanceof DataMap) {
            if (where instanceof DataDomain) {
                rAction.removeDataMap((DataDomain) where, (DataMap) content);
            }
            else if (where instanceof DataNode) {
                rAction.removeDataMapFromDataNode((DataNode) where, (DataMap) content);
            }
        }
        else if (where instanceof DataMap) {
            if (content instanceof DbEntity) {
                rAction.removeDbEntity(map, (DbEntity) content);
            }
            else if (content instanceof ObjEntity) {
                rAction.removeObjEntity(map, (ObjEntity) content);
            }
            else if (content instanceof Query) {
                rAction.removeQuery(map, (Query) content);
            }
            else if (content instanceof Procedure) {
                rAction.removeProcedure(map, (Procedure) content);
            }
        }
        else if (where instanceof DbEntity) {
            if (content instanceof DbAttribute) {
                rAttributeAction.removeDbAttributes(
                        map,
                        (DbEntity) where,
                        new DbAttribute[] {
                            (DbAttribute) content
                        });
            }
            else if (content instanceof DbRelationship) {
                rRelationShipAction.removeDbRelationships(
                        (DbEntity) where,
                        new DbRelationship[] {
                            (DbRelationship) content
                        });
            }
        }
        else if (where instanceof ObjEntity) {
            if (content instanceof ObjAttribute) {
                rAttributeAction.removeObjAttributes(
                        (ObjEntity) where,
                        new ObjAttribute[] {
                            (ObjAttribute) content
                        });
            }
            else if (content instanceof ObjRelationship) {
                rRelationShipAction.removeObjRelationships(
                        (ObjEntity) where,
                        new ObjRelationship[] {
                            (ObjRelationship) content
                        });
            }
View Full Code Here

        RemoveAttributeAction rAttributeAction = actionManager
                .getAction(RemoveAttributeAction.class);

        RemoveAction rAction = actionManager.getAction(RemoveAction.class);

        RemoveRelationshipAction rRelationShipAction = actionManager
                .getAction(RemoveRelationshipAction.class);

        RemoveProcedureParameterAction rProcedureParamAction = actionManager
                .getAction(RemoveProcedureParameterAction.class);

        if (content instanceof DataMap) {
            if (where instanceof DataChannelDescriptor) {
                rAction.removeDataMap((DataMap) content);
            }
            else if (where instanceof DataNodeDescriptor) {
                rAction.removeDataMapFromDataNode(
                        (DataNodeDescriptor) where,
                        (DataMap) content);
            }
        }
        else if (where instanceof DataMap) {
            if (content instanceof DbEntity) {
                rAction.removeDbEntity(map, (DbEntity) content);
            }
            else if (content instanceof ObjEntity) {
                rAction.removeObjEntity(map, (ObjEntity) content);
            }
            else if (content instanceof Embeddable) {
                rAction.removeEmbeddable(map, (Embeddable) content);
            }
            else if (content instanceof Query) {
                rAction.removeQuery(map, (Query) content);
            }
            else if (content instanceof Procedure) {
                rAction.removeProcedure(map, (Procedure) content);
            }
        }
        else if (where instanceof DbEntity) {
            if (content instanceof DbEntity) {
                rAction.removeDbEntity(map, (DbEntity) content);
            }
            else if (content instanceof DbAttribute) {
                rAttributeAction.removeDbAttributes(
                        map,
                        (DbEntity) where,
                        new DbAttribute[] {
                            (DbAttribute) content
                        });
            }
            else if (content instanceof DbRelationship) {
                rRelationShipAction.removeDbRelationships(
                        (DbEntity) where,
                        new DbRelationship[] {
                            (DbRelationship) content
                        });
            }
        }
        else if (where instanceof ObjEntity) {
            if (content instanceof ObjEntity) {
                rAction.removeObjEntity(map, (ObjEntity) content);
            }
            else if (content instanceof ObjAttribute) {
                rAttributeAction.removeObjAttributes(
                        (ObjEntity) where,
                        new ObjAttribute[] {
                            (ObjAttribute) content
                        });
            }
            else if (content instanceof ObjRelationship) {
                rRelationShipAction.removeObjRelationships(
                        (ObjEntity) where,
                        new ObjRelationship[] {
                            (ObjRelationship) content
                        });
            }
View Full Code Here

        }
    }

    @Override
    public void undo() throws CannotUndoException {
        RemoveRelationshipAction action = actionManager
                .getAction(RemoveRelationshipAction.class);

        if (objEnt != null) {
            action.removeObjRelationships(objEnt, objectRel);
            controller.fireObjEntityDisplayEvent(new EntityDisplayEvent(
                    this,
                    objEnt,
                    objEnt.getDataMap(),
                    (DataChannelDescriptor) controller.getProject().getRootNode()));
        }

        if (dbEnt != null) {
            action.removeDbRelationships(dbEnt, dbRel);
            controller.fireDbEntityDisplayEvent(new EntityDisplayEvent(this, dbEnt, dbEnt
                    .getDataMap(), (DataChannelDescriptor) controller
                    .getProject()
                    .getRootNode()));
        }
View Full Code Here

        }
    }

    @Override
    public void redo() throws CannotRedoException {
        RemoveRelationshipAction action = actionManager
                .getAction(RemoveRelationshipAction.class);
        if (objEntity != null) {
            action.removeObjRelationships(objEntity, rels);
        }
        else {
            action.removeDbRelationships(dbEntity, dbRels);
        }
    }
View Full Code Here

TOP

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

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.