Skip to main content


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 21:32 Go to next message
G. Smith is currently offline G. SmithFriend
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 07:58 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
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 08:11 Go to previous messageGo to next message
Eclipse UserFriend
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 08:27 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
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 Sep 23 04:29:37 GMT 2024

Powered by FUDForum. Page generated in 0.04105 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top