KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > clif > scenario > util > isac > gui > action > UnSelectAction


1 /*
2  * CLIF is a Load Injection Framework
3  * Copyright (C) 2004 France Telecom R&D
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * CLIF
20  *
21  * Contact: clif@objectweb.org
22  */

23 package org.objectweb.clif.scenario.util.isac.gui.action;
24
25 import org.apache.log4j.Category;
26 import org.eclipse.jface.action.Action;
27 import org.eclipse.jface.window.ApplicationWindow;
28 import org.objectweb.clif.scenario.util.isac.gui.ScenarioGUIEditor;
29 /**
30  * Action which unselect the selected node
31  *
32  * @author JC Meillaud
33  * @author A Peyrard
34  */

35 public class UnSelectAction extends Action {
36     /**
37      * The application window, which launch this action
38      */

39     ScenarioGUIEditor window;
40     static Category cat = Category.getInstance(UnSelectAction.class.getName());
41
42     /**
43      * Build a new 'unselect' action
44      *
45      * @param w
46      * The application window which launch the action
47      */

48     public UnSelectAction(ApplicationWindow w) {
49         cat.debug("-> constructor");
50         this.window = (ScenarioGUIEditor) w;
51         this.setText("UnSelect node@Ctrl+Z");
52         this.setToolTipText("Unselect the node which is selected");
53         // try {
54
// this.setImageDescriptor(ImageDescriptor.createFromURL(
55
// new URL("file:" + FileName.ABOUT_ICON)));
56
// } catch (Exception e) {
57
// cat.warn("Unable to find about icon file");
58
// }
59
}
60
61     public void run() {
62         cat.debug("-> run");
63         ((ScenarioGUIEditor) this.window).getTreeViewer().setSelection(null);
64     }
65 }
Popular Tags