01: /*
02: * Copyright (c) 2004 JETA Software, Inc. All rights reserved.
03: *
04: * Redistribution and use in source and binary forms, with or without modification,
05: * are permitted provided that the following conditions are met:
06: *
07: * o Redistributions of source code must retain the above copyright notice,
08: * this list of conditions and the following disclaimer.
09: *
10: * o Redistributions in binary form must reproduce the above copyright notice,
11: * this list of conditions and the following disclaimer in the documentation
12: * and/or other materials provided with the distribution.
13: *
14: * o Neither the name of JETA Software nor the names of its contributors may
15: * be used to endorse or promote products derived from this software without
16: * specific prior written permission.
17: *
18: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21: * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22: * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23: * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24: * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25: * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26: * INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28: */
29:
30: package com.jeta.open.gui.framework;
31:
32: import java.awt.Component;
33: import java.util.Collection;
34:
35: /**
36: * An interface for containers ( Panels, Dialogs, InternalFrames, and Frames).
37: * JETAControllers work with JETAContainers.
38: *
39: * @author Jeff Tassin
40: */
41: public interface JETAContainer {
42: /**
43: * Enables/Disables the menu/toolbar button associated with the commandid
44: *
45: * @param commandId
46: * the id of the command whose button to enable/disable
47: * @param bEnable
48: * true/false to enable/disable
49: */
50: public void enableComponent(String commandId, boolean bEnable);
51:
52: /**
53: * Locates the first component found in this container hierarchy that has
54: * the given name. This will recursively search into child containers as
55: * well. If no component is found with the given name, null is returned.
56: *
57: * @param compName
58: * the name of the component to search for
59: * @return the named component
60: */
61: public Component getComponentByName(String compName);
62:
63: /**
64: * Locates all components found in this container hierarchy that has the
65: * given name. This will recursively search into child containers as well.
66: * This method is useful for frame windows that can have multiple components
67: * with the same name. For example, a menu item and toolbar button for the
68: * same command would have the same name.
69: *
70: * @param compName
71: * the name of the components to search for
72: * @return a collection of
73: * @see Component objects that have the given name.
74: */
75: public Collection getComponentsByName(String compName);
76:
77: /**
78: * Returns the UIDirector for this container. UIDirectors are part of this
79: * framework and are responsible for enabling/disabling components based on
80: * the program state. For example, menu items and toolbar buttons must be
81: * enabled or disabled depending on the current state of the frame window.
82: * UIDirectors handle this logic.
83: *
84: * @return the UIDirector
85: */
86: public UIDirector getUIDirector();
87: }
|