@Override protected boolean prepare() { copyCommand = CopyCommand.create(domain, sourceObjects); return copyCommand.canExecute(); }
@Override protected boolean prepare() { // Since input objects are read-only, we don't need to make a copy of them for the clipboard. // We can just put a pointer to the original object(s) on the clipboard. // copyCommand = new IdentityCommand(inputObjects); // Do we also have some non-input objects to copy? // if (sourceObjects.size() > 0) { copyCommand = copyCommand.chain(CopyCommand.create(domain, sourceObjects)); } return copyCommand.canExecute(); }
@Override protected boolean prepare() { // Since input objects are read-only, we don't need to make a copy of them for the clipboard. // We can just put a pointer to the original object(s) on the clipboard. // copyCommand = new IdentityCommand(inputObjects); // Do we also have some non-input objects to copy? // if (sourceObjects.size() > 0) { copyCommand = copyCommand.chain(CopyCommand.create(domain, sourceObjects)); } return copyCommand.canExecute(); }
@Override public void setPropertyValue(Object thisObject, final Object value) { final MappingDomain domain = mapping.getMappingRoot().getDomain(); final Object feature = itemPropertyDescriptor.getFeature(value); CompoundCommand compound = new StrictCompoundCommand(); final Command copyCommand = CopyCommand.create(domain, typeMappingHelper); compound.append(copyCommand); compound.append (new CommandWrapper() { @Override protected Command createCommand() { return SetCommand.create(domain, copyCommand.getResult().iterator().next(), feature, value); } }); compound.append (new CommandWrapper() { @Override protected Command createCommand() { return SetCommand.create(domain, mapping, MappingPackage.eINSTANCE.getMapping_Helper(), copyCommand.getResult().iterator().next()); } }); domain.getCommandStack().execute(compound); }
final Command copyCommand = CopyCommand.create(domain, domain.getClipboard()); command.append(copyCommand);
@Override public void setPropertyValue(Object thisObject, final Object value) { final MappingDomain domain = mapping.getMappingRoot().getDomain(); final Object feature = itemPropertyDescriptor.getFeature(value); CompoundCommand compound = new StrictCompoundCommand(); final Command copyCommand = CopyCommand.create(domain, typeMappingHelper); compound.append(copyCommand); compound.append (new CommandWrapper() { @Override protected Command createCommand() { return SetCommand.create(domain, copyCommand.getResult().iterator().next(), feature, value); } }); compound.append (new CommandWrapper() { @Override protected Command createCommand() { return SetCommand.create(domain, mapping, MappingPackage.eINSTANCE.getMapping_Helper(), copyCommand.getResult().iterator().next()); } }); domain.getCommandStack().execute(compound); }
dragCommand = CopyCommand.create(domain, collection);
dragCommand = CopyCommand.create(domain, collection);