public class Document extends Object implements EventTarget
This class should not be instantiated directly. The document object is generated during the document load process.
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addCollaboratorJoinedListener(EventHandler<CollaboratorJoinedEvent> handler) |
void |
addCollaboratorLeftListener(EventHandler<CollaboratorLeftEvent> handler) |
void |
addDocumentSaveStateListener(EventHandler<DocumentSaveStateChangedEvent> handler) |
void |
addEventListener(EventType type,
EventHandler<?> handler,
boolean opt_capture)
Adds an event listener to the event target.
|
void |
close()
Closes the document and disconnects from the server.
|
Collaborator[] |
getCollaborators()
Gets an array of collaborators active in this session.
|
Model |
getModel()
Gets the collaborative model associated with this document.
|
void |
removeCollaboratorJoinedListener(EventHandler<CollaboratorJoinedEvent> handler) |
void |
removeCollaboratorLeftListener(EventHandler<CollaboratorLeftEvent> handler) |
void |
removeEventListener(EventType type,
EventHandler<?> handler,
boolean opt_capture)
Removes an event listener from the event target.
|
public void addCollaboratorJoinedListener(EventHandler<CollaboratorJoinedEvent> handler)
public void addCollaboratorLeftListener(EventHandler<CollaboratorLeftEvent> handler)
public void addDocumentSaveStateListener(EventHandler<DocumentSaveStateChangedEvent> handler)
public void addEventListener(EventType type, EventHandler<?> handler, boolean opt_capture)
EventTargetaddEventListener 在接口中 EventTargettype - The type of the event to listen for.handler - The function to handle the event. The handler can also be an object that
implements the handleEvent method which takes the event object as argument.opt_capture - In DOM-compliant browsers, this determines whether the listener is fired
during the capture or bubble phase of the event.public void close()
DocumentClosedError. Calling this function after the
document has been closed will have no effect.public Collaborator[] getCollaborators()
public Model getModel()
public void removeCollaboratorJoinedListener(EventHandler<CollaboratorJoinedEvent> handler)
public void removeCollaboratorLeftListener(EventHandler<CollaboratorLeftEvent> handler)
public void removeEventListener(EventType type, EventHandler<?> handler, boolean opt_capture)
EventTargetremoveEventListener 在接口中 EventTargettype - The type of the event to listen for.handler - The function to handle the event. The handler can also be an object that
implements the handleEvent method which takes the event object as argument.opt_capture - In DOM-compliant browsers, this determines whether the listener is fired
during the capture or bubble phase of the event.Copyright © 2013. All Rights Reserved.