简体   繁体   中英

Eclipse RCP: how to determine whether an editor page was brought to front

I have a FormEditor with a FormPage and I want to start some action when the page was brought to front (so that it is visible for the user).

The problem is that the editor is opened in a wizard and setActive() is called before the page is visible.

I want to start a IRunnableWithProgress when the page is visible via ModalContext.run() and display some results on the page that are created in another thread. But currently this is done when the wizard is still visible.

Many thanks for help,

Michael

The first few options that comes to mind is to override setActivePage or pageChange on the FormEditor , or use addPageChangedListener . You can always have some kind of flag to control your task if you don't want it to run every time the page becomes visible.

Another option (based on your question it sounds like you want to run this task specifically after the wizard is done), you could use Display.getDefault().asyncExec to start your task when the stack unwinds after the wizard is complete.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM