001: /*
002: * Copyright 2005 jWic group (http://www.jwic.de)
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: *
016: * de.jwic.base.ControlContainer
017: * $Id: IControlContainer.java,v 1.3 2006/09/26 14:26:54 lordsam Exp $
018: */
019: package de.jwic.base;
020:
021: import java.util.Iterator;
022:
023: /**
024: * This interface defines methods required by containers.
025: * @author Florian Lippisch
026: */
027: public interface IControlContainer {
028:
029: /**
030: * Adopt a control that has already been created with a different parent. The
031: * control is removed from its current parent and added to this container.
032: * @param control
033: * @param name - new name of the control or <code>null</code> if the name should be assigned automatically
034: */
035: public void adopt(Control control, String name);
036:
037: /**
038: * Returns a Control by its name.
039: * @param name java.lang.String
040: */
041: public Control getControl(String name);
042:
043: /**
044: * Returns an Iterator for all controls in this container.
045: * @return Iterator of Control objects
046: */
047: public Iterator getControls();
048:
049: /**
050: * Returns the SessionContext.
051: * @return
052: */
053: public SessionContext getSessionContext();
054:
055: /**
056: * INTERNAL method used to registers a control with this container. This method is called automatically
057: * within the constructor of a control. Do not use this method directly, thought that subclasses
058: * may override this method to get notified if a control is registered.
059: * @param control the Control
060: */
061: public void registerControl(Control control, String name);
062:
063: /**
064: * INTERNAL method used to unregisters a control from this container. The control is removed but not
065: * destroyed. Do not use this method directly, thought that subclasses may override this method to
066: * get notified if a control is removed.
067: * @param control the Control
068: */
069: public void unregisterControl(Control control);
070:
071: /**
072: * Remove a control from the container.
073: */
074: public void removeControl(String name);
075:
076: /**
077: * Returns true if the control has been changed since the last rendering
078: * and must be rendered again to reflect the last changes.
079: * @return boolean
080: */
081: public abstract boolean isRequireRedraw();
082:
083: /**
084: * Set to true if the control needs to be rendered again to reflect the changes
085: * of the control since it was last rendered.
086: * @param requireRedraw
087: */
088: public abstract void setRequireRedraw(boolean requireRedraw);
089:
090: /**
091: * Returns true if the specified childControl is visible. This method is
092: * used by the rendering engine to determine if the specified control can
093: * be rendered. By default, it simply returns the childControls visible
094: * property. But some container implementations (like the TabStripControl)
095: * can override this method to prevent rendering of a child (i.e. a TabControl)
096: * that is visible but not 'active.
097: *
098: * @param childControl
099: * @return
100: */
101: public boolean isRenderingRelevant(Control childControl);
102:
103: }
|