/** * This file is licensed under the University of Illinois/NCSA Open Source License. See LICENSE.TXT for details. */ package edu.illinois.codingtracker.operations.starts; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.IWorkspaceDescription; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import edu.illinois.codingtracker.compare.helpers.EditorHelper; import edu.illinois.codingtracker.operations.OperationLexer; import edu.illinois.codingtracker.operations.OperationSymbols; import edu.illinois.codingtracker.operations.OperationTextChunk; import edu.illinois.codingtracker.operations.UserOperation; /** * * @author Stas Negara * */ public class StartedEclipseOperation extends UserOperation { public StartedEclipseOperation() { super(); } @Override protected char getOperationSymbol() { return OperationSymbols.ECLIPSE_STARTED_SYMBOL; } @Override public String getDescription() { return "Started Eclipse"; } @Override protected void populateTextChunk(OperationTextChunk textChunk) { //Nothing to populate here } @Override protected void initializeFrom(OperationLexer operationLexer) { //Nothing to initialize } @Override public void replay() throws CoreException { isReplayedRefactoring= false; //Close all editors (in case the previous Eclipse session ended abnormally, and thus close editor operations were not recorded). EditorHelper.closeAllEditors(); //disable auto build IWorkspace workspace= ResourcesPlugin.getWorkspace(); IWorkspaceDescription workspaceDesription= workspace.getDescription(); workspaceDesription.setAutoBuilding(false); workspace.setDescription(workspaceDesription); } @Override public boolean isTestReplayRecorded() { return false; } }