KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > clif > scenario > util > isac > util > tree > nodes > NonePluginNode


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.util.tree.nodes;
24
25 import java.util.Vector JavaDoc;
26
27 import org.objectweb.clif.scenario.util.isac.plugin.gui.ParametersWidgetsNode;
28 import org.objectweb.clif.scenario.util.isac.util.tree.Node;
29 import org.objectweb.clif.scenario.util.isac.util.tree.NodeDescription;
30
31 /**
32  * This class implements some statics methods which will be used with none plugins nodes
33  * @author JC Meillaud
34  * @author A Peyrard
35  */

36 public class NonePluginNode {
37
38     /**
39      * Help getter
40      * @param type The type of the node
41      * @return The help of the node given
42      */

43     public static Vector JavaDoc getHelp(String JavaDoc type) {
44         if (Node.NCHOICE.equals(type)) {
45             return NChoiceNode.getHelp() ;
46         }
47         if (Node.CHOICE.equals(type)) {
48             return ChoiceNode.getHelp() ;
49         }
50         // default
51
return null ;
52     }
53     
54     /**
55      * Create a new node description of the given type
56      * @param type The type
57      * @return The node description
58      */

59     public static NodeDescription createNodeDescription(String JavaDoc type) {
60         if (Node.CHOICE.equals(type)) {
61             return ChoiceNode.createNodeDescription() ;
62         }
63         if (Node.BEHAVIOR.equals(type)) {
64             return BehaviorNode.createNodeDescription() ;
65         }
66         if (Node.BEHAVIORS.equals(type)) {
67             return BehaviorsNode.createNodeDescription() ;
68         }
69         // default
70
return new NodeDescription(type) ;
71     }
72     
73     /**
74      * Create the parameters widgets tree of a none plugin node
75      * @param type The type of the node
76      * @return the tree created
77      */

78     public static ParametersWidgetsNode createParametersWidgetsNode(String JavaDoc type) {
79         if (Node.BEHAVIOR.equals(type))
80             return BehaviorNode.createParametersWidgetsNode() ;
81         if (Node.CHOICE.equals(type))
82             return ChoiceNode.createParametersWidgetsNode() ;
83         // default
84
return null ;
85     }
86     
87 }
88
Popular Tags