org.eclipse.xtext.ui.editor.autoedit
Class ShortCutEditStrategy
java.lang.Object
org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategy
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ShortCutEditStrategy
public ShortCutEditStrategy()
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:
- 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)
- Specified by:
verifyKey
in interface org.eclipse.swt.custom.VerifyKeyListener
- Overrides:
verifyKey
in class AbstractEditStrategy
- Parameters:
event
- the verify event- See Also:
VerifyEvent