/******************************************************************************* * Copyright (c) 2012 Pivotal Software, Inc. * 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: * Pivotal Software, Inc. - initial API and implementation *******************************************************************************/ package org.springsource.ide.eclipse.commons.core; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; /** * @author Steffen Pingel * @author Leo Dos Santos * @author Christian Dupuis */ public class Policy { public static boolean TEST_MODE; static { String application = System.getProperty("eclipse.application", ""); //$NON-NLS-1$ //$NON-NLS-2$ if (application.length() > 0) { TEST_MODE = application.endsWith("testapplication") || application.endsWith("uitest"); //$NON-NLS-1$ //$NON-NLS-2$ } } public static void checkCancelled(IProgressMonitor monitor) { if (monitor != null && monitor.isCanceled()) { throw new OperationCanceledException(); } } }