KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jmeter > config > gui > AbstractConfigGui


1 // $Header: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/config/gui/AbstractConfigGui.java,v 1.4 2004/02/13 02:21:37 sebb Exp $
2
/*
3  * Copyright 2001-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17 */

18
19 package org.apache.jmeter.config.gui;
20 import java.util.Arrays JavaDoc;
21 import java.util.Collection JavaDoc;
22
23 import javax.swing.JPopupMenu JavaDoc;
24
25 import org.apache.jmeter.gui.AbstractJMeterGuiComponent;
26 import org.apache.jmeter.gui.util.MenuFactory;
27
28 /**
29  * This is the base class for JMeter GUI components which provide configuration
30  * for some other component.
31  *
32  * @author Michael Stover
33  * @version $Revision: 1.4 $
34  */

35 public abstract class AbstractConfigGui extends AbstractJMeterGuiComponent
36 {
37     /**
38      * When a user right-clicks on the component in the test tree, or
39      * selects the edit menu when the component is selected, the
40      * component will be asked to return a JPopupMenu that provides
41      * all the options available to the user from this component.
42      * <p>
43      * This implementation returns menu items appropriate for most
44      * configuration components.
45      *
46      * @return a JPopupMenu appropriate for the component.
47      */

48     public JPopupMenu JavaDoc createPopupMenu()
49     {
50         return MenuFactory.getDefaultConfigElementMenu();
51     }
52
53     /**
54      * This is the list of menu categories this gui component will be available
55      * under. This implementation returns
56      * {@link org.apache.jmeter.gui.util.MenuFactory#CONFIG_ELEMENTS}, which
57      * is appropriate for most configuration components.
58      *
59      * @return a Collection of Strings, where each element is one of the
60      * constants defined in MenuFactory
61      */

62     public Collection JavaDoc getMenuCategories()
63     {
64         return Arrays.asList(new String JavaDoc[]{MenuFactory.CONFIG_ELEMENTS});
65     }
66 }
67
Popular Tags