com.raelity.jvi.swing
Class OpsBase
java.lang.Object
com.raelity.jvi.swing.OpsBase
- All Implemented Interfaces:
- TextOps
public class OpsBase
- extends Object
- implements TextOps
This provides default swings JEditorPane actions that are
used by vi.
Usually xop(int)
is overridden for the environment.
When overridden, the superclass should be invoked if given an
unrecognized op.
This implementation simply uses actions from the editor kit.
The action names are taken from the default editor kit.
The action map is built as needd, so if the same instance is used with
different editors which have different actions, curious results could
ensue.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
textView
protected ViTextView textView
event
protected OpsBase.ReusableEvent event
actionMap
protected static Map<String,Action> actionMap
OpsBase
public OpsBase(ViTextView textView)
- Creates a new instance of OpsBase
init
public void init(JEditorPane editorPane)
- Specified by:
init
in interface TextOps
xact
public void xact(Action action)
- Specified by:
xact
in interface TextOps
xact
public void xact(Action action,
String s)
- Specified by:
xact
in interface TextOps
xop
public void xop(int op,
String s)
- Specified by:
xop
in interface TextOps
xact
public void xact(String actionName)
- Specified by:
xact
in interface TextOps
xop
public void xop(int op)
- Try to do something useful with the op.
- Specified by:
xop
in interface TextOps
xact
protected void xact(String actionName,
String cmd)
findAction
protected Action findAction(String actionName)