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

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategy
      extended by org.eclipse.xtext.ui.editor.autoedit.ShortCutEditStrategy
All Implemented Interfaces:
java.util.EventListener, org.eclipse.jface.text.IAutoEditStrategy, org.eclipse.swt.custom.VerifyKeyListener, org.eclipse.swt.internal.SWTEventListener, ISourceViewerAware

public class ShortCutEditStrategy
extends AbstractEditStrategy
implements ISourceViewerAware

A simple IAutoEditStrategy for shortcuts. Replaces the given shortcut by the given replacement.

Author:
Sven Efftinge - Initial contribution and API

Field Summary
 
Fields inherited from class org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategy
debug, DEBUG
 
Constructor Summary
ShortCutEditStrategy()
           
 
Method Summary
 ShortCutEditStrategy configure(java.lang.String shortcut, java.lang.String replacement)
           
protected  void internalCustomizeDocumentCommand(org.eclipse.jface.text.IDocument document, org.eclipse.jface.text.DocumentCommand command)
           
 void setSourceViewer(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
 void verifyKey(org.eclipse.swt.events.VerifyEvent event)
          The following event fields are used: event.character is the character that was typed (input) event.keyCode is the key code that was typed (input) event.stateMask is the state of the keyboard (input) event.doit is processed or not (output)
 
Methods inherited from class org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategy
count, customizeDocumentCommand, getDocumentContent, handleBadLocationException, isIdentifierPart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShortCutEditStrategy

public ShortCutEditStrategy()
Method Detail

configure

public ShortCutEditStrategy configure(java.lang.String shortcut,
                                      java.lang.String replacement)

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

setSourceViewer

public void setSourceViewer(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
Specified by:
setSourceViewer in interface ISourceViewerAware

verifyKey

public void verifyKey(org.eclipse.swt.events.VerifyEvent event)
Description copied from interface: org.eclipse.swt.custom.VerifyKeyListener
The following event fields are used:

Specified by:
verifyKey in interface org.eclipse.swt.custom.VerifyKeyListener
Overrides:
verifyKey in class AbstractEditStrategy
Parameters:
event - the verify event
See Also:
VerifyEvent