public class UIComponentData extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
void |
addJavaAppEventListener(JavaAppEventListener listener)
Adds a listener to handle application events.
|
void |
addListener(UIListener listener) |
protected static StringBuilder |
appendTo(RecordHolder def,
StringBuilder sb) |
static UIComponentData |
create(UIComponent parent,
RecordHolder definition)
Creates component data for a UIComponent.
|
static UIComponentData |
create(UIComponent parent,
RecordHolder definition,
UIComponentScope scope)
Creates component data for a UIComponent.
|
static UIComponentData |
createRoot(LspsScreen screen,
RecordHolder definition,
UIComponentScope scope)
Creates component data for a root UIComponent - the root of the UI component hierarchy.
|
boolean |
equals(Object obj) |
void |
fireUIEvent(UIEvent event)
This method provides LSPS with possibility to fire
UIEvent
directly on component itself. |
ContextWrapper |
getComponentContext()
Returns the execution context in which values of this component should be evaluated and updated.
|
RecordHolder |
getComponentDefinition() |
int |
getComponentDepth()
A distance of this component from the root component.
|
UIComponentFactory |
getComponentFactory()
Equivalent to
getScreen().getContextHolder().getAppConnector().getComponentFactory() |
LspsConverterFactory |
getConverterFactory()
Equivalent to
getScreen().getContextHolder().getAppConnector().getConverterFactory() . |
Variant.RecordVariant |
getDefinition() |
Variant.MapVariant<String,Object> |
getHints()
Returns the presentation hints from the last component refresh.
|
Variant.MapVariant<String,Object> |
getHintsNonnull()
Returns the presentation hints from the last component refresh.
|
SetVariant<RecordHolder> |
getListenerDefinitions()
Returns the value of
UIFieldNames.LISTENERS . |
String |
getLocalizedString(String original,
com.vaadin.ui.Component component)
Returns localized engine string based on the application locale.
|
String |
getModelingId()
Returns the value of the
UIFieldNames.MODELING_ID property. |
UIComponent |
getParent() |
String |
getPath()
Returns a path from the root component to this component, in the form of root / child / child / ...
|
UIComponentScope |
getScope() |
LspsScreen |
getScreen() |
int |
hashCode() |
boolean |
hasListenersOfType(String listenerType)
Checks if this component has listeners of given type listed, in the property.
|
boolean |
isInitializationStarted() |
boolean |
isInitialized() |
boolean |
isInitializing() |
boolean |
isRegistered() |
boolean |
markAfterCreateCalled()
Marks the component as
UIComponentFactoryImpl.afterCreate(UIComponent) -called. |
void |
removeJavaAppEventListener(JavaAppEventListener listener)
Removes a listener of application events.
|
void |
setComponentContext(ContextWrapper context)
Updates the execution context in which values should be evaluated and updated.
|
void |
setHints(Variant.MapVariant<String,Object> hints)
Sets the presentation hints from the last component refresh.
|
void |
setInitialized()
Sets the component to initialized state.
|
void |
setInitializing(boolean initializing)
Updates the initializing flag.
|
void |
setRegistered(boolean registered)
Updates the registered flag.
|
String |
toString() |
void |
updateContext()
Updates context dependent variables for this component.
|
public boolean markAfterCreateCalled()
UIComponentFactoryImpl.afterCreate(UIComponent)
-called.public static UIComponentData create(UIComponent parent, RecordHolder definition)
parent
- the parent, not null.definition
- this component definition, not null.public static UIComponentData createRoot(LspsScreen screen, RecordHolder definition, UIComponentScope scope)
screen
- the screen, not null.definition
- the definition, not null.scope
- the scope, not null.public static UIComponentData create(UIComponent parent, RecordHolder definition, UIComponentScope scope)
parent
- parent component, must not be null. Use createRoot(com.whitestein.lsps.vaadin.LspsScreen, com.whitestein.lsps.lang.exec.RecordHolder, UIComponentScope)
to create definition for the root component.definition
- the definition, not null.scope
- the scope. If null, the scope is inferred from the parent.public RecordHolder getComponentDefinition()
public Variant.RecordVariant getDefinition()
public LspsScreen getScreen()
public int getComponentDepth()
getParent()
is null). Root's children have depth of 1, etc.public ContextWrapper getComponentContext()
LspsScreen.getScreenContext()
e.g. for view model and its children.public UIComponentScope getScope()
public UIComponent getParent()
public boolean isRegistered()
public void setRegistered(boolean registered)
registered
- if true, the component is registered in the screen.public boolean isInitializing()
public boolean isInitialized()
public void setInitialized()
isInitializing()
flag.public boolean isInitializationStarted()
public void setInitializing(boolean initializing)
initializing
- true if the component is currently being initialized.public Variant.MapVariant<String,Object> getHints()
UIComponent.refresh()
,
it may provide null value only if this is some custom component which does not extend ui::UIComponent.present
.public Variant.MapVariant<String,Object> getHintsNonnull()
UIComponent.refresh()
,
it may provide null value only if this is some custom component which does not extend ui::UIComponent.present
.public void setHints(Variant.MapVariant<String,Object> hints)
hints
- hints, not null, must be present.public UIComponentFactory getComponentFactory()
getScreen().getContextHolder().getAppConnector().getComponentFactory()
public LspsConverterFactory getConverterFactory()
getScreen().getContextHolder().getAppConnector().getConverterFactory()
.public String getLocalizedString(String original, com.vaadin.ui.Component component)
getAppConnector().getLocalizer().getLocalizedString(original)
.original
- may be null.component
- used in com.whitestein.lsps.vaadin.ui.LspsLocalizer#getLocalizedString(String, com.whitestein.lsps.vaadin.ui.components.UIComponent)
public void setComponentContext(ContextWrapper context)
context
- the new context, not null.public SetVariant<RecordHolder> getListenerDefinitions()
UIFieldNames.LISTENERS
. Returns an empty set if there are no listeners.protected static StringBuilder appendTo(RecordHolder def, StringBuilder sb)
public final void updateContext()
UIComponentScope.updateContext()
public String getPath()
public String getModelingId()
UIFieldNames.MODELING_ID
property.public boolean hasListenersOfType(String listenerType)
listenerType
- the type of the listener, not null.public void addListener(UIListener listener)
public void addJavaAppEventListener(JavaAppEventListener listener)
listener
- public void removeJavaAppEventListener(JavaAppEventListener listener)
listener
- Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.