`getComponent` of my custom `FileEditor` is never called


I wish to make my own file type to edit some lineage graphs graphically.

I have derived from `FileEditor` class 

public class LineageFileEditor implements FileEditor {

@Override public @NotNull JComponent getComponent() {
return new JExample();


and also wrote a custom component, which draws a circle

public class JExample extends JComponent {

@Override protected void paintComponent(Graphics g) {
Graphics2D g2 = (Graphics2D)g;

g.fillOval(10, 10, 100, 100);

public static void main(String[] args) {
JFrame frame = new JFrame();

frame.add(new JExample(), BorderLayout.CENTER);

frame.setSize(800, 600);


This component works from it's main.

Unfortunately, my editor acts as just text editor in IntelliJ

and `#getComponent()` method is never called according to the debugger.

Why and how to fix?

Comment actions Permalink

Please always show full context. Did you register/implement com.intellij.openapi.fileEditor.FileEditorProvider as well?

Comment actions Permalink

Context is full :) I did only what I wrote, I am a newbiew and didn't knew about FileEditorProvider at all! Thank you, will dig at this direction!

Comment actions Permalink

It worked. I was to notice, that there was no connection between editor and type before...


Please sign in to leave a comment.