public abstract class AbstractWebComponent extends TreeNode implements WebComponent
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
changed |
protected Component |
component |
protected org.jsoup.nodes.Element |
htmlInnerElement |
protected org.jsoup.nodes.Element |
htmlOuterElement |
protected String |
id |
protected org.jsoup.nodes.Element |
styleElement |
| Constructor and Description |
|---|
AbstractWebComponent(String id,
Component component) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(TreeNode node) |
protected void |
applyEvents(org.jsoup.nodes.Element element,
String inputName,
String event) |
protected void |
applyStyle(org.jsoup.nodes.Element element,
CSSAttributes attrs) |
String |
calcHash() |
String |
calcHashOfChildrenId() |
protected CSSAttributes |
createCommonStyles()
common style of component, such as font and color
|
abstract void |
createHtmlElement() |
String |
getChildrenIdsHash() |
List<WebComponent> |
getChildrenWebComponents() |
Component |
getComponent() |
protected String |
getFullInputName(String shortName) |
protected String |
getFullInputName(String id,
String shortName) |
protected org.jsoup.nodes.Element |
getHtmlInnerElementForNewChild()
used by addChild()
|
org.jsoup.nodes.Element |
getHtmlOuterElement() |
String |
getId() |
String |
getOwnHash() |
WebComponent |
getParentWebComponent() |
org.jsoup.nodes.Element |
getStyleElement() |
void |
init()
it should be called after all other required parameters are set.
|
boolean |
isStaticResource() |
protected org.jsoup.nodes.Document |
loadFromResource(String name) |
protected String |
null2Empty(String str) |
ViewAction |
processEvent(WebEvent event,
ListValueMap<String,Object> parameters)
event from browser
|
ViewAction |
processEvent(WebEvent event,
Map<String,Object> parameters) |
void |
replaceChild(WebComponent oldChild,
WebComponent newChild) |
void |
setChildrenIdsHash(String childrenIdsHash) |
void |
setId(String id) |
void |
setOwnHash(String ownHash) |
void |
setStaticResource(boolean staticResource) |
protected void |
updateIdInHtml(String id) |
void |
writeFile(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse response,
String shortName)
subclass should find the file or image object by the short name.
|
protected void |
writeFile(javax.servlet.http.HttpServletResponse response,
File file)
response with file(image, ...)
|
addChild, addChildren, checkConsistency, clear, copy, detach, findFirst, findFirstAncestor, getChildren, getDepth, getParent, getRoot, indexOf, isLast, isLeaf, isRoot, remove, removeAllChildren, removeChild, replace, replaceSingleNode, setChildren, setParent, tranverse, tranverseUpprotected String id
protected org.jsoup.nodes.Element styleElement
protected org.jsoup.nodes.Element htmlOuterElement
protected org.jsoup.nodes.Element htmlInnerElement
protected Component component
protected boolean changed
public void init()
public String getId()
getId in interface WebComponentpublic void setId(String id)
setId in interface WebComponentprotected void updateIdInHtml(String id)
public Component getComponent()
getComponent in interface WebComponentpublic abstract void createHtmlElement()
createHtmlElement in interface WebComponentpublic org.jsoup.nodes.Element getStyleElement()
public org.jsoup.nodes.Element getHtmlOuterElement()
getHtmlOuterElement in interface WebComponentprotected org.jsoup.nodes.Element getHtmlInnerElementForNewChild()
public void addChild(TreeNode node)
addChild in interface WebComponentaddChild in class TreeNodeprotected org.jsoup.nodes.Document loadFromResource(String name)
public ViewAction processEvent(WebEvent event, ListValueMap<String,Object> parameters)
processEvent in interface WebComponentname - parameters - public ViewAction processEvent(WebEvent event, Map<String,Object> parameters)
public void writeFile(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse response,
String shortName)
throws IOException
writeFile in interface WebComponentreq - response - shortName - IOExceptionprotected void writeFile(javax.servlet.http.HttpServletResponse response,
File file)
throws IOException
IOExceptionpublic WebComponent getParentWebComponent()
getParentWebComponent in interface WebComponentpublic List<WebComponent> getChildrenWebComponents()
getChildrenWebComponents in interface WebComponentpublic void replaceChild(WebComponent oldChild, WebComponent newChild)
replaceChild in interface WebComponentprotected CSSAttributes createCommonStyles()
protected void applyStyle(org.jsoup.nodes.Element element,
CSSAttributes attrs)
protected void applyEvents(org.jsoup.nodes.Element element,
String inputName,
String event)
public String calcHash()
public String calcHashOfChildrenId()
public String getOwnHash()
getOwnHash in interface WebComponentpublic void setOwnHash(String ownHash)
setOwnHash in interface WebComponentpublic String getChildrenIdsHash()
getChildrenIdsHash in interface WebComponentpublic void setChildrenIdsHash(String childrenIdsHash)
setChildrenIdsHash in interface WebComponentpublic boolean isStaticResource()
public void setStaticResource(boolean staticResource)
Copyright © 2016. All Rights Reserved.