1 /******************************************************************************* 2 * Copyright (c) 2006 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 ******************************************************************************/ 11 12 package org.eclipse.ui.internal; 13 14 import org.eclipse.jface.dialogs.AnimatorFactory; 15 import org.eclipse.jface.dialogs.ControlAnimator; 16 import org.eclipse.swt.widgets.Control; 17 import org.eclipse.ui.IWorkbenchPreferenceConstants; 18 import org.eclipse.ui.PlatformUI; 19 import org.eclipse.ui.internal.util.PrefUtil; 20 21 /** 22 * Factory for workbench control animators to be used by JFace in animating 23 * the display of an SWT Control. 24 * 25 * @since 3.2 26 * 27 */ 28 public class WorkbenchAnimatorFactory extends AnimatorFactory { 29 30 /** 31 * Creates a new WorkbenchControlAnimator for use by JFace in animating 32 * the display of an SWT Control. 33 * 34 * @param control the SWT Control to de animated 35 * @return animator the WorkbenchControlAnimator 36 */ 37 public ControlAnimator createAnimator(Control control) { 38 if(PrefUtil.getAPIPreferenceStore() 39 .getBoolean(IWorkbenchPreferenceConstants.ENABLE_ANIMATIONS) 40 && PlatformUI.isWorkbenchRunning()) 41 return new WorkbenchControlAnimator(control); 42 return new ControlAnimator(control); 43 } 44 } 45