|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.view.LyComponent
public abstract class LyComponent
This class implements the generic behavior of the classes of the viewer package. LyComponents are created when parsing the XML tree describing the graphical objects that must be shown to the user. LyComponent implements LyActionTransmitter methods, but the interface is NOT declared. Inherited classes just have to indicate that they implement this interface to benefit from transmission features.
Nested Class Summary | |
---|---|
static class |
LyComponent.EventType
Type of events available on abstract components. |
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
static int |
_nbComponents
|
static boolean |
INIT_RESOURCE_ID
Boolean used for activating the search for id based If set to false, the initForId method for a component won't be called. |
static java.lang.String |
INTERNAL_ID_SEP
Separator used in internal ids. |
static boolean |
REWRITING_MODE
Boolean used for activating raw XML writing of components This boolean inhibits attributes initialization from properties and initFromModel. |
static java.lang.String |
SEP_ID
Id for sep components. |
Constructor Summary | |
---|---|
LyComponent()
Default constructor. |
Method Summary | ||
---|---|---|
static void |
addComponent(LyComponent component)
Method to register a component in the association table. |
|
void |
addData(java.lang.String name,
java.lang.String value)
Add data to this component. |
|
void |
addEventFunction(LyComponent.EventType eventType,
java.lang.String function)
Add a function to the list of functions that must be called for a given event type. |
|
void |
clearChildrenBounds()
Clears the content of the internal cache containing sub components sizes and positions. |
|
abstract LyComponent |
cloneComponent()
Method for cloning a component. |
|
void |
free()
Free this component. |
|
void |
freeze(boolean status)
Freeze or unfreeze current view. |
|
int[] |
getBounds(LyComponent parentComponent)
Returns the position and size of current component relatively to given component. |
|
LyComponent |
getChild(int i)
Returns child component of index i. |
|
int |
getChildCount()
Returns child component count. |
|
LyComponent |
getChildFromCache(java.lang.String id)
Add the given id / component from child cache. |
|
int[] |
getChildrenBounds(LyComponent childrenComponent)
Returns the position and size of given sub component relatively to current component. |
|
LyComponent |
getComponent(java.lang.String id)
Retrieve a node from a view by its id. |
|
LyComponent |
getComponent(java.lang.String id,
boolean skipCurrent)
Retrieve a node from a view by its id. |
|
LyComponent |
getComponent(java.lang.String id,
boolean skipCurrent,
boolean useInternalId)
Retrieve a node from a view by its id. |
|
LyComponent |
getComponent(java.lang.String id,
java.lang.Class<?> componentClass)
Retrieve a node from a view by its id. |
|
void |
getComponent(java.lang.String id,
java.util.Vector<LyComponent> result)
Retrieve nodes from a view by their ids. |
|
LyComponent |
getComponentAt(int[] position,
int hMargin,
int vMargin)
Returns the component at given position with an error margin. |
|
|
getComponentAt(int[] position,
int hMargin,
int vMargin,
java.lang.Class<T> componentClass)
Returns the component at given position with an error margin. |
|
static LyComponent |
getComponentByInternalId(java.lang.String internalId)
Method used to get a component by its internal id. |
|
LyComponent |
getComponentByLabel(java.lang.String label)
Retrieve a node from a view. |
|
|
getComponents(java.lang.Class<T> compClass,
java.util.Vector<T> result)
Retrieve nodes from a view by their class. |
|
LyComponent |
getComponentWithModel(LyComponent model)
Retrieve a child component from a model. |
|
java.lang.String |
getData(java.lang.String name)
Get data corresponding to the given data name. |
|
java.util.Hashtable<java.lang.String,java.lang.String> |
getDatas()
Gets datas. |
|
LyEnvironment |
getEnvironment()
Returns the component environment. |
|
java.lang.String |
getEventFunctions(LyComponent.EventType eventType,
char sep)
Return the list of functions that must be called for a given event type. |
|
java.lang.String |
getId()
Gets component id (may be null). |
|
java.lang.String |
getIdCode()
Internal code used as identifier for web components. |
|
java.lang.String |
getInternalId()
Returns the internal id of this component (may be null). |
|
LyViewComponent |
getInternalView()
Internal view implementation. |
|
LyViewComponent |
getInternalView(boolean build)
Get internal view implementation. |
|
java.lang.Object |
getLock()
Get a lock to prevent concurrent access Returns the one provided by the internal view implementation, otherwise returns this. |
|
LyComponent |
getModel()
Gets model of this component. |
|
LyComponent |
getParent()
Get parent component. |
|
LyArea |
getParentArea()
Retrieve closest area that contains this component. |
|
LyForm |
getParentForm()
Retrieve closest form that contains this component. |
|
java.lang.String |
getParentFormFieldId()
Retrieve closest formField id that contains this component. |
|
LySplitter |
getParentSplitter()
Retrieve closest splitter that contains this component. |
|
LySplitter |
getParentSplitter(LyComponent topComponent)
Retrieve closest splitter that contains this component. |
|
LyTab |
getParentTab()
Retrieve closest tab that contains this component. |
|
LyTab |
getParentTab(LyComponent topComponent)
Retrieve closest tab that contains this component. |
|
LyTabs |
getParentTabs()
Retrieve closest tabs that contains this component. |
|
LyTabs |
getParentTabs(LyComponent topComponent)
Retrieve closest tabs that contains this component. |
|
LyView |
getParentView()
Retrieve closest frame or dialog that contains this component. |
|
java.lang.String |
getRootController()
Retrieves controller id for the component. |
|
LySetVisibleInterface |
getSetVisibleParent()
Retrieve closest parent that implements the LySetVisibleInterface interface. |
|
java.lang.String |
getTag()
Gets tag name corresponding to this component. |
|
LyViewManager |
getViewManager()
Gets current view manager. |
|
boolean |
isFreed()
Checks if this component was freed. |
|
boolean |
isFreeing()
Checks if this component is freeing. |
|
void |
registerChildrenBounds()
Registers in the internal cache position ans size of all sub components of current component. |
|
static void |
removeComponent(LyComponent component)
Method to remove a component from the association table. |
|
void |
reset()
Reset this component. |
|
void |
resetChildrenCache()
Empty children cache. |
|
void |
resetEventFunctions(LyComponent.EventType eventType)
Remove all the functionc to the list of functions that must be called for a given event type, even the generic ones. |
|
void |
setDatas(java.util.Hashtable<java.lang.String,java.lang.String> datas)
Sets datas. |
|
void |
setInternalView(LyViewComponent viewComponent)
Reserved for internal use, do not use. |
|
void |
setVisible(boolean status)
Shows or hides the component/node. |
|
boolean |
useEventDefaultFunction(LyComponent.EventType eventType)
Indicates whether the default Leonardi function must be called for the given type of event. |
|
void |
writeXml(java.io.PrintWriter pw)
Write XML description corresponding to this component. |
|
abstract void |
writeXml(java.io.PrintWriter pw,
boolean debug)
Write XML description corresponding to this component. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
public static final java.lang.String SEP_ID
public static boolean REWRITING_MODE
public static boolean INIT_RESOURCE_ID
public static java.lang.String INTERNAL_ID_SEP
public static int _nbComponents
Constructor Detail |
---|
public LyComponent()
Method Detail |
---|
public static void addComponent(LyComponent component)
public static LyComponent getComponentByInternalId(java.lang.String internalId)
public static void removeComponent(LyComponent component)
public abstract LyComponent cloneComponent()
public java.lang.String getInternalId()
public java.lang.String getTag()
public java.lang.String getId()
public java.lang.String getIdCode()
public LyEnvironment getEnvironment()
public final LyViewManager getViewManager()
public final LyComponent getComponent(java.lang.String id)
id
- unique id of the node in the view.
public LyComponent getComponent(java.lang.String id, java.lang.Class<?> componentClass)
id
- unique id of the node in the view.componentClass
- expected class
public final LyComponent getComponent(java.lang.String id, boolean skipCurrent)
id
- unique id of the node in the view.
public LyComponent getComponent(java.lang.String id, boolean skipCurrent, boolean useInternalId)
id
- unique id of the node in the view.skipCurrent
- indicates whether current component must be tested or not.useInternalId
- indicates whether internal identifiers may be used to retrieve node
with given id.
public void getComponent(java.lang.String id, java.util.Vector<LyComponent> result)
id
- id of the nodes in the view.result
- The vector containing all the components which match the id.public <T> void getComponents(java.lang.Class<T> compClass, java.util.Vector<T> result)
compClass
- class of the nodes in the view.result
- The vector containing all the components which belongs to the given class.public LyComponent getComponentByLabel(java.lang.String label)
label
- label of the node in the view.
public LyComponent getComponentWithModel(LyComponent model)
model
- Model of the searched component.
public final LyViewComponent getInternalView()
public LyViewComponent getInternalView(boolean build)
build
- Indicates if this representation should be built if it doesn't exist.public void setInternalView(LyViewComponent viewComponent)
public LyComponent getChild(int i)
i
- index of component to get.
public int getChildCount()
public final LyComponent getParent()
public final LyComponent getModel()
public int[] getBounds(LyComponent parentComponent)
parentComponent
- the component used to compute relative position of current
component. If null, position of current component is computed with
the top-left corner of the screen as the origin.
public int[] getChildrenBounds(LyComponent childrenComponent)
childrenComponent
- the sub component whose relative position must be returned.
public void registerChildrenBounds()
public void clearChildrenBounds()
public final LyComponent getComponentAt(int[] position, int hMargin, int vMargin)
position
- the position of the component we want to retrieve.hMargin
- the horizontal margin used to retrieve component at given position.vMargin
- the vertical margin used to retrieve component at given position.
public <T extends LyComponent> T getComponentAt(int[] position, int hMargin, int vMargin, java.lang.Class<T> componentClass)
position
- the position of the component we want to retrieve.hMargin
- the horizontal margin used to retrieve component at given position.vMargin
- the vertical margin used to retrieve component at given position.componentClass
- expected class
public void resetChildrenCache()
public LyComponent getChildFromCache(java.lang.String id)
id
- to search in local cache.
public java.lang.String getRootController()
public final void writeXml(java.io.PrintWriter pw)
pw
- Print writer where the description is written.public abstract void writeXml(java.io.PrintWriter pw, boolean debug)
pw
- Print writer where the description is written.debug
- True if debug mode (full dump includinf optional ids and references of
controllers).public LySetVisibleInterface getSetVisibleParent()
public LyView getParentView()
public LyArea getParentArea()
public LyForm getParentForm()
public final LyTabs getParentTabs()
public LyTabs getParentTabs(LyComponent topComponent)
topComponent
- limit of the search
public final LySplitter getParentSplitter()
public LySplitter getParentSplitter(LyComponent topComponent)
topComponent
- limit of the search
public final LyTab getParentTab()
public LyTab getParentTab(LyComponent topComponent)
topComponent
- limit of the search
public java.lang.String getParentFormFieldId()
public void reset()
public void free()
public final boolean isFreeing()
public final boolean isFreed()
public void setVisible(boolean status)
status
- new visibility statusLySetVisibleInterface.setVisible(boolean)
public void freeze(boolean status)
status
- indicates whether current view must be frozen or not.public java.lang.Object getLock()
public void setDatas(java.util.Hashtable<java.lang.String,java.lang.String> datas)
datas
- Datas of the component.public final java.lang.String getData(java.lang.String name)
name
- Name of the data.
public final java.util.Hashtable<java.lang.String,java.lang.String> getDatas()
public void addData(java.lang.String name, java.lang.String value)
name
- Name of the data.value
- Value of the data.public void addEventFunction(LyComponent.EventType eventType, java.lang.String function)
EventType.FOCUS_LOST
and the
"CheckValue()"
parameters with the web viewer will call the CheckValue()
Javascript function when focus will be lost on current component.
eventType
- the type of event that will call the functionfunction
- the function to be called by the eventpublic void resetEventFunctions(LyComponent.EventType eventType)
eventType
- the type of event that will call the functionpublic boolean useEventDefaultFunction(LyComponent.EventType eventType)
eventType
- the type of event (see EventType enum)
public java.lang.String getEventFunctions(LyComponent.EventType eventType, char sep)
eventType
- the type of event that will call the functionsep
- the separator used to concatenate the function names
sep
character or an
empty string if no additional function has been set for this type of event.
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |