|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.gui.AbstractComponent
public abstract class AbstractComponent
abstract implementation of the component interface with some common code for subclasses
| Field Summary | |
|---|---|
protected 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 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 static XMLOutputter |
outputter
the renderer for the JDOM-Tree |
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 Summary | |
|---|---|
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 |
|
| Method Summary | |
|---|---|
Object |
clone()
returns a copy of the Component object |
static Component |
create(Element root)
Create element from dom |
String |
getActionListener(String event)
returs the value of an attribute |
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. |
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 |
void |
setContent(Object o)
sets the content of the component |
void |
setEncoding(boolean val)
|
void |
setExpandEmptyElements(boolean val)
|
void |
setId(String id)
set the unique identifier to a given value. |
void |
setIndenting(boolean val)
|
void |
setLabel(Label c)
sets the label component |
void |
setName(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(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 |
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 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 static XMLOutputter outputter
protected Label label
protected Map actions
| Constructor Detail |
|---|
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)
| Method Detail |
|---|
public void init(Element element)
init in interface Componentelement - - the root-element of the tree, must not be nullpublic void init(String name)
public void init(String name,
String id,
String className)
init in interface Componentname - - the name of the root-element of the tree, must not be nullid - - the id of the componentclassName - - the name of the component class
public Component setAttribute(String name,
String value)
setAttribute in interface Componentname - - the name of the attributevalue - - the value of the attributepublic String getAttribute(String name)
getAttribute in interface Componentname - - the name of the attribute
public boolean removeAttribute(String name)
removeAttribute in interface Componentname - - the name of the attribute
public void setActionListener(String event,
String action)
setActionListener in interface Componentevent - the event to listenaction - the action to performpublic String getActionListener(String event)
getActionListener in interface Componentevent - - the event to listen
public void setId(String id)
setId in interface Componentid - the new id of this componentpublic String getId()
getId in interface Componentpublic void setName(String name)
setName in interface Componentname - - the new name of this componentpublic String getName()
getName in interface Componentpublic void setRootName(String name)
name - - the new name of the root elementpublic String getRootName()
public void setLabel(Label c)
setLabel in interface Componentc - - the label componentpublic Label getLabel()
getLabel in interface Componentpublic void setParentElement(Element parent)
setParentElement in interface Componentparent - - the parent elementpublic Element getParentElement()
getParentElement in interface Componentpublic void setParent(Container parent)
setParent in interface Componentparent - - the parent containerpublic Container getParent()
getParent in interface Componentpublic void setViewMode(short mode)
setViewMode in interface Componentmode - - the new viewModepublic short getViewMode()
getViewMode in interface Componentpublic void setBrowserMode(short mode)
setBrowserMode in interface Componentmode - - the new browserModepublic short getBrowserMode()
getBrowserMode in interface Componentpublic void setStyle(String style)
setStyle in interface Componentstyle - - the new stylepublic String getStyle()
getStyle in interface Componentpublic String show()
Component
show in interface Componentpublic void show(PrintWriter pw)
show in interface Componentpw - - the Printwriterpublic String toString()
toString in interface ComponenttoString in class Objectpublic Object clone()
clone in interface Componentclone in class Objectpublic Element getRoot()
getRoot in interface Componentpublic void setContent(Object o)
setContent in interface Componento - any object where the string representation is used for renderingpublic Object getContent()
getContent in interface Componentpublic void setNewLines(boolean val)
public void setEncoding(boolean val)
public void setExpandEmptyElements(boolean val)
public void setIndenting(boolean val)
public static Component create(Element root)
root -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||