com.groiss.gui
Class AbstractContainer

java.lang.Object
  extended by com.groiss.gui.AbstractComponent
      extended by com.groiss.gui.AbstractContainer
All Implemented Interfaces:
Component, Container, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
Button, DivComponent, FieldSet, FormContainer, Label, TableContainer, Tabs, XHTMLPage

public abstract class AbstractContainer
extends AbstractComponent
implements Container

abstract implementation of the container interface with some common code for subclasses

See Also:
Serialized Form

Field Summary
protected  java.util.Map<java.lang.String,Component> components
          the components of the container
 
Fields inherited from class com.groiss.gui.AbstractComponent
actions, ACTIVE, browserMode, DEFAULT, ID, IE, INVISIBLE, isSensitive, label, NS, ON_BLUR, ON_CHANGE, ON_CLICK, ON_DBLCLICK, ON_FOCUS, ON_KEY_DOWN, ON_KEY_PRESS, ON_KEY_UP, ON_LOAD, ON_MOUSE_DOWN, ON_MOUSE_MOVE, ON_MOUSE_OUT, ON_MOUSE_UP, ON_RESET, ON_SELECT, ON_SUBMIT, ON_UNLOAD, outputter, parent, parentElem, READONLY, root, viewMode
 
Constructor Summary
AbstractContainer()
          constructs a new container from an existing JDOM the root element must have an id attribute
AbstractContainer(org.jdom.Element root)
          constructs a new container from an existing JDOM the root element must have an id attribute
AbstractContainer(java.lang.String name)
           
AbstractContainer(java.lang.String name, java.lang.String id, java.lang.String className)
          constructs a new empty container and creates an internal JDOM that consists of an empty root element
 
Method Summary
 Component add(Component c)
           
<T extends Component>
T
get(java.lang.String id)
           
 java.util.Collection<Component> getAll()
           
 java.util.Collection<Component> getAll(java.lang.String name)
           
 java.util.Collection<Component> getAllDeep()
           
<T extends Component>
T
getByName(java.lang.String name)
           
protected  void getComponents(org.jdom.Element element, org.jdom.Element par)
          search the JDOM for components and collect them /* @param element - the root-element of the JDOM (or any other element in recursive calls)
protected  Pair<Component,Container> getWithParent(java.lang.String id)
           
 void init(org.jdom.Element element)
          Initialize the component with a jdom-tree.
 Component remove(java.lang.String id)
           
 void setBrowserMode(short mode)
          sets the browserMode
 Component substitute(java.lang.String id, Component c)
           
 
Methods inherited from class com.groiss.gui.AbstractComponent
clone, create, getActionListener, getAttribute, getBrowserMode, getContent, getId, getLabel, getName, getParent, getParentElement, getRoot, getRootName, getStyle, getViewMode, init, init, removeAttribute, setActionListener, setAttribute, setContent, setEncoding, setExpandEmptyElements, setId, setIndenting, setLabel, setName, setNewLines, setParent, setParentElement, setRootName, setStyle, setViewMode, show, show, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.groiss.gui.Component
clone, getActionListener, getAttribute, getBrowserMode, getContent, getId, getLabel, getName, getParent, getParentElement, getRoot, getStyle, getViewMode, init, removeAttribute, setActionListener, setAttribute, setContent, setId, setLabel, setName, setParent, setParentElement, setStyle, setViewMode, show, show, toString
 

Field Detail

components

protected java.util.Map<java.lang.String,Component> components
the components of the container

Constructor Detail

AbstractContainer

public AbstractContainer()
constructs a new container from an existing JDOM the root element must have an id attribute


AbstractContainer

public AbstractContainer(org.jdom.Element root)
constructs a new container from an existing JDOM the root element must have an id attribute


AbstractContainer

public AbstractContainer(java.lang.String name,
                         java.lang.String id,
                         java.lang.String className)
constructs a new empty container and creates an internal JDOM that consists of an empty root element

Parameters:
name - - the name of the root element
id - - the id of the container
className - - the name of the container class

AbstractContainer

public AbstractContainer(java.lang.String name)
Method Detail

add

public Component add(Component c)
Specified by:
add in interface Container
Parameters:
c - - the component to add
Returns:
- the replaced component or null

remove

public Component remove(java.lang.String id)
Specified by:
remove in interface Container
Parameters:
id - - the id of the component
Returns:
- the removed component with the given id or null

substitute

public Component substitute(java.lang.String id,
                            Component c)
Specified by:
substitute in interface Container
Parameters:
id - - the id of the component which should be substituted
c - - the new component
Returns:
- the substituted component or null, if no component with the given id was found

getComponents

protected void getComponents(org.jdom.Element element,
                             org.jdom.Element par)
search the JDOM for components and collect them /* @param element - the root-element of the JDOM (or any other element in recursive calls)


init

public void init(org.jdom.Element element)
Description copied from class: AbstractComponent
Initialize the component with a jdom-tree.

Specified by:
init in interface Component
Overrides:
init in class AbstractComponent
Parameters:
element - - the root-element of the tree, must not be null

get

public <T extends Component> T get(java.lang.String id)
Specified by:
get in interface Container
Parameters:
id - - the id of the component
Returns:
- the component with the given id or null

getWithParent

protected Pair<Component,Container> getWithParent(java.lang.String id)

getByName

public <T extends Component> T getByName(java.lang.String name)
Specified by:
getByName in interface Container
Parameters:
name - - the name of the component
Returns:
- the first found component with the given name or null

getAll

public java.util.Collection<Component> getAll()
Specified by:
getAll in interface Container
Returns:
- all components of the container

getAllDeep

public java.util.Collection<Component> getAllDeep()
Specified by:
getAllDeep in interface Container
Returns:
- all components of the container recursively

getAll

public java.util.Collection<Component> getAll(java.lang.String name)
Specified by:
getAll in interface Container
Returns:
- all direct components of the container with the given name

setBrowserMode

public void setBrowserMode(short mode)
Description copied from class: AbstractComponent
sets the browserMode

Specified by:
setBrowserMode in interface Component
Overrides:
setBrowserMode in class AbstractComponent
Parameters:
mode - - the new browserMode


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.