| /******************************************************************************* |
| * Copyright (c) 2008-2010, Istvan Rath and Daniel Varro |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Istvan Rath - initial API and implementation |
| *******************************************************************************/ |
| |
| package org.eclipse.viatra2.frameworkgui.views.console.commands.builtin; |
| |
| import java.util.List; |
| |
| import org.eclipse.viatra2.framework.IFramework; |
| import org.eclipse.viatra2.frameworkgui.views.console.commands.CommandExecutor; |
| import org.eclipse.viatra2.frameworkgui.views.console.commands.IVIATRAConsoleCommandProvider; |
| |
| public class PrintCommandHistory implements IVIATRAConsoleCommandProvider { |
| |
| public void executeCommand(IFramework fw, List<String> parameters) { |
| List<String> history = CommandExecutor.getCommandHistory(fw); |
| if(history == null) { |
| fw.getLogger().info("VIATRA2 Console command history is empty."); |
| return; |
| } |
| fw.getLogger().info("Printing VIATRA2 Console command history:"); |
| for (String rawCmd:history) { |
| fw.getLogger().info("\t"+rawCmd); |
| } |
| } |
| |
| public String getCommandSignature() { |
| return "printcommandhistory()"; |
| } |
| |
| public String getDescription() { |
| return "Prints the historical record of VIATRA2 Console commands"; |
| } |
| |
| public String getHelpText() { |
| return "This command shows you the history of commands executed in the VIATRA2 Console."; |
| } |
| |
| } |