Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » OwnerDrawLabelProvider -> set other things than text
OwnerDrawLabelProvider -> set other things than text [message #7900] Tue, 19 May 2009 13:25 Go to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

hi,

I want to create a custom Cell with a Spinner.

So on my ColumnViewer I set an OwnerdrawLabelProvider.
I looked :
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.s nippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippet s/viewers/Snippet010OwnerDraw.java?view=markup
and
http://keulkeul.blogspot.com/2007/08/tableviewer-et-ownerdra wlabelprovider.html

But this is only for custom text.

How can we put a new Control/Composite in the cell? Is there some examples
somewhere?

thanks for your help


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: OwnerDrawLabelProvider -> set other things than text [message #7920 is a reply to message #7900] Tue, 19 May 2009 14:03 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

OwnerDraw and putting controls into the viewer are 2 completely
different things and in the end have nothing together.

I guess what you want is to fake the effect that the user thinks the
control is show all the time incontrast to how cell-editors work. The
problem is that then you are very likely run out of handles if you table
has many cells.

What we suggest to people to use instead is to fake the Control using a
picture (though for a spinner this could be a problem to because you
need to have an image for every spinner state possible).

We have a very complete example of this technique for Checkboxes if you
look at [1]. If the spinner is take to whole width of the cell ownerdraw
would not be needed though and normal label provider is enough.

Tom

[1] http://wiki.eclipse.org/JFaceSnippets#Snippet061FakedNativeC ellEditor

Aurelien Pupier schrieb:
> hi,
>
> I want to create a custom Cell with a Spinner.
>
> So on my ColumnViewer I set an OwnerdrawLabelProvider.
> I looked :
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.s nippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippet s/viewers/Snippet010OwnerDraw.java?view=markup
>
> and
> http://keulkeul.blogspot.com/2007/08/tableviewer-et-ownerdra wlabelprovider.html
>
>
> But this is only for custom text.
>
> How can we put a new Control/Composite in the cell? Is there some
> examples somewhere?
>
> thanks for your help
>
Re: OwnerDrawLabelProvider -> set other things than text [message #8864 is a reply to message #7920] Wed, 20 May 2009 07:12 Go to previous message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Ok, It is exactly what I want.

I will try this later.

thanks for your reply


Tom Schindl wrote:

> Hi,

> OwnerDraw and putting controls into the viewer are 2 completely
> different things and in the end have nothing together.

> I guess what you want is to fake the effect that the user thinks the
> control is show all the time incontrast to how cell-editors work. The
> problem is that then you are very likely run out of handles if you table
> has many cells.

> What we suggest to people to use instead is to fake the Control using a
> picture (though for a spinner this could be a problem to because you
> need to have an image for every spinner state possible).

> We have a very complete example of this technique for Checkboxes if you
> look at [1]. If the spinner is take to whole width of the cell ownerdraw
> would not be needed though and normal label provider is enough.

> Tom

> [1] http://wiki.eclipse.org/JFaceSnippets#Snippet061FakedNativeC ellEditor

> Aurelien Pupier schrieb:
>> hi,
>>
>> I want to create a custom Cell with a Spinner.
>>
>> So on my ColumnViewer I set an OwnerdrawLabelProvider.
>> I looked :
>>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.s nippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippet s/viewers/Snippet010OwnerDraw.java?view=markup
>>
>> and
>>
http://keulkeul.blogspot.com/2007/08/tableviewer-et-ownerdra wlabelprovider.html
>>
>>
>> But this is only for custom text.
>>
>> How can we put a new Control/Composite in the cell? Is there some
>> examples somewhere?
>>
>> thanks for your help
>>


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Previous Topic:TableViewer CellEditor
Next Topic:TreeViewer and SelectionProvider
Goto Forum:
  


Current Time: Sun Sep 01 09:26:07 GMT 2024

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

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

Back to the top