KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > AnimatedTabFeedback


1 /*******************************************************************************
2  * Copyright (c) 2007 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.swt.custom.CTabItem;
15 import org.eclipse.swt.graphics.Image;
16 import org.eclipse.swt.widgets.Shell;
17
18 /**
19  * @since 3.3
20  *
21  */

22 public class AnimatedTabFeedback extends ImageCycleFeedbackBase {
23
24     private CTabItem tabItem;
25
26     /**
27      * @param parentShell
28      */

29     public AnimatedTabFeedback(Shell parentShell) {
30         super(parentShell);
31         // TODO Auto-generated constructor stub
32
}
33
34     public AnimatedTabFeedback(Shell parentShell, CTabItem item,
35             Image[] images) {
36         super(parentShell, images);
37         tabItem = item;
38     }
39
40     /* (non-Javadoc)
41      * @see org.eclipse.ui.internal.AnimationFeedbackBase#initialize(org.eclipse.ui.internal.AnimationEngine)
42      */

43     public void initialize(AnimationEngine engine) {
44         // TODO Auto-generated method stub
45
background = tabItem.getParent().getBackground();
46         display = tabItem.getParent().getDisplay();
47     }
48
49     public void saveStoppedImage() {
50         stoppedImage = tabItem.getImage();
51     }
52
53     public void setStoppedImage(Image image) {
54         tabItem.setImage(image);
55     }
56
57     public void showImage(Image image) {
58         if (tabItem.isDisposed())
59             return;
60         tabItem.setImage(image);
61     }
62
63 }
64
Popular Tags