Class AbstractBslAddAnnotationCommentHandler

java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
com._1c.g5.v8.dt.bsl.ui.menu.AbstractBslAddAnnotationCommentHandler
All Implemented Interfaces:
org.eclipse.core.commands.IHandler, org.eclipse.core.commands.IHandler2
Direct Known Subclasses:
BslAddQlAnnotationCommentHandler, BslAddWarningAnnotationCommentHandler

public abstract class AbstractBslAddAnnotationCommentHandler extends org.eclipse.core.commands.AbstractHandler
Abstract handler listener for generate annotated comments
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.eclipse.xtext.resource.EObjectAtOffsetHelper
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.eclipse.xtext.util.Pair<Integer,String>
    createAnnotationComment(org.eclipse.xtext.ui.editor.model.IXtextDocument document, org.eclipse.emf.ecore.EObject annotatedObject, String commentContent, BslProposalProvider proposalProvider)
    Creates annotation comment content and computes the offset of position for inserting comment
    execute(org.eclipse.core.commands.ExecutionEvent event)
     
    protected abstract String
    Gets annotation comment content

    Methods inherited from class org.eclipse.core.commands.AbstractHandler

    addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabled

    Methods inherited from class org.eclipse.core.commands.common.EventManager

    addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • proposalProvider

      protected BslProposalProvider proposalProvider
    • offsetHelper

      protected org.eclipse.xtext.resource.EObjectAtOffsetHelper offsetHelper
  • Constructor Details

    • AbstractBslAddAnnotationCommentHandler

      public AbstractBslAddAnnotationCommentHandler()
  • Method Details

    • createAnnotationComment

      public static org.eclipse.xtext.util.Pair<Integer,String> createAnnotationComment(org.eclipse.xtext.ui.editor.model.IXtextDocument document, org.eclipse.emf.ecore.EObject annotatedObject, String commentContent, BslProposalProvider proposalProvider)
      Creates annotation comment content and computes the offset of position for inserting comment
      Parameters:
      document - actual IXtextDocument for inserting comment, can't be null
      annotatedObject - Bsl langugage semantic object, can be null
      commentContent - content of the comment for generating, can't be null
      proposalProvider - actual BslProposalProvider, can't be null
      Returns:
      pair of comment content and offset of position for inserting comment or null if annotatedObject is null
    • execute

      public Object execute(org.eclipse.core.commands.ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException
      Throws:
      org.eclipse.core.commands.ExecutionException
    • getCommentContent

      protected abstract String getCommentContent()
      Gets annotation comment content
      Returns:
      comment content, can't be null