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 CutCommand extends AbstractCommand { 31 32 public static final String ACTION_CUT = "cut"; 33 34 protected String getAction(CommandContext context) { 35 return ACTION_CUT; 36 } 37 38 protected String getItemStyleClass(CommandContext context, String action) { 39 return Clipboard.get(context).isCut(context) ? "cut" : null; 40 } 41 42 protected boolean isEnabled(CommandContext context, String action) { 43 return Clipboard.get(context).canCut(context); 44 } 45 46 public CommandResult execute(CommandContext context) { 47 Clipboard.get(context).cut(context); 48 return new ShowListResult(context); 49 } 50 } 51 | Popular Tags |