use of org.eclipse.che.ide.api.editor.texteditor.HandlesTextOperations in project che by eclipse.
the class SignatureHelpAction method updateInPerspective.
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
final EditorPartPresenter editor = editorAgent.getActiveEditor();
boolean isCanDoOperation = false;
HandlesTextOperations handlesOperations;
if (editor instanceof HandlesTextOperations) {
handlesOperations = (HandlesTextOperations) editor;
isCanDoOperation = handlesOperations.canDoOperation(TextEditorOperations.SIGNATURE_HELP);
}
event.getPresentation().setEnabledAndVisible(isCanDoOperation);
}
use of org.eclipse.che.ide.api.editor.texteditor.HandlesTextOperations in project che by eclipse.
the class SignatureHelpAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
final EditorPartPresenter editor = editorAgent.getActiveEditor();
HandlesTextOperations handlesOperations;
if (editor instanceof HandlesTextOperations) {
handlesOperations = (HandlesTextOperations) editor;
if (handlesOperations.canDoOperation(TextEditorOperations.SIGNATURE_HELP)) {
handlesOperations.doOperation(TextEditorOperations.SIGNATURE_HELP);
}
}
}
use of org.eclipse.che.ide.api.editor.texteditor.HandlesTextOperations in project che by eclipse.
the class FormatterAction method updateInPerspective.
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
final EditorPartPresenter editor = editorAgent.getActiveEditor();
boolean isCanDoOperation = false;
HandlesTextOperations handlesOperations;
if (editor instanceof HandlesTextOperations) {
handlesOperations = (HandlesTextOperations) editor;
isCanDoOperation = handlesOperations.canDoOperation(TextEditorOperations.FORMAT);
}
event.getPresentation().setEnabled(isCanDoOperation);
}
use of org.eclipse.che.ide.api.editor.texteditor.HandlesTextOperations in project che by eclipse.
the class FormatterAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
final EditorPartPresenter editor = editorAgent.getActiveEditor();
HandlesTextOperations handlesOperations;
if (editor instanceof HandlesTextOperations) {
handlesOperations = (HandlesTextOperations) editor;
if (handlesOperations.canDoOperation(TextEditorOperations.FORMAT)) {
handlesOperations.doOperation(TextEditorOperations.FORMAT);
}
}
}
Aggregations