javax.rad.genui
Class UIContainer<C extends IContainer>

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UIComponent<C>
          extended by javax.rad.genui.UIContainer<C>
Type Parameters:
C - instance of IContainer
All Implemented Interfaces:
ITranslatable, IComponent, IContainer, IResource, INamedObject
Direct Known Subclasses:
AbstractWindow, UICustomContainer, UIDesktopPanel, UIGroupPanel, UIMenuBar, UIPanel, UIPopupMenu, UIScrollPanel, UISplitPanel, UITabsetPanel, UIToolBar, UIToolBarPanel

public abstract class UIContainer<C extends IContainer>
extends UIComponent<C>
implements IContainer

Platform and technology independent Container. It is designed for use with AWT, Swing, SWT, JSP, JSF,... .


Field Summary
protected  List<IComponent> components
          List of subcomponents.
 
Fields inherited from class javax.rad.genui.UIComponent
lLastTranslationModified, parent
 
Fields inherited from class javax.rad.genui.UIResource
uiResource
 
Constructor Summary
protected UIContainer(C pContainer)
          Creates a new instance of UIContainer.
 
Method Summary
 void add(IComponent pComponent)
          Adds the specified IComponent to the end of this container.
 void add(IComponent pComponent, int pIndex)
          Adds the specified IComponent to this container at the specified index.
 void add(IComponent pComponent, Object pConstraints)
          Adds the specified IComponent to the end of this container.
 void add(IComponent pComponent, Object pConstraints, int pIndex)
          Adds the specified IComponent to this container with the specified constraints at the specified index.
 void addNotify()
          Makes this UIComponent displayable by adding it to an UIContainer.
 void beforeAddNotify(IComponent pParent)
          Invoked before this component is added.
protected  void checkAdd(IComponent pComponent, Object pConstraints, int pIndex)
          Checks if it's allowed to add a specific component to this container.
 IComponent getComponent(int pIndex)
          Gets the nth IComponent in this container.
 int getComponentCount()
          Gets the number of IComponents in this panel.
 ILayout getLayout()
          Gets the layout manager for this container.
 int indexOf(IComponent pComponent)
          Gets the nth position of an IComponent in this container.
 void remove(IComponent pComponent)
          Removes the specified component from this container.
 void remove(int pIndex)
          Removes the IComponent, specified by index, from this container.
 void removeAll()
          Removes all the components from this container.
 void removeNotify()
          Makes this UIComponent undisplayable by removing it to an UIContainer.
 void setLayout(ILayout pLayout)
          Sets the layout manager for this container.
 void setZOrder(IComponent pComponent, int pZOrder)
          Sets the order of the given component.
 void updateTranslation()
          Notification for updating the translation.
 
Methods inherited from class javax.rad.genui.UIComponent
capture, createCellFormatter, createNodeFormatter, debug, error, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getComponentUIResource, getCurrentTranslation, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getResource, getSize, getToolTipText, getTranslation, info, invokeAndWait, invokeAndWait, invokeInThread, invokeInThread, invokeLater, invokeLater, isBackgroundSet, isBeforeNotified, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isNotified, isPreferredSizeSet, isTranslationChanged, isTranslationEnabled, isVisible, requestFocus, setBackground, setBounds, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocation, setLocationRelativeTo, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setParent, setPreferredSize, setPreferredSize, setSize, setSize, setToolTipText, setTranslation, setTranslationEnabled, setVisible, translate
 
Methods inherited from class javax.rad.genui.UIResource
equals, getUIResource, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Field Detail

components

protected List<IComponent> components
List of subcomponents.

Constructor Detail

UIContainer

protected UIContainer(C pContainer)
Creates a new instance of UIContainer.

Parameters:
pContainer - the Container.
See Also:
IContainer
Method Detail

getLayout

public ILayout getLayout()
Gets the layout manager for this container.

Specified by:
getLayout in interface IContainer
Returns:
the ILayout
See Also:
ILayout, IContainer.setLayout(javax.rad.ui.ILayout)

setLayout

public void setLayout(ILayout pLayout)
Sets the layout manager for this container.

Specified by:
setLayout in interface IContainer
Parameters:
pLayout - the specified layout manager
See Also:
ILayout, IContainer.getLayout()

add

public void add(IComponent pComponent)
Adds the specified IComponent to the end of this container.

Specified by:
add in interface IContainer
Parameters:
pComponent - the IComponent to be added
See Also:
IComponent

add

public void add(IComponent pComponent,
                Object pConstraints)
Adds the specified IComponent to the end of this container. Also notifies the layout manager to add the component to this container's layout using the specified constraints object.

Specified by:
add in interface IContainer
Parameters:
pComponent - the IComponent to be added
pConstraints - an object expressing layout contraints for this component
See Also:
IComponent

add

public void add(IComponent pComponent,
                int pIndex)
Adds the specified IComponent to this container at the specified index. Also notifies the layout manager to add the component to the this container's layout.

Specified by:
add in interface IContainer
Parameters:
pComponent - the IComponent to be added
pIndex - the position in the container's list at which to insert the IComponent; -1 means insert at the end component
See Also:
IComponent

add

public void add(IComponent pComponent,
                Object pConstraints,
                int pIndex)
Adds the specified IComponent to this container with the specified constraints at the specified index. Also notifies the layout manager to add the component to the this container's layout using the specified constraints object.

Specified by:
add in interface IContainer
Parameters:
pComponent - the IComponent to be added
pConstraints - an object expressing layout contraints for this
pIndex - the position in the container's list at which to insert the IComponent; -1 means insert at the end component
See Also:
IComponent

remove

public void remove(int pIndex)
Removes the IComponent, specified by index, from this container. This method also notifies the layout manager to remove the component from this container's layout via the removeLayoutComponent method.

Specified by:
remove in interface IContainer
Parameters:
pIndex - the index of the IComponent to be removed
See Also:
IContainer.add(javax.rad.ui.IComponent), IContainer.getComponentCount()

remove

public void remove(IComponent pComponent)
Removes the specified component from this container.

Specified by:
remove in interface IContainer
Parameters:
pComponent - the IComponent to be removed
See Also:
IContainer.add(javax.rad.ui.IComponent), IContainer.remove(int)

removeAll

public void removeAll()
Removes all the components from this container. This method also notifies the layout manager to remove the components from this container's layout via the removeLayoutComponent method.

Specified by:
removeAll in interface IContainer
See Also:
IContainer.add(javax.rad.ui.IComponent), IContainer.remove(int)

getComponentCount

public int getComponentCount()
Gets the number of IComponents in this panel.

Specified by:
getComponentCount in interface IContainer
Returns:
the number of components in this panel.
See Also:
IContainer.getComponent(int)

getComponent

public IComponent getComponent(int pIndex)
Gets the nth IComponent in this container.

Specified by:
getComponent in interface IContainer
Parameters:
pIndex - the index of the IComponent to get.
Returns:
the nth component in this container.

indexOf

public int indexOf(IComponent pComponent)
Gets the nth position of an IComponent in this container.

Specified by:
indexOf in interface IContainer
Parameters:
pComponent - the IComponent to search
Returns:
the nth position of pComponent in this container or -1 if pComponent is not added

updateTranslation

public void updateTranslation()
Notification for updating the translation. This method will be called when the UIComponent will be added to a displayable containment hierarchy, when its containment hierarchy is made displayable or the translation table will be changed.

Overrides:
updateTranslation in class UIComponent<C extends IContainer>
See Also:
UIComponent.setTranslation(TranslationMap), UIComponent.addNotify()

beforeAddNotify

public void beforeAddNotify(IComponent pParent)
Invoked before this component is added.

Overrides:
beforeAddNotify in class UIComponent<C extends IContainer>
Parameters:
pParent - the parent

addNotify

public void addNotify()
Makes this UIComponent displayable by adding it to an UIContainer. This method is called internally by the genui and should not be called directly.

Overrides:
addNotify in class UIComponent<C extends IContainer>
See Also:
UIComponent.removeNotify(), UIComponent.isNotified()

removeNotify

public void removeNotify()
Makes this UIComponent undisplayable by removing it to an UIContainer.

This method is called by the genui internally and should not be called directly. Code overriding this method should call super.removeNotify as the first line of the overriding method.

Overrides:
removeNotify in class UIComponent<C extends IContainer>
See Also:
UIComponent.addNotify(), UIComponent.isNotified()

checkAdd

protected void checkAdd(IComponent pComponent,
                        Object pConstraints,
                        int pIndex)
Checks if it's allowed to add a specific component to this container.

Parameters:
pComponent - the component to be added
pConstraints - an object expressing layout constraints
pIndex - the position in the container's list at which to insert the IComponent; -1 means insert at the end component

setZOrder

public void setZOrder(IComponent pComponent,
                      int pZOrder)
Sets the order of the given component.

Parameters:
pComponent - the component
pZOrder - the zOrder.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.