Home » Eclipse Projects » Nebula » PShelf: How to change BGColor for PShelfItems
PShelf: How to change BGColor for PShelfItems [message #47327] |
Fri, 25 January 2008 05:10  |
Eclipse User |
|
|
|
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 18:20   |
Eclipse User |
|
|
|
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
|
|
| |
Re: PShelf: How to change BGColor for PShelfItems [message #47473 is a reply to message #47384] |
Sat, 26 January 2008 07:46   |
Eclipse User |
|
|
|
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 11:01   |
Eclipse User |
|
|
|
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 10:03   |
Eclipse User |
|
|
|
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 15:05   |
Eclipse User |
|
|
|
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 #48545 is a reply to message #48407] |
Sun, 03 February 2008 19:39   |
Eclipse User |
|
|
|
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 11:29  |
Eclipse User |
|
|
|
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 18:20  |
Eclipse User |
|
|
|
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 #587948 is a reply to message #47384] |
Sat, 26 January 2008 07:46  |
Eclipse User |
|
|
|
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 11:01  |
Eclipse User |
|
|
|
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 10:03  |
Eclipse User |
|
|
|
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 15:05  |
Eclipse User |
|
|
|
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 08:42  |
Eclipse User |
|
|
|
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 15:33  |
Eclipse User |
|
|
|
>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 12:21  |
Eclipse User |
|
|
|
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] |
Sun, 03 February 2008 19:39  |
Eclipse User |
|
|
|
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 11:29  |
Eclipse User |
|
|
|
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
>>>>
|
|
|
Goto Forum:
Current Time: Thu May 08 10:24:23 EDT 2025
Powered by FUDForum. Page generated in 0.35626 seconds
|