Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » PShelf: How to change BGColor for PShelfItems
PShelf: How to change BGColor for PShelfItems [message #47327] Fri, 25 January 2008 10:10 Go to next message
Klaus Pesendorfer is currently offline Klaus PesendorferFriend
Messages: 5
Registered: July 2009
Junior Member
How can I set different colors (background, gradient background,
foreground, font) on every PShelfItem of a PShelf?
(a reason why I need this behavior is, to have a better visual
separation between the collapsed items)

What would be the easiest way to do this?
.... write my own subclass of AbstractRenderer?
The major task I think will be to manage the different colors for each
PShelfItem, because the renderer class is only linked to the main PShelf.

Kind regards,
Klaus.



--
Dipl.-Ing. Klaus Pesendorfer
Fabalabs Software GmbH
E-Mail: klaus.pesendorfer@fabalabs.org
Web: http://www.fabalabs.org
Re: PShelf: How to change BGColor for PShelfItems [message #47384 is a reply to message #47327] Fri, 25 January 2008 23:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tom.seidel.spiritlink.de

Klaus Pesendorfer schrieb:
> How can I set different colors (background, gradient background,
> foreground, font) on every PShelfItem of a PShelf?
> (a reason why I need this behavior is, to have a better visual
> separation between the collapsed items)
>
> What would be the easiest way to do this?
> ... write my own subclass of AbstractRenderer?
> The major task I think will be to manage the different colors for each
> PShelfItem, because the renderer class is only linked to the main PShelf.
>
> Kind regards,
> Klaus.
>
>
>
Klaus,

We had a similar issue, we extended the PShelfItem with needed methods,
e.g. #getForeground(), #getImage(), ... and implemented our Renderer,
that is asking the specific PShelfItem for its representation in
AbstractRenderer#paint(GC,Object)

Cheerz,
Tom
[CompositeTable] Version 0.9.3 released [message #47412 is a reply to message #47384] Sat, 26 January 2008 05:02 Go to previous messageGo to next message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
Version 0.9.3 of CompositeTable was just released to the download
site.

This is mainly a maintenance release, but it also adds better scroll
wheel handling, and adds a single row refresh API.

The following Bugzilla query shows the specific changes that went into
this release:

https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advan ced&short_desc_type=allwordssubstr&short_desc=&c lassification=Technology&product=Nebula&component=Co mpositeTable&bug_status=RESOLVED&resolution=FIXED&am p;resolution=DUPLICATE&bugidtype=include&chfieldfrom =2008-01-25&chfieldto=Now&chfieldvalue=&cmdtype= doit


Best regards,

Dave Orme
Re: PShelf: How to change BGColor for PShelfItems [message #47473 is a reply to message #47384] Sat, 26 January 2008 12:46 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Did you file a bug? This sounds like a good use case for a PShelf
contribution.

Tom

Tom Seidel schrieb:
> Klaus Pesendorfer schrieb:
>> How can I set different colors (background, gradient background,
>> foreground, font) on every PShelfItem of a PShelf?
>> (a reason why I need this behavior is, to have a better visual
>> separation between the collapsed items)
>>
>> What would be the easiest way to do this?
>> ... write my own subclass of AbstractRenderer?
>> The major task I think will be to manage the different colors for each
>> PShelfItem, because the renderer class is only linked to the main PShelf.
>>
>> Kind regards,
>> Klaus.
>>
>>
>>
> Klaus,
>
> We had a similar issue, we extended the PShelfItem with needed methods,
> e.g. #getForeground(), #getImage(), ... and implemented our Renderer,
> that is asking the specific PShelfItem for its representation in
> AbstractRenderer#paint(GC,Object)
>
> Cheerz,
> Tom


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: PShelf: How to change BGColor for PShelfItems [message #47503 is a reply to message #47473] Sat, 26 January 2008 16:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tom.seidel.spiritlink.de

Tom,

Ok, I'll file a bug and provide a patch (afer some refactoring :). Still
one question: I'm using some interfaces from JFace. I was wondering if I
can add a dependency to JFace.

Cheerz
Tom

Tom Schindl schrieb:
> Did you file a bug? This sounds like a good use case for a PShelf
> contribution.
>
> Tom
>
> Tom Seidel schrieb:
>> Klaus Pesendorfer schrieb:
>>> How can I set different colors (background, gradient background,
>>> foreground, font) on every PShelfItem of a PShelf?
>>> (a reason why I need this behavior is, to have a better visual
>>> separation between the collapsed items)
>>>
>>> What would be the easiest way to do this?
>>> ... write my own subclass of AbstractRenderer?
>>> The major task I think will be to manage the different colors for
>>> each PShelfItem, because the renderer class is only linked to the
>>> main PShelf.
>>>
>>> Kind regards,
>>> Klaus.
>>>
>>>
>>>
>> Klaus,
>>
>> We had a similar issue, we extended the PShelfItem with needed
>> methods, e.g. #getForeground(), #getImage(), ... and implemented our
>> Renderer, that is asking the specific PShelfItem for its
>> representation in AbstractRenderer#paint(GC,Object)
>>
>> Cheerz,
>> Tom
>
>
Re: PShelf: How to change BGColor for PShelfItems [message #47674 is a reply to message #47503] Sun, 27 January 2008 15:03 Go to previous messageGo to next message
Chris Gross is currently offline Chris GrossFriend
Messages: 253
Registered: July 2009
Senior Member
Hi Tom,

I would be interested in a patch but I do not want the PShelf to need
JFace. I am interested to know what you used from JFace when
implementing your renderer though.

Regards,
-Chris

Tom Seidel wrote:
> Tom,
>
> Ok, I'll file a bug and provide a patch (afer some refactoring :). Still
> one question: I'm using some interfaces from JFace. I was wondering if I
> can add a dependency to JFace.
>
> Cheerz
> Tom
>
> Tom Schindl schrieb:
>> Did you file a bug? This sounds like a good use case for a PShelf
>> contribution.
>>
>> Tom
>>
>> Tom Seidel schrieb:
>>> Klaus Pesendorfer schrieb:
>>>> How can I set different colors (background, gradient background,
>>>> foreground, font) on every PShelfItem of a PShelf?
>>>> (a reason why I need this behavior is, to have a better visual
>>>> separation between the collapsed items)
>>>>
>>>> What would be the easiest way to do this?
>>>> ... write my own subclass of AbstractRenderer?
>>>> The major task I think will be to manage the different colors for
>>>> each PShelfItem, because the renderer class is only linked to the
>>>> main PShelf.
>>>>
>>>> Kind regards,
>>>> Klaus.
>>>>
>>>>
>>>>
>>> Klaus,
>>>
>>> We had a similar issue, we extended the PShelfItem with needed
>>> methods, e.g. #getForeground(), #getImage(), ... and implemented our
>>> Renderer, that is asking the specific PShelfItem for its
>>> representation in AbstractRenderer#paint(GC,Object)
>>>
>>> Cheerz,
>>> Tom
>>
>>
Re: PShelf: How to change BGColor for PShelfItems [message #47763 is a reply to message #47674] Sun, 27 January 2008 20:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tom.seidel.spiritlink.de

Hi Chris,

I wrapped the PSHelf in a JFace similar viewer where you can set
ContentProvider, LabelProvider, FontProvider, etc. In addition the
wrapped PShelf uses a new Renderer, that paints the PSHelf-items based
on that providers. I think this is a good alternative to define a PSHelf
and is compatible to the current code; so the denpendencies to JFace are
limited to the provider-interfaces.

Cheerz

Chris Gross schrieb:
> Hi Tom,
>
> I would be interested in a patch but I do not want the PShelf to need
> JFace. I am interested to know what you used from JFace when
> implementing your renderer though.
>
> Regards,
> -Chris
>
> Tom Seidel wrote:
>> Tom,
>>
>> Ok, I'll file a bug and provide a patch (afer some refactoring :).
>> Still one question: I'm using some interfaces from JFace. I was
>> wondering if I can add a dependency to JFace.
>>
>> Cheerz
>> Tom
>>
>> Tom Schindl schrieb:
>>> Did you file a bug? This sounds like a good use case for a PShelf
>>> contribution.
>>>
>>> Tom
>>>
>>> Tom Seidel schrieb:
>>>> Klaus Pesendorfer schrieb:
>>>>> How can I set different colors (background, gradient background,
>>>>> foreground, font) on every PShelfItem of a PShelf?
>>>>> (a reason why I need this behavior is, to have a better visual
>>>>> separation between the collapsed items)
>>>>>
>>>>> What would be the easiest way to do this?
>>>>> ... write my own subclass of AbstractRenderer?
>>>>> The major task I think will be to manage the different colors for
>>>>> each PShelfItem, because the renderer class is only linked to the
>>>>> main PShelf.
>>>>>
>>>>> Kind regards,
>>>>> Klaus.
>>>>>
>>>>>
>>>>>
>>>> Klaus,
>>>>
>>>> We had a similar issue, we extended the PShelfItem with needed
>>>> methods, e.g. #getForeground(), #getImage(), ... and implemented our
>>>> Renderer, that is asking the specific PShelfItem for its
>>>> representation in AbstractRenderer#paint(GC,Object)
>>>>
>>>> Cheerz,
>>>> Tom
>>>
>>>
Re: PShelf: How to change BGColor for PShelfItems [message #47877 is a reply to message #47763] Mon, 28 January 2008 13:42 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Tom Seidel schrieb:
> Hi Chris,
>
> I wrapped the PSHelf in a JFace similar viewer where you can set
> ContentProvider, LabelProvider, FontProvider, etc. In addition the
> wrapped PShelf uses a new Renderer, that paints the PSHelf-items based
> on that providers. I think this is a good alternative to define a PSHelf
> and is compatible to the current code; so the denpendencies to JFace are
> limited to the provider-interfaces.
>

We could split the viewer-code out into a seperate plugin or do what the
Gallery guys have done by specifying the dependency on JFace as optional.

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: PShelf: How to change BGColor for PShelfItems [message #47937 is a reply to message #47877] Mon, 28 January 2008 20:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tom.seidel.spiritlink.de

>specifying the dependency on JFace as optional.
Ok, makes sense.

Tom

Tom Schindl schrieb:
> Tom Seidel schrieb:
>> Hi Chris,
>>
>> I wrapped the PSHelf in a JFace similar viewer where you can set
>> ContentProvider, LabelProvider, FontProvider, etc. In addition the
>> wrapped PShelf uses a new Renderer, that paints the PSHelf-items based
>> on that providers. I think this is a good alternative to define a
>> PSHelf and is compatible to the current code; so the denpendencies to
>> JFace are limited to the provider-interfaces.
>>
>
> We could split the viewer-code out into a seperate plugin or do what the
> Gallery guys have done by specifying the dependency on JFace as optional.
>
> Tom
>
Re: PShelf: How to change BGColor for PShelfItems [message #48407 is a reply to message #47937] Fri, 01 February 2008 17:21 Go to previous messageGo to next message
Chris Gross is currently offline Chris GrossFriend
Messages: 253
Registered: July 2009
Senior Member
I would be ok with having the JFace stuff be an optional dependency but
I'm a little worried about the renderer using the providers. That seems
a little weird. It might mean we just need to enhance the PShelfItem
class. Or perhaps some other custom attributes can be put in the
setData map of the items. What are you pulling from the provider for
rendering?

regards,
-Chris

Tom Seidel wrote:
> >specifying the dependency on JFace as optional.
> Ok, makes sense.
>
> Tom
>
> Tom Schindl schrieb:
>> Tom Seidel schrieb:
>>> Hi Chris,
>>>
>>> I wrapped the PSHelf in a JFace similar viewer where you can set
>>> ContentProvider, LabelProvider, FontProvider, etc. In addition the
>>> wrapped PShelf uses a new Renderer, that paints the PSHelf-items
>>> based on that providers. I think this is a good alternative to define
>>> a PSHelf and is compatible to the current code; so the denpendencies
>>> to JFace are limited to the provider-interfaces.
>>>
>>
>> We could split the viewer-code out into a seperate plugin or do what
>> the Gallery guys have done by specifying the dependency on JFace as
>> optional.
>>
>> Tom
>>
Re: PShelf: How to change BGColor for PShelfItems [message #48545 is a reply to message #48407] Mon, 04 February 2008 00:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tom.seidel.spiritlink.de

Hi Chris,

Enhancing the PShelf item itself could be a suitable solution for
setting attributes like fonts, color, etc. but I thought it would be
nice if there would be a more abstract handling of the widget, like in
JFace. I think there are some parallels between a PShelf and a Table.

For defining a PShelf you would write something like that
----
PShelfViewer viewer = new PShelfViewer(parentComp, myStyleBits);
viewer.setContentProvider(myContentProvider);
viewer.setLabelProvider(myLabelProvider);
viewer.setChildrenControlProvider(myControlProvider);
viewer.setInput(myInput);
----
The Content-Provider would return all your model-children from your
input you want to visualize with a PShelfItem.
The LabelProvider (that can be also a IColorProvider, IFontProvider)
returns depended on your model object the color and fonts for your
PShelfItem and the ChildrenControlProvider (PShelf-specific) would
return the controls of a PShelf-content; you have to implement the
method #createContents(Composite parent, Object element);

The intention is to eliminate the need of a client to provide a
renderer. The PShelfViewer has assigned by default a renderer which gets
its required attributes from the providers and renders the PShelfItem.
There will be no need to define PShelfItems, they'll be createt by the
Viewer. In addition you could use the nice features from JFace like
ViewerFilter, Sorter, etc..

I don't know if this is a suitable architectur for your, feedback would
be appreciated.

Tom

Chris Gross schrieb:
> I would be ok with having the JFace stuff be an optional dependency but
> I'm a little worried about the renderer using the providers. That seems
> a little weird. It might mean we just need to enhance the PShelfItem
> class. Or perhaps some other custom attributes can be put in the
> setData map of the items. What are you pulling from the provider for
> rendering?
>
> regards,
> -Chris
>
> Tom Seidel wrote:
>> >specifying the dependency on JFace as optional.
>> Ok, makes sense.
>>
>> Tom
>>
>> Tom Schindl schrieb:
>>> Tom Seidel schrieb:
>>>> Hi Chris,
>>>>
>>>> I wrapped the PSHelf in a JFace similar viewer where you can set
>>>> ContentProvider, LabelProvider, FontProvider, etc. In addition the
>>>> wrapped PShelf uses a new Renderer, that paints the PSHelf-items
>>>> based on that providers. I think this is a good alternative to
>>>> define a PSHelf and is compatible to the current code; so the
>>>> denpendencies to JFace are limited to the provider-interfaces.
>>>>
>>>
>>> We could split the viewer-code out into a seperate plugin or do what
>>> the Gallery guys have done by specifying the dependency on JFace as
>>> optional.
>>>
>>> Tom
>>>
Re: PShelf: How to change BGColor for PShelfItems [message #48748 is a reply to message #48545] Tue, 05 February 2008 16:29 Go to previous message
Chris Gross is currently offline Chris GrossFriend
Messages: 253
Registered: July 2009
Senior Member
I think what you describe sounds very cool - but I'm wary to mix JFace
in with the widget. I'd rather stick to the current SWT/JFace
delineation of responsibilities. In other words, just add attributes to
the PShelfItem for all the necessary features. Please feel free to add
bugs against PShelf for all these attributes.

regards,
-Chris

Tom Seidel wrote:
> Hi Chris,
>
> Enhancing the PShelf item itself could be a suitable solution for
> setting attributes like fonts, color, etc. but I thought it would be
> nice if there would be a more abstract handling of the widget, like in
> JFace. I think there are some parallels between a PShelf and a Table.
>
> For defining a PShelf you would write something like that
> ----
> PShelfViewer viewer = new PShelfViewer(parentComp, myStyleBits);
> viewer.setContentProvider(myContentProvider);
> viewer.setLabelProvider(myLabelProvider);
> viewer.setChildrenControlProvider(myControlProvider);
> viewer.setInput(myInput);
> ----
> The Content-Provider would return all your model-children from your
> input you want to visualize with a PShelfItem.
> The LabelProvider (that can be also a IColorProvider, IFontProvider)
> returns depended on your model object the color and fonts for your
> PShelfItem and the ChildrenControlProvider (PShelf-specific) would
> return the controls of a PShelf-content; you have to implement the
> method #createContents(Composite parent, Object element);
>
> The intention is to eliminate the need of a client to provide a
> renderer. The PShelfViewer has assigned by default a renderer which gets
> its required attributes from the providers and renders the PShelfItem.
> There will be no need to define PShelfItems, they'll be createt by the
> Viewer. In addition you could use the nice features from JFace like
> ViewerFilter, Sorter, etc..
>
> I don't know if this is a suitable architectur for your, feedback would
> be appreciated.
>
> Tom
>
> Chris Gross schrieb:
>> I would be ok with having the JFace stuff be an optional dependency
>> but I'm a little worried about the renderer using the providers. That
>> seems a little weird. It might mean we just need to enhance the
>> PShelfItem class. Or perhaps some other custom attributes can be put
>> in the setData map of the items. What are you pulling from the
>> provider for rendering?
>>
>> regards,
>> -Chris
>>
>> Tom Seidel wrote:
>>> >specifying the dependency on JFace as optional.
>>> Ok, makes sense.
>>>
>>> Tom
>>>
>>> Tom Schindl schrieb:
>>>> Tom Seidel schrieb:
>>>>> Hi Chris,
>>>>>
>>>>> I wrapped the PSHelf in a JFace similar viewer where you can set
>>>>> ContentProvider, LabelProvider, FontProvider, etc. In addition the
>>>>> wrapped PShelf uses a new Renderer, that paints the PSHelf-items
>>>>> based on that providers. I think this is a good alternative to
>>>>> define a PSHelf and is compatible to the current code; so the
>>>>> denpendencies to JFace are limited to the provider-interfaces.
>>>>>
>>>>
>>>> We could split the viewer-code out into a seperate plugin or do what
>>>> the Gallery guys have done by specifying the dependency on JFace as
>>>> optional.
>>>>
>>>> Tom
>>>>
Re: PShelf: How to change BGColor for PShelfItems [message #587920 is a reply to message #47327] Fri, 25 January 2008 23:20 Go to previous message
Tom Seidel is currently offline Tom SeidelFriend
Messages: 91
Registered: July 2009
Member
Klaus Pesendorfer schrieb:
> How can I set different colors (background, gradient background,
> foreground, font) on every PShelfItem of a PShelf?
> (a reason why I need this behavior is, to have a better visual
> separation between the collapsed items)
>
> What would be the easiest way to do this?
> ... write my own subclass of AbstractRenderer?
> The major task I think will be to manage the different colors for each
> PShelfItem, because the renderer class is only linked to the main PShelf.
>
> Kind regards,
> Klaus.
>
>
>
Klaus,

We had a similar issue, we extended the PShelfItem with needed methods,
e.g. #getForeground(), #getImage(), ... and implemented our Renderer,
that is asking the specific PShelfItem for its representation in
AbstractRenderer#paint(GC,Object)

Cheerz,
Tom
[CompositeTable] Version 0.9.3 released [message #587927 is a reply to message #47384] Sat, 26 January 2008 05:02 Go to previous message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
Version 0.9.3 of CompositeTable was just released to the download
site.

This is mainly a maintenance release, but it also adds better scroll
wheel handling, and adds a single row refresh API.

The following Bugzilla query shows the specific changes that went into
this release:

https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advan ced&short_desc_type=allwordssubstr&short_desc=&c lassification=Technology&product=Nebula&component=Co mpositeTable&bug_status=RESOLVED&resolution=FIXED&am p;resolution=DUPLICATE&bugidtype=include&chfieldfrom =2008-01-25&chfieldto=Now&chfieldvalue=&cmdtype= doit


Best regards,

Dave Orme
Re: PShelf: How to change BGColor for PShelfItems [message #587948 is a reply to message #47384] Sat, 26 January 2008 12:46 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Did you file a bug? This sounds like a good use case for a PShelf
contribution.

Tom

Tom Seidel schrieb:
> Klaus Pesendorfer schrieb:
>> How can I set different colors (background, gradient background,
>> foreground, font) on every PShelfItem of a PShelf?
>> (a reason why I need this behavior is, to have a better visual
>> separation between the collapsed items)
>>
>> What would be the easiest way to do this?
>> ... write my own subclass of AbstractRenderer?
>> The major task I think will be to manage the different colors for each
>> PShelfItem, because the renderer class is only linked to the main PShelf.
>>
>> Kind regards,
>> Klaus.
>>
>>
>>
> Klaus,
>
> We had a similar issue, we extended the PShelfItem with needed methods,
> e.g. #getForeground(), #getImage(), ... and implemented our Renderer,
> that is asking the specific PShelfItem for its representation in
> AbstractRenderer#paint(GC,Object)
>
> Cheerz,
> Tom


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: PShelf: How to change BGColor for PShelfItems [message #587956 is a reply to message #47473] Sat, 26 January 2008 16:01 Go to previous message
Tom Seidel is currently offline Tom SeidelFriend
Messages: 91
Registered: July 2009
Member
Tom,

Ok, I'll file a bug and provide a patch (afer some refactoring :). Still
one question: I'm using some interfaces from JFace. I was wondering if I
can add a dependency to JFace.

Cheerz
Tom

Tom Schindl schrieb:
> Did you file a bug? This sounds like a good use case for a PShelf
> contribution.
>
> Tom
>
> Tom Seidel schrieb:
>> Klaus Pesendorfer schrieb:
>>> How can I set different colors (background, gradient background,
>>> foreground, font) on every PShelfItem of a PShelf?
>>> (a reason why I need this behavior is, to have a better visual
>>> separation between the collapsed items)
>>>
>>> What would be the easiest way to do this?
>>> ... write my own subclass of AbstractRenderer?
>>> The major task I think will be to manage the different colors for
>>> each PShelfItem, because the renderer class is only linked to the
>>> main PShelf.
>>>
>>> Kind regards,
>>> Klaus.
>>>
>>>
>>>
>> Klaus,
>>
>> We had a similar issue, we extended the PShelfItem with needed
>> methods, e.g. #getForeground(), #getImage(), ... and implemented our
>> Renderer, that is asking the specific PShelfItem for its
>> representation in AbstractRenderer#paint(GC,Object)
>>
>> Cheerz,
>> Tom
>
>
Re: PShelf: How to change BGColor for PShelfItems [message #588027 is a reply to message #47503] Sun, 27 January 2008 15:03 Go to previous message
Chris Gross is currently offline Chris GrossFriend
Messages: 471
Registered: July 2009
Senior Member
Hi Tom,

I would be interested in a patch but I do not want the PShelf to need
JFace. I am interested to know what you used from JFace when
implementing your renderer though.

Regards,
-Chris

Tom Seidel wrote:
> Tom,
>
> Ok, I'll file a bug and provide a patch (afer some refactoring :). Still
> one question: I'm using some interfaces from JFace. I was wondering if I
> can add a dependency to JFace.
>
> Cheerz
> Tom
>
> Tom Schindl schrieb:
>> Did you file a bug? This sounds like a good use case for a PShelf
>> contribution.
>>
>> Tom
>>
>> Tom Seidel schrieb:
>>> Klaus Pesendorfer schrieb:
>>>> How can I set different colors (background, gradient background,
>>>> foreground, font) on every PShelfItem of a PShelf?
>>>> (a reason why I need this behavior is, to have a better visual
>>>> separation between the collapsed items)
>>>>
>>>> What would be the easiest way to do this?
>>>> ... write my own subclass of AbstractRenderer?
>>>> The major task I think will be to manage the different colors for
>>>> each PShelfItem, because the renderer class is only linked to the
>>>> main PShelf.
>>>>
>>>> Kind regards,
>>>> Klaus.
>>>>
>>>>
>>>>
>>> Klaus,
>>>
>>> We had a similar issue, we extended the PShelfItem with needed
>>> methods, e.g. #getForeground(), #getImage(), ... and implemented our
>>> Renderer, that is asking the specific PShelfItem for its
>>> representation in AbstractRenderer#paint(GC,Object)
>>>
>>> Cheerz,
>>> Tom
>>
>>
Re: PShelf: How to change BGColor for PShelfItems [message #588061 is a reply to message #47674] Sun, 27 January 2008 20:05 Go to previous message
Tom Seidel is currently offline Tom SeidelFriend
Messages: 91
Registered: July 2009
Member
Hi Chris,

I wrapped the PSHelf in a JFace similar viewer where you can set
ContentProvider, LabelProvider, FontProvider, etc. In addition the
wrapped PShelf uses a new Renderer, that paints the PSHelf-items based
on that providers. I think this is a good alternative to define a PSHelf
and is compatible to the current code; so the denpendencies to JFace are
limited to the provider-interfaces.

Cheerz

Chris Gross schrieb:
> Hi Tom,
>
> I would be interested in a patch but I do not want the PShelf to need
> JFace. I am interested to know what you used from JFace when
> implementing your renderer though.
>
> Regards,
> -Chris
>
> Tom Seidel wrote:
>> Tom,
>>
>> Ok, I'll file a bug and provide a patch (afer some refactoring :).
>> Still one question: I'm using some interfaces from JFace. I was
>> wondering if I can add a dependency to JFace.
>>
>> Cheerz
>> Tom
>>
>> Tom Schindl schrieb:
>>> Did you file a bug? This sounds like a good use case for a PShelf
>>> contribution.
>>>
>>> Tom
>>>
>>> Tom Seidel schrieb:
>>>> Klaus Pesendorfer schrieb:
>>>>> How can I set different colors (background, gradient background,
>>>>> foreground, font) on every PShelfItem of a PShelf?
>>>>> (a reason why I need this behavior is, to have a better visual
>>>>> separation between the collapsed items)
>>>>>
>>>>> What would be the easiest way to do this?
>>>>> ... write my own subclass of AbstractRenderer?
>>>>> The major task I think will be to manage the different colors for
>>>>> each PShelfItem, because the renderer class is only linked to the
>>>>> main PShelf.
>>>>>
>>>>> Kind regards,
>>>>> Klaus.
>>>>>
>>>>>
>>>>>
>>>> Klaus,
>>>>
>>>> We had a similar issue, we extended the PShelfItem with needed
>>>> methods, e.g. #getForeground(), #getImage(), ... and implemented our
>>>> Renderer, that is asking the specific PShelfItem for its
>>>> representation in AbstractRenderer#paint(GC,Object)
>>>>
>>>> Cheerz,
>>>> Tom
>>>
>>>
Re: PShelf: How to change BGColor for PShelfItems [message #588098 is a reply to message #47763] Mon, 28 January 2008 13:42 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Tom Seidel schrieb:
> Hi Chris,
>
> I wrapped the PSHelf in a JFace similar viewer where you can set
> ContentProvider, LabelProvider, FontProvider, etc. In addition the
> wrapped PShelf uses a new Renderer, that paints the PSHelf-items based
> on that providers. I think this is a good alternative to define a PSHelf
> and is compatible to the current code; so the denpendencies to JFace are
> limited to the provider-interfaces.
>

We could split the viewer-code out into a seperate plugin or do what the
Gallery guys have done by specifying the dependency on JFace as optional.

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: PShelf: How to change BGColor for PShelfItems [message #588116 is a reply to message #47877] Mon, 28 January 2008 20:33 Go to previous message
Tom Seidel is currently offline Tom SeidelFriend
Messages: 91
Registered: July 2009
Member
>specifying the dependency on JFace as optional.
Ok, makes sense.

Tom

Tom Schindl schrieb:
> Tom Seidel schrieb:
>> Hi Chris,
>>
>> I wrapped the PSHelf in a JFace similar viewer where you can set
>> ContentProvider, LabelProvider, FontProvider, etc. In addition the
>> wrapped PShelf uses a new Renderer, that paints the PSHelf-items based
>> on that providers. I think this is a good alternative to define a
>> PSHelf and is compatible to the current code; so the denpendencies to
>> JFace are limited to the provider-interfaces.
>>
>
> We could split the viewer-code out into a seperate plugin or do what the
> Gallery guys have done by specifying the dependency on JFace as optional.
>
> Tom
>
Re: PShelf: How to change BGColor for PShelfItems [message #588262 is a reply to message #47937] Fri, 01 February 2008 17:21 Go to previous message
Chris Gross is currently offline Chris GrossFriend
Messages: 471
Registered: July 2009
Senior Member
I would be ok with having the JFace stuff be an optional dependency but
I'm a little worried about the renderer using the providers. That seems
a little weird. It might mean we just need to enhance the PShelfItem
class. Or perhaps some other custom attributes can be put in the
setData map of the items. What are you pulling from the provider for
rendering?

regards,
-Chris

Tom Seidel wrote:
> >specifying the dependency on JFace as optional.
> Ok, makes sense.
>
> Tom
>
> Tom Schindl schrieb:
>> Tom Seidel schrieb:
>>> Hi Chris,
>>>
>>> I wrapped the PSHelf in a JFace similar viewer where you can set
>>> ContentProvider, LabelProvider, FontProvider, etc. In addition the
>>> wrapped PShelf uses a new Renderer, that paints the PSHelf-items
>>> based on that providers. I think this is a good alternative to define
>>> a PSHelf and is compatible to the current code; so the denpendencies
>>> to JFace are limited to the provider-interfaces.
>>>
>>
>> We could split the viewer-code out into a seperate plugin or do what
>> the Gallery guys have done by specifying the dependency on JFace as
>> optional.
>>
>> Tom
>>
Re: PShelf: How to change BGColor for PShelfItems [message #588312 is a reply to message #48407] Mon, 04 February 2008 00:39 Go to previous message
Tom Seidel is currently offline Tom SeidelFriend
Messages: 91
Registered: July 2009
Member
Hi Chris,

Enhancing the PShelf item itself could be a suitable solution for
setting attributes like fonts, color, etc. but I thought it would be
nice if there would be a more abstract handling of the widget, like in
JFace. I think there are some parallels between a PShelf and a Table.

For defining a PShelf you would write something like that
----
PShelfViewer viewer = new PShelfViewer(parentComp, myStyleBits);
viewer.setContentProvider(myContentProvider);
viewer.setLabelProvider(myLabelProvider);
viewer.setChildrenControlProvider(myControlProvider);
viewer.setInput(myInput);
----
The Content-Provider would return all your model-children from your
input you want to visualize with a PShelfItem.
The LabelProvider (that can be also a IColorProvider, IFontProvider)
returns depended on your model object the color and fonts for your
PShelfItem and the ChildrenControlProvider (PShelf-specific) would
return the controls of a PShelf-content; you have to implement the
method #createContents(Composite parent, Object element);

The intention is to eliminate the need of a client to provide a
renderer. The PShelfViewer has assigned by default a renderer which gets
its required attributes from the providers and renders the PShelfItem.
There will be no need to define PShelfItems, they'll be createt by the
Viewer. In addition you could use the nice features from JFace like
ViewerFilter, Sorter, etc..

I don't know if this is a suitable architectur for your, feedback would
be appreciated.

Tom

Chris Gross schrieb:
> I would be ok with having the JFace stuff be an optional dependency but
> I'm a little worried about the renderer using the providers. That seems
> a little weird. It might mean we just need to enhance the PShelfItem
> class. Or perhaps some other custom attributes can be put in the
> setData map of the items. What are you pulling from the provider for
> rendering?
>
> regards,
> -Chris
>
> Tom Seidel wrote:
>> >specifying the dependency on JFace as optional.
>> Ok, makes sense.
>>
>> Tom
>>
>> Tom Schindl schrieb:
>>> Tom Seidel schrieb:
>>>> Hi Chris,
>>>>
>>>> I wrapped the PSHelf in a JFace similar viewer where you can set
>>>> ContentProvider, LabelProvider, FontProvider, etc. In addition the
>>>> wrapped PShelf uses a new Renderer, that paints the PSHelf-items
>>>> based on that providers. I think this is a good alternative to
>>>> define a PSHelf and is compatible to the current code; so the
>>>> denpendencies to JFace are limited to the provider-interfaces.
>>>>
>>>
>>> We could split the viewer-code out into a seperate plugin or do what
>>> the Gallery guys have done by specifying the dependency on JFace as
>>> optional.
>>>
>>> Tom
>>>
Re: PShelf: How to change BGColor for PShelfItems [message #588402 is a reply to message #48545] Tue, 05 February 2008 16:29 Go to previous message
Chris Gross is currently offline Chris GrossFriend
Messages: 471
Registered: July 2009
Senior Member
I think what you describe sounds very cool - but I'm wary to mix JFace
in with the widget. I'd rather stick to the current SWT/JFace
delineation of responsibilities. In other words, just add attributes to
the PShelfItem for all the necessary features. Please feel free to add
bugs against PShelf for all these attributes.

regards,
-Chris

Tom Seidel wrote:
> Hi Chris,
>
> Enhancing the PShelf item itself could be a suitable solution for
> setting attributes like fonts, color, etc. but I thought it would be
> nice if there would be a more abstract handling of the widget, like in
> JFace. I think there are some parallels between a PShelf and a Table.
>
> For defining a PShelf you would write something like that
> ----
> PShelfViewer viewer = new PShelfViewer(parentComp, myStyleBits);
> viewer.setContentProvider(myContentProvider);
> viewer.setLabelProvider(myLabelProvider);
> viewer.setChildrenControlProvider(myControlProvider);
> viewer.setInput(myInput);
> ----
> The Content-Provider would return all your model-children from your
> input you want to visualize with a PShelfItem.
> The LabelProvider (that can be also a IColorProvider, IFontProvider)
> returns depended on your model object the color and fonts for your
> PShelfItem and the ChildrenControlProvider (PShelf-specific) would
> return the controls of a PShelf-content; you have to implement the
> method #createContents(Composite parent, Object element);
>
> The intention is to eliminate the need of a client to provide a
> renderer. The PShelfViewer has assigned by default a renderer which gets
> its required attributes from the providers and renders the PShelfItem.
> There will be no need to define PShelfItems, they'll be createt by the
> Viewer. In addition you could use the nice features from JFace like
> ViewerFilter, Sorter, etc..
>
> I don't know if this is a suitable architectur for your, feedback would
> be appreciated.
>
> Tom
>
> Chris Gross schrieb:
>> I would be ok with having the JFace stuff be an optional dependency
>> but I'm a little worried about the renderer using the providers. That
>> seems a little weird. It might mean we just need to enhance the
>> PShelfItem class. Or perhaps some other custom attributes can be put
>> in the setData map of the items. What are you pulling from the
>> provider for rendering?
>>
>> regards,
>> -Chris
>>
>> Tom Seidel wrote:
>>> >specifying the dependency on JFace as optional.
>>> Ok, makes sense.
>>>
>>> Tom
>>>
>>> Tom Schindl schrieb:
>>>> Tom Seidel schrieb:
>>>>> Hi Chris,
>>>>>
>>>>> I wrapped the PSHelf in a JFace similar viewer where you can set
>>>>> ContentProvider, LabelProvider, FontProvider, etc. In addition the
>>>>> wrapped PShelf uses a new Renderer, that paints the PSHelf-items
>>>>> based on that providers. I think this is a good alternative to
>>>>> define a PSHelf and is compatible to the current code; so the
>>>>> denpendencies to JFace are limited to the provider-interfaces.
>>>>>
>>>>
>>>> We could split the viewer-code out into a seperate plugin or do what
>>>> the Gallery guys have done by specifying the dependency on JFace as
>>>> optional.
>>>>
>>>> Tom
>>>>
Previous Topic:Gallery : NullPointerException at clearAll()
Next Topic:Restricting the selection of entire row in grid
Goto Forum:
  


Current Time: Fri Apr 19 01:59:52 GMT 2024

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

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

Back to the top