EditorTextField getEditor return null

Answered

How to get Editor from EditorTextField when creating dialog??

  1. Description from source: getEditor "return null if the editor is not initialized (e.g. if the field is not added to a container)"
  2. EditorTextField added in protected JComponent createCenterPanel()
  3. getEditor() called after DialogWrapper.init() and still return null;

It return value when user change input (by .addDocumentListener), but i need to get editor early.

4 comments
Comment actions Permalink

Maybe, EditorTextField.addSettingsProvider() will help? This provider will be executed every time a new Editor is created.

1
Comment actions Permalink

What do you need it for? 

Please note, that underlying Editor might change later.

0
Comment actions Permalink

I'm use HighlightManager.getInstance(project).addRangeHighlight(...editor...) with DocumentListener. EditorTextField might be initialized with text, which must be highlighted, but i can't apply addRangeHighlight without Editor

0
Comment actions Permalink

Yeah, it works, thx.

0

Please sign in to leave a comment.