@Override public JComponent getPreferredFocusedComponent() { final TextEditor textEditor = myPanel.getFileEditor(); if (textEditor != null) { return textEditor.getPreferredFocusedComponent(); } return myPanel.getMainPanel(); }
@Override public void setState(@NotNull final FileEditorState state) { final TextEditor textEditor = myPanel.getFileEditor(); if (textEditor != null) { textEditor.setState(state); } }
@Override public void dispose() { if (myMockTextEditor != null) { EditorFactory.getInstance().releaseEditor(myMockTextEditor); } myPanel.dispose(); }
@Override public void navigateTo(@NotNull Navigatable navigatable) { final TextEditor textEditor = myPanel.getFileEditor(); if (textEditor != null) { textEditor.navigateTo(navigatable); } }
@Override public StructureViewBuilder getStructureViewBuilder() { final TextEditor textEditor = myPanel.getFileEditor(); if (textEditor != null) { return textEditor.getStructureViewBuilder(); } return null; }
@Override public FileEditorLocation getCurrentLocation() { final TextEditor textEditor = myPanel.getFileEditor(); if (textEditor != null) { return textEditor.getCurrentLocation(); } return null; }
@Override public <T> T getUserData(@NotNull Key<T> key) { final TextEditor textEditor = myPanel.getFileEditor(); if (textEditor != null) { return textEditor.getUserData(key); } return myUserDataHolder.getUserData(key); }
@Override public boolean canNavigateTo(@NotNull Navigatable navigatable) { final TextEditor textEditor = myPanel.getFileEditor(); if (textEditor != null) { return textEditor.canNavigateTo(navigatable); } return false; }
@Override public BackgroundEditorHighlighter getBackgroundHighlighter() { final TextEditor textEditor = myPanel.getFileEditor(); if (textEditor != null) { return textEditor.getBackgroundHighlighter(); } return null; }
@Override @NotNull public FileEditorState getState(@NotNull final FileEditorStateLevel level) { final TextEditor textEditor = myPanel.getFileEditor(); if (textEditor != null) { return textEditor.getState(level); } return new TextEditorState(); }
@Override public <T> void putUserData(@NotNull Key<T> key, @Nullable T value) { final TextEditor textEditor = myPanel.getFileEditor(); if (textEditor != null) { textEditor.putUserData(key, value); } else { myUserDataHolder.putUserData(key, value); } }
@Override @NotNull public Editor getEditor() { final TextEditor fileEditor = myPanel.getFileEditor(); if (fileEditor != null) { return fileEditor.getEditor(); } if (myMockTextEditor == null) { myMockTextEditor = EditorFactory.getInstance().createViewer(new DocumentImpl(""), myProject); } return myMockTextEditor; }
@Override @NotNull public JComponent getComponent() { return myPanel.getMainPanel(); }
@Override public void removePropertyChangeListener(@NotNull final PropertyChangeListener listener) { myPanel.removePropertyChangeListener(listener); }
@Override public void deselectNotify() { myPanel.deselectNotify(); }