1 24 package org.riotfamily.riot.list.command.core; 25 26 import org.riotfamily.riot.list.command.CommandContext; 27 import org.riotfamily.riot.list.command.CommandResult; 28 import org.riotfamily.riot.list.command.result.ShowListResult; 29 30 public class PasteCommand extends AbstractCommand { 31 32 public static final String ACTION_PASTE = "paste"; 33 34 protected String getAction(CommandContext context) { 35 return ACTION_PASTE; 36 } 37 38 protected boolean isEnabled(CommandContext context, String action) { 39 Clipboard cb = Clipboard.get(context); 40 return cb.canPaste(context); 41 } 42 43 public CommandResult execute(CommandContext context) { 44 Clipboard cb = Clipboard.get(context); 45 cb.paste(context); 46 return new ShowListResult(context); 47 } 48 49 } 50 | Popular Tags |