org.eclipse.ocl.examples.xtext.console.xtfo
Class EmbeddedXtextEditor

java.lang.Object
  extended by org.eclipse.ocl.examples.xtext.console.xtfo.EmbeddedXtextEditor

public class EmbeddedXtextEditor
extends java.lang.Object


Constructor Summary
EmbeddedXtextEditor(org.eclipse.swt.widgets.Composite control, com.google.inject.Injector injector)
          Creates a new EmbeddedXtextEditor.
EmbeddedXtextEditor(org.eclipse.swt.widgets.Composite control, com.google.inject.Injector injector, int style)
          Creates a new EmbeddedXtextEditor.
 
Method Summary
protected  org.eclipse.jface.text.source.IVerticalRulerColumn createAnnotationRulerColumn(org.eclipse.jface.text.source.CompositeRuler ruler)
          Creates the annotation ruler column.
protected  org.eclipse.xtext.resource.XtextResource createResource()
           
 org.eclipse.swt.widgets.Composite getControl()
           
 org.eclipse.xtext.ui.editor.model.IXtextDocument getDocument()
           
 org.eclipse.xtext.resource.XtextResource getResource()
           
 org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
           
 org.eclipse.xtext.ui.editor.XtextSourceViewer getViewer()
           
protected  void setText(org.eclipse.xtext.ui.editor.model.XtextDocument document, java.lang.String text)
          Should be called only once, during initialization.
 void update(java.lang.String text)
          Updates the text of this editor with the given String
protected  void updateAction(org.eclipse.jface.action.IAction action)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedXtextEditor

public EmbeddedXtextEditor(org.eclipse.swt.widgets.Composite control,
                           com.google.inject.Injector injector,
                           int style)
Creates a new EmbeddedXtextEditor. It must have the SWT.V_SCROLL style at least not to throw NPE when computing overview ruler.

Parameters:
control - the parent composite that will contain the editor
injector - the Guice injector to get Xtext configuration elements
style - the SWT style of the SourceViewer of this editor.

EmbeddedXtextEditor

public EmbeddedXtextEditor(org.eclipse.swt.widgets.Composite control,
                           com.google.inject.Injector injector)
Creates a new EmbeddedXtextEditor. Equivalent to EmbeddedXtextEditor(control, injector, job, fileExtension, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);

Parameters:
control - the parent composite that will contain the editor
injector - the Guice injector to get Xtext configuration elements
Method Detail

getControl

public org.eclipse.swt.widgets.Composite getControl()

getViewer

public org.eclipse.xtext.ui.editor.XtextSourceViewer getViewer()

getResource

public org.eclipse.xtext.resource.XtextResource getResource()

getDocument

public org.eclipse.xtext.ui.editor.model.IXtextDocument getDocument()

setText

protected void setText(org.eclipse.xtext.ui.editor.model.XtextDocument document,
                       java.lang.String text)
Should be called only once, during initialization. Then, you should call update(String);


createAnnotationRulerColumn

protected org.eclipse.jface.text.source.IVerticalRulerColumn createAnnotationRulerColumn(org.eclipse.jface.text.source.CompositeRuler ruler)
Creates the annotation ruler column. Subclasses may re-implement or extend.

Parameters:
ruler - the composite ruler that the column will be added
Returns:
an annotation ruler column
Since:
3.2

update

public void update(java.lang.String text)
Updates the text of this editor with the given String

Parameters:
text -

updateAction

protected void updateAction(org.eclipse.jface.action.IAction action)

createResource

protected org.eclipse.xtext.resource.XtextResource createResource()

getResourceSet

public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()