Class InitialPropertiesHandler
- java.lang.Object
-
- com.vaadin.client.InitialPropertiesHandler
-
public class InitialPropertiesHandler extends Object
Handles server initial property values with the purpose to prevent change their values from the client side.Initial property values have to be set from the server side. Client side may have default values which override server side values and those values are sent to the server (overriding server side values). This class prevents this. Only properties that have not been set form the server are sent from the client to the server. Properties that have been set from the server overrides any client side default value.
- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
StateTree.sendNodePropertySyncToServer(MapProperty)
-
-
Constructor Summary
Constructors Constructor Description InitialPropertiesHandler(Registry registry)Creates a new instance connected to the given registry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflushPropertyUpdates()Flushes collected property update queue (requested to be sent from the client to the server).booleanhandlePropertyUpdate(MapProperty property)Handlespropertyupdate request before it's sent to the server via RPC.voidnodeRegistered(StateNode node)Notifies the handler about registered node.
-
-
-
Constructor Detail
-
InitialPropertiesHandler
public InitialPropertiesHandler(Registry registry)
Creates a new instance connected to the given registry.- Parameters:
registry- the global registry
-
-
Method Detail
-
flushPropertyUpdates
public void flushPropertyUpdates()
Flushes collected property update queue (requested to be sent from the client to the server).Supposed to be called in the end of
TreeChangeProcessorchanges processing.
-
nodeRegistered
public void nodeRegistered(StateNode node)
Notifies the handler about registered node.The method is called for the newly created
nodewhich is registered in theStateTree.- Parameters:
node- the registered node
-
handlePropertyUpdate
public boolean handlePropertyUpdate(MapProperty property)
Handlespropertyupdate request before it's sent to the server via RPC.The method returns
truefor thepropertywhich shouldn't be sent to the server because it's going to be handled by the handler (queued and sent later on if allowed).- Parameters:
property- property to handle- Returns:
trueif property is handled by the handler,falseotherwise
-
-