KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > cheatsheets > composite > explorer > StartAction


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.cheatsheets.composite.explorer;
13
14 import org.eclipse.core.runtime.IPath;
15 import org.eclipse.jface.action.Action;
16 import org.eclipse.jface.resource.ImageDescriptor;
17 import org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin;
18 import org.eclipse.ui.internal.cheatsheets.Messages;
19 import org.eclipse.ui.internal.cheatsheets.composite.model.AbstractTask;
20 import org.eclipse.ui.internal.provisional.cheatsheets.ICompositeCheatSheetTask;
21
22 public class StartAction extends Action {
23     private AbstractTask task;
24     private static final String JavaDoc START_CCS_TASK_GIF = "start_ccs_task.gif"; //$NON-NLS-1$
25

26     public StartAction(ICompositeCheatSheetTask task) {
27         this.task = (AbstractTask) task;
28         this.setText(Messages.COMPOSITE_MENU_START);
29         IPath path = CheatSheetPlugin.ICONS_PATH.append(CheatSheetPlugin.T_ELCL).append(START_CCS_TASK_GIF);
30         ImageDescriptor startImage = CheatSheetPlugin.createImageDescriptor(CheatSheetPlugin.getPlugin().getBundle(), path);
31         this.setImageDescriptor(startImage);
32     }
33     
34     public void run() {
35         task.setState(ICompositeCheatSheetTask.IN_PROGRESS);
36     }
37
38 }
39
Popular Tags