Class CustomHandlyXtextEditorCallback

  • All Implemented Interfaces:
    org.eclipse.xtext.ui.editor.IXtextEditorCallback

    @Singleton
    public class CustomHandlyXtextEditorCallback
    extends org.eclipse.xtext.ui.editor.IXtextEditorCallback.NullImpl
    Integrates Xtext editor with Handly working copy management facility.

    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 void configureXtextEditorCallback(Binder binder) {
         binder.bind(IXtextEditorCallback.class).annotatedWith(Names.named(
             HandlyXtextEditorCallback.class.getName())).to(
                 CustomHandlyXtextEditorCallback.class);
     }
    
     
    • Constructor Detail

      • CustomHandlyXtextEditorCallback

        public CustomHandlyXtextEditorCallback()
    • Method Detail

      • setInputElementProvider

        @Inject
        public void setInputElementProvider​(org.eclipse.handly.ui.IInputElementProvider provider)
      • afterCreatePartControl

        public void afterCreatePartControl​(org.eclipse.xtext.ui.editor.XtextEditor editor)
        Specified by:
        afterCreatePartControl in interface org.eclipse.xtext.ui.editor.IXtextEditorCallback
        Overrides:
        afterCreatePartControl in class org.eclipse.xtext.ui.editor.IXtextEditorCallback.NullImpl
      • beforeDispose

        public void beforeDispose​(org.eclipse.xtext.ui.editor.XtextEditor editor)
        Specified by:
        beforeDispose in interface org.eclipse.xtext.ui.editor.IXtextEditorCallback
        Overrides:
        beforeDispose in class org.eclipse.xtext.ui.editor.IXtextEditorCallback.NullImpl
      • beforeSetInput

        public void beforeSetInput​(org.eclipse.xtext.ui.editor.XtextEditor editor)
        Specified by:
        beforeSetInput in interface org.eclipse.xtext.ui.editor.IXtextEditorCallback
        Overrides:
        beforeSetInput in class org.eclipse.xtext.ui.editor.IXtextEditorCallback.NullImpl
      • afterSetInput

        public void afterSetInput​(org.eclipse.xtext.ui.editor.XtextEditor editor)
        Specified by:
        afterSetInput in interface org.eclipse.xtext.ui.editor.IXtextEditorCallback
        Overrides:
        afterSetInput in class org.eclipse.xtext.ui.editor.IXtextEditorCallback.NullImpl