本文整理汇总了Java中org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java TextEditorConfiguration类的具体用法?Java TextEditorConfiguration怎么用?Java TextEditorConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextEditorConfiguration类属于org.eclipse.che.ide.api.editor.editorconfig包,在下文中一共展示了TextEditorConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractPageWithTextEditor
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
protected AbstractPageWithTextEditor(
PageWithTextEditorView view,
EditorBuilder editorBuilder,
FileTypeRegistry fileTypeRegistry,
MacroChooser macroChooser,
String title,
TextEditorConfiguration editorConfiguration) {
super("");
this.view = view;
this.fileTypeRegistry = fileTypeRegistry;
this.macroChooser = macroChooser;
this.editorConfiguration = editorConfiguration;
view.setDelegate(this);
view.setHeight(getHeight());
view.setEditorTitle(title);
initializeEditor(editorBuilder);
}
示例2: updateInPerspective
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
if (Objects.nonNull(activeEditor) && activeEditor instanceof TextEditor) {
TextEditorConfiguration configuration = ((TextEditor) activeEditor).getConfiguration();
if (configuration instanceof LanguageServerEditorConfiguration) {
ServerCapabilities capabilities =
((LanguageServerEditorConfiguration) configuration).getServerCapabilities();
event
.getPresentation()
.setEnabledAndVisible(
capabilities.getDocumentSymbolProvider() != null
&& capabilities.getDocumentSymbolProvider());
return;
}
}
event.getPresentation().setEnabledAndVisible(false);
}
示例3: updateInPerspective
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@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.getReferencesProvider() != null
&& capabilities.getReferencesProvider());
return;
}
}
event.getPresentation().setEnabledAndVisible(false);
}
示例4: updateInPerspective
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
if (Objects.nonNull(activeEditor) && activeEditor instanceof TextEditor) {
TextEditorConfiguration configuration = ((TextEditor) activeEditor).getConfiguration();
if (configuration instanceof LanguageServerEditorConfiguration) {
ServerCapabilities capabilities =
((LanguageServerEditorConfiguration) configuration).getServerCapabilities();
event
.getPresentation()
.setEnabledAndVisible(
capabilities.getWorkspaceSymbolProvider() != null
&& capabilities.getWorkspaceSymbolProvider());
return;
}
}
event.getPresentation().setEnabledAndVisible(false);
}
示例5: updateInPerspective
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@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.getDefinitionProvider() != null
&& capabilities.getDefinitionProvider());
return;
}
}
event.getPresentation().setEnabledAndVisible(false);
}
示例6: updateInPerspective
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@Override
public void updateInPerspective(ActionEvent event) {
EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
Presentation presentation = event.getPresentation();
if (activeEditor != workspaceAgent.getActivePart()) {
presentation.setEnabledAndVisible(false);
return;
}
if (Objects.nonNull(activeEditor) && activeEditor instanceof TextEditor) {
TextEditorConfiguration configuration = ((TextEditor) activeEditor).getConfiguration();
if (configuration instanceof LanguageServerEditorConfiguration) {
ServerCapabilities capabilities =
((LanguageServerEditorConfiguration) configuration).getServerCapabilities();
presentation.setEnabledAndVisible(
capabilities.getRenameProvider() != null && capabilities.getRenameProvider());
return;
}
}
presentation.setEnabledAndVisible(false);
}
示例7: processDiagnostics
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
public void processDiagnostics(ExtendedPublishDiagnosticsParams diagnosticsMessage) {
EditorPartPresenter openedEditor =
editorAgent.getOpenedEditor(new Path(diagnosticsMessage.getParams().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;
String languageServerId = diagnosticsMessage.getLanguageServerId();
collector.beginReporting(languageServerId);
try {
for (Diagnostic diagnostic : diagnosticsMessage.getParams().getDiagnostics()) {
collector.acceptDiagnostic(languageServerId, diagnostic);
}
} finally {
collector.endReporting(languageServerId);
}
}
}
}
示例8: getEditor
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@Override
public TextEditor getEditor() {
LOG.fine("JsJavaEditor instance creation.");
final TextEditor textEditor = super.getEditor();
if (textEditor instanceof OrionEditorPresenter) {
final OrionEditorPresenter editor = (OrionEditorPresenter) textEditor;
final TextEditorConfiguration configuration = configurationFactory.create(editor);
editor.initialize(configuration);
}
watcher.editorOpened(textEditor);
return textEditor;
}
示例9: OrionEditorInit
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
/** The quick assist assistant. */
public OrionEditorInit(
final AutoSaveMode autoSaveMode,
final TextEditorConfiguration configuration,
final CodeAssistantFactory codeAssistantFactory,
final QuickAssistAssistant quickAssist,
final OrionEditorPresenter textEditor) {
this.autoSaveMode = autoSaveMode;
this.configuration = configuration;
this.codeAssistantFactory = codeAssistantFactory;
this.quickAssist = quickAssist;
this.textEditor = textEditor;
}
示例10: createEditor
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@Override
public Promise<EditorPartPresenter> createEditor(VirtualFile file) {
if (file instanceof File) {
File resource = (File) file;
Promise<ServerCapabilities> promise =
registry.getOrInitializeServer(resource.getProject().getPath(), file);
return promise.then(
new Function<ServerCapabilities, EditorPartPresenter>() {
@Override
public EditorPartPresenter apply(ServerCapabilities capabilities)
throws FunctionException {
if (editorBuilder == null) {
Log.debug(
AbstractTextEditorProvider.class,
"No builder registered for default editor type - giving up.");
return null;
}
final TextEditor editor = editorBuilder.buildEditor();
TextEditorConfiguration configuration =
capabilities == null
? new DefaultTextEditorConfiguration()
: editorConfigurationFactory.build(editor, capabilities);
editor.initialize(configuration);
return editor;
}
});
}
return null;
}
示例11: getEditorConfiguration
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@Override
protected TextEditorConfiguration getEditorConfiguration() {
return jsonExampleEditorConfigurationProvider.get();
}
示例12: initialize
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@Override
public void initialize(@NotNull TextEditorConfiguration configuration) {
this.configuration = configuration;
}
示例13: getConfiguration
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@Override
public TextEditorConfiguration getConfiguration() {
return configuration;
}
示例14: getEditorConfiguration
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
/** Returns configuration for initializing an editor returned by {@link #getEditor()} method. */
protected TextEditorConfiguration getEditorConfiguration() {
return new DefaultTextEditorConfiguration();
}
示例15: getEditorConfiguration
import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@Override
protected TextEditorConfiguration getEditorConfiguration() {
return configurationProvider.get();
}