Class AbstractBslSpecCopyPasteHandler

  • All Implemented Interfaces:
    org.eclipse.core.commands.IHandler, org.eclipse.core.commands.IHandler2
    Direct Known Subclasses:
    BslSpecCopyHandler, BslSpecCutHandler, BslSpecPasteHandler

    public abstract class AbstractBslSpecCopyPasteHandler
    extends org.eclipse.core.commands.AbstractHandler
    Abstract handler for processing special operation - copy, cut and paste, for StringLiteral in Built-in language
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void copyToClipboard​(org.eclipse.jface.text.ITextSelection selection, boolean delete, org.eclipse.jface.text.source.SourceViewer viewer)
      Copy text from selection to the clipboard
      protected boolean isStringLiteralContext​(org.eclipse.jface.text.IDocument document, org.eclipse.swt.graphics.Point selectRange)
      Checks that selected range in the editor corresponding to the body of the StringLiteral
      protected String transformCopyText​(String copyText)
      Transfroms text deleting symbols "|" from it
      • 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 interface org.eclipse.core.commands.IHandler

        execute
    • Constructor Detail

      • AbstractBslSpecCopyPasteHandler

        public AbstractBslSpecCopyPasteHandler()
    • Method Detail

      • isStringLiteralContext

        protected boolean isStringLiteralContext​(org.eclipse.jface.text.IDocument document,
                                                 org.eclipse.swt.graphics.Point selectRange)
        Checks that selected range in the editor corresponding to the body of the StringLiteral
        Parameters:
        selectRange - checking selected range, cannot be null
        Returns:
        true if selected range in the editor corresponding to the body of the StringLiteral, false otherwise
      • transformCopyText

        protected String transformCopyText​(String copyText)
        Transfroms text deleting symbols "|" from it
        Parameters:
        copyText - transforming text, can't be null
        Returns:
        transformed text without symbols "|", never null
      • copyToClipboard

        protected void copyToClipboard​(org.eclipse.jface.text.ITextSelection selection,
                                       boolean delete,
                                       org.eclipse.jface.text.source.SourceViewer viewer)
        Copy text from selection to the clipboard
        Parameters:
        selection - actual ITextSelection for copying text, cannot be null
        delete - true if text should be deleted after copying, false copying without deleting
        viewer - actual SourceViewer for copying, cannot be null