use of org.apache.cayenne.configuration.DataChannelDescriptor in project cayenne by apache.
the class CreateAttributeAction method fireObjAttributeEvent.
/**
* Fires events when an obj attribute was added
*/
static void fireObjAttributeEvent(Object src, ProjectController mediator, DataMap map, ObjEntity objEntity, ObjAttribute attr) {
mediator.fireObjAttributeEvent(new AttributeEvent(src, attr, objEntity, MapEvent.ADD));
DataChannelDescriptor domain = (DataChannelDescriptor) mediator.getProject().getRootNode();
AttributeDisplayEvent ade = new AttributeDisplayEvent(src, attr, objEntity, map, domain);
mediator.fireObjAttributeDisplayEvent(ade);
}
use of org.apache.cayenne.configuration.DataChannelDescriptor in project cayenne by apache.
the class CreateDataMapAction method performAction.
public void performAction(ActionEvent e) {
ProjectController mediator = getProjectController();
DataChannelDescriptor dataChannelDescriptor = (DataChannelDescriptor) mediator.getProject().getRootNode();
DataMap map = new DataMap();
map.setName(NameBuilder.builder(map, dataChannelDescriptor).name());
createDataMap(map);
application.getUndoManager().addEdit(new CreateDataMapUndoableEdit(dataChannelDescriptor, map));
}
use of org.apache.cayenne.configuration.DataChannelDescriptor in project cayenne by apache.
the class CreateNodeAction method createDataNode.
public void createDataNode(DataNodeDescriptor node) {
DataChannelDescriptor domain = (DataChannelDescriptor) getProjectController().getProject().getRootNode();
domain.getNodeDescriptors().add(node);
getProjectController().fireDataNodeEvent(new DataNodeEvent(this, node, MapEvent.ADD));
getProjectController().fireDataNodeDisplayEvent(new DataNodeDisplayEvent(this, domain, node));
}
use of org.apache.cayenne.configuration.DataChannelDescriptor in project cayenne by apache.
the class CreateProcedureParameterAction method performAction.
/**
* Creates ProcedureParameter depending on context.
*/
@Override
public void performAction(ActionEvent e) {
ProjectController mediator = getProjectController();
if (getProjectController().getCurrentProcedure() != null) {
Procedure procedure = getProjectController().getCurrentProcedure();
ProcedureParameter parameter = new ProcedureParameter();
parameter.setName(NameBuilder.builder(parameter, procedure).name());
createProcedureParameter(procedure, parameter);
application.getUndoManager().addEdit(new CreateProcedureParameterUndoableEdit((DataChannelDescriptor) mediator.getProject().getRootNode(), mediator.getCurrentDataMap(), procedure, parameter));
}
}
use of org.apache.cayenne.configuration.DataChannelDescriptor in project cayenne by apache.
the class DataMapDisplayEventType method fireLastDisplayEvent.
@Override
public void fireLastDisplayEvent() {
DataChannelDescriptor dataChannel = (DataChannelDescriptor) controller.getProject().getRootNode();
if (!dataChannel.getName().equals(preferences.getDomain())) {
return;
}
DataNodeDescriptor dataNode = dataChannel.getNodeDescriptor(preferences.getNode());
DataMap dataMap = dataChannel.getDataMap(preferences.getDataMap());
if (dataMap == null) {
return;
}
DataMapDisplayEvent dataMapDisplayEvent = new DataMapDisplayEvent(this, dataMap, dataChannel, dataNode);
controller.fireDataMapDisplayEvent(dataMapDisplayEvent);
}
Aggregations