Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager Class Reference
Inheritance diagram for de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager:
de.fu_berlin.inf.dpp.session.IActivityConsumer

List of all members.

Classes

class  RemoteEditor
class  RemoteEditorState

Public Member Functions

 RemoteEditorManager (ISarosSession sarosSession)
RemoteEditorState getEditorState (User user)
void exec (IActivity activity)
TextSelection getSelection (User user)
LineRange getViewport (User user)
void removeUser (User participant)
List< UsergetRemoteOpenEditorUsers (SPath path)
List< UsergetRemoteActiveEditorUsers (SPath path)
Set< SPathgetRemoteOpenEditors ()
Set< SPathgetRemoteActiveEditors ()
Set< SPathgetRemoteOpenEditors (User user)
RemoteEditor getRemoteActiveEditor (User user)
boolean isRemoteActiveEditorShared (User user)

Protected Attributes

Map< User, RemoteEditorState > editorStates = new HashMap<User, RemoteEditorState>()
ISarosSession sarosSession

Detailed Description

This class contains the state of the editors, viewports and selections of all remote users as we believe it to be by listening to the Activities we receive.


Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager.RemoteEditorManager ( ISarosSession  sarosSession)

Member Function Documentation

void de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager.exec ( IActivity  activity)

Executes the given activity.

Implementations may expect that this method is called from the UI thread (EDT).

Implements de.fu_berlin.inf.dpp.session.IActivityConsumer.

RemoteEditorState de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager.getEditorState ( User  user)
RemoteEditor de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager.getRemoteActiveEditor ( User  user)

Returns the active Editor which is currently open by the given user of this shared session (i.e. not our own).

Returns:
the active RemoteEditor or null if the given user has no editor open.
Set<SPath> de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager.getRemoteActiveEditors ( )

Returns a set of all paths representing the editors which are currently opened and active by the remote users of this shared session (i.e. not our own).

Returns:
set of all active remote editors
List<User> de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager.getRemoteActiveEditorUsers ( SPath  path)
Set<SPath> de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager.getRemoteOpenEditors ( )

Returns a set of all paths representing the editors which are currently opened by the remote users of this shared session (i.e. not our own).

If no editors are opened an empty set is being returned.

Set<SPath> de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager.getRemoteOpenEditors ( User  user)

Returns a snapshot copy of all paths representing the editors which are currently opened by the given user of this shared session (i.e. not our own).

If no editors are opened by the given user an empty set is being returned.

List<User> de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager.getRemoteOpenEditorUsers ( SPath  path)
TextSelection de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager.getSelection ( User  user)

Returns the selection of the given user in the currently active editor or null if the user has no active editor or no selection in the active editor.

LineRange de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager.getViewport ( User  user)
Returns:
the viewport of the given user in the currently active editor or null if the user has no active editor.
boolean de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager.isRemoteActiveEditorShared ( User  user)

Checks if the active editor of the given user is part of the Saros session, or not. Convenience method for calling getEditorState(user).getActiveEditor() != null.

Returns:
true, if the currently active remote editor of the given user is shared via the Saros session, false otherwise.
void de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager.removeUser ( User  participant)

Clears all state information associated with the given user.


Member Data Documentation

Map<User, RemoteEditorState> de.fu_berlin.inf.dpp.core.editor.RemoteEditorManager.editorStates = new HashMap<User, RemoteEditorState>() [protected]
 All Classes Namespaces Files Functions Variables Enumerations