org.eclipse.xtext.ui.editor.autoedit
Class AbstractTerminalsEditStrategy

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategy
      extended by org.eclipse.xtext.ui.editor.autoedit.AbstractTerminalsEditStrategy
All Implemented Interfaces:
java.util.EventListener, org.eclipse.jface.text.IAutoEditStrategy, org.eclipse.swt.custom.VerifyKeyListener, org.eclipse.swt.internal.SWTEventListener
Direct Known Subclasses:
MultiLineTerminalsEditStrategy, SingleLineTerminalsStrategy

public abstract class AbstractTerminalsEditStrategy
extends AbstractEditStrategy

Author:
Sven Efftinge - Initial contribution and API

Field Summary
protected  DocumentUtil util
           
 
Fields inherited from class org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategy
debug, DEBUG
 
Constructor Summary
AbstractTerminalsEditStrategy(java.lang.String leftTerminal, java.lang.String rightTerminal)
           
 
Method Summary
protected  boolean allowsEqualTerminals()
           
protected  org.eclipse.jface.text.IRegion findStartTerminal(org.eclipse.jface.text.IDocument document, int offset)
          finds the first stop terminal which has not been started after the cursor position.
protected  org.eclipse.jface.text.IRegion findStopTerminal(org.eclipse.jface.text.IDocument document, int offset)
          finds the first start terminal which is not closed before the cursor position.
protected  DocumentUtil getDocumentUtil()
           
 java.lang.String getLeftTerminal()
           
 java.lang.String getRightTerminal()
           
 void setDocumentUtil(DocumentUtil util)
           
 
Methods inherited from class org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategy
count, customizeDocumentCommand, getDocumentContent, handleBadLocationException, internalCustomizeDocumentCommand, isIdentifierPart, verifyKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

util

@Inject
protected DocumentUtil util
Constructor Detail

AbstractTerminalsEditStrategy

public AbstractTerminalsEditStrategy(java.lang.String leftTerminal,
                                     java.lang.String rightTerminal)
Method Detail

setDocumentUtil

public void setDocumentUtil(DocumentUtil util)

getLeftTerminal

public java.lang.String getLeftTerminal()

getRightTerminal

public java.lang.String getRightTerminal()

allowsEqualTerminals

protected boolean allowsEqualTerminals()

getDocumentUtil

protected DocumentUtil getDocumentUtil()

findStopTerminal

protected org.eclipse.jface.text.IRegion findStopTerminal(org.eclipse.jface.text.IDocument document,
                                                          int offset)
                                                   throws org.eclipse.jface.text.BadLocationException
finds the first start terminal which is not closed before the cursor position.

Throws:
org.eclipse.jface.text.BadLocationException

findStartTerminal

protected org.eclipse.jface.text.IRegion findStartTerminal(org.eclipse.jface.text.IDocument document,
                                                           int offset)
                                                    throws org.eclipse.jface.text.BadLocationException
finds the first stop terminal which has not been started after the cursor position.

Throws:
org.eclipse.jface.text.BadLocationException