Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Which function gets called first
Which function gets called first [message #454580] Mon, 25 April 2005 04:35 Go to next message
Neeraj is currently offline NeerajFriend
Messages: 18
Registered: July 2009
Junior Member
I have the following code for a labelProvider:
class ViewLabelProvider extends LabelProvider implements IColorProvider{
....
...
public Image getImage(Object obj) {
....
}

public Color getForeground(Object element) {
...
}

public Color getBackground(Object element) {
....
}

}
which of these three function are called first when the viewer is
associated with this label provider
Say,
TreeViewer tv = new TreeViewer(...);
tv.setLabelProvider(new ViewLabelProvider());

and is the order of call same always, i.e when tree is expanded or
collapsed etc..
Re: Which function gets called first [message #454648 is a reply to message #454580] Tue, 26 April 2005 07:10 Go to previous message
Emil Crumhorn is currently offline Emil CrumhornFriend
Messages: 169
Registered: July 2009
Senior Member
If you add some debug messages in each of the methods, you'll find out
that..

1. getImage(...)
2. getForeground(...)
3. getBackground(...)
4. getFont(...)
5. Looks like it

Emil

"Neeraj" <neerajkrishnag@yahoo.com> wrote in message
news:f0c5e651bad1493cdea3ec3a436f7e3d$1@www.eclipse.org...
>I have the following code for a labelProvider:
> class ViewLabelProvider extends LabelProvider implements IColorProvider{
> ...
> ..
> public Image getImage(Object obj) {
> ...
> }
>
> public Color getForeground(Object element) {
> ..
> }
>
> public Color getBackground(Object element) {
> ...
> }
>
> }
> which of these three function are called first when the viewer is
> associated with this label provider
> Say,
> TreeViewer tv = new TreeViewer(...);
> tv.setLabelProvider(new ViewLabelProvider());
>
> and is the order of call same always, i.e when tree is expanded or
> collapsed etc..
>
Previous Topic:How to avoid Composite Flicker ?
Next Topic:TableItem length
Goto Forum:
  


Current Time: Fri Apr 19 04:59:43 GMT 2024

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

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

Back to the top