use of org.whole.lang.ui.commands.ReplaceChildCommand in project whole by wholeplatform.
the class WholeLayoutEditPolicy method getCreateCommand.
protected Command getCreateCommand(CreateRequest request) {
// TODO incapsulate in command factory
Object newObject = request.getNewObject();
if (newObject instanceof IEntity) {
IEntityPart hostPart = (IEntityPart) getHost();
// TODO
// return commandFactory.create(new
// DnDOverPartRequest(PartRequest.MOVE_ADD_CHILD,
// hostPart, ((GroupRequest)request).getEditParts()));
ReplaceChildCommand cmd = new ReplaceChildCommand();
cmd.setParent(hostPart.getParentModelEntity());
cmd.setOldChild(hostPart.getModelEntity());
cmd.setNewChild((IEntity) newObject);
return cmd;
}
return null;
}
Aggregations