1 // $Header: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/control/gui/AbstractControllerGui.java,v 1.5 2004/03/05 01:34:05 sebb Exp $ 2 /* 3 * Copyright 2000-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.control.gui; 20 import java.util.Arrays; 21 import java.util.Collection; 22 23 import javax.swing.JPopupMenu; 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 manage controllers. 30 * 31 * @version $Revision: 1.5 $ on $Date: 2004/03/05 01:34:05 $ 32 */ 33 public abstract class AbstractControllerGui extends AbstractJMeterGuiComponent 34 { 35 /** 36 * When a user right-clicks on the component in the test tree, or 37 * selects the edit menu when the component is selected, the 38 * component will be asked to return a JPopupMenu that provides 39 * all the options available to the user from this component. 40 * <p> 41 * This implementation returns menu items appropriate for most 42 * controller components. 43 * 44 * @return a JPopupMenu appropriate for the component. 45 */ 46 public JPopupMenu createPopupMenu() 47 { 48 return MenuFactory.getDefaultControllerMenu(); 49 } 50 51 /** 52 * This is the list of menu categories this gui component will be available 53 * under. This implementation returns 54 * {@link org.apache.jmeter.gui.util.MenuFactory#CONTROLLERS}, which 55 * is appropriate for most controller components. 56 * 57 * @return a Collection of Strings, where each element is one of the 58 * constants defined in MenuFactory 59 */ 60 public Collection getMenuCategories() 61 { 62 return Arrays.asList(new String[] { MenuFactory.CONTROLLERS }); 63 } 64 } 65