Search in sources :

Example 1 with HandlesTextOperations

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);
}
Also used : HandlesTextOperations(org.eclipse.che.ide.api.editor.texteditor.HandlesTextOperations) EditorPartPresenter(org.eclipse.che.ide.api.editor.EditorPartPresenter)

Example 2 with HandlesTextOperations

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);
        }
    }
}
Also used : HandlesTextOperations(org.eclipse.che.ide.api.editor.texteditor.HandlesTextOperations) EditorPartPresenter(org.eclipse.che.ide.api.editor.EditorPartPresenter)

Example 3 with HandlesTextOperations

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);
}
Also used : HandlesTextOperations(org.eclipse.che.ide.api.editor.texteditor.HandlesTextOperations) EditorPartPresenter(org.eclipse.che.ide.api.editor.EditorPartPresenter)

Example 4 with HandlesTextOperations

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);
        }
    }
}
Also used : HandlesTextOperations(org.eclipse.che.ide.api.editor.texteditor.HandlesTextOperations) EditorPartPresenter(org.eclipse.che.ide.api.editor.EditorPartPresenter)

Aggregations

EditorPartPresenter (org.eclipse.che.ide.api.editor.EditorPartPresenter)4 HandlesTextOperations (org.eclipse.che.ide.api.editor.texteditor.HandlesTextOperations)4