KickJava   Java API By Example, From Geeks To Geeks.

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


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 SkipAction extends Action {
23
24     private static final String JavaDoc SKIP_CCS_TASK_GIF = "skip_ccs_task.gif"; //$NON-NLS-1$
25
private AbstractTask task;
26
27     public SkipAction(ICompositeCheatSheetTask task) {
28         this.task = (AbstractTask) task;
29         this.setText(Messages.COMPOSITE_MENU_SKIP);
30         IPath ePath = CheatSheetPlugin.ICONS_PATH.append(CheatSheetPlugin.T_ELCL).append(SKIP_CCS_TASK_GIF);
31         ImageDescriptor skipImage = CheatSheetPlugin.createImageDescriptor(CheatSheetPlugin.getPlugin().getBundle(), ePath);
32         this.setImageDescriptor(skipImage);
33     }
34     
35     public void run() {
36         task.setState(ICompositeCheatSheetTask.SKIPPED);
37     }
38
39 }
40
Popular Tags