Class 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 Detail

      • offsetHelper

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

      • AbstractBslAddAnnotationCommentHandler

        public AbstractBslAddAnnotationCommentHandler()
    • Method Detail

      • createAnnotationComment

        public static org.eclipse.xtext.util.Pair<Integer,​String> createAnnotationComment​(Module module,
                                                                                                org.eclipse.emf.ecore.EObject annotatedObject,
                                                                                                String commentContent,
                                                                                                BslProposalProvider proposalProvider,
                                                                                                org.eclipse.jface.text.IDocument document)
        Creates annotation comment content and computes the offset of position for inserting comment
        Parameters:
        module - module, 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
        document - actual IDocument for inserting comment, 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