当前位置: 首页>>代码示例>>Java>>正文


Java TextEditorConfiguration类代码示例

本文整理汇总了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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:AbstractPageWithTextEditor.java

示例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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:GoToSymbolAction.java

示例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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:FindReferencesAction.java

示例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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:FindSymbolAction.java

示例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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:FindDefinitionAction.java

示例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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:LSRenameAction.java

示例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);
      }
    }
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:26,代码来源:PublishDiagnosticsProcessor.java

示例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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:JsJavaEditorProvider.java

示例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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:OrionEditorInit.java

示例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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:32,代码来源:LanguageServerEditorProvider.java

示例11: getEditorConfiguration

import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@Override
protected TextEditorConfiguration getEditorConfiguration() {
  return jsonExampleEditorConfigurationProvider.get();
}
 
开发者ID:eclipse,项目名称:che-archetypes,代码行数:5,代码来源:JsonExampleEditorProvider.java

示例12: initialize

import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@Override
public void initialize(@NotNull TextEditorConfiguration configuration) {
  this.configuration = configuration;
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:OrionEditorPresenter.java

示例13: getConfiguration

import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@Override
public TextEditorConfiguration getConfiguration() {
  return configuration;
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:OrionEditorPresenter.java

示例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();
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:AbstractTextEditorProvider.java

示例15: getEditorConfiguration

import org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration; //导入依赖的package包/类
@Override
protected TextEditorConfiguration getEditorConfiguration() {
  return configurationProvider.get();
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:JsEditorProvider.java


注:本文中的org.eclipse.che.ide.api.editor.editorconfig.TextEditorConfiguration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。