Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Updating the application model in a batch
Updating the application model in a batch [message #1061273] Thu, 30 May 2013 17:32 Go to next message
G. Smith is currently offline G. Smith
Messages: 12
Registered: August 2012
Junior Member
On button click I'm doing quite a few model operations on different MParts/MPartStacks: moving MParts around, setting their visibility, etc. The UI is significantly slow enough that I can see flickering after each operation.

Is there a way to "pause" the UI updates until I'm finished changing the model, or a way to queue up all my changes and execute them in a single batch?
Re: Updating the application model in a batch [message #1061316 is a reply to message #1061273] Fri, 31 May 2013 03:58 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5252
Registered: July 2009
Senior Member
Not by default. You can turn of change notification on the model but
then nobody will notice your changes and even if you could queue up the
changes most of the rendering code expects to the UI in sync when
executing (e.g. to identify the index an element has to inserting in the
UI).

The best idea is to get access to the Shell and setRedraw(false) this
way you should not see the flickering because the UI does not redraw so
your could would look like this:

Shell s = ...

try {
s.setRedraw(false);
// execute your code
} finally {
s.setRedraw(true);
}

In 4.3 we added the possibility for multi-add/remove but you are
modifying different stacks this does not help you.

Tom

On 30.05.13 23:32, G. Smith wrote:
> On button click I'm doing quite a few model operations on different
> MParts/MPartStacks: moving MParts around, setting their visibility, etc.
> The UI is significantly slow enough that I can see flickering after each
> operation.
>
> Is there a way to "pause" the UI updates until I'm finished changing the
> model, or a way to queue up all my changes and execute them in a single
> batch?
Re: Updating the application model in a batch [message #1061320 is a reply to message #1061316] Fri, 31 May 2013 04:11 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 596
Registered: December 2010
Senior Member

There is always the possibility to provide a custom renderer to inhibit changes and delay the ui-model sync.
Re: Updating the application model in a batch [message #1061322 is a reply to message #1061320] Fri, 31 May 2013 04:27 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5252
Registered: July 2009
Senior Member
Right one would have to build the UI <=> Model delta when changes are
queued. I'm not sure this makes sense for the default renderers.

Tom

On 31.05.13 10:11, Sopot Cela wrote:
> There is always the possibility to provide a custom renderer to inhibit
> changes and delay the ui-model sync.
Previous Topic:How to add an ISaveHandler and IWindowCloseHandler to the Model
Next Topic:Where should ISaveHandler be registered?
Goto Forum:
  


Current Time: Mon Jul 28 18:48:52 EDT 2014

Powered by FUDForum. Page generated in 0.02468 seconds