public abstract class HTMLComponent
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
alignment |
protected java.lang.String |
alt |
protected java.awt.Color |
bgColor |
protected boolean |
cancelBubble |
protected java.util.ArrayList<HTMLEvent> |
events |
protected HTMLMutableTheme |
gMutableTheme |
protected java.lang.Boolean |
hasInitFocus |
protected java.lang.String |
id |
protected HTMLStyleSheet |
intStyleSheet |
protected java.util.ArrayList<HTMLComponent> |
items |
protected java.lang.String |
name |
protected HTMLComponent |
parent |
protected java.lang.String |
styleId |
protected java.util.HashMap |
styleProperty |
protected java.lang.Integer |
tabIndex |
protected java.lang.String |
toolTip |
static java.lang.String |
VALID_NAME_REGEX
http://www.w3.org/TR/html4/types.html#type-id
|
static java.lang.String |
VALID_STYLE_REGEX
Valid style
|
Constructor and Description |
---|
HTMLComponent() |
Modifier and Type | Method and Description |
---|---|
void |
addJavaScript(java.lang.String token,
JavaScript script) |
void |
addJavaScript(java.lang.String token,
java.lang.String scr) |
void |
addOnLoadScript(java.lang.String token,
java.lang.String script) |
void |
appendClassName(java.lang.String className)
Append a class name to the existing class names ( if name).
|
protected void |
checkIsContainer()
Just Create the items vector if needed
|
protected void |
compile(ClientBrowser browser)
This is the spot to put all your generation
of the HTML components.
|
protected void |
copyAttributes(HTMLComponent table) |
protected void |
doBuildToolTip(ClientBrowser browser)
Protected methods
|
java.lang.String |
fetchStyleProperty(java.lang.String type)
get the style property if set
|
java.lang.String |
getClassName() |
java.lang.String |
getId()
get the ID of this component
|
HTMLMutableTheme |
getMutableTheme()
Returns a mutable theme
|
HTMLComponent |
getParent() |
protected HTMLPage |
getParentPage() |
protected HTMLStyleSheet |
getStyleSheet() |
HTMLTheme |
getTheme()
Returns the current theme or an Overlay theme if one doesn't exists.
|
boolean |
hasTheme()
Test to see if this component has a Theme ( without creating one)
|
protected void |
iAddComponent(HTMLComponent component)
Adds a component to this container
|
protected void |
iAddComponent(HTMLComponent component,
int index)
Adds a component to this container at a particular position
|
protected void |
iAddedToPage(HTMLPage page) |
void |
iAddEvent(HTMLEvent event,
java.lang.String script)
INTERNAL ONLY Adds the event to the event list.
|
protected void |
iClear() |
protected HTMLComponent |
iFindId(java.lang.String searchId) |
protected void |
iGenerate(ClientBrowser browser,
java.lang.StringBuilder buffer)
This is the method that creates the raw HTML.
|
protected void |
iGenerateAttributes(ClientBrowser browser,
java.lang.StringBuilder buffer) |
protected void |
iGenerateAttributesID(ClientBrowser browser,
java.lang.StringBuilder buffer) |
protected void |
iGenerateComponent(HTMLComponent c,
ClientBrowser browser,
int count,
java.lang.StringBuilder buffer) |
protected void |
iGenerateComponent(HTMLComponent c,
ClientBrowser browser,
java.lang.StringBuilder buffer) |
protected void |
iGenerateEvents(ClientBrowser browser,
java.lang.StringBuilder buffer) |
protected HTMLComponent |
iGetComponent(int at) |
protected int |
iGetComponentCount()
The count of components contained
|
protected boolean |
iHasEvent(java.lang.String eventName) |
protected void |
iRemoveComponent(int at)
Remove component from the container
|
boolean |
isCompiled() |
protected void |
iSetId(java.lang.String id)
set the ID of this component.
|
protected void |
iSetName(java.lang.String inName) |
protected void |
iSetStyleId(java.lang.String styleId) |
static java.lang.String |
makeColorID(java.awt.Color color) |
protected void |
makeListOfEvents(java.util.List<HTMLEvent> list) |
protected HTMLPage |
monitorPage() |
protected void |
postCompile(ClientBrowser browser)
This is the post compile if needed
|
protected void |
resetParent() |
void |
setAlignment(java.lang.String alignment) |
void |
setAttribute(java.lang.String name,
java.lang.String value) |
void |
setClassName(java.lang.String className)
Clears all of the object's style names and sets it to the given style.
|
void |
setHasInitFocus(boolean fg)
Sets whether this component receives focus when the page is loaded
If value is not set then the component with tab index of one will receive the focus |
protected void |
setParent(HTMLComponent parent)
Set the parent of this component internally called by
addComponent
|
void |
setStyleProperty(java.lang.String type,
java.lang.String value)
Set the internal style of this component.
if this method is used for a component, this component will be appended a class attribute. If this method is used, iGenerateAttributes() method must be used to generate the CSS. |
void |
setTabIndex(int tabIndex)
Sets the index that defines the tab order for the Component
The tabIndex value determines the tab order as follows: 1. |
void |
touch() |
public static final java.lang.String VALID_NAME_REGEX
public static final java.lang.String VALID_STYLE_REGEX
protected java.lang.String alt
protected HTMLComponent parent
protected java.lang.String alignment
protected java.lang.String id
protected java.lang.String name
protected java.lang.String styleId
protected java.lang.String toolTip
protected java.lang.Integer tabIndex
protected java.lang.Boolean hasInitFocus
protected HTMLMutableTheme gMutableTheme
protected java.util.ArrayList<HTMLEvent> events
protected java.awt.Color bgColor
protected java.util.ArrayList<HTMLComponent> items
protected boolean cancelBubble
protected java.util.HashMap styleProperty
protected HTMLStyleSheet intStyleSheet
public void touch()
public final void setClassName(@Nullable java.lang.String className)
className
- the class name to set.public final void appendClassName(@Nullable java.lang.String className)
className
- the class name to append.@Nonnull @CheckReturnValue public final java.lang.String getClassName()
public void addJavaScript(@Nonnull java.lang.String token, @Nullable java.lang.String scr)
token
- The tokenscr
- public void addJavaScript(@Nonnull java.lang.String token, @Nullable JavaScript script)
token
- The tokenscript
- public void addOnLoadScript(@Nonnull java.lang.String token, @Nullable java.lang.String script)
token
- The tokenscript
- @CheckReturnValue @Nullable protected HTMLComponent iFindId(@Nullable java.lang.String searchId)
searchId
- @CheckReturnValue @Nullable public java.lang.String getId()
protected void iSetId(@Nullable java.lang.String id)
id
- The id of the componentprotected void iSetName(@Nonnull java.lang.String inName)
inName
- protected void iSetStyleId(java.lang.String styleId)
styleId
- protected void iGenerateComponent(HTMLComponent c, ClientBrowser browser, int count, java.lang.StringBuilder buffer)
c
- browser
- count
- buffer
- public void iAddEvent(HTMLEvent event, java.lang.String script)
event
- the eventscript
- protected boolean iHasEvent(java.lang.String eventName)
eventName
- @CheckReturnValue public boolean isCompiled()
@CheckReturnValue @Nullable protected HTMLPage monitorPage()
protected void compile(@Nonnull ClientBrowser browser)
browser
- @OverridingMethodsMustInvokeSuper protected void postCompile(ClientBrowser browser)
browser
- protected void resetParent()
protected void makeListOfEvents(@Nonnull java.util.List<HTMLEvent> list)
list
- public void setAlignment(@Nullable java.lang.String alignment)
alignment
- public void setTabIndex(int tabIndex)
tabIndex
- public void setHasInitFocus(boolean fg)
fg
- protected void setParent(HTMLComponent parent)
parent
- protected void iAddedToPage(HTMLPage page)
page
- @CheckReturnValue @Nullable protected HTMLPage getParentPage()
@CheckReturnValue @Nullable public HTMLComponent getParent()
@CheckReturnValue @Nonnull public static java.lang.String makeColorID(@Nonnull java.awt.Color color)
color
- @CheckReturnValue @Nullable public java.lang.String fetchStyleProperty(java.lang.String type)
type
- the propertypublic void setStyleProperty(@Nonnull java.lang.String type, @Nullable java.lang.String value)
type
- the typevalue
- the valuepublic void setAttribute(@Nonnull java.lang.String name, @Nonnull java.lang.String value)
protected void iGenerateAttributesID(ClientBrowser browser, @Nonnull java.lang.StringBuilder buffer)
browser
- buffer
- protected void iGenerateAttributes(ClientBrowser browser, @Nonnull java.lang.StringBuilder buffer)
browser
- buffer
- protected void iGenerateEvents(ClientBrowser browser, java.lang.StringBuilder buffer)
browser
- buffer
- protected void doBuildToolTip(@Nonnull ClientBrowser browser)
browser
- @CheckReturnValue @Nullable protected HTMLComponent iGetComponent(int at)
at
- protected void checkIsContainer()
protected void iAddComponent(@Nullable HTMLComponent component)
component
- protected void iAddComponent(HTMLComponent component, int index) throws java.lang.ArrayIndexOutOfBoundsException
component
- index
- java.lang.ArrayIndexOutOfBoundsException
protected void iRemoveComponent(int at)
at
- @CheckReturnValue protected int iGetComponentCount()
protected void iClear()
protected void iGenerate(@Nonnull ClientBrowser browser, @Nonnull java.lang.StringBuilder buffer)
browser
- The target browserbuffer
- The generate HTML@CheckReturnValue public boolean hasTheme()
@CheckReturnValue @Nonnull public HTMLMutableTheme getMutableTheme()
@CheckReturnValue @Nonnull public HTMLTheme getTheme()
protected void iGenerateComponent(HTMLComponent c, ClientBrowser browser, java.lang.StringBuilder buffer)
c
- browser
- buffer
- @CheckReturnValue protected HTMLStyleSheet getStyleSheet()
protected void copyAttributes(HTMLComponent table)
table
- stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.