Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Composite.redraw() - Does it work or not?(Whats the exact implementation of this?)
icon1.gif  Composite.redraw() - Does it work or not? [message #525892] Thu, 08 April 2010 08:21 Go to next message
Bassspieler  is currently offline Bassspieler Friend
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 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

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 #527381 is a reply to message #526144] Thu, 15 April 2010 06:45 Go to previous messageGo to next message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
Thx Ralf for your quick support on this forum.

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.

But it is still interesting for my, what redraw stands for. What code is in there? You said it does the same as "computeSize". But computeSize does nothing, does it? It just computes a size, but does not set any values to a widget or something like that.

Beste Grüße,
Bassspieler
Re: Composite.redraw() - Does it work or not? [message #527406 is a reply to message #527381] Thu, 15 April 2010 07:38 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

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
Re: Composite.redraw() - Does it work or not? [message #527448 is a reply to message #527406] Thu, 15 April 2010 10:17 Go to previous messageGo to next message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
Wink My question is: What "physically" happens in RAP, when I call this method? Is it like:

public void redraw(){
// just for API
}

or is it more like:

public void redraw(){
this.pack();
this.layout();
}

->
I just found the " public static void fakeRedraw( final Control control,
final boolean redraw )" in RWTLifeCycle. Interesting. Not as easy as I thought.

Have a nice day,
Bassspieler

[Updated on: Thu, 15 April 2010 10:21]

Report message to a moderator

Re: Composite.redraw() - Does it work or not? [message #527455 is a reply to message #527448] Thu, 15 April 2010 10:38 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Bassspieler wrote:
> ;) My question is: What "physically" happens in RAP, when I call this
> method? Is it like:
>
> public void redraw(){
> // just for API
> }

yes

>
> or is it more like:
>
> public void redraw(){
> this.pack();
> this.layout();
> }
Previous Topic:Issue with TabItem containing ScrollableComponent
Next Topic:RAP is not working with Galileo 3.5
Goto Forum:
  


Current Time: Tue Dec 07 12:47:34 GMT 2021

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

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

Back to the top