org.eclipse.xtext.ui.editor.embedded
Class EmbeddedEditor

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.embedded.EmbeddedEditor

public class EmbeddedEditor
extends java.lang.Object

Handle for an embedded Xtext editor. It allows to initialize the edited model and provides accessors for the document, the source viewer configuration, and the viewer.

Since:
2.2
Author:
Sebastian Zarnekow - Initial contribution and API
This class is not intended to be instantiated by clients.
This class is not intended to be instantiated by clients.

Constructor Summary
EmbeddedEditor(XtextDocument document, XtextSourceViewer viewer, XtextSourceViewerConfiguration configuration, IEditedResourceProvider resourceProvider, java.lang.Runnable afterSetDocumet)
           
 
Method Summary
 EmbeddedEditorModelAccess createPartialEditor()
          Obtain the model access for this editor instance.
 EmbeddedEditorModelAccess createPartialEditor(boolean insertLinebreaks)
          Obtain the model access for this editor instance.
 EmbeddedEditorModelAccess createPartialEditor(java.lang.String prefix, java.lang.String editablePart, java.lang.String suffix, boolean insertLineBreaks)
          Obtain the model access for this editor instance.
 XtextSourceViewerConfiguration getConfiguration()
           
 XtextDocument getDocument()
           
 XtextSourceViewer getViewer()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedEditor

public EmbeddedEditor(XtextDocument document,
                      XtextSourceViewer viewer,
                      XtextSourceViewerConfiguration configuration,
                      IEditedResourceProvider resourceProvider,
                      java.lang.Runnable afterSetDocumet)
Method Detail

getViewer

public XtextSourceViewer getViewer()

getDocument

public XtextDocument getDocument()

getConfiguration

public XtextSourceViewerConfiguration getConfiguration()

createPartialEditor

public EmbeddedEditorModelAccess createPartialEditor(java.lang.String prefix,
                                                     java.lang.String editablePart,
                                                     java.lang.String suffix,
                                                     boolean insertLineBreaks)
Obtain the model access for this editor instance. It can be used to query the currently edited text or update it externally. The prefix and the suffix will not be visible in the editor. It is possible to insert artificial line-breaks between the three parts (prefix, editablePart, suffix).

Returns:
the model access. Never null.

createPartialEditor

public EmbeddedEditorModelAccess createPartialEditor(boolean insertLinebreaks)
Obtain the model access for this editor instance. It can be used to query the currently edited text or update it externally. This is a shortcut for createPartialEditor("", "", "", insertLinebreaks).

Returns:
the model access. Never null.

createPartialEditor

public EmbeddedEditorModelAccess createPartialEditor()
Obtain the model access for this editor instance. It can be used to query the currently edited text or update it externally. This is a shortcut for createPartialEditor("", "", "", false).

Returns:
the model access. Never null.