How to edit the active intellij editor background color ONLY
Answered
I know all about color code preferences. This is not in there, so I need to build a plugin for it.
Basically, I would like to edit the color of the background of the currently active editor that is accepting INPUT.
I've tried
JComponent component = super.window.getSelectedEditor().getComponent();
component.setBackground(JBColor.YELLOW);
But this is not working.
Alternatively, might be interesting to edit the color of the active line in the editor ACCEPTING INPUT only ... currently splitter groups will show the active line having the same color in all splitters, forcing you to see try to identify the CURSOR.
So how can I edit these things?
Thanks!
Please sign in to leave a comment.
Having the Editor instance, you can call setBackgroundColor which is available in EditorEx interface.
I got it to work by using this.manager.getSelectedTextEditor and casting it.
Frankly I don't know why I need to cast it. Why doesn't it give me the proper type to start with.
I found this
Which will fire for events when an editor is opened, closed.
But what is the one for editor active / inactive? That is being focused and loosing focus.
That way I avoid having to poll.
Also, maybe it would be better to color only active LINE, rather than the entire editor.
Also, why are my replies pending approval? Isn't this for a community to answer.
My latest posts has been delayed by days.