public static class ChatRoomView.ViewModel extends Entity
A reference view model for the ChatRoomView. You do NOT need to use this class
for your view model as long as your own view model includes at least properties
with the messagesTag
and inputBufferTag
.
Modifier and Type | Class and Description |
---|---|
static class |
ChatRoomView.ViewModel.ChatMessages
A list of chat messages
|
static class |
ChatRoomView.ViewModel.Participants
A list of participants in a chat room.
|
Modifier and Type | Field and Description |
---|---|
static StringProperty |
inputBuffer
InputBuffer property, which is bound to the text field for entering
messages.
|
static Tag |
inputBufferTag
Tag used to mark the "input buffer" property on an entity.
|
static ListProperty |
messages
Messages property, which contains a list of chat messages to display
in the chat room.
|
static Tag |
messagesTag
Tag used to mark the "messages" property of an entity.
|
static ListProperty |
participants
Participants property, which contains a list of participants in this chat room.
|
static Tag |
participantsTag
Tag used to mark the "participants" property of an entity.
|
Constructor and Description |
---|
ViewModel() |
Modifier and Type | Method and Description |
---|---|
ChatRoomView.ViewModel |
addMessages(Entity... entities)
Adds chat messages to the chat room.
|
ChatRoomView.ViewModel |
addParticipants(Entity... entities)
Adds participants to the chat room.
|
String |
getInputBuffer()
Gets the input buffer string.
|
ChatRoomView.ViewModel.ChatMessages |
getMessages()
Gets the chat messages in this room.
|
ChatRoomView.ViewModel.Participants |
getParticipants()
Gets the participants.
|
ChatRoomView.ViewModel |
inputBuffer(String string)
Sets the contents of the input buffer property.
|
ChatRoomView.ViewModel |
removeMessages(Entity... entities)
Removes chat messages from the chat room.
|
ChatRoomView.ViewModel |
removeParticipants(Entity... entities) |
addPropertyChangeListener, addPropertyChangeListener, clearChanged, createImageToFile, createImageToFile, createImageToFile, createImageToFile, createImageToFile, createImageToFile, createImageToFile, createImageToFile, createImageToStorage, createImageToStorage, createImageToStorage, createImageToStorage, createImageToStorage, createImageToStorage, createImageToStorage, createImageToStorage, findProperty, firePropertyChangeEvent, get, get, get, getAggregate, getBoolean, getBoolean, getDate, getDate, getEntity, getEntity, getEntityList, getEntityList, getEntityType, getText, getText, isEmpty, isEmpty, isEntity, isEntity, isFalsey, isFalsey, removePropertyChangeListener, removePropertyChangeListener, set, set, set, set, setBoolean, setBoolean, setBoolean, setChanged, setDate, setDate, setDate, setDouble, setDouble, setDouble, setEntity, setEntity, setEntity, setEntityType, setFloat, setFloat, setFloat, setInt, setInt, setInt, setText, setText, setText
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
public static StringProperty inputBuffer
InputBuffer property, which is bound to the text field for entering messages.
inputBufferTag
public static ListProperty messages
Messages property, which contains a list of chat messages to display
in the chat room. See ChatBubbleView.ViewModel
for a reference
implementation of an entity that can be used as the model for a chat message,
and description of which tags a custom entity must implement to be used
as a chat message view model.
messagesTag
,
ChatBubbleView.ViewModel
public static ListProperty participants
Participants property, which contains a list of participants in this chat room.
Individual participants can be any entity type that implements the Thing#name
tag.
public static final Tag inputBufferTag
Tag used to mark the "input buffer" property on an entity. This is the one required tag for an entity that you want to use as a view model for a ChatRoomView.
public static final Tag participantsTag
Tag used to mark the "participants" property of an entity. This is an optional tag. If present, the ChatRoomView will be able to display avatars of the chatroom’s participants in the header.
public static final Tag messagesTag
Tag used to mark the "messages" property of an entity. This is a required
tag, and the property that is tagged with this should be an entity list
containing "chat message" entities. See ChatBubbleView.ViewModel
for a
reference implementation of a chat message entity, and instructions on using
your own custom entities for chat messages.
public ChatRoomView.ViewModel inputBuffer(String string)
Sets the contents of the input buffer property. The input buffer property is bound to the text field that allows the user to enter text messages.
string
- public ChatRoomView.ViewModel addMessages(Entity... entities)
Adds chat messages to the chat room.
entities
- "Chat message" entities to add. See ChatBubbleView.ViewModel
for a
reference implementation of a "chat message" entity, and instructions on using custom entities
as "chat messages".public ChatRoomView.ViewModel removeMessages(Entity... entities)
Removes chat messages from the chat room.
entities
- "Chat message" entities to add. See ChatBubbleView.ViewModel
for a
reference implementation of a "chat message" entity, and instructions on using custom entities
as "chat messages".public ChatRoomView.ViewModel addParticipants(Entity... entities)
Adds participants to the chat room. Individual participants can be any entity type that implements the Thing#name
tag.
entities
- Participants to add. These can be any entity with a property tagged with Thing#name
.public ChatRoomView.ViewModel removeParticipants(Entity... entities)
public String getInputBuffer()
Gets the input buffer string.
public ChatRoomView.ViewModel.Participants getParticipants()
Gets the participants. Individual participants can be any entity type that implements the Thing#name
tag.
public ChatRoomView.ViewModel.ChatMessages getMessages()
Gets the chat messages in this room. See ChatBubbleView.ViewModel
for a
reference implementation of a "chat message" entity, and instructions on using custom entities
as "chat messages".