Class CollaborationBinderUtil
- java.lang.Object
-
- com.vaadin.collaborationengine.CollaborationBinderUtil
-
public class CollaborationBinderUtil extends Object
Utility methods forCollaborationBinder
.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addEditor(TopicConnection topicConnection, String propertyName, UserInfo user)
Signals that the user is currently editing the field that is bound to the property.static void
addEditor(TopicConnection topicConnection, String propertyName, UserInfo user, int fieldIndex)
Signals that the user is currently editing the field that is bound to the property.static void
removeEditor(TopicConnection topicConnection, String propertyName, UserInfo user)
Signals that the user is not editing the field that is bound to the property.static void
setFieldValue(TopicConnection topicConnection, String propertyName, Object value)
Sets the property value in the collaboration binders connected to the same topic, updating the fields which are bound to that property for all connected clients.
-
-
-
Method Detail
-
setFieldValue
public static void setFieldValue(TopicConnection topicConnection, String propertyName, Object value)
Sets the property value in the collaboration binders connected to the same topic, updating the fields which are bound to that property for all connected clients.The collaboration binder already takes care of propagating field value changes among collaborating users. This method may be useful when the data changes outside a UI thread, and the new values should be made visible to the users.
- Parameters:
topicConnection
- the topic connection, notnull
propertyName
- the name of the property to update, notnull
value
- the new value to set, can benull
to clear the fields- Since:
- 1.0
-
addEditor
public static void addEditor(TopicConnection topicConnection, String propertyName, UserInfo user)
Signals that the user is currently editing the field that is bound to the property. This is indicated to the collaborating users by highlighting the field.If the user is already an editor of the field, this method does nothing.
The collaboration binder already takes care of updating the active editors when users focus the fields. This method is needed only if you need to explicitly control the users who are displayed as the active editors.
- Parameters:
topicConnection
- the topic connection, notnull
propertyName
- the name of the property bound to the edited field, notnull
user
- information of the user to add as the editor of the field, notnull
- Since:
- 1.0
-
addEditor
public static void addEditor(TopicConnection topicConnection, String propertyName, UserInfo user, int fieldIndex)
Signals that the user is currently editing the field that is bound to the property. This is indicated to the collaborating users by highlighting the field.If the user is already an editor of the field, this method does nothing.
The collaboration binder already takes care of updating the active editors when users focus the fields. This method is needed only if you need to explicitly control the users who are displayed as the active editors.
- Parameters:
topicConnection
- the topic connection, notnull
propertyName
- the name of the property bound to the edited field, notnull
user
- information of the user to add as the editor of the field, notnull
fieldIndex
- index of the focused element inside the field, for example a radio button inside a radio button group- Since:
- 1.0
-
removeEditor
public static void removeEditor(TopicConnection topicConnection, String propertyName, UserInfo user)
Signals that the user is not editing the field that is bound to the property.If the user is currently not an editor of the field, this method does nothing.
The collaboration binder already takes care of updating the active editors when users focus the fields. This method is needed only if you need to explicitly control the users who are displayed as the active editors.
- Parameters:
topicConnection
- the topic connection, notnull
propertyName
- the name of the property bound to the edited field, notnull
user
- information of the user to remove from the editors of the field, notnull
- See Also:
addEditor(TopicConnection, String, UserInfo)
-
-