位于org.eclipse.ui.workbenck.texteditor_3.2.0v20060605-1400.jar包的
org.eclipse.ui.texteditor.AbstractTextEditor.class中。
2569行开始
直观上感觉这段代码是想支持鼠标手势的
/* gestures commented out until proper solution (i.e. preference page) can be found
* for bug # 28417:
*
final Map gestureMap= new HashMap();
gestureMap.put("E", "org.eclipse.ui.navigate.forwardHistory");
gestureMap.put("N", "org.eclipse.ui.file.save");
gestureMap.put("NW", "org.eclipse.ui.file.saveAll");
gestureMap.put("S", "org.eclipse.ui.file.close");
gestureMap.put("SW", "org.eclipse.ui.file.closeAll");
gestureMap.put("W", "org.eclipse.ui.navigate.backwardHistory");
gestureMap.put("EN", "org.eclipse.ui.edit.copy");
gestureMap.put("ES", "org.eclipse.ui.edit.paste");
gestureMap.put("EW", "org.eclipse.ui.edit.cut");
Capture capture= Capture.create();
capture.setControl(styledText);
capture.addCaptureListener(new CaptureListener() {
public void gesture(Gesture gesture) {
if (gesture.getPen() == 3) {
String actionId= (String) gestureMap.get(Util.recognize(gesture.getPoints(), 20));
if (actionId != null) {
IKeyBindingService keyBindingService= getEditorSite().getKeyBindingService();
if (keyBindingService instanceof KeyBindingService) {
IAction action= ((KeyBindingService) keyBindingService).getAction(actionId);
if (action != null) {
if (action instanceof IUpdate)
((IUpdate) action).update();
if (action.isEnabled())
action.run();
}
}
return;
}
fTextContextMenu.setVisible(true);
}
};
});
*/