KickJava   Java API By Example, From Geeks To Geeks.

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


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 import org.objectweb.clif.scenario.util.isac.loadprofile.LoadProfileManager;
30 import org.objectweb.clif.scenario.util.isac.util.tree.Node;
31 /**
32  * Action which add a new load profile element
33  *
34  * @author JC Meillaud
35  * @author A Peyrard
36  */

37 public class AddLoadProfileElementAction extends Action {
38     /**
39      * The application window, which launch this action
40      */

41     private ScenarioGUIEditor window;
42     private String JavaDoc type ;
43     static Category cat = Category.getInstance(AddLoadProfileElementAction.class
44             .getName());
45     /**
46      * Build a new 'add load profile element' action
47      *
48      * @param w The application window, in wich we will use this action
49      * @param type The type of the node which must be added
50      */

51     public AddLoadProfileElementAction(ApplicationWindow w, String JavaDoc type) {
52         cat.debug("-> constructor");
53         this.window = (ScenarioGUIEditor) w;
54         this.type = type;
55         // set the name in function of the type to be added
56
this.setText(type) ;
57         this.setToolTipText("Add a new " + type + " element in the load profile tree viewer") ;
58     }
59
60     public void run() {
61         cat.debug("-> run");
62         // get the load manager
63
LoadProfileManager loadManager = LoadProfileManager.getInstance() ;
64         if (type.equals(Node.GROUP))
65 // loadManager.createGroupDescription() ;
66
// change the scenario saved state
67
this.window.setScenarioSavedState(false) ;
68     }
69 }
Popular Tags