use of org.eclipse.che.ide.api.editor.position.PositionConverter in project che by eclipse.
the class OrionEditorInit method addQuickAssistKeyBinding.
/**
* Add key binding to quick assist assistant.
*/
private void addQuickAssistKeyBinding() {
if (this.quickAssist != null) {
final KeyBindingAction action = new KeyBindingAction() {
@Override
public boolean action() {
final PositionConverter positionConverter = textEditor.getPositionConverter();
if (positionConverter != null) {
textEditor.showQuickAssist();
}
return true;
}
};
final HasKeyBindings hasKeyBindings = this.textEditor.getHasKeybindings();
hasKeyBindings.addKeyBinding(new KeyBinding(false, false, true, false, KeyCode.ENTER, action), QUICK_FIX);
}
}
use of org.eclipse.che.ide.api.editor.position.PositionConverter in project che by eclipse.
the class OrionEditorPresenter method showQuickAssist.
protected void showQuickAssist() {
if (quickAssistant == null) {
return;
}
PositionConverter positionConverter = getPositionConverter();
if (positionConverter != null) {
TextPosition cursor = getCursorPosition();
PositionConverter.PixelCoordinates pixelPos = positionConverter.textToPixel(cursor);
quickAssistant.showPossibleQuickAssists(getCursorModel().getCursorPosition().getOffset(), pixelPos.getX(), pixelPos.getY());
}
}
Aggregations