replacing a swing JEditorPane by an IDEA editor

In a complex dialog (ui designer + DialogWrapper), the main element is a
pure Swing JEditorPane.

As I'd like to benefit from IDEA's niceties (Ctrl-W, etc..), I need to
replace the JEditorPane by an IDEA text editor.

How to?
Is there some available plugin source that does that?

Alain

2 comments
Comment actions Permalink

Here's what to start with:

EditorFactory editorFactory = EditorFactory.getInstance();
Document document = editorFactory.createDocument(initialText);
Editor editor = editorFactory.createEditor(document);

Then insert editor.getContentComponent() or editor.getComponent()
(I don't know the difference between them) into your dialog. From
there on you're on your own, I've never really used that stuff.

Good luck :)

Sascha


Alain Ravet wrote:

In a complex dialog (ui designer + DialogWrapper), the main element is a
pure Swing JEditorPane.

As I'd like to benefit from IDEA's niceties (Ctrl-W, etc..), I need to
replace the JEditorPane by an IDEA text editor.

How to?
Is there some available plugin source that does that?

Alain

0
Comment actions Permalink

Sascha

Here's what to start with:

>

Thanks. I'll try it out.

Alain

0

Please sign in to leave a comment.