01: /*******************************************************************************
02: * Copyright (c) 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: ******************************************************************************/package org.eclipse.ui.internal;
11:
12: import org.eclipse.swt.custom.CTabItem;
13: import org.eclipse.swt.graphics.Image;
14: import org.eclipse.swt.widgets.Shell;
15:
16: /**
17: * @since 3.3
18: *
19: */
20: public class AnimatedTabFeedback extends ImageCycleFeedbackBase {
21:
22: private CTabItem tabItem;
23:
24: /**
25: * @param parentShell
26: */
27: public AnimatedTabFeedback(Shell parentShell) {
28: super (parentShell);
29: // TODO Auto-generated constructor stub
30: }
31:
32: public AnimatedTabFeedback(Shell parentShell, CTabItem item,
33: Image[] images) {
34: super (parentShell, images);
35: tabItem = item;
36: }
37:
38: /* (non-Javadoc)
39: * @see org.eclipse.ui.internal.AnimationFeedbackBase#initialize(org.eclipse.ui.internal.AnimationEngine)
40: */
41: public void initialize(AnimationEngine engine) {
42: // TODO Auto-generated method stub
43: background = tabItem.getParent().getBackground();
44: display = tabItem.getParent().getDisplay();
45: }
46:
47: public void saveStoppedImage() {
48: stoppedImage = tabItem.getImage();
49: }
50:
51: public void setStoppedImage(Image image) {
52: tabItem.setImage(image);
53: }
54:
55: public void showImage(Image image) {
56: if (tabItem.isDisposed())
57: return;
58: tabItem.setImage(image);
59: }
60:
61: }
|