Skip to main content



      Home
Home » Eclipse Projects » JFace » OwnerDrawLabelProvider -> set other things than text
OwnerDrawLabelProvider -> set other things than text [message #7900] Tue, 19 May 2009 09:25 Go to next message
Eclipse UserFriend
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 #7920 is a reply to message #7900] Tue, 19 May 2009 10:03 Go to previous messageGo to next message
Eclipse UserFriend
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 03:12 Go to previous message
Eclipse UserFriend
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
>>
Previous Topic:TableViewer CellEditor
Next Topic:TreeViewer and SelectionProvider
Goto Forum:
  


Current Time: Fri May 09 16:53:50 EDT 2025

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

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

Back to the top