コード例 #1
0
ファイル: CopyCommand.java プロジェクト: cwoelk/riot
 public CommandResult execute(CommandContext context, Selection selection) {
   Clipboard.get(context).set(context.getScreen(), selection, this);
   return new BatchResult(
       new UpdateCommandsResult(),
       new NotificationResult(context, this)
           .setArgs(selection.size())
           .setDefaultMessage("{0,choice,1#Item|1<{0} items} put into the clipboard"));
 }
コード例 #2
0
ファイル: CopyCommand.java プロジェクト: cwoelk/riot
 @Override
 public boolean isEnabled(CommandContext context, Selection selection) {
   if (selection.isEmpty()) {
     return false;
   }
   CopyAndPaste dao = getDao(context.getScreen());
   for (SelectionItem item : selection) {
     if (!dao.canCopy(item.getObject())) {
       return false;
     }
   }
   return true;
 }