org.eclipse.xtext.ui.editor.autoedit
Class SingleLineTerminalsStrategy
java.lang.Object
org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategy
org.eclipse.xtext.ui.editor.autoedit.AbstractTerminalsEditStrategy
org.eclipse.xtext.ui.editor.autoedit.SingleLineTerminalsStrategy
- All Implemented Interfaces:
- java.util.EventListener, org.eclipse.jface.text.IAutoEditStrategy, org.eclipse.swt.custom.VerifyKeyListener, org.eclipse.swt.internal.SWTEventListener
public class SingleLineTerminalsStrategy
- extends AbstractTerminalsEditStrategy
This strategies automatically inserts the closing terminal when the opening terminal is typed. It also deletes both
when the opening terminal is deleted. When the closing terminal is typed before the already existing closing
terminals, the cursor is just moved.
This strategy can be used together with MultiLineTerminalsEditStrategy
- Author:
- Sven Efftinge - Initial contribution and API
Method Summary |
protected java.lang.String |
appliedText(org.eclipse.jface.text.IDocument document,
org.eclipse.jface.text.DocumentCommand command)
|
protected void |
handleDeletion(org.eclipse.jface.text.IDocument document,
org.eclipse.jface.text.DocumentCommand command)
|
protected void |
handleInsertLeftTerminal(org.eclipse.jface.text.IDocument document,
org.eclipse.jface.text.DocumentCommand command)
|
protected void |
handleInsertRightTerminal(org.eclipse.jface.text.IDocument document,
org.eclipse.jface.text.DocumentCommand command)
|
protected void |
internalCustomizeDocumentCommand(org.eclipse.jface.text.IDocument document,
org.eclipse.jface.text.DocumentCommand command)
|
protected boolean |
isInsertClosingTerminal(org.eclipse.jface.text.IDocument document,
int i)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT
public static SingleLineTerminalsStrategy.StrategyPredicate DEFAULT
SingleLineTerminalsStrategy
public SingleLineTerminalsStrategy(java.lang.String left,
java.lang.String right,
SingleLineTerminalsStrategy.StrategyPredicate strategy)
internalCustomizeDocumentCommand
protected void internalCustomizeDocumentCommand(org.eclipse.jface.text.IDocument document,
org.eclipse.jface.text.DocumentCommand command)
throws org.eclipse.jface.text.BadLocationException
- Specified by:
internalCustomizeDocumentCommand
in class AbstractEditStrategy
- Throws:
org.eclipse.jface.text.BadLocationException
handleInsertLeftTerminal
protected void handleInsertLeftTerminal(org.eclipse.jface.text.IDocument document,
org.eclipse.jface.text.DocumentCommand command)
throws org.eclipse.jface.text.BadLocationException
- Throws:
org.eclipse.jface.text.BadLocationException
isInsertClosingTerminal
protected boolean isInsertClosingTerminal(org.eclipse.jface.text.IDocument document,
int i)
appliedText
protected java.lang.String appliedText(org.eclipse.jface.text.IDocument document,
org.eclipse.jface.text.DocumentCommand command)
throws org.eclipse.jface.text.BadLocationException
- Throws:
org.eclipse.jface.text.BadLocationException
handleDeletion
protected void handleDeletion(org.eclipse.jface.text.IDocument document,
org.eclipse.jface.text.DocumentCommand command)
throws org.eclipse.jface.text.BadLocationException
- Throws:
org.eclipse.jface.text.BadLocationException
handleInsertRightTerminal
protected void handleInsertRightTerminal(org.eclipse.jface.text.IDocument document,
org.eclipse.jface.text.DocumentCommand command)
throws org.eclipse.jface.text.BadLocationException
- Throws:
org.eclipse.jface.text.BadLocationException