public J2EECopyToClipboardOverrideCommand(CopyToClipboardCommand cmd) { super(cmd.getDomain(), cmd.getSourceObjects()); }
/** * This creates a command that copies the given object to the clipboard. */ public static Command create(EditingDomain domain, Object owner) { return create(domain, Collections.singleton(owner)); }
protected Command createCopyToClipboardOverrideCommand(CopyToClipboardCommand copyToClipboardCommand) { if (!(copyToClipboardCommand instanceof CopyToClipboardOverrideCommand)) { Collection<Object> inputObjects = new ArrayList<Object>(); Collection<Object> nonInputObjects = new ArrayList<Object>(); for (Object object : copyToClipboardCommand.getSourceObjects()) { if (mappingRoot.isInputObject(object)) { inputObjects.add(object); } else { nonInputObjects.add(object); } } if (inputObjects.size() > 0) { return new CopyToClipboardOverrideCommand(this, nonInputObjects, inputObjects); } } return null; }
/** * This creates a command that copies the given collection of objects to the clipboard. */ public static Command create(EditingDomain domain, final Collection<?> collection) { if (domain == null) { CopyToClipboardCommand command = new CopyToClipboardCommand(domain, collection); return command; } else { Command command = domain.createCommand(CopyToClipboardCommand.class, new CommandParameter(null, null, collection)); return command; } }
protected boolean prepare() { prepareSourceObjects(); if (!onlyRefObjects) { copyCommand = UnexecutableCommand.INSTANCE; return copyCommand.canExecute(); } if (!extendedSourceObjects.hasBindings() && !extendedSourceObjects.hasExtensions()) return super.prepare(); copyCommand = createCopyCommand(); return copyCommand.canExecute(); }
protected Command createCopyToClipboardOverrideCommand(CopyToClipboardCommand copyToClipboardCommand) { if (!(copyToClipboardCommand instanceof CopyToClipboardOverrideCommand)) { Collection<Object> inputObjects = new ArrayList<Object>(); Collection<Object> nonInputObjects = new ArrayList<Object>(); for (Object object : copyToClipboardCommand.getSourceObjects()) { if (mappingRoot.isInputObject(object)) { inputObjects.add(object); } else { nonInputObjects.add(object); } } if (inputObjects.size() > 0) { return new CopyToClipboardOverrideCommand(this, nonInputObjects, inputObjects); } } return null; }
if (commandClass == CopyToClipboardCommand.class) return new CopyToClipboardCommand(this, commandParameter.getCollection());