!(commandParameter.getOwner() instanceof Mapping) && !(commandParameter.getOwner() instanceof MappedObjectItemProvider) && commandParameter.getFeature() == null && commandParameter.getValue() instanceof Collection) boolean inputToOutput = mappingRoot.isOutputObject(commandParameter.getOwner()); boolean okay = true; for (Object object : (Collection<?>)commandParameter.getValue()) mappedObjects.add(commandParameter.getOwner()); return CreateMappingCommand.create(this, mappedObjects); else if (commandClass == RemoveCommand.class && commandParameter.getOwner() == null) if ((mappingRoot.isInputObject(commandParameter.getOwner()) || mappingRoot.isOutputReadOnly() && mappingRoot.isOutputObject(commandParameter.getOwner())) && (commandClass == AddCommand.class || commandClass == MoveCommand.class ||
!(commandParameter.getOwner() instanceof Mapping) && !(commandParameter.getOwner() instanceof MappedObjectItemProvider) && commandParameter.getFeature() == null && commandParameter.getValue() instanceof Collection<?>) boolean inputToOutput = mappingRoot.isOutputObject(commandParameter.getOwner()); boolean okay = true; for (Object object : (Collection<?>)commandParameter.getValue()) mappedObjects.add(commandParameter.getOwner()); return CreateMappingCommand.create(this, mappedObjects); else if (commandClass == RemoveCommand.class && commandParameter.getOwner() == null) if ((mappingRoot.isInputObject(commandParameter.getOwner()) || mappingRoot.isOutputReadOnly() && mappingRoot.isOutputObject(commandParameter.getOwner())) && (commandClass == AddCommand.class || commandClass == MoveCommand.class ||
@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); }
/** * 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; } }
@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); }
encode(commandParameter.getOwner()); encode(commandParameter.getFeature()); encode(commandParameter.getCollection());
encode(commandParameter.getOwner()); encode(commandParameter.getFeature()); encode(commandParameter.getCollection());
Object owner = commandParameter.getOwner(); if (commandClass == CopyToClipboardCommand.class) (this, commandParameter.getOwner(), commandParameter.getFeature(), commandParameter.getIndex(), getOptimizeCopy()); (this, RemoveCommand.create(this, commandParameter.getOwner(), commandParameter.getFeature(), commandParameter.getCollection()));
return createDragAndDropCommand(domain, commandParameter.getOwner(), detail.location, detail.operations, detail.operation, commandParameter.getCollection());