Constructor and Description |
---|
Note(String text,
StyleDesc style)
JSON-driven constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
edit(User from,
OptString text,
StyleDesc style)
Message handler for the 'edit' message.
|
JSONLiteral |
encode(EncodeControl control)
Encode this mod for transmission or persistence.
|
attachTo, clone, context, ensureHolding, ensureInContext, ensureReachable, ensureSameContext, ensureSameUser, holder, isEphemeral, markAsChanged, markAsEphemeral, object
@JSONMethod(value={"text","style"}) public Note(String text, StyleDesc style)
text
- The text of this note.style
- How its text is to be displayed.public JSONLiteral encode(EncodeControl control)
@JSONMethod(value={"text","?style"}) public void edit(User from, OptString text, StyleDesc style) throws MessageHandlerException
This message is a request from a client to change the text of this note or one or more of its style attributes. If the change is successful, a corresponding 'edit' message is broadcast to the context.
recv: { to:REF, op:"edit", text:optSTR,
style:optSTYLE }
send: { to:REF, op:"edit", text:optSTR,
style:optSTYLE }
from
- The user who sent the message.text
- New text string value (optional).style
- New style information (optional).MessageHandlerException
- if 'from' is not in the same context as
this mod or if invalid style information is provided.Copyright © 2017. All rights reserved.