Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.editor.internal.LocationAnnotationManager Class Reference

List of all members.

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)

Detailed Description

This class is responsible for managing annotations related with other users' locations, i.e. their cursors, selections, and viewports.


Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.editor.internal.LocationAnnotationManager.LocationAnnotationManager ( IPreferenceStore  preferenceStore)

Member Function Documentation

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.

Parameters:
userThe 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.

Parameters:
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.

Parameters:
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.

Parameters:
sourceThe remote user who made the text selection (or to whom the text cursor belongs).
selectionThe selection itself.
editorPartIEditorPart 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).

Parameters:
userThe remote user whose viewport should be visualized.
editorPartThe IEditorPart which shows the file that the remote user has opened, too.
lineRangeThe ILineRange that is visible to the remote user.
 All Classes Namespaces Files Functions Variables Enumerations