public class HandlyXtextEditorCallback
extends org.eclipse.xtext.ui.editor.IXtextEditorCallback.NullImpl
Multiple Xtext editor instances may simultaneously be open for a given source file, each with its own underlying document, but only one of them (the most recently used one) is connected to the source file's working copy.
Note that this class relies on a language-specific implementation of
IInputElementProvider
being available through injection.
Also, HandlyXtextDocument
and other classes pertaining to
Handly/Xtext integration should be bound if this callback is configured.
For example:
public Class<? extends IInputElementProvider> bindIInputElementProvider() { return FooInputElementProvider.class; } public void configureXtextEditorCallback(Binder binder) { binder.bind(IXtextEditorCallback.class).annotatedWith(Names.named( HandlyXtextEditorCallback.class.getName())).to( HandlyXtextEditorCallback.class); } public Class<? extends XtextDocument> bindXtextDocument() { return HandlyXtextDocument.class; } public Class<? extends IReconciler> bindIReconciler() { return HandlyXtextReconciler.class; } public Class<? extends DirtyStateEditorSupport> bindDirtyStateEditorSupport() { return HandlyDirtyStateEditorSupport.class; // or its subclass }
Constructor and Description |
---|
HandlyXtextEditorCallback() |
Modifier and Type | Method and Description |
---|---|
protected ISourceFile |
acquireWorkingCopy(org.eclipse.xtext.ui.editor.XtextEditor editor) |
void |
afterCreatePartControl(org.eclipse.xtext.ui.editor.XtextEditor editor) |
protected void |
afterSelectionChange(org.eclipse.xtext.ui.editor.XtextEditor editor,
org.eclipse.jface.viewers.ISelection selection) |
void |
afterSetInput(org.eclipse.xtext.ui.editor.XtextEditor editor) |
void |
beforeDispose(org.eclipse.xtext.ui.editor.XtextEditor editor) |
void |
beforeSetInput(org.eclipse.xtext.ui.editor.XtextEditor editor) |
protected ISourceFile |
getSourceFile(org.eclipse.xtext.ui.editor.XtextEditor editor) |
protected ISourceFile |
getWorkingCopy(org.eclipse.xtext.ui.editor.XtextEditor editor) |
protected void |
releaseWorkingCopy(org.eclipse.xtext.ui.editor.XtextEditor editor,
ISourceFile workingCopy) |
protected void |
setHighlightRange(org.eclipse.xtext.ui.editor.XtextEditor editor,
org.eclipse.jface.viewers.ISelection selection) |
void |
setInputElementProvider(IInputElementProvider provider) |
@Inject public void setInputElementProvider(IInputElementProvider provider)
public void afterCreatePartControl(org.eclipse.xtext.ui.editor.XtextEditor editor)
afterCreatePartControl
in interface org.eclipse.xtext.ui.editor.IXtextEditorCallback
afterCreatePartControl
in class org.eclipse.xtext.ui.editor.IXtextEditorCallback.NullImpl
public void beforeDispose(org.eclipse.xtext.ui.editor.XtextEditor editor)
beforeDispose
in interface org.eclipse.xtext.ui.editor.IXtextEditorCallback
beforeDispose
in class org.eclipse.xtext.ui.editor.IXtextEditorCallback.NullImpl
public void beforeSetInput(org.eclipse.xtext.ui.editor.XtextEditor editor)
beforeSetInput
in interface org.eclipse.xtext.ui.editor.IXtextEditorCallback
beforeSetInput
in class org.eclipse.xtext.ui.editor.IXtextEditorCallback.NullImpl
public void afterSetInput(org.eclipse.xtext.ui.editor.XtextEditor editor)
afterSetInput
in interface org.eclipse.xtext.ui.editor.IXtextEditorCallback
afterSetInput
in class org.eclipse.xtext.ui.editor.IXtextEditorCallback.NullImpl
protected void afterSelectionChange(org.eclipse.xtext.ui.editor.XtextEditor editor, org.eclipse.jface.viewers.ISelection selection)
protected void setHighlightRange(org.eclipse.xtext.ui.editor.XtextEditor editor, org.eclipse.jface.viewers.ISelection selection)
protected ISourceFile getSourceFile(org.eclipse.xtext.ui.editor.XtextEditor editor)
protected final ISourceFile getWorkingCopy(org.eclipse.xtext.ui.editor.XtextEditor editor)
protected ISourceFile acquireWorkingCopy(org.eclipse.xtext.ui.editor.XtextEditor editor) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
protected void releaseWorkingCopy(org.eclipse.xtext.ui.editor.XtextEditor editor, ISourceFile workingCopy)