Java 类com.intellij.openapi.editor.impl.SettingsImpl 实例源码

项目:consulo    文件:DetailViewImpl.java   
@Nonnull
protected Editor createEditor(@Nullable Project project, Document document, VirtualFile file) {
  EditorEx editor = (EditorEx)EditorFactory.getInstance().createViewer(document, project);

  final EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
  EditorHighlighter highlighter = EditorHighlighterFactory.getInstance().createEditorHighlighter(file, scheme, project);

  editor.setFile(file);
  editor.setHighlighter(highlighter);

  EditorSettings settings = editor.getSettings();
  settings.setAnimatedScrolling(false);
  settings.setRefrainFromScrolling(false);
  settings.setLineNumbersShown(true);
  settings.setFoldingOutlineShown(false);
  if (settings instanceof SettingsImpl) {
    ((SettingsImpl)settings).setSoftWrapAppliancePlace(SoftWrapAppliancePlaces.PREVIEW);
  }
  editor.getFoldingModel().setFoldingEnabled(false);

  return editor;
}
项目:consulo    文件:UsagePreviewPanel.java   
protected void customizeEditorSettings(EditorSettings settings) {
  settings.setLineMarkerAreaShown(myIsEditor);
  settings.setFoldingOutlineShown(false);
  settings.setAdditionalColumnsCount(0);
  settings.setAdditionalLinesCount(0);
  settings.setAnimatedScrolling(false);
  if (settings instanceof SettingsImpl) {
    ((SettingsImpl)settings).setSoftWrapAppliancePlace(SoftWrapAppliancePlaces.PREVIEW);
  }
}
项目:consulo    文件:AbstractToggleUseSoftWrapsAction.java   
@Override
public void update(@Nonnull AnActionEvent e) {
  if (myGlobal) {
    Editor editor = getEditor(e);
    if (editor != null) {
      EditorSettings settings = editor.getSettings();
      if (settings instanceof SettingsImpl && ((SettingsImpl)settings).getSoftWrapAppliancePlace() != myAppliancePlace) {
        e.getPresentation().setEnabledAndVisible(false);
        return;
      }
    }
  }
  super.update(e);
}