[Question] fail to register two event handler

first is  before file selectionChanged event

For now, i just subscribe a FileEditorManagerAdapter and i find there is only three event handler there, fileOpened, selectionChanged and fileClosed.

But what i need is to trigger an action before file selectionChanged, and selectionChanged handler in FileEditorManagerAdapter only invoke after file selection is done.

Actually, i just add a painter when file is opened and edited, and if i can not remove the painter before file selection action, the things drew by the painter on the former file will exists there for a while, so i want to remove the painter before file selectionChanged.

second is before editor width / height changed event

if the width and height of current editor's component is changing, i also want to remove the painter before this event happens.

i searched docs and source code but can not find any Listener or Adapter i want, How can i register these two event handler?

3 comments
Comment actions Permalink

Maybe adding a ComponentListener on editor component can help you - component events are fired on component being shown/hidden and on size change.

0
Comment actions Permalink

thx! i will give it a shot.

but how can i listen before-file-selectionChanged event @Dmitry Batrak ?

0
Comment actions Permalink

There's no such an event at the level of FileEditorManager. You should get a component event though when editor component changes visibility.

0

Please sign in to leave a comment.