1 package org.apache.ojb.tools.mapping.reversedb2; 2 3 /* Copyright 2002-2005 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 * This interface is intended to be implemented by objects that are part 20 * of a GUI and that whish to present a context menu. 21 * 22 * @author <a HREF="mailto:bfl@florianbruckner.com">Florian Bruckner</a> 23 * @version $Id: ActionTarget.java,v 1.1.2.1 2005/12/21 22:32:04 tomdz Exp $ 24 */ 25 public interface ActionTarget 26 { 27 /** 28 * Get a bunch of java.util.Action objects that this object wants to 29 * offer in a context-menu. 30 * @return an Iterator containing all the actions. 31 */ 32 public java.util.Iterator getActions(); 33 34 /** 35 * Some objects may alter the list of actions they present depending 36 * on the state they are in. If this method returns true, the list of 37 * actions can be cached (i.e. the resulting GUI object can be cached 38 * and doesn't have to be regenerated all the time) 39 * 40 * @return true if the result of getActions() may be cached. 41 */ 42 public boolean actionListCachable(); 43 44 /** 45 * Some objects may return a list of actions depending on the state they 46 * are in or the way they have been created. Others always return the 47 * same list of actions without any dependency on the state. If this 48 * is the case, this method should return true. Other objects may 49 * cache the list of actions and the depending GUI objects on a per-class 50 * basis instead of a per-object basis. If this method returns true, 51 * actionListCacheable has to return true as well, otherwise it would 52 * not make any sense to cache the information here. 53 */ 54 public boolean actionListStatic(); 55 } 56