Saros
Distributed Collaborative Editing and Distributed Party Programming
|
Public Member Functions | |
LocationAnnotationManager (IPreferenceStore preferenceStore) | |
void | propertyChange (final PropertyChangeEvent event, final Set< IEditorPart > allEditors) |
void | setViewportForUser (final User user, IEditorPart editorPart, ILineRange lineRange) |
void | clearViewportForUser (final User user, IEditorPart editorPart) |
void | setSelection (IEditorPart editorPart, ITextSelection selection, User source) |
void | clearSelectionForUser (final User user, IEditorPart editorPart) |
This class is responsible for managing annotations related with other users' locations, i.e. their cursors, selections, and viewports.
de.fu_berlin.inf.dpp.editor.internal.LocationAnnotationManager.LocationAnnotationManager | ( | IPreferenceStore | preferenceStore | ) |
void de.fu_berlin.inf.dpp.editor.internal.LocationAnnotationManager.clearSelectionForUser | ( | final User | user, |
IEditorPart | editorPart | ||
) |
Removes all selection-related annotations of a user inside the given IEditorPart.
user | The originator of the annotations to be deleted. |
editorPart |
void de.fu_berlin.inf.dpp.editor.internal.LocationAnnotationManager.clearViewportForUser | ( | final User | user, |
IEditorPart | editorPart | ||
) |
Remove any existing viewport-related annotations of a user that might exist inside the given IEditorPart.
user | |
editorPart |
void de.fu_berlin.inf.dpp.editor.internal.LocationAnnotationManager.propertyChange | ( | final PropertyChangeEvent | event, |
final Set< IEditorPart > | allEditors | ||
) |
Listens for changes to the preferences whether to show SelectionFillUpAnnotations.
In principle, this class could also listen to preference changes directly. But since we want to remove existing annotations when the option is disabled, and this class doesn't have access to all open editors, we leave the actual listening to a class that does.
event | |
allEditors |
void de.fu_berlin.inf.dpp.editor.internal.LocationAnnotationManager.setSelection | ( | IEditorPart | editorPart, |
ITextSelection | selection, | ||
User | source | ||
) |
Create or update annotations related to text selections made by remote users.
Such selections consist of a highlight (one character wide, if there is no actual text selection) and a vertical line that resembles the local text cursor. If the selection includes multiple lines an additional element will be created to highlight the space between a line's last character and the right margin.
source | The remote user who made the text selection (or to whom the text cursor belongs). |
selection | The selection itself. |
editorPart | IEditorPart that displays the opened document of which the annotations should be updated. |
void de.fu_berlin.inf.dpp.editor.internal.LocationAnnotationManager.setViewportForUser | ( | final User | user, |
IEditorPart | editorPart, | ||
ILineRange | lineRange | ||
) |
Create or update the annotations that represent a user's viewport (visible lines of code).
user | The remote user whose viewport should be visualized. |
editorPart | The IEditorPart which shows the file that the remote user has opened, too. |
lineRange | The ILineRange that is visible to the remote user. |