public abstract class AbstractComponent extends 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 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 String |
ON_BLUR |
static String |
ON_CHANGE
some defined events specially for select lists
|
static String |
ON_CLICK
some defined common events
|
static String |
ON_DBLCLICK |
static String |
ON_FOCUS
some defined events for components that can get the focus
|
static String |
ON_KEY_DOWN |
static String |
ON_KEY_PRESS |
static String |
ON_KEY_UP |
static String |
ON_LOAD
some defined events specially for the htmlpage
|
static String |
ON_MOUSE_DOWN |
static String |
ON_MOUSE_MOVE |
static String |
ON_MOUSE_OUT |
static String |
ON_MOUSE_UP |
static String |
ON_RESET |
static String |
ON_SELECT
some defined events specially for textareas and inputfields
|
static String |
ON_SUBMIT
some defined events specially for the formcontainer
|
static 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
|
LABELLEDBY
Constructor and Description |
---|
AbstractComponent() |
AbstractComponent(Element root)
constructs a new component from an existing JDOM
the root element must have an id attribute
|
AbstractComponent(String name) |
AbstractComponent(String name,
String id,
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 |
---|---|
Component |
addClass(String clazz)
add the given CSS class(es) to the list of existing CSS-classes
|
Object |
clone()
returns a copy of the Component object
|
static Component |
create(Element root)
Create element from dom
|
String |
getAttribute(String name)
returs the value of an attribute
|
short |
getBrowserMode() |
Object |
getContent() |
String |
getId() |
Label |
getLabel() |
String |
getName() |
Container |
getParent() |
Element |
getParentElement() |
Element |
getRoot()
returns the root element of the internal JDOM
|
String |
getRootName() |
String |
getStyle() |
short |
getViewMode() |
void |
init(Element element)
Initialize the component with a jdom-tree.
|
void |
init(String name) |
void |
init(String name,
String id,
String className)
initialize the component with an new jdom-tree
|
boolean |
removeAttribute(String name)
Remove the attribute from the component.
|
Component |
removeClass(String clazz)
remove the given CSS class(es) from the list of existing CSS-classes
|
void |
setActionListener(String event,
String action)
Sets the action to an event.
|
Component |
setAttribute(String name,
String value)
sets the attribute to the component
|
void |
setBrowserMode(short mode)
sets the browserMode
|
Component |
setClass(String clazz)
set the CSS-class attribute to the given value
|
void |
setContent(Object o)
sets the content of the component
|
void |
setEncoding(boolean val)
Deprecated.
method does nothing
|
void |
setExpandEmptyElements(boolean val)
Deprecated.
method does nothing
|
void |
setId(String id)
set the unique identifier to a given value.
|
void |
setIndenting(boolean val)
Deprecated.
method does nothing
|
void |
setLabel(Label c)
sets the label component
|
void |
setName(String name)
set the name to a given value.
|
void |
setNewLines(boolean val)
Deprecated.
method does nothing
|
void |
setParent(Container parent)
sets the parent container
|
void |
setParentElement(Element parent)
sets the parent element of the components root
|
void |
setRootName(String name)
set the name of the root element to a given value.
|
void |
setStyle(String style)
Set the style
|
void |
setViewMode(short mode)
sets the viewMode
|
String |
show()
method for rendering the component as string
|
void |
show(PrintWriter pw)
prints the rendered component to a PrintWriter
|
Component |
toggleClass(String clazz,
boolean add)
remove or add the given CSS class(es) from the list of existing CSS-classes depending on a condition
|
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 String ON_CLICK
public static final String ON_DBLCLICK
public static final String ON_MOUSE_DOWN
public static final String ON_MOUSE_UP
public static final String ON_MOUSE_MOVE
public static final String ON_MOUSE_OUT
public static final String ON_KEY_PRESS
public static final String ON_KEY_DOWN
public static final String ON_KEY_UP
public static final String ON_FOCUS
public static final String ON_BLUR
public static final String ON_LOAD
public static final String ON_UNLOAD
public static final String ON_SUBMIT
public static final String ON_RESET
public static final String ON_SELECT
public static final String ON_CHANGE
protected short viewMode
protected short browserMode
protected boolean isSensitive
public static final String ID
protected Element parentElem
protected Container parent
protected Element root
protected Label label
public AbstractComponent()
public AbstractComponent(Element root)
public AbstractComponent(String name, String id, String className)
name
- - the name of the root elementid
- - the id of the componentclassName
- - the name of the component classpublic AbstractComponent(String name)
public void init(Element element)
public void init(String name)
public void init(String name, String id, String className)
public Component setAttribute(String name, String value)
setAttribute
in interface Component
name
- - the name of the attributevalue
- - the value of the attributepublic String getAttribute(String name)
getAttribute
in interface Component
name
- - the name of the attributepublic boolean removeAttribute(String name)
removeAttribute
in interface Component
name
- - the name of the attributepublic void setActionListener(String event, String action)
setActionListener
in interface Component
event
- the event to listenaction
- the action to performpublic void setId(String id)
public String getId()
public void setName(String name)
public String getName()
public void setRootName(String name)
name
- - the new name of the root elementpublic 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(String style)
public String getStyle()
public String show()
Component
public void show(PrintWriter pw)
public String toString()
public Object clone()
public Element getRoot()
public void setContent(Object o)
setContent
in interface Component
o
- any object where the string representation is used for renderingpublic Object getContent()
getContent
in interface Component
@Deprecated public void setNewLines(boolean val)
@Deprecated public void setEncoding(boolean val)
@Deprecated public void setExpandEmptyElements(boolean val)
@Deprecated public void setIndenting(boolean val)
public static Component create(Element root)
root
- public Component toggleClass(String clazz, boolean add)
Component
toggleClass
in interface Component
clazz
- blank separated list of CSS classes to be added/removedadd
- - condition to add (true
) or remove (false
) the classespublic Component addClass(String clazz)
Component
public Component removeClass(String clazz)
Component
removeClass
in interface Component
clazz
- blank separated list of CSS classes to be removed@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.