Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.editor.internal.IEditorAPI Interface Reference
Inheritance diagram for de.fu_berlin.inf.dpp.editor.internal.IEditorAPI:
de.fu_berlin.inf.dpp.editor.internal.EditorAPI

List of all members.

Public Member Functions

IEditorPart openEditor (SPath path)
IEditorPart openEditor (SPath path, boolean activate)
boolean openEditor (IEditorPart part)
void closeEditor (IEditorPart part)
IEditorPart getActiveEditor ()
ITextSelection getSelection (IEditorPart editorPart)
SPath getEditorPath (IEditorPart editorPart)
ILineRange getViewport (IEditorPart editorPart)
void setEditable (IEditorPart editorPart, boolean editable)
SPath getActiveEditorPath ()
IResource getEditorResource (IEditorPart editorPart)
IDocumentProvider getDocumentProvider (IEditorInput input)
IDocument getDocument (IEditorPart editorPart)

Detailed Description

A humble interface that is responsible for editor functionality. The idea behind this interface is to only capsulates the least possible amount of functionality - the one that can't be easily tested. All higher logic can be found in EditorManager.

Author:
rdjemili

Member Function Documentation

void de.fu_berlin.inf.dpp.editor.internal.IEditorAPI.closeEditor ( IEditorPart  part)

Closes the given editorpart.

Needs to be called from an UI thread.

Implemented in de.fu_berlin.inf.dpp.editor.internal.EditorAPI.

IEditorPart de.fu_berlin.inf.dpp.editor.internal.IEditorAPI.getActiveEditor ( )
Returns:
the editor that is currently activated.

Implemented in de.fu_berlin.inf.dpp.editor.internal.EditorAPI.

SPath de.fu_berlin.inf.dpp.editor.internal.IEditorAPI.getActiveEditorPath ( )

Syntactic sugar for getting the path of the IEditorPart returned by getActiveEditor()

Implemented in de.fu_berlin.inf.dpp.editor.internal.EditorAPI.

IDocument de.fu_berlin.inf.dpp.editor.internal.IEditorAPI.getDocument ( IEditorPart  editorPart)

Returns the document for the given editor part.

Parameters:
editorParteditor part to retrieve the document
Returns:
the document for the given editor part
IDocumentProvider de.fu_berlin.inf.dpp.editor.internal.IEditorAPI.getDocumentProvider ( IEditorInput  input)

Returns the IDocumentProvider of the given IEditorInput. This method analyzes the file extension of the IFile associated with the given IEditorInput. Depending on the file extension it returns file-types responsible IDocumentProvider.

Parameters:
inputthe IEditorInput for which IDocumentProvider is needed
Returns:
IDocumentProvider of the given input
SPath de.fu_berlin.inf.dpp.editor.internal.IEditorAPI.getEditorPath ( IEditorPart  editorPart)
Returns:
the path of the file the given editor is displaying or null if the given editor is not showing a file or the file is not referenced via a path in the project.

Implemented in de.fu_berlin.inf.dpp.editor.internal.EditorAPI.

IResource de.fu_berlin.inf.dpp.editor.internal.IEditorAPI.getEditorResource ( IEditorPart  editorPart)

Returns the resource currently displayed in the given editorPart.

Returns:
Can be null, e.g. if the given editorPart is not operating on a resource, or has several resources.

Implemented in de.fu_berlin.inf.dpp.editor.internal.EditorAPI.

ITextSelection de.fu_berlin.inf.dpp.editor.internal.IEditorAPI.getSelection ( IEditorPart  editorPart)

Returns the current text selection for given editor.

Parameters:
editorPartthe editorPart for which to get the text selection.
Returns:
the current text selection. Returns TextSelection#emptySelection() if no text selection exists.

Implemented in de.fu_berlin.inf.dpp.editor.internal.EditorAPI.

ILineRange de.fu_berlin.inf.dpp.editor.internal.IEditorAPI.getViewport ( IEditorPart  editorPart)
Returns:
Return the viewport for given editor or null, if this editorPart does not have ITextViewer associated.

Implemented in de.fu_berlin.inf.dpp.editor.internal.EditorAPI.

boolean de.fu_berlin.inf.dpp.editor.internal.IEditorAPI.openEditor ( IEditorPart  part)

Opens the given editor part.

Needs to be called from an UI thread.

Returns:
true if the editor part was successfully opened, false otherwise

Implemented in de.fu_berlin.inf.dpp.editor.internal.EditorAPI.

IEditorPart de.fu_berlin.inf.dpp.editor.internal.IEditorAPI.openEditor ( SPath  path,
boolean  activate 
)

Opens the editor with given path. Needs to be called from an UI thread.

Parameters:
activatetrue, if editor should get focus, otherwise false
Returns:
the opened editor or null if the editor couldn't be opened.

Implemented in de.fu_berlin.inf.dpp.editor.internal.EditorAPI.

IEditorPart de.fu_berlin.inf.dpp.editor.internal.IEditorAPI.openEditor ( SPath  path)

Opens the editor with given path. Needs to be called from an UI thread.

Returns:
the opened editor or null if the editor couldn't be opened.

Implemented in de.fu_berlin.inf.dpp.editor.internal.EditorAPI.

void de.fu_berlin.inf.dpp.editor.internal.IEditorAPI.setEditable ( IEditorPart  editorPart,
boolean  editable 
)

Enables/disables the ability to edit the document in given editor.

 All Classes Namespaces Files Functions Variables Enumerations