public abstract class AbstractComponent extends java.lang.Object implements Component
Modifier and Type | Field and Description |
---|---|
static short |
ACTIVE
some view modes
|
protected short |
browserMode
for which browser should the component be rendered
|
static short |
DEFAULT
some browser modes
|
static java.lang.String |
ID
the id of attribute of a component
|
static short |
IE |
static short |
INVISIBLE |
protected boolean |
isSensitive
shows if the component can listen to events
|
protected Label |
label
the reference to the component, which is the label of this component
|
static short |
NS |
static java.lang.String |
ON_BLUR |
static java.lang.String |
ON_CHANGE
some defined events specially for select lists
|
static java.lang.String |
ON_CLICK
some defined common events
|
static java.lang.String |
ON_DBLCLICK |
static java.lang.String |
ON_FOCUS
some defined events for components that can get the focus
|
static java.lang.String |
ON_KEY_DOWN |
static java.lang.String |
ON_KEY_PRESS |
static java.lang.String |
ON_KEY_UP |
static java.lang.String |
ON_LOAD
some defined events specially for the htmlpage
|
static java.lang.String |
ON_MOUSE_DOWN |
static java.lang.String |
ON_MOUSE_MOVE |
static java.lang.String |
ON_MOUSE_OUT |
static java.lang.String |
ON_MOUSE_UP |
static java.lang.String |
ON_RESET |
static java.lang.String |
ON_SELECT
some defined events specially for textareas and inputfields
|
static java.lang.String |
ON_SUBMIT
some defined events specially for the formcontainer
|
static java.lang.String |
ON_UNLOAD |
protected Container |
parent |
protected Element |
parentElem
the parent element of the components root
|
static short |
READONLY |
protected Element |
root
the root element of the internal JDOM-Tree of the component
|
protected short |
viewMode
how should the component be rendered
|
Constructor and Description |
---|
AbstractComponent() |
AbstractComponent(Element root)
constructs a new component from an existing JDOM
the root element must have an id attribute
|
AbstractComponent(java.lang.String name) |
AbstractComponent(java.lang.String name,
java.lang.String id,
java.lang.String className)
constructs a new empty component and creates an internal JDOM that consists of an empty root element
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
returns a copy of the Component object
|
static Component |
create(Element root)
Create element from dom
|
java.lang.String |
getAttribute(java.lang.String name)
returs the value of an attribute
|
short |
getBrowserMode() |
java.lang.Object |
getContent() |
java.lang.String |
getId() |
Label |
getLabel() |
java.lang.String |
getName() |
Container |
getParent() |
Element |
getParentElement() |
Element |
getRoot()
returns the root element of the internal JDOM
|
java.lang.String |
getRootName() |
java.lang.String |
getStyle() |
short |
getViewMode() |
void |
init(Element element)
Initialize the component with a jdom-tree.
|
void |
init(java.lang.String name) |
void |
init(java.lang.String name,
java.lang.String id,
java.lang.String className)
initialize the component with an new jdom-tree
|
boolean |
removeAttribute(java.lang.String name)
Remove the attribute from the component.
|
void |
setActionListener(java.lang.String event,
java.lang.String action)
Sets the action to an event.
|
Component |
setAttribute(java.lang.String name,
java.lang.String value)
sets the attribute to the component
|
void |
setBrowserMode(short mode)
sets the browserMode
|
void |
setContent(java.lang.Object o)
sets the content of the component
|
void |
setEncoding(boolean val) |
void |
setExpandEmptyElements(boolean val) |
void |
setId(java.lang.String id)
set the unique identifier to a given value.
|
void |
setIndenting(boolean val) |
void |
setLabel(Label c)
sets the label component
|
void |
setName(java.lang.String name)
set the name to a given value.
|
void |
setNewLines(boolean val) |
void |
setParent(Container parent)
sets the parent container
|
void |
setParentElement(Element parent)
sets the parent element of the components root
|
void |
setRootName(java.lang.String name)
set the name of the root element to a given value.
|
void |
setStyle(java.lang.String style)
Set the style
|
void |
setViewMode(short mode)
sets the viewMode
|
java.lang.String |
show()
method for rendering the component as string
|
void |
show(java.io.PrintWriter pw)
prints the rendered component to a PrintWriter
|
java.lang.String |
toString()
Returns the classname followed by a colon and the title attribute.
|
public static final short ACTIVE
public static final short READONLY
public static final short INVISIBLE
public static final short DEFAULT
public static final short NS
public static final short IE
public static final java.lang.String ON_CLICK
public static final java.lang.String ON_DBLCLICK
public static final java.lang.String ON_MOUSE_DOWN
public static final java.lang.String ON_MOUSE_UP
public static final java.lang.String ON_MOUSE_MOVE
public static final java.lang.String ON_MOUSE_OUT
public static final java.lang.String ON_KEY_PRESS
public static final java.lang.String ON_KEY_DOWN
public static final java.lang.String ON_KEY_UP
public static final java.lang.String ON_FOCUS
public static final java.lang.String ON_BLUR
public static final java.lang.String ON_LOAD
public static final java.lang.String ON_UNLOAD
public static final java.lang.String ON_SUBMIT
public static final java.lang.String ON_RESET
public static final java.lang.String ON_SELECT
public static final java.lang.String ON_CHANGE
protected short viewMode
protected short browserMode
protected boolean isSensitive
public static final java.lang.String ID
protected Element parentElem
protected Container parent
protected Element root
protected Label label
public AbstractComponent()
public AbstractComponent(Element root)
public AbstractComponent(java.lang.String name, java.lang.String id, java.lang.String className)
name
- - the name of the root elementid
- - the id of the componentclassName
- - the name of the component classpublic AbstractComponent(java.lang.String name)
public void init(Element element)
public void init(java.lang.String name)
public void init(java.lang.String name, java.lang.String id, java.lang.String className)
public Component setAttribute(java.lang.String name, java.lang.String value)
setAttribute
in interface Component
name
- - the name of the attributevalue
- - the value of the attributepublic java.lang.String getAttribute(java.lang.String name)
getAttribute
in interface Component
name
- - the name of the attributepublic boolean removeAttribute(java.lang.String name)
removeAttribute
in interface Component
name
- - the name of the attributepublic void setActionListener(java.lang.String event, java.lang.String action)
setActionListener
in interface Component
event
- the event to listenaction
- the action to performpublic void setId(java.lang.String id)
public java.lang.String getId()
public void setName(java.lang.String name)
public java.lang.String getName()
public void setRootName(java.lang.String name)
name
- - the new name of the root elementpublic java.lang.String getRootName()
public void setLabel(Label c)
public Label getLabel()
public void setParentElement(Element parent)
setParentElement
in interface Component
parent
- - the parent elementpublic Element getParentElement()
getParentElement
in interface Component
public void setParent(Container parent)
public Container getParent()
public void setViewMode(short mode)
setViewMode
in interface Component
mode
- - the new viewModepublic short getViewMode()
getViewMode
in interface Component
public void setBrowserMode(short mode)
setBrowserMode
in interface Component
mode
- - the new browserModepublic short getBrowserMode()
getBrowserMode
in interface Component
public void setStyle(java.lang.String style)
public java.lang.String getStyle()
public java.lang.String show()
Component
public void show(java.io.PrintWriter pw)
public java.lang.String toString()
public java.lang.Object clone()
public Element getRoot()
public void setContent(java.lang.Object o)
setContent
in interface Component
o
- any object where the string representation is used for renderingpublic java.lang.Object getContent()
getContent
in interface Component
public void setNewLines(boolean val)
public void setEncoding(boolean val)
public void setExpandEmptyElements(boolean val)
public void setIndenting(boolean val)
@enterprise 9.0.33982 Copyright © 2001-2023 Groiss Informatics GmbH. All Rights Reserved.