public class UIScreen extends AbstractScreen
ui
module.Modifier and Type | Field and Description |
---|---|
Map<Variant.RecordVariant,UIPopup> |
dynamicPopups
INTERNAL API.
|
Constructor and Description |
---|
UIScreen(LspsContextHolder contextHolder,
RecordHolder uiDefinition,
Serializable uiState)
Full constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addComponentToRefresh(UIComponent component)
Schedules a component to be refreshed during next call to
LspsScreen.triggerEventProcessing(com.whitestein.lsps.vaadin.ui.events.UIEvent) . |
protected void |
addErrorMessagesToComponents(Map<UIComponent,List<String>> errorMessages)
Displays error messages on components.
|
void |
addEventToQueue(UIEvent uiEvent,
UIListener uiListener)
INTERNAL API, do no use
|
void |
addPersistAction(UIPersistAction persistAction)
Marks the screen for persisting.
|
void |
addUploadedBinaryData(long binaryDataId)
Adds a temporary file to the list of files to be deleted once the screen is closed.
|
void |
addViewModelAction(UIViewModelAction viewModelAction)
INTERNAL API, do no use
|
void |
cleanup()
Removes temporary files.
|
protected void |
clearErrorMessages()
Clears validation messages from all components.
|
UIComponent |
createUIComponent(UIComponent parent,
RecordHolder componentDefinition,
UIComponentScope scope)
Creates a Vaadin component based on the provided component definition.
|
void |
fireApplicationEvent(UIApplicationEvent appEvent)
Schedules given application event to be fired on all registered components that have an application event listener.
|
void |
fireBrowserWindowResizeEvent(Dimension dimension)
A browser window resize has been detected.
|
LspsContextHolder |
getContextHolder()
Returns the owner of the LSPS context for which this screen is rendered.
|
protected int |
getMaxProcessingIterations()
Maximum number of iterations of event queue processing.
|
UIComponentScope |
getRootScope()
Returns the root scope.
|
ContextWrapper |
getScreenContext()
Returns the associated execution context.
|
UIComponent |
getTopmostComponent()
Returns the topmost component.
|
Set<ValueHolder> |
getValuesToRetain()
Returns the set of value holders that should not be garbage collected
even if they are not referenced from any variables in the model.
|
ViewModelMerger |
getViewModelMerger()
INTERNAL API
|
boolean |
isInvalid(UIComponent component)
Checks whether given component is marked as invalid, by calling
LspsScreen.markComponentAsInvalid(com.whitestein.lsps.vaadin.ui.components.UIComponent) . |
boolean |
isProcessing()
Returns
true if the screen is processing events. |
protected Map<UIComponent,List<String>> |
mapErrorsToComponents(LspsFormConnector.ValidationErrors validationErrors,
Bindings bindings)
Maps given validation errors to component.
|
void |
markComponentAsInvalid(UIComponent component)
Marks the component as invalid.
|
void |
markComponentAsValid(UIComponent component)
Marks the component as valid again.
|
void |
markForCloseForm() |
void |
markForSave()
Marks the screen for save.
|
void |
markForSubmit()
Marks the screen for submission.
|
void |
navigateTo(RecordHolder navigateTo) |
protected UIEventQueue |
newEventQueue() |
void |
persist()
INTERNAL API, DO NOT USE.
|
void |
registerUIComponent(UIComponent component)
Register the given UI component and its children in this screen.
|
void |
registerValueToRetain(Handle handle)
Registers the value for the given handle as one to be kept during garbage collection.
|
ContextWrapper |
registerViewModel(Variant.RecordVariant viewModel,
ContextWrapper parent)
INTERNAL API, do not use
|
com.vaadin.ui.Component |
render()
Called when the screen content should be added to the Vaadin UI.
|
void |
resume()
Called after the screen component has been added to Vaadin UI.
|
void |
setNavigationAction(UINavigateAction action)
Sets the navigation.
|
void |
showValidationErrors(LspsFormConnector.ValidationErrors errors)
INTERNAL API
|
boolean |
triggerEventProcessing(UIEvent triggeringEvent)
Process all events in the queue - invokes standard LSPS ui lifecycle
|
void |
unregisterUIComponent(UIComponent component)
Unregister the given UI component and its children from this screen.
|
void |
unregisterValueToRetain(Handle handle)
Unregisters the value for the given handle as one to be kept during garbage collection.
|
void |
updateContextFor(UIComponentData componentData)
Updates context dependent variables for the given
componentData . |
getAllComponents, getComponentsForDefinition
public final Map<Variant.RecordVariant,UIPopup> dynamicPopups
public UIScreen(LspsContextHolder contextHolder, RecordHolder uiDefinition, Serializable uiState)
contextHolder
- uiDefinition
- uiState
- protected int getMaxProcessingIterations()
protected UIEventQueue newEventQueue()
public UIComponent getTopmostComponent()
LspsScreen
public void persist() throws LspsException
LspsException
public com.vaadin.ui.Component render()
LspsScreen
LspsScreen.resume()
method is called after this method.
This method must be called exactly once.public void resume()
LspsScreen
LspsScreen.render()
method has already been calledpublic void cleanup()
public Set<ValueHolder> getValuesToRetain()
LspsScreen
public LspsContextHolder getContextHolder()
public ContextWrapper getScreenContext()
public UIComponentScope getRootScope()
LspsScreen
public void addUploadedBinaryData(long binaryDataId)
binaryDataId
- public void fireApplicationEvent(UIApplicationEvent appEvent)
triggerEventProcessing(com.whitestein.lsps.vaadin.ui.events.UIEvent)
is called.appEvent
- the event, not null.public void fireBrowserWindowResizeEvent(Dimension dimension)
LspsScreen
internal_windowresize
, having payload
of type hu::Dimension which
holds new window dimension. The event originator component is set to ROOT.
Warning: browsers on Android return value in DPs instead of pixels. From Android documentation:
Density-independent Pixels - an abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi screen, so one dp is one pixel on a 160 dpi screen.
The ratio of dp-to-pixel will change with the screen density, but not necessarily in direct proportion. Example: a screen width of 720 on a 320 DPI screen will be reported as 360 DPs.
Therefore, to render special page for small devices, compare screen width to the value of 400. If equal or smaller, provide small screen version.dimension
- the new dimension, in pixels (on desktop OS) or DPs (on Android phones).public UIComponent createUIComponent(UIComponent parent, RecordHolder componentDefinition, UIComponentScope scope)
LspsScreen
UIComponentFactory.createComponent(LspsScreen, com.whitestein.lsps.vaadin.ui.components.UIComponent, com.whitestein.lsps.lang.exec.RecordHolder, com.whitestein.lsps.vaadin.ui.UIComponentScope)
.parent
- parent of the component in the LSPS component hierarchycomponentDefinition
- definition of the component to createscope
- component scope; if null, same scope as parent will be usedpublic void markForSubmit()
public void markForSave()
public void markForCloseForm()
public void addPersistAction(UIPersistAction persistAction)
persistAction
- public void setNavigationAction(UINavigateAction action)
action
- public void navigateTo(RecordHolder navigateTo)
public void markComponentAsInvalid(UIComponent component)
LspsScreen
LspsScreen.triggerEventProcessing(com.whitestein.lsps.vaadin.ui.events.UIEvent)
to return false for events which
processes given component.
Note that this will not cause the component to show an error icon.component
- the component, not null.public void markComponentAsValid(UIComponent component)
LspsScreen
component
- the component, not null.public void addComponentToRefresh(UIComponent component)
LspsScreen
LspsScreen.triggerEventProcessing(com.whitestein.lsps.vaadin.ui.events.UIEvent)
.component
- the component, not null. The component must be initialized.public void addViewModelAction(UIViewModelAction viewModelAction)
viewModelAction
- public void addEventToQueue(UIEvent uiEvent, UIListener uiListener)
uiEvent
- not null.uiListener
- not null.public boolean isProcessing()
true
if the screen is processing events.true
if the screen is processing eventstriggerEventProcessing(UIEvent)
public boolean triggerEventProcessing(UIEvent triggeringEvent)
LspsScreen
triggeringEvent
- the event that triggered this round of processing; can be null if there is no such event.LspsScreen.markComponentAsInvalid(com.whitestein.lsps.vaadin.ui.components.UIComponent)
.public void showValidationErrors(LspsFormConnector.ValidationErrors errors)
errors
- protected void clearErrorMessages()
protected Map<UIComponent,List<String>> mapErrorsToComponents(LspsFormConnector.ValidationErrors validationErrors, Bindings bindings)
UIComponentFactory.mapErrorsToComponents(com.whitestein.lsps.vaadin.LspsScreen, com.whitestein.lsps.vaadin.LspsFormConnector.ValidationErrors, Bindings)
validationErrors
- bindings
- protected void addErrorMessagesToComponents(Map<UIComponent,List<String>> errorMessages)
UIComponentFactory.addErrorMessagesToComponents(Map)
.errorMessages
- public ContextWrapper registerViewModel(Variant.RecordVariant viewModel, ContextWrapper parent)
viewModel
- parent
- public void registerValueToRetain(Handle handle)
LspsScreen
LspsScreen.getValuesToRetain()
.handle
- a handle to the model object, not null.public void unregisterValueToRetain(Handle handle)
LspsScreen
LspsScreen.getValuesToRetain()
.handle
- a handle to the model object, not null.public void registerUIComponent(UIComponent component)
LspsScreen
component
- not null. The component parent must already be registered.public void unregisterUIComponent(UIComponent component)
LspsScreen
component
- not null. The component parent must already be registered.public boolean isInvalid(UIComponent component)
LspsScreen
LspsScreen.markComponentAsInvalid(com.whitestein.lsps.vaadin.ui.components.UIComponent)
.component
- the component, not null.LspsScreen.markComponentAsValid(com.whitestein.lsps.vaadin.ui.components.UIComponent)
.public void updateContextFor(UIComponentData componentData)
LspsScreen
componentData
. See UIComponentScope.updateContext()
.componentData
- a component data, may not be null
public ViewModelMerger getViewModelMerger()
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.