Class CollaborationBinderUtil

java.lang.Object
com.vaadin.collaborationengine.CollaborationBinderUtil

public class CollaborationBinderUtil extends Object
Utility methods for CollaborationBinder.
Since:
1.0
Author:
Vaadin Ltd
  • Method Details

    • 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, not null
      propertyName - the name of the property to update, not null
      value - the new value to set, can be null 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, not null
      propertyName - the name of the property bound to the edited field, not null
      user - information of the user to add as the editor of the field, not null
      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, not null
      propertyName - the name of the property bound to the edited field, not null
      user - information of the user to add as the editor of the field, not null
      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, not null
      propertyName - the name of the property bound to the edited field, not null
      user - information of the user to remove from the editors of the field, not null
      See Also: