Package com.groiss.gui
Interface Component
- All Superinterfaces:
Cloneable
,Serializable
- All Known Subinterfaces:
Container
- All Known Implementing Classes:
AbstractComponent
,AbstractContainer
,Button
,Checkbox
,ComparableComponent
,DivComponent
,DropdownList
,FieldSet
,FileChooser
,FormContainer
,HiddenField
,Image
,Label
,Link
,PasswordField
,RadioButton
,RadioGroup
,SelectList
,SortableLink
,SubmitButton
,TableContainer
,Tabs
,Text
,Textarea
,Textfield
,XHTMLPage
interface for any component
the component is an elementary part of any view
see the composite pattern [GoF95] for any details
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd the given CSS class(es) to the list of existing CSS-classesclone()
returns a copy of the Component objectgetAttribute
(String name) returs the value of an attributeshort
getId()
getLabel()
getName()
getRoot()
returns the root element of the internal JDOMgetStyle()
short
void
initialize the component with a jdom-treevoid
initialize the component with a jdom-treeboolean
removeAttribute
(String name) removes the attributeremoveClass
(String clazz) remove the given CSS class(es) from the list of existing CSS-classesvoid
setActionListener
(String event, String action) sets the stylesetAttribute
(String name, String value) sets the attribute to the componentvoid
setBrowserMode
(short mode) sets the browserModeset the CSS-class attribute to the given valuevoid
setContent
(Object o) sets the content of the componentvoid
set the unique identifier to a given value.void
sets the label componentvoid
set the name to a given value.void
sets the parent continervoid
setParentElement
(Element parent) sets the parent element of the components rootvoid
sets the stylevoid
setViewMode
(short mode) sets the viewModeshow()
method for rendering the component as stringvoid
show
(PrintWriter output) prints the rendered component to a PrintWritertoggleClass
(String clazz, boolean add) remove or add the given CSS class(es) from the list of existing CSS-classes depending on a conditiontoString()
-
Field Details
-
LABELLEDBY
- See Also:
-
-
Method Details
-
init
initialize the component with a jdom-tree- Parameters:
root
- - the root-element of the tree, must not be null
-
init
initialize the component with a jdom-tree- Parameters:
name
- - the name of the root elementid
- - the id of the componentclassName
- - the name of the component class
-
setAttribute
sets the attribute to the component- Parameters:
name
- - the name of the attributevalue
- - the value of the attribute- Returns:
- the updated component
-
getAttribute
returs the value of an attribute- Parameters:
name
- - the name of the attribute- Returns:
- - the value of the attribute
-
removeAttribute
removes the attribute- Parameters:
name
- - the name of the attribute- Returns:
- - true, if the attribute was found
-
setId
set the unique identifier to a given value. Handle with care!- Parameters:
id
- the new id of this component
-
getId
String getId()- Returns:
- - the unique identifier of the component
-
setName
set the name to a given value.- Parameters:
name
- - the new name of this component
-
getName
String getName()- Returns:
- - the name of the component
-
setLabel
sets the label component- Parameters:
c
- - the label component
-
getLabel
Label getLabel()- Returns:
- - the label component of the component
-
setParent
sets the parent continer- Parameters:
parent
- - the parent element of the container
-
getParent
Container getParent()- Returns:
- - the parent container of the component
-
setParentElement
sets the parent element of the components root- Parameters:
parent
- - the parent element
-
getParentElement
Element getParentElement()- Returns:
- - the parent element of the components root
-
setViewMode
void setViewMode(short mode) sets the viewMode- Parameters:
mode
- - the new viewMode
-
getViewMode
short getViewMode()- Returns:
- - the viewMode of the component
-
setBrowserMode
void setBrowserMode(short mode) sets the browserMode- Parameters:
mode
- - the new browserMode
-
getBrowserMode
short getBrowserMode()- Returns:
- - the browserMode of the component
-
setStyle
sets the style- Parameters:
style
- - the new style
-
getStyle
String getStyle()- Returns:
- - the style of the component
-
setActionListener
sets the style- Parameters:
event
- - the event to listenaction
- - the action to perform
-
show
String show()method for rendering the component as string- Returns:
- the rendered component as string
-
show
prints the rendered component to a PrintWriter- Parameters:
output
- - the Printwriter
-
toString
String toString() -
clone
Object clone()returns a copy of the Component object- Returns:
- the Component clone
-
getRoot
Element getRoot()returns the root element of the internal JDOM- Returns:
- the (root) Element object
-
setContent
sets the content of the component- Parameters:
o
- any object where the string representation is used for rendering
-
getContent
Object getContent()- Returns:
- - the content object of the component
-
toggleClass
remove or add the given CSS class(es) from the list of existing CSS-classes depending on a condition- Parameters:
clazz
- blank separated list of CSS classes to be added/removedadd
- - condition to add (true
) or remove (false
) the classes- Returns:
- the current CSS classes
-
removeClass
remove the given CSS class(es) from the list of existing CSS-classes- Parameters:
clazz
- blank separated list of CSS classes to be removed- Returns:
- the current CSS classes
-
addClass
add the given CSS class(es) to the list of existing CSS-classes- Parameters:
clazz
- blank separated list of CSS classes to be added- Returns:
- the current CSS classes
-
setClass
set the CSS-class attribute to the given value- Parameters:
clazz
- blank separated list of CSS classes to be assigned- Returns:
- the current CSS classes
-