Search in sources :

Example 41 with ProjectController

use of org.apache.cayenne.modeler.ProjectController in project cayenne by apache.

the class RemoveAction method removeDataNode.

public void removeDataNode(DataNodeDescriptor node) {
    ProjectController mediator = getProjectController();
    DataChannelDescriptor domain = (DataChannelDescriptor) mediator.getProject().getRootNode();
    DataNodeEvent e = new DataNodeEvent(Application.getFrame(), node, MapEvent.REMOVE);
    e.setDomain((DataChannelDescriptor) mediator.getProject().getRootNode());
    domain.getNodeDescriptors().remove(node);
    mediator.fireDataNodeEvent(e);
}
Also used : DataChannelDescriptor(org.apache.cayenne.configuration.DataChannelDescriptor) DataNodeEvent(org.apache.cayenne.configuration.event.DataNodeEvent) ProjectController(org.apache.cayenne.modeler.ProjectController)

Example 42 with ProjectController

use of org.apache.cayenne.modeler.ProjectController in project cayenne by apache.

the class RemoveAction method removeProcedure.

/**
 * Removes current Procedure from its DataMap and fires "remove" ProcedureEvent.
 */
public void removeProcedure(DataMap map, Procedure procedure) {
    ProjectController mediator = getProjectController();
    ProcedureEvent e = new ProcedureEvent(Application.getFrame(), procedure, MapEvent.REMOVE);
    e.setDomain((DataChannelDescriptor) mediator.getProject().getRootNode());
    map.removeProcedure(procedure.getName());
    mediator.fireProcedureEvent(e);
}
Also used : ProcedureEvent(org.apache.cayenne.configuration.event.ProcedureEvent) ProjectController(org.apache.cayenne.modeler.ProjectController)

Example 43 with ProjectController

use of org.apache.cayenne.modeler.ProjectController in project cayenne by apache.

the class RemoveAction method removeEmbeddable.

public void removeEmbeddable(DataMap map, Embeddable embeddable) {
    ProjectController mediator = getProjectController();
    EmbeddableEvent e = new EmbeddableEvent(Application.getFrame(), embeddable, MapEvent.REMOVE);
    e.setDomain((DataChannelDescriptor) mediator.getProject().getRootNode());
    map.removeEmbeddable(embeddable.getClassName());
    mediator.fireEmbeddableEvent(e, map);
}
Also used : EmbeddableEvent(org.apache.cayenne.map.event.EmbeddableEvent) ProjectController(org.apache.cayenne.modeler.ProjectController)

Example 44 with ProjectController

use of org.apache.cayenne.modeler.ProjectController in project cayenne by apache.

the class RemoveAction method removeDataMapFromDataNode.

public void removeDataMapFromDataNode(DataNodeDescriptor node, DataMap map) {
    ProjectController mediator = getProjectController();
    DataNodeEvent e = new DataNodeEvent(Application.getFrame(), node);
    e.setDomain((DataChannelDescriptor) mediator.getProject().getRootNode());
    node.getDataMapNames().remove(map.getName());
    // Force reloading of the data node in the browse view
    mediator.fireDataNodeEvent(e);
}
Also used : DataNodeEvent(org.apache.cayenne.configuration.event.DataNodeEvent) ProjectController(org.apache.cayenne.modeler.ProjectController)

Example 45 with ProjectController

use of org.apache.cayenne.modeler.ProjectController in project cayenne by apache.

the class RemoveAction method removeProcedureParameters.

private void removeProcedureParameters(Procedure procedure, ProcedureParameter[] parameters) {
    ProjectController mediator = getProjectController();
    for (ProcedureParameter parameter : parameters) {
        procedure.removeCallParameter(parameter.getName());
        ProcedureParameterEvent e = new ProcedureParameterEvent(Application.getFrame(), parameter, MapEvent.REMOVE);
        mediator.fireProcedureParameterEvent(e);
    }
}
Also used : ProcedureParameter(org.apache.cayenne.map.ProcedureParameter) ProcedureParameterEvent(org.apache.cayenne.configuration.event.ProcedureParameterEvent) ProjectController(org.apache.cayenne.modeler.ProjectController)

Aggregations

ProjectController (org.apache.cayenne.modeler.ProjectController)59 DataChannelDescriptor (org.apache.cayenne.configuration.DataChannelDescriptor)12 ObjEntity (org.apache.cayenne.map.ObjEntity)10 DbEntity (org.apache.cayenne.map.DbEntity)8 DataMap (org.apache.cayenne.map.DataMap)7 DataNodeDescriptor (org.apache.cayenne.configuration.DataNodeDescriptor)6 EntityEvent (org.apache.cayenne.map.event.EntityEvent)6 DataNodeEvent (org.apache.cayenne.configuration.event.DataNodeEvent)5 ObjAttribute (org.apache.cayenne.map.ObjAttribute)5 ProcedureParameter (org.apache.cayenne.map.ProcedureParameter)5 ArrayList (java.util.ArrayList)4 DbAttribute (org.apache.cayenne.map.DbAttribute)4 DbRelationship (org.apache.cayenne.map.DbRelationship)4 Embeddable (org.apache.cayenne.map.Embeddable)4 EmbeddableAttribute (org.apache.cayenne.map.EmbeddableAttribute)4 ObjRelationship (org.apache.cayenne.map.ObjRelationship)4 RelationshipEvent (org.apache.cayenne.map.event.RelationshipEvent)4 ComponentAdapter (java.awt.event.ComponentAdapter)3 ComponentEvent (java.awt.event.ComponentEvent)3 EntityMergeSupport (org.apache.cayenne.dbsync.merge.context.EntityMergeSupport)3