Java Code Examples for com.intellij.openapi.editor.Editor#EMPTY_ARRAY

The following examples show how to use com.intellij.openapi.editor.Editor#EMPTY_ARRAY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EditorFactoryImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
@Nonnull
public Editor[] getEditors(@Nonnull Document document, Project project) {
  List<Editor> list = null;
  for (Editor editor : myEditors) {
    if (editor.getDocument().equals(document) && (project == null || project.equals(editor.getProject()))) {
      if (list == null) list = new SmartList<>();
      list.add(editor);
    }
  }
  return list == null ? Editor.EMPTY_ARRAY : list.toArray(Editor.EMPTY_ARRAY);
}
 
Example 2
Source File: MockEditorFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public Editor[] getEditors(@Nonnull Document document, Project project) {
  return Editor.EMPTY_ARRAY;
}
 
Example 3
Source File: MockEditorFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public Editor[] getAllEditors() {
  return Editor.EMPTY_ARRAY;
}
 
Example 4
Source File: CaretVisualPositionKeeper.java    From consulo with Apache License 2.0 4 votes vote down vote up
public CaretVisualPositionKeeper(@Nullable Editor editor) {
  this(editor == null ? Editor.EMPTY_ARRAY : new Editor[]{editor});
}
 
Example 5
Source File: CaretVisualPositionKeeper.java    From consulo with Apache License 2.0 4 votes vote down vote up
public CaretVisualPositionKeeper(@Nullable Document document) {
  this(document == null ? Editor.EMPTY_ARRAY : EditorFactory.getInstance().getEditors(document));
}