Object value = commandParameter.getValue();
Object oldValue = commandParameter.getValue(); Object newValue = unwrap(oldValue);
encode(commandParameter.getFeature()); encode(commandParameter.getCollection()); encode(commandParameter.getValue()); encode(commandParameter.getIndex()); buffer.append("</command-parameter>");
/** * Implements creation of a set, copy, or drag-and-drop command by calling out to {@link #createSetCommand * createSetCommand}, {@link #createCopyCommand createCopyCommand}, or {@link #createDragAndDropCommand * createDragAndDropCommand}. */ public Command baseCreateCommand(Object object, EditingDomain domain, Class<? extends Command> commandClass, CommandParameter commandParameter) { if (commandClass == SetCommand.class) { return createSetCommand (domain, commandParameter.getOwner(), commandParameter.getFeature(), commandParameter.getValue(), commandParameter.getIndex()); } else if (commandClass == CopyCommand.class) { return createCopyCommand(domain, commandParameter.getOwner(), (CopyCommand.Helper)commandParameter.getValue()); } else if (commandClass == DragAndDropCommand.class) { DragAndDropCommand.Detail detail = (DragAndDropCommand.Detail)commandParameter.getFeature(); return createDragAndDropCommand (domain, commandParameter.getOwner(), detail.location, detail.operations, detail.operation, commandParameter.getCollection()); } else { return UnexecutableCommand.INSTANCE; } }
encode(commandParameter.getFeature()); encode(commandParameter.getCollection()); encode(commandParameter.getValue()); encode(commandParameter.getIndex()); buffer.append("</command-parameter>");
!(commandParameter.getOwner() instanceof MappedObjectItemProvider) && commandParameter.getFeature() == null && commandParameter.getValue() instanceof Collection) for (Object object : (Collection<?>)commandParameter.getValue()) Collection<Object> mappedObjects = new ArrayList<Object>((Collection<?>)commandParameter.getValue()); mappedObjects.add(commandParameter.getOwner()); return CreateMappingCommand.create(this, mappedObjects);
!(commandParameter.getOwner() instanceof MappedObjectItemProvider) && commandParameter.getFeature() == null && commandParameter.getValue() instanceof Collection<?>) for (Object object : (Collection<?>)commandParameter.getValue()) Collection<Object> mappedObjects = new ArrayList<Object>((Collection<?>)commandParameter.getValue()); mappedObjects.add(commandParameter.getOwner()); return CreateMappingCommand.create(this, mappedObjects);
final Object value = commandParameter.getValue(); int index = commandParameter.getIndex();
@Override public Command createCommand(Object object, EditingDomain editingDomain, Class<? extends Command> commandClass, CommandParameter commandParameter) { if (editingDomain instanceof MappingDomain) { MappingDomain mappingDomain = (MappingDomain)editingDomain; if (commandClass == NameMatchMappingCommand.class) { return createNameMatchMappingCommand(mappingDomain, (Mapping)commandParameter.getOwner()); } else if (commandClass == TypeMatchMappingCommand.class) { return createTypeMatchMappingCommand(mappingDomain, (Mapping)commandParameter.getOwner()); } } // This ensures that we are dealing with actual MOF objects. // commandParameter.collection = (Collection<?>)substituteMappedObject((Mapping)object, commandParameter.getCollection()); commandParameter.value = substituteMappedObject((Mapping)object, commandParameter.getValue()); return super.createCommand(object, editingDomain, commandClass, commandParameter); }
@Override public Command createCommand(Object object, EditingDomain editingDomain, Class<? extends Command> commandClass, CommandParameter commandParameter) { if (editingDomain instanceof MappingDomain) { MappingDomain mappingDomain = (MappingDomain)editingDomain; if (commandClass == NameMatchMappingCommand.class) { return createNameMatchMappingCommand(mappingDomain, (Mapping)commandParameter.getOwner()); } else if (commandClass == TypeMatchMappingCommand.class) { return createTypeMatchMappingCommand(mappingDomain, (Mapping)commandParameter.getOwner()); } } // This ensures that we are dealing with actual MOF objects. // commandParameter.collection = (Collection<?>)substituteMappedObject((Mapping)object, commandParameter.getCollection()); commandParameter.value = substituteMappedObject((Mapping)object, commandParameter.getValue()); return super.createCommand(object, editingDomain, commandClass, commandParameter); }
commandParameter.getEStructuralFeature() != null ? commandParameter.getEStructuralFeature() : getSetFeature(commandParameter.getEOwner(), commandParameter.getValue()), commandParameter.getValue(), commandParameter.getIndex()); result = createCopyCommand(domain, commandParameter.getEOwner(), (CopyCommand.Helper)commandParameter.getValue()); result = createCreateCopyCommand(domain, commandParameter.getEOwner(), (CopyCommand.Helper)commandParameter.getValue()); result = createInitializeCopyCommand(domain, commandParameter.getEOwner(), (CopyCommand.Helper)commandParameter.getValue()); commandParameter.getEOwner(), commandParameter.getEStructuralFeature(), commandParameter.getValue(), commandParameter.getIndex()); (domain, commandParameter.getEOwner(), commandParameter.getEStructuralFeature(), commandParameter.getValue(), commandParameter.getCollection()); CommandParameter newChildParameter = (CommandParameter)commandParameter.getValue(); result = createCreateChildCommand commandParameter.getEOwner(), newChildParameter.getEStructuralFeature(), newChildParameter.getValue(), newChildParameter.getIndex(), commandParameter.getCollection());
Object obj = commandParameter.getValue(); Object parent = (obj == null) ? null : getParent(obj); if (parent == null) parent = obj; return createCommand(CreateChildCommand.class, new CommandParameter(parent, commandParameter.getFeature(), commandParameter.getValue(), commandParameter.getCollection(), commandParameter.getIndex())); return createCommand(DragAndDropCommand.class, new CommandParameter(resourceSet, commandParameter.getFeature(), commandParameter.getValue(), commandParameter.getCollection(), commandParameter.getIndex()));
Object child = parameter.getValue(); if (childFeature != null && child != null)
result = SetCommand.create(domain, commandOwner, feature, commandParameter.getValue(), commandParameter.getIndex());