use of org.eclipse.che.ide.api.editor.texteditor.TextEditor in project che by eclipse.
the class AbstractTextEditorProvider method getEditor.
@Override
public TextEditor getEditor() {
if (editorBuilder == null) {
Log.debug(AbstractTextEditorProvider.class, "No builder registered for default editor type - giving up.");
return null;
}
final TextEditor editor = editorBuilder.buildEditor();
editor.initialize(getEditorConfiguration());
return editor;
}
use of org.eclipse.che.ide.api.editor.texteditor.TextEditor in project che by eclipse.
the class FileWatcher method reparseAllOpenedFiles.
private void reparseAllOpenedFiles() {
for (EditorPartPresenter editorPartPresenter : editorAgent.getOpenedEditors()) {
if (editorPartPresenter instanceof TextEditor) {
final TextEditor editor = (TextEditor) editorPartPresenter;
editor.refreshEditor();
}
}
}
use of org.eclipse.che.ide.api.editor.texteditor.TextEditor in project che by eclipse.
the class FindDefinitionAction method updateInPerspective.
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
if (activeEditor instanceof TextEditor) {
TextEditorConfiguration configuration = ((TextEditor) activeEditor).getConfiguration();
if (configuration instanceof LanguageServerEditorConfiguration) {
ServerCapabilities capabilities = ((LanguageServerEditorConfiguration) configuration).getServerCapabilities();
event.getPresentation().setEnabledAndVisible(capabilities.isDefinitionProvider() != null && capabilities.isDefinitionProvider());
return;
}
}
event.getPresentation().setEnabledAndVisible(false);
}
use of org.eclipse.che.ide.api.editor.texteditor.TextEditor in project che by eclipse.
the class FindReferencesAction method updateInPerspective.
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
if (activeEditor instanceof TextEditor) {
TextEditorConfiguration configuration = ((TextEditor) activeEditor).getConfiguration();
if (configuration instanceof LanguageServerEditorConfiguration) {
ServerCapabilities capabilities = ((LanguageServerEditorConfiguration) configuration).getServerCapabilities();
event.getPresentation().setEnabledAndVisible(capabilities.isReferencesProvider() != null && capabilities.isReferencesProvider());
return;
}
}
event.getPresentation().setEnabledAndVisible(false);
}
use of org.eclipse.che.ide.api.editor.texteditor.TextEditor in project che by eclipse.
the class PublishDiagnosticsProcessor method processDiagnostics.
public void processDiagnostics(PublishDiagnosticsParamsDTO diagnosticsMessage) {
EditorPartPresenter openedEditor = editorAgent.getOpenedEditor(new Path(diagnosticsMessage.getUri()));
//TODO add markers
if (openedEditor == null) {
return;
}
if (openedEditor instanceof TextEditor) {
TextEditorConfiguration editorConfiguration = ((TextEditor) openedEditor).getConfiguration();
AnnotationModel annotationModel = editorConfiguration.getAnnotationModel();
if (annotationModel != null && annotationModel instanceof DiagnosticCollector) {
DiagnosticCollector collector = (DiagnosticCollector) annotationModel;
collector.beginReporting();
try {
for (DiagnosticDTO diagnostic : diagnosticsMessage.getDiagnostics()) {
collector.acceptDiagnostic(diagnostic);
}
} finally {
collector.endReporting();
}
}
}
}
Aggregations