How to update a view from code in an Eclipse RCP application

I have an extends class ViewPartthat contains ScrolledFormcreated using FormToolkit. When some events occur in other views in the application, I want to change the form in this view and update it in real time for the user.

I have property change support added now and the next method in the view

    public void propertyChange(PropertyChangeEvent event) {
    form.dispose();
    toolkit.dispose();
    createForm( event );
    form.redraw();
}

where createForm( event )recreates an event-based form.

The problem is that after that the user interface does not display the new form. I know that the form was created OK, because if I dragged the border between the view and another view to resize it, then the view will immediately update to show the new form. How can I programmatically force a view to be updated in a user interface?

+3
source share
1 answer

Have you tried form.reflow(true);:?

This will repeat the layout of the form.

, xxx.layout(true) "xxx" - mame SWT Composite, . , createForm( event )?

+5

Source: https://habr.com/ru/post/1765643/


All Articles