TextEditor implementation questions

1. How to signal to IDEA that document changed to place modified marker on the tab? (force isModified call)
2. How to get instance of default IDEA text-editor implementation with all capabilities? (Menus, modification tracker(duplication of 1.) etc.) (Editor created by editorFactory.createEditor(editorFactory.createDocument(file.contentsToCharArray())) very restricted)
3. There are some other questions but 1. and 2. stops further investigations :(

TIA,
Dmitry

3 comments

More questions:
1. How to make RangeHighlighter with custom color of font.
(all styles exept font color working)?
2. How custom editor can notify that position in text changed?
3. How to make custom ErrorStripeRenderer and place it in Editor is it simple JPanel?

TIA,
Dmitry

0

What purpose of layers in highlighters and which index layers can be used to avoid intersection with system layers?

TIA,
Dmitry

0

Answers:
1. Implement addPropertyChangeListener to register listeners(for example using PropertyChangeSupport), after modification call this listeners.firePropertyChange("modified", false, true);
2. Not possible by default need customization of editor anyway.
2a. For menus something like this:

2b. For toolbar notification imposible as I see.

0

Please sign in to leave a comment.