Composite.redraw() - Does it work or not? [message #525892] |
Thu, 08 April 2010 08:21 |
Bassspieler Messages: 40 Registered: April 2010 Location: Germany |
Member |
|
|
Hi folks!
The 'redraw'-methods of RAP are explained with:
"Note: With RAP we can't really force a redraw. This is just a fake to enable event notifications that come on OS systems with redraws."
But, what does that mean? Does it work? Does it have any effect at all? How to deal with it in my application? Leave it out? Implement a substitution?
Right now I am struggeling with some code about a table being told to "setRedraw(false)" and true after refreshing the data model. Thing is, the table's 'computeSize()' reacts strange. The correct height is only correct on second 'refresh()' (I press the button once -> new data is in table, but height is old height. I press it 2nd time with same data to come -> height is computed correctly and table resizes itself).
Anyhow, any hints for redraw()?
Bassspieler
[Updated on: Thu, 08 April 2010 08:23] Report message to a moderator
|
|
|
Re: Composite.redraw() - Does it work or not? [message #526144 is a reply to message #525892] |
Thu, 08 April 2010 21:15 |
|
Hi,
setRedraw() is used to keep the operating system from doing expensive
redrawing operations during certain UI updates. In a RAP-only
application, you can safely omit those calls.
Using redraw methods should not make a difference for computeSize(). If
it does in your case, can you provide a simple snippet?
By "refresh()", do you mean the second browser refresh after server
restart? If so, your issue could be related to the text size determination.
Ralf
Bassspieler wrote:
> Hi folks!
>
> The 'redraw'-methods of RAP are explained with:
>
> "Note: With RAP we can't really force a redraw. This is just a fake to
> enable event notifications that come on OS systems with redraws."
>
> But, what does that mean? Does it work? Does it have any effect at all?
> How to deal with it in my application? Leave it out? Implement a
> substitution?
>
> Right now I am struggeling with some code about a table being told to
> "setRedraw(false)" and true after refreshing the data model. Thing is,
> the table's 'computeSize()' reacts strange. The correct height is only
> correct on second 'refresh()'.
>
> Anyhow, any hints for redraw()?
> Bassspieler
|
|
|
|
Re: Composite.redraw() - Does it work or not? [message #527406 is a reply to message #527381] |
Thu, 15 April 2010 07:38 |
|
Hi,
see my comments below:
Bassspieler wrote:
> The main error was on my side. I told my model in my TableViewer to
> refresh and wanted to handle the data on the next line of code. But this
> was just wrong. I had to add a Listener to my model, that triggers, when
> all the data was provided.
To better understand how to work with TableViewers, have a look at the
JFace examples in the wiki, e.g. [1].
> But it is still interesting for my, what redraw stands for. What code is
> in there? You said it does the same as "computeSize".
No, I said that using redraw() makes no difference for computeSize(),
not that it would do the same!
As I said, redraw() makes sense on other platforms, that use the
operating system to draw. I think the JavaDoc is pretty clear, so what
is your question?
> But computeSize
> does nothing, does it? It just computes a size, but does not set any
> values to a widget or something like that.
computeSize() may use caching, but does not have other side effects.
Best regards,
Ralf
[1]
http://wiki.eclipse.org/index.php/JFaceSnippets#Snippet029Vi rtualTableViewer
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04430 seconds