|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.groiss.gui.AbstractComponent
public abstract class AbstractComponent
abstract implementation of the component interface with some common code for subclasses
Field Summary | |
---|---|
protected java.util.Map |
actions
|
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 static org.jdom.output.XMLOutputter |
outputter
the renderer for the JDOM-Tree |
protected Container |
parent
|
protected org.jdom.Element |
parentElem
the parent element of the components root |
static short |
READONLY
|
protected org.jdom.Element |
root
the root element of the internal JDOM-Tree of the component |
protected short |
viewMode
how should the component be rendered |
Constructor Summary | |
---|---|
AbstractComponent()
|
|
AbstractComponent(org.jdom.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 |
Method Summary | |
---|---|
java.lang.Object |
clone()
returns a copy of the Component object |
static Component |
create(org.jdom.Element root)
Create element from dom |
java.lang.String |
getActionListener(java.lang.String event)
returs the value of an attribute |
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()
|
org.jdom.Element |
getParentElement()
|
org.jdom.Element |
getRoot()
returns the root element of the internal JDOM |
java.lang.String |
getRootName()
|
java.lang.String |
getStyle()
|
short |
getViewMode()
|
void |
init(org.jdom.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(org.jdom.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. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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 org.jdom.Element parentElem
protected Container parent
protected org.jdom.Element root
protected static org.jdom.output.XMLOutputter outputter
protected Label label
protected java.util.Map actions
Constructor Detail |
---|
public AbstractComponent()
public AbstractComponent(org.jdom.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)
Method Detail |
---|
public void init(org.jdom.Element element)
init
in interface Component
element
- - the root-element of the tree, must not be nullpublic void init(java.lang.String name)
public void init(java.lang.String name, java.lang.String id, java.lang.String className)
init
in interface Component
name
- - the name of the root-element of the tree, must not be nullid
- - the id of the componentclassName
- - the name of the component classpublic 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 attribute
public boolean removeAttribute(java.lang.String name)
removeAttribute
in interface Component
name
- - the name of the attribute
public void setActionListener(java.lang.String event, java.lang.String action)
setActionListener
in interface Component
event
- the event to listenaction
- the action to performpublic java.lang.String getActionListener(java.lang.String event)
getActionListener
in interface Component
event
- - the event to listen
public void setId(java.lang.String id)
setId
in interface Component
id
- the new id of this componentpublic java.lang.String getId()
getId
in interface Component
public void setName(java.lang.String name)
setName
in interface Component
name
- - the new name of this componentpublic java.lang.String getName()
getName
in interface Component
public void setRootName(java.lang.String name)
name
- - the new name of the root elementpublic java.lang.String getRootName()
public void setLabel(Label c)
setLabel
in interface Component
c
- - the label componentpublic Label getLabel()
getLabel
in interface Component
public void setParentElement(org.jdom.Element parent)
setParentElement
in interface Component
parent
- - the parent elementpublic org.jdom.Element getParentElement()
getParentElement
in interface Component
public void setParent(Container parent)
setParent
in interface Component
parent
- - the parent containerpublic Container getParent()
getParent
in interface Component
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)
setStyle
in interface Component
style
- - the new stylepublic java.lang.String getStyle()
getStyle
in interface Component
public java.lang.String show()
Component
show
in interface Component
public void show(java.io.PrintWriter pw)
show
in interface Component
pw
- - the Printwriterpublic java.lang.String toString()
toString
in interface Component
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in interface Component
clone
in class java.lang.Object
public org.jdom.Element getRoot()
getRoot
in interface Component
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)
public static Component create(org.jdom.Element root)
root
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |