@SuppressWarnings("unchecked") public final CommandResult execute(CommandContext context, Selection selection) { BatchResult result = new BatchResult(); int i = 0; for (SelectionItem item : selection) { result.add(execute(context, (T) item.getObject(), i++, selection.size())); } return result; }
@Override protected CommandResult execute(CommandContext context, SelectionItem parent) { return new BatchResult( new RefreshListResult(), new NotificationResult(context, this) .setDefaultMessage("The list has been refreshed.")); }
public BatchResult(CommandResult... results) { for (CommandResult result : results) { add(result); } }
public CommandResult execute(CommandContext context, Selection selection) { sessionFactory.getStatistics().clear(); return new BatchResult( new RefreshListResult(), new NotificationResult(context, this) .setDefaultMessage("The baseline has been cleared.")); } }
@Override public CommandResult execute(CommandContext context, SelectionItem parent) { NotificationResult notification = new NotificationResult(context, this) .setDefaultMessage("{0,choice,1#One item has|1<{0} items have} been pasted."); Clipboard.get(context).paste(context, parent, notification); return new BatchResult( notification, new RefreshListResult(parent.getObjectId()).refreshAll()); }
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")); }
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")); }
@Override protected CommandResult handleYes(CommandContext context, Selection selection, Object input) { Object[] args = getArgs(context, selection); for (SelectionItem item : selection) { context.getScreen().getDao().delete(item.getObject(), context.getParent()); } return new BatchResult( new RefreshListResult(), new NotificationResult(context, this) .setDefaultMessage("{0,choice,1#Item \"{1}\"|1<{0} items} successfully deleted.") .setArgs(args)); }