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 CopyCommand extends AbstractCommand { 31 32 protected String getItemStyleClass(CommandContext context, String action) { 33 return Clipboard.get(context).isCopied(context) ? "copied" : null; 34 } 35 36 protected boolean isEnabled(CommandContext context, String action) { 37 return Clipboard.get(context).canCopy(context); 38 } 39 40 public CommandResult execute(CommandContext context) { 41 Clipboard.get(context).copy(context); 42 return new ShowListResult(context); 43 } 44 45 } 46 | Popular Tags |