KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > clif > scenario > util > isac > loadprofile > gui > GroupDescriptionWizard


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.loadprofile.gui;
24
25 import java.util.Vector JavaDoc;
26
27 import org.apache.log4j.Category;
28 import org.eclipse.jface.wizard.Wizard;
29 import org.eclipse.swt.widgets.Combo;
30 import org.objectweb.clif.scenario.util.isac.loadprofile.GroupDescription;
31
32 /**
33  * This class is the wizard which permit to configure a group
34  *
35  * @author JC Meillaud
36  * @author A Peyrard
37  */

38 public class GroupDescriptionWizard extends Wizard {
39     // logger
40
static Category cat = Category.getInstance(GroupDescriptionWizard.class.getName()) ;
41     // information we need to create a behavior load profile description
42
private Vector JavaDoc behaviorIds ;
43     private GroupDescription groupDescription ;
44     private GroupDescriptionPage groupPage ;
45     private Combo idsCombo ;
46     
47     /**
48      * Build a new group description wizard
49      * @param lpd The group description previously defined,
50      * @param ids and the behaviors ids
51      */

52     public GroupDescriptionWizard(GroupDescription lpd, Vector JavaDoc ids) {
53         super();
54         
55         // init infos
56
this.behaviorIds = ids ;
57         this.groupDescription = lpd ;
58     }
59
60     /**
61      * @see org.eclipse.jface.wizard.IWizard#addPages()
62      */

63     public void addPages() {
64         // init the page
65
this.groupPage = new GroupDescriptionPage("behavior", behaviorIds, this.groupDescription) ;
66         addPage(this.groupPage);
67     }
68
69     /**
70      * @see org.eclipse.jface.wizard.IWizard#performFinish()
71      */

72     public boolean performFinish() {
73         if (this.groupPage.isFinish()) {
74             this.groupDescription.setCurveColor(this.groupPage.getColor()) ;
75             this.groupDescription.setBehaviorId(this.groupPage.getBehaviorId()) ;
76             this.groupDescription.setForceStop(this.groupPage.isForceStopThread()) ;
77             return true ;
78         }
79         return false ;
80     }
81 }
82
Popular Tags