Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » CompositeTable has landed. :-)
CompositeTable has landed. :-) [message #14795] Sat, 21 October 2006 06:37 Go to next message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
CompositeTable source code has just been committed to Nebula CVS with
the following features:

- Edit your grid visually using the Eclipse Visual Editor
- Use *any* SWT control anywhere in your grid's header or row
- Automatically edit in-place with zero extra code
- Fully virtual -- only requests data that it actually displays
- Insert / delete either programmatically or from the user interface.
- Supports the new JFace Data Binding API (binding code in the JFace
data binding examples plugin)

In addition, an example Outlook(r)/PalmOS(r) calendar control has been
submitted illustrating some of the more sophisticated things that can be
done with this control.

I'll be working with Chris to make a full download available as soon as
possible. In the meantime, grab HEAD and try out CompositeTableTest and
DayEditorTest to see how things work.


Best regards,

Dave Orme
Re: CompositeTable has landed. :-) [message #14825 is a reply to message #14795] Sat, 21 October 2006 17:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alnospammajor.noboxspamspoon.com

David J. Orme wrote:
> - Use *any* SWT control anywhere in your grid's header or row

how does this compare with CTableTree's functionality. can i embed a
GEF viewer in a row? that's the primary use case i'm interested in.

i'm assuming that this means the row heights can be set individually.

how does CompositeTable compare to CTableTree in general?

thx,

al
Re: CompositeTable has landed. :-) [message #14855 is a reply to message #14795] Sat, 21 October 2006 17:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alnospammajor.noboxspamspoon.com

does CompositeTable use content providers ala JFace? if so, does it
support ITreePathContentProvider?

David J. Orme wrote:
> CompositeTable source code has just been committed to Nebula CVS with
> the following features:
>
> - Edit your grid visually using the Eclipse Visual Editor
> - Use *any* SWT control anywhere in your grid's header or row
> - Automatically edit in-place with zero extra code
> - Fully virtual -- only requests data that it actually displays
> - Insert / delete either programmatically or from the user interface.
> - Supports the new JFace Data Binding API (binding code in the JFace
> data binding examples plugin)
>
> In addition, an example Outlook(r)/PalmOS(r) calendar control has been
> submitted illustrating some of the more sophisticated things that can be
> done with this control.
>
> I'll be working with Chris to make a full download available as soon as
> possible. In the meantime, grab HEAD and try out CompositeTableTest and
> DayEditorTest to see how things work.
>
>
> Best regards,
>
> Dave Orme
Re: CompositeTable has landed. :-) [message #14886 is a reply to message #14855] Sat, 21 October 2006 17:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alnospammajor.noboxspamspoon.com

i see that there's no nebface viewer correspondong to CompositeTable, so
i'm assuming the answer to my questions are no and no.

Al Major wrote:
> does CompositeTable use content providers ala JFace? if so, does it
> support ITreePathContentProvider?
>
> David J. Orme wrote:
>> CompositeTable source code has just been committed to Nebula CVS with
>> the following features:
>>
>> - Edit your grid visually using the Eclipse Visual Editor
>> - Use *any* SWT control anywhere in your grid's header or row
>> - Automatically edit in-place with zero extra code
>> - Fully virtual -- only requests data that it actually displays
>> - Insert / delete either programmatically or from the user interface.
>> - Supports the new JFace Data Binding API (binding code in the JFace
>> data binding examples plugin)
>>
>> In addition, an example Outlook(r)/PalmOS(r) calendar control has been
>> submitted illustrating some of the more sophisticated things that can
>> be done with this control.
>>
>> I'll be working with Chris to make a full download available as soon
>> as possible. In the meantime, grab HEAD and try out
>> CompositeTableTest and DayEditorTest to see how things work.
>>
>>
>> Best regards,
>>
>> Dave Orme
Re: CompositeTable has landed. :-) [message #14910 is a reply to message #14825] Sat, 21 October 2006 17:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alnospammajor.noboxspamspoon.com

one difference appears to be tree functionality. i'm assuming
CompositeTable doesn't provide any. but is there an easy way to do
master/detail rows (basically a tree of depth 2)?

Al Major wrote:
> how does this compare with CTableTree's functionality. can i embed a
> GEF viewer in a row? that's the primary use case i'm interested in.
Re: CompositeTable has landed. :-) [message #14930 is a reply to message #14825] Sat, 21 October 2006 17:58 Go to previous messageGo to next message
Chris Gross is currently offline Chris GrossFriend
Messages: 253
Registered: July 2009
Senior Member
It should be noted that you can use an TableEditor/TreeEditor to embed
any widget in even the standard SWT Tree and Table.

-Chris


Al Major wrote:
> David J. Orme wrote:
>> - Use *any* SWT control anywhere in your grid's header or row
>
> how does this compare with CTableTree's functionality. can i embed a
> GEF viewer in a row? that's the primary use case i'm interested in.
>
> i'm assuming that this means the row heights can be set individually.
>
> how does CompositeTable compare to CTableTree in general?
>
> thx,
>
> al
Re: CompositeTable has landed. :-) [message #15152 is a reply to message #14930] Sat, 21 October 2006 18:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alnospammajor.noboxspamspoon.com

but that's an API for embedding a widget, one cell at at time (whichever
cell is being in-place-edited), correct? i just assumed it wasn't
appropriate for a table/tree that may have half or more of it's cells be
arbitrary widgets. if that's an incorrect assumption, i would definitely
consider that as an option.

Chris Gross wrote:
> It should be noted that you can use an TableEditor/TreeEditor to embed
> any widget in even the standard SWT Tree and Table.
>
> -Chris
>
>
> Al Major wrote:
>> David J. Orme wrote:
>>> - Use *any* SWT control anywhere in your grid's header or row
>>
>> how does this compare with CTableTree's functionality. can i embed
>> a GEF viewer in a row? that's the primary use case i'm interested in.
>>
>> i'm assuming that this means the row heights can be set individually.
>>
>> how does CompositeTable compare to CTableTree in general?
>>
>> thx,
>>
>> al
Re: CompositeTable has landed. :-) [message #15182 is a reply to message #15152] Sat, 21 October 2006 18:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alnospammajor.noboxspamspoon.com

plus, i do like JFace style model/view separation, so would want viewers
on top of the TreeEditor/Tree combo.

Al Major wrote:
> but that's an API for embedding a widget, one cell at at time (whichever
> cell is being in-place-edited), correct? i just assumed it wasn't
> appropriate for a table/tree that may have half or more of it's cells be
> arbitrary widgets. if that's an incorrect assumption, i would definitely
> consider that as an option.
>
> Chris Gross wrote:
>> It should be noted that you can use an TableEditor/TreeEditor to embed
>> any widget in even the standard SWT Tree and Table.
>>
>> -Chris
>>
>>
>> Al Major wrote:
>>> David J. Orme wrote:
>>>> - Use *any* SWT control anywhere in your grid's header or row
>>>
>>> how does this compare with CTableTree's functionality. can i
>>> embed a GEF viewer in a row? that's the primary use case i'm
>>> interested in.
>>>
>>> i'm assuming that this means the row heights can be set
>>> individually.
>>>
>>> how does CompositeTable compare to CTableTree in general?
>>>
>>> thx,
>>>
>>> al
Re: CompositeTable has landed. :-) [message #15214 is a reply to message #15182] Sat, 21 October 2006 18:45 Go to previous messageGo to next message
Chris Gross is currently offline Chris GrossFriend
Messages: 253
Registered: July 2009
Senior Member
The base SWT TableEditor/TreeEditor classes can be specifically
activated or active all the time. Its up to you. See the following SWT
snippet:

http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.ecli pse.swt.snippets/src/org/eclipse/swt/snippets/Snippet126.jav a

Regarding JFace viewers, I believe you can use a viewer and still create
and use a regular SWT TableEditor. JFace viewers also have a paradigm
for using its own cell editors which are typically triggered by clicking
on the cell. I'm not sure if JFace has a way to keep an editor active.

-Chris

Al Major wrote:
> plus, i do like JFace style model/view separation, so would want viewers
> on top of the TreeEditor/Tree combo.
>
> Al Major wrote:
>> but that's an API for embedding a widget, one cell at at time
>> (whichever cell is being in-place-edited), correct? i just assumed it
>> wasn't appropriate for a table/tree that may have half or more of it's
>> cells be arbitrary widgets. if that's an incorrect assumption, i would
>> definitely consider that as an option.
>>
>> Chris Gross wrote:
>>> It should be noted that you can use an TableEditor/TreeEditor to
>>> embed any widget in even the standard SWT Tree and Table.
>>>
>>> -Chris
>>>
>>>
>>> Al Major wrote:
>>>> David J. Orme wrote:
>>>>> - Use *any* SWT control anywhere in your grid's header or row
>>>>
>>>> how does this compare with CTableTree's functionality. can i
>>>> embed a GEF viewer in a row? that's the primary use case i'm
>>>> interested in.
>>>>
>>>> i'm assuming that this means the row heights can be set
>>>> individually.
>>>>
>>>> how does CompositeTable compare to CTableTree in general?
>>>>
>>>> thx,
>>>>
>>>> al
Re: CompositeTable has landed. :-) [message #15247 is a reply to message #15214] Sat, 21 October 2006 20:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alnospammajor.noboxspamspoon.com

if this works as the snippet implies, one option for me would be to
modify the standard JFace viewer so that it'll

a) provide a model that allows a representation of arbitrary widgets in
rows, kinda like CTableTreeViewer
b) use the ***Editor classes within this modified viewer to implement
the arbitrary widgets using the standard Tree controls
c) change the row-height of TreeItem (on a first glance at the code,
this actually seems to be the only thing that the current design makes
difficult).

this seems a bit like re-inventing CTableTreeViewer without the
tree-in-every-cell feature (which i don't need). but since that viewer
needs to be modified to support my use-case (ITreePathContentProvider),
this may actually be the easiest option for me.

however, this is such a common use-case (i think) that it begs to be
abstracted. it probably should be in JFace to begin with. or somewhere
else where it can be re-used.

al

Chris Gross wrote:
> The base SWT TableEditor/TreeEditor classes can be specifically
> activated or active all the time. Its up to you. See the following SWT
> snippet:
>
> http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.ecli pse.swt.snippets/src/org/eclipse/swt/snippets/Snippet126.jav a
>
>
> Regarding JFace viewers, I believe you can use a viewer and still create
> and use a regular SWT TableEditor. JFace viewers also have a paradigm
> for using its own cell editors which are typically triggered by clicking
> on the cell. I'm not sure if JFace has a way to keep an editor active.
>
> -Chris
>
> Al Major wrote:
>> plus, i do like JFace style model/view separation, so would want
>> viewers on top of the TreeEditor/Tree combo.
>>
>> Al Major wrote:
>>> but that's an API for embedding a widget, one cell at at time
>>> (whichever cell is being in-place-edited), correct? i just assumed it
>>> wasn't appropriate for a table/tree that may have half or more of
>>> it's cells be arbitrary widgets. if that's an incorrect assumption, i
>>> would definitely consider that as an option.
>>>
>>> Chris Gross wrote:
>>>> It should be noted that you can use an TableEditor/TreeEditor to
>>>> embed any widget in even the standard SWT Tree and Table.
>>>>
>>>> -Chris
>>>>
>>>>
>>>> Al Major wrote:
>>>>> David J. Orme wrote:
>>>>>> - Use *any* SWT control anywhere in your grid's header or row
>>>>>
>>>>> how does this compare with CTableTree's functionality. can i
>>>>> embed a GEF viewer in a row? that's the primary use case i'm
>>>>> interested in.
>>>>>
>>>>> i'm assuming that this means the row heights can be set
>>>>> individually.
>>>>>
>>>>> how does CompositeTable compare to CTableTree in general?
>>>>>
>>>>> thx,
>>>>>
>>>>> al
Re: CompositeTable has landed. :-) [message #15280 is a reply to message #14825] Sat, 21 October 2006 20:41 Go to previous messageGo to next message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
Al Major wrote:
> David J. Orme wrote:
>> - Use *any* SWT control anywhere in your grid's header or row
>
> how does this compare with CTableTree's functionality. can i embed a
> GEF viewer in a row? that's the primary use case i'm interested in.

I believe that CTableTree is lightweight. CompositeTable works by
pasting together existing SWT controls to look and behave like a table.

> i'm assuming that this means the row heights can be set individually.

Currently all rows must be the same height. If you need flexibility
here, please file a bug or better yet, contribute a patch. :-)

> how does CompositeTable compare to CTableTree in general?

CompositeTable makes no attempts to be a tree and it's best to think of
it as like a *really* powerful tabular layout manager because it
fundamentally works with other controls that you supply.

The advantage is that you get complete flexibility for how the users
will interact with your table as well as complete flexibility about
mixing and/or matching lightweight and heavyweight controls inside your
table. The disadvantage is that a highly-optimized lightweight control
will draw and, resize, and scroll somewhat faster.

To see both the advantages and disadvantages in action at once, try
running the DayEditorTest demo, which implements an Outlook-like work
week calendar control. It really powerful and looks nice, but when you
load a lot of data into it, there are a few visible artifacts when you
scroll where you can see the layout managers delegating layout semantics
to all of the embedded controls.

DayEditor is an extreme example both of how graphical you can get with
CompositeTable and also pushes the limits of what you can do nicely with
it performance-wise, so it's a pretty good example to study.


Regards,

Dave Orme




Regards,

Dave Orme
Re: CompositeTable has landed. :-) [message #15312 is a reply to message #14910] Sat, 21 October 2006 20:43 Go to previous messageGo to next message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
Al Major wrote:
> one difference appears to be tree functionality. i'm assuming
> CompositeTable doesn't provide any. but is there an easy way to do
> master/detail rows (basically a tree of depth 2)?

A row can currently contain *anything* you want as long as consecutive
rows in the same table are all the same height.


Best regards,

Dave Orme
Re: CompositeTable has landed. :-) [message #15345 is a reply to message #14930] Sat, 21 October 2006 21:03 Go to previous messageGo to next message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
Chris Gross wrote:
> It should be noted that you can use an TableEditor/TreeEditor to embed
> any widget in even the standard SWT Tree and Table.

True, but you can't lay them out however you want. :-) For example,
the following kind of repeating row layout is hard to do with the
standard table, but is dirt simple with CompositeTable:

CheckNo Clr Description Debit Credit Balance
Memo Category
CheckNo Clr Description Debit Credit Balance
Memo Category
CheckNo Clr Description Debit Credit Balance
Memo Category
.....


Best Regards,

Dave Orme
Re: CompositeTable has landed. :-) [message #15378 is a reply to message #14855] Sat, 21 October 2006 21:17 Go to previous messageGo to next message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
Al Major wrote:
> does CompositeTable use content providers ala JFace? if so, does it
> support ITreePathContentProvider?

CompositeTable uses a concept similar to JFace content providers by
default (since it's virtual). Again, because CompositeTable is virtual,
it is actually impossible to use CompositeTable in any way other than
via some sort of MVC pattern--either using CompositeTable's native API
or via data binding.

CompositeTable's native API is intentionally designed to be conceptually
similar to JFace, but because of the requirement to be able to put any
kind of control anywhere in a row using any layout manager, the API
necessarily isn't exactly the same as JFace.

In addition, CompositeTable supports the new JFace data binding API
right now. (We actually have deployed CompositeTable in a 2 million
plus line enterprise application using data binding as the MVC layer.)

So CompositeTable supports a nice MVC separation of concerns either way.


Best regards,

Dave Orme
Re: CompositeTable has landed. :-) [message #15411 is a reply to message #15378] Sun, 22 October 2006 03:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alnospammajor.noboxspamspoon.com

hmm. data binding isn't particularly important in this case.
architecture/API similarity/correspondence with other JFace viewers is
desirable. but i'll take a look at the actual CompositeTable code before
i comment further.

David J. Orme wrote:
> Al Major wrote:
>> does CompositeTable use content providers ala JFace? if so, does it
>> support ITreePathContentProvider?
>
> CompositeTable uses a concept similar to JFace content providers by
> default (since it's virtual). Again, because CompositeTable is virtual,
> it is actually impossible to use CompositeTable in any way other than
> via some sort of MVC pattern--either using CompositeTable's native API
> or via data binding.
>
> CompositeTable's native API is intentionally designed to be conceptually
> similar to JFace, but because of the requirement to be able to put any
> kind of control anywhere in a row using any layout manager, the API
> necessarily isn't exactly the same as JFace.
>
> In addition, CompositeTable supports the new JFace data binding API
> right now. (We actually have deployed CompositeTable in a 2 million
> plus line enterprise application using data binding as the MVC layer.)
>
> So CompositeTable supports a nice MVC separation of concerns either way.
>
>
> Best regards,
>
> Dave Orme
Re: CompositeTable has landed. :-) [message #15444 is a reply to message #14910] Sun, 22 October 2006 20:34 Go to previous messageGo to next message
Jeremy Dowdall is currently offline Jeremy DowdallFriend
Messages: 181
Registered: July 2009
Senior Member
> ...is there an easy way to do
> master/detail rows (basically a tree of depth 2)?

Master/Detail rows is what caused CTableTree to be created in the first
place, though maybe we're talking about different things here.

A master/detail block, as one might create using the Forms toolkit, has
a table on one side and a detail composite on the other. As the user
selects an item from the table, the appropriate info is filled in, and
is editable in, the child controls of the detail composite.
see the pic most of the way down this page:
http://www.eclipse.org/articles/Article-Forms/article.html

When using the CTableTree, each cell's title area effectively creates
the master table but rather than having a separate detail composite to
the side, it is in the child area of the cell (which can now span the
width of the table width if necessary).
see in the first pic's upper left, "Contacts", view part:
http://www.aspencloud.com/screenshots.php

Is there a reason you do not use the child area of the CTableTreeCell?
Re: CompositeTable has landed. :-) [message #15477 is a reply to message #15280] Sun, 22 October 2006 20:48 Go to previous messageGo to next message
Jeremy Dowdall is currently offline Jeremy DowdallFriend
Messages: 181
Registered: July 2009
Senior Member
David J. Orme wrote:
> I believe that CTableTree is lightweight. CompositeTable works by
> pasting together existing SWT controls to look and behave like a table.

CTableTree can be either, or both. It works by pasting together
CTableTreeCells which have a Title Area and a Child Area and thus allow
each cell to create and display itself in two stages.
One way to begin looking at a CTableTree is to view each column as a
vertical list of ExpandableComposites (or PGroups), where both the title
and child can contain anything, or have anything drawn on them using a GC.
Re: CompositeTable has landed. :-) [message #15510 is a reply to message #15247] Mon, 23 October 2006 08:03 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Comments in line:

Al Major schrieb:
> if this works as the snippet implies, one option for me would be to
> modify the standard JFace viewer so that it'll
>
> a) provide a model that allows a representation of arbitrary widgets in
> rows, kinda like CTableTreeViewer

https://bugs.eclipse.org/bugs/show_bug.cgi?id=36977. The only problem I
could think of are resources needed when using arbitary widgets like
Steve says in https://bugs.eclipse.org/bugs/show_bug.cgi?id=36977#c6

> b) use the ***Editor classes within this modified viewer to implement
> the arbitrary widgets using the standard Tree controls
> c) change the row-height of TreeItem (on a first glance at the code,
> this actually seems to be the only thing that the current design makes
> difficult).

The limitation of SWT Tree/Table is that *all* rows in your table need
to have the same row height!

>
> this seems a bit like re-inventing CTableTreeViewer without the
> tree-in-every-cell feature (which i don't need). but since that viewer
> needs to be modified to support my use-case (ITreePathContentProvider),
> this may actually be the easiest option for me.
>
> however, this is such a common use-case (i think) that it begs to be
> abstracted. it probably should be in JFace to begin with. or somewhere
> else where it can be re-used.
>

By the way we have been actively working on JFace-Viewer support for
nebula already and provide draft solutions how this could work.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=154329

together with:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=153993
https://bugs.eclipse.org/bugs/show_bug.cgi?id=151295
https://bugs.eclipse.org/bugs/show_bug.cgi?id=36977

Will make JFace a really powerfully editing platform.

>>
>> Regarding JFace viewers, I believe you can use a viewer and still
>> create and use a regular SWT TableEditor. JFace viewers also have a
>> paradigm for using its own cell editors which are typically triggered
>> by clicking on the cell. I'm not sure if JFace has a way to keep an
>> editor active.

Yes that's true. You can use Table/TreeEditor together with CellEditors
currently although you need some custom code to deactivate the
Table/TreeEditor. Although I have tried it myself it seems to work.

http://dev.eclipse.org/newslists/news.eclipse.platform/msg58 930.html

I'll revisit this topic once I'll start working on
https://bugs.eclipse.org/bugs/show_bug.cgi?id=36977 but there are more
important JFace topics on my personal priority list and because
CompositeTable provides what is requested here the priority is lowered
once more ;-)

By the way CompositeTable is really cool stuff David how good is it
tested in real world applications. Do you think it could already be used
in commercial projects?

Tom
Re: CompositeTable has landed. :-) [message #15542 is a reply to message #15510] Mon, 23 October 2006 12:16 Go to previous messageGo to next message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
Tom Schindl wrote:
> By the way CompositeTable is really cool stuff David how good is it
> tested in real world applications. Do you think it could already be used
> in commercial projects?

Thanks. :-)

We're using CompositeTable successfully in a two million plus line
enterprise RCP application, plus I have used it on small in-house projects.

One thing CompositeTable does to eliminate the SWT resource issue is: it
only creates SWT controls to represent *visible* rows. So there is a
hard upper bound on how many SWT controls CompositeTable will ever
create at a given time.


Best regards,

Dave Orme
Re: CompositeTable has landed. :-) [message #15573 is a reply to message #15477] Mon, 23 October 2006 12:16 Go to previous message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
Jeremy Dowdall wrote:
> David J. Orme wrote:
>> I believe that CTableTree is lightweight. CompositeTable works by
>> pasting together existing SWT controls to look and behave like a table.
>
> CTableTree can be either, or both. It works by pasting together
> CTableTreeCells which have a Title Area and a Child Area and thus allow
> each cell to create and display itself in two stages.
> One way to begin looking at a CTableTree is to view each column as a
> vertical list of ExpandableComposites (or PGroups), where both the title
> and child can contain anything, or have anything drawn on them using a GC.

That's pretty cool. :-)


Dave
Re: CompositeTable has landed. :-) [message #567052 is a reply to message #14795] Sat, 21 October 2006 17:15 Go to previous message
Al Major is currently offline Al MajorFriend
Messages: 72
Registered: July 2009
Member
David J. Orme wrote:
> - Use *any* SWT control anywhere in your grid's header or row

how does this compare with CTableTree's functionality. can i embed a
GEF viewer in a row? that's the primary use case i'm interested in.

i'm assuming that this means the row heights can be set individually.

how does CompositeTable compare to CTableTree in general?

thx,

al
Re: CompositeTable has landed. :-) [message #567087 is a reply to message #14795] Sat, 21 October 2006 17:18 Go to previous message
Al Major is currently offline Al MajorFriend
Messages: 72
Registered: July 2009
Member
does CompositeTable use content providers ala JFace? if so, does it
support ITreePathContentProvider?

David J. Orme wrote:
> CompositeTable source code has just been committed to Nebula CVS with
> the following features:
>
> - Edit your grid visually using the Eclipse Visual Editor
> - Use *any* SWT control anywhere in your grid's header or row
> - Automatically edit in-place with zero extra code
> - Fully virtual -- only requests data that it actually displays
> - Insert / delete either programmatically or from the user interface.
> - Supports the new JFace Data Binding API (binding code in the JFace
> data binding examples plugin)
>
> In addition, an example Outlook(r)/PalmOS(r) calendar control has been
> submitted illustrating some of the more sophisticated things that can be
> done with this control.
>
> I'll be working with Chris to make a full download available as soon as
> possible. In the meantime, grab HEAD and try out CompositeTableTest and
> DayEditorTest to see how things work.
>
>
> Best regards,
>
> Dave Orme
Re: CompositeTable has landed. :-) [message #567121 is a reply to message #14855] Sat, 21 October 2006 17:19 Go to previous message
Al Major is currently offline Al MajorFriend
Messages: 72
Registered: July 2009
Member
i see that there's no nebface viewer correspondong to CompositeTable, so
i'm assuming the answer to my questions are no and no.

Al Major wrote:
> does CompositeTable use content providers ala JFace? if so, does it
> support ITreePathContentProvider?
>
> David J. Orme wrote:
>> CompositeTable source code has just been committed to Nebula CVS with
>> the following features:
>>
>> - Edit your grid visually using the Eclipse Visual Editor
>> - Use *any* SWT control anywhere in your grid's header or row
>> - Automatically edit in-place with zero extra code
>> - Fully virtual -- only requests data that it actually displays
>> - Insert / delete either programmatically or from the user interface.
>> - Supports the new JFace Data Binding API (binding code in the JFace
>> data binding examples plugin)
>>
>> In addition, an example Outlook(r)/PalmOS(r) calendar control has been
>> submitted illustrating some of the more sophisticated things that can
>> be done with this control.
>>
>> I'll be working with Chris to make a full download available as soon
>> as possible. In the meantime, grab HEAD and try out
>> CompositeTableTest and DayEditorTest to see how things work.
>>
>>
>> Best regards,
>>
>> Dave Orme
Re: CompositeTable has landed. :-) [message #567158 is a reply to message #14825] Sat, 21 October 2006 17:39 Go to previous message
Al Major is currently offline Al MajorFriend
Messages: 72
Registered: July 2009
Member
one difference appears to be tree functionality. i'm assuming
CompositeTable doesn't provide any. but is there an easy way to do
master/detail rows (basically a tree of depth 2)?

Al Major wrote:
> how does this compare with CTableTree's functionality. can i embed a
> GEF viewer in a row? that's the primary use case i'm interested in.
Re: CompositeTable has landed. :-) [message #567171 is a reply to message #14825] Sat, 21 October 2006 17:58 Go to previous message
Chris Gross is currently offline Chris GrossFriend
Messages: 471
Registered: July 2009
Senior Member
It should be noted that you can use an TableEditor/TreeEditor to embed
any widget in even the standard SWT Tree and Table.

-Chris


Al Major wrote:
> David J. Orme wrote:
>> - Use *any* SWT control anywhere in your grid's header or row
>
> how does this compare with CTableTree's functionality. can i embed a
> GEF viewer in a row? that's the primary use case i'm interested in.
>
> i'm assuming that this means the row heights can be set individually.
>
> how does CompositeTable compare to CTableTree in general?
>
> thx,
>
> al
Re: CompositeTable has landed. :-) [message #567226 is a reply to message #14930] Sat, 21 October 2006 18:13 Go to previous message
Al Major is currently offline Al MajorFriend
Messages: 72
Registered: July 2009
Member
but that's an API for embedding a widget, one cell at at time (whichever
cell is being in-place-edited), correct? i just assumed it wasn't
appropriate for a table/tree that may have half or more of it's cells be
arbitrary widgets. if that's an incorrect assumption, i would definitely
consider that as an option.

Chris Gross wrote:
> It should be noted that you can use an TableEditor/TreeEditor to embed
> any widget in even the standard SWT Tree and Table.
>
> -Chris
>
>
> Al Major wrote:
>> David J. Orme wrote:
>>> - Use *any* SWT control anywhere in your grid's header or row
>>
>> how does this compare with CTableTree's functionality. can i embed
>> a GEF viewer in a row? that's the primary use case i'm interested in.
>>
>> i'm assuming that this means the row heights can be set individually.
>>
>> how does CompositeTable compare to CTableTree in general?
>>
>> thx,
>>
>> al
Re: CompositeTable has landed. :-) [message #567249 is a reply to message #15152] Sat, 21 October 2006 18:30 Go to previous message
Al Major is currently offline Al MajorFriend
Messages: 72
Registered: July 2009
Member
plus, i do like JFace style model/view separation, so would want viewers
on top of the TreeEditor/Tree combo.

Al Major wrote:
> but that's an API for embedding a widget, one cell at at time (whichever
> cell is being in-place-edited), correct? i just assumed it wasn't
> appropriate for a table/tree that may have half or more of it's cells be
> arbitrary widgets. if that's an incorrect assumption, i would definitely
> consider that as an option.
>
> Chris Gross wrote:
>> It should be noted that you can use an TableEditor/TreeEditor to embed
>> any widget in even the standard SWT Tree and Table.
>>
>> -Chris
>>
>>
>> Al Major wrote:
>>> David J. Orme wrote:
>>>> - Use *any* SWT control anywhere in your grid's header or row
>>>
>>> how does this compare with CTableTree's functionality. can i
>>> embed a GEF viewer in a row? that's the primary use case i'm
>>> interested in.
>>>
>>> i'm assuming that this means the row heights can be set
>>> individually.
>>>
>>> how does CompositeTable compare to CTableTree in general?
>>>
>>> thx,
>>>
>>> al
Re: CompositeTable has landed. :-) [message #567277 is a reply to message #15182] Sat, 21 October 2006 18:45 Go to previous message
Chris Gross is currently offline Chris GrossFriend
Messages: 471
Registered: July 2009
Senior Member
The base SWT TableEditor/TreeEditor classes can be specifically
activated or active all the time. Its up to you. See the following SWT
snippet:

http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.ecli pse.swt.snippets/src/org/eclipse/swt/snippets/Snippet126.jav a

Regarding JFace viewers, I believe you can use a viewer and still create
and use a regular SWT TableEditor. JFace viewers also have a paradigm
for using its own cell editors which are typically triggered by clicking
on the cell. I'm not sure if JFace has a way to keep an editor active.

-Chris

Al Major wrote:
> plus, i do like JFace style model/view separation, so would want viewers
> on top of the TreeEditor/Tree combo.
>
> Al Major wrote:
>> but that's an API for embedding a widget, one cell at at time
>> (whichever cell is being in-place-edited), correct? i just assumed it
>> wasn't appropriate for a table/tree that may have half or more of it's
>> cells be arbitrary widgets. if that's an incorrect assumption, i would
>> definitely consider that as an option.
>>
>> Chris Gross wrote:
>>> It should be noted that you can use an TableEditor/TreeEditor to
>>> embed any widget in even the standard SWT Tree and Table.
>>>
>>> -Chris
>>>
>>>
>>> Al Major wrote:
>>>> David J. Orme wrote:
>>>>> - Use *any* SWT control anywhere in your grid's header or row
>>>>
>>>> how does this compare with CTableTree's functionality. can i
>>>> embed a GEF viewer in a row? that's the primary use case i'm
>>>> interested in.
>>>>
>>>> i'm assuming that this means the row heights can be set
>>>> individually.
>>>>
>>>> how does CompositeTable compare to CTableTree in general?
>>>>
>>>> thx,
>>>>
>>>> al
Re: CompositeTable has landed. :-) [message #567305 is a reply to message #15214] Sat, 21 October 2006 20:02 Go to previous message
Al Major is currently offline Al MajorFriend
Messages: 72
Registered: July 2009
Member
if this works as the snippet implies, one option for me would be to
modify the standard JFace viewer so that it'll

a) provide a model that allows a representation of arbitrary widgets in
rows, kinda like CTableTreeViewer
b) use the ***Editor classes within this modified viewer to implement
the arbitrary widgets using the standard Tree controls
c) change the row-height of TreeItem (on a first glance at the code,
this actually seems to be the only thing that the current design makes
difficult).

this seems a bit like re-inventing CTableTreeViewer without the
tree-in-every-cell feature (which i don't need). but since that viewer
needs to be modified to support my use-case (ITreePathContentProvider),
this may actually be the easiest option for me.

however, this is such a common use-case (i think) that it begs to be
abstracted. it probably should be in JFace to begin with. or somewhere
else where it can be re-used.

al

Chris Gross wrote:
> The base SWT TableEditor/TreeEditor classes can be specifically
> activated or active all the time. Its up to you. See the following SWT
> snippet:
>
> http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.ecli pse.swt.snippets/src/org/eclipse/swt/snippets/Snippet126.jav a
>
>
> Regarding JFace viewers, I believe you can use a viewer and still create
> and use a regular SWT TableEditor. JFace viewers also have a paradigm
> for using its own cell editors which are typically triggered by clicking
> on the cell. I'm not sure if JFace has a way to keep an editor active.
>
> -Chris
>
> Al Major wrote:
>> plus, i do like JFace style model/view separation, so would want
>> viewers on top of the TreeEditor/Tree combo.
>>
>> Al Major wrote:
>>> but that's an API for embedding a widget, one cell at at time
>>> (whichever cell is being in-place-edited), correct? i just assumed it
>>> wasn't appropriate for a table/tree that may have half or more of
>>> it's cells be arbitrary widgets. if that's an incorrect assumption, i
>>> would definitely consider that as an option.
>>>
>>> Chris Gross wrote:
>>>> It should be noted that you can use an TableEditor/TreeEditor to
>>>> embed any widget in even the standard SWT Tree and Table.
>>>>
>>>> -Chris
>>>>
>>>>
>>>> Al Major wrote:
>>>>> David J. Orme wrote:
>>>>>> - Use *any* SWT control anywhere in your grid's header or row
>>>>>
>>>>> how does this compare with CTableTree's functionality. can i
>>>>> embed a GEF viewer in a row? that's the primary use case i'm
>>>>> interested in.
>>>>>
>>>>> i'm assuming that this means the row heights can be set
>>>>> individually.
>>>>>
>>>>> how does CompositeTable compare to CTableTree in general?
>>>>>
>>>>> thx,
>>>>>
>>>>> al
Re: CompositeTable has landed. :-) [message #567320 is a reply to message #14825] Sat, 21 October 2006 20:41 Go to previous message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
Al Major wrote:
> David J. Orme wrote:
>> - Use *any* SWT control anywhere in your grid's header or row
>
> how does this compare with CTableTree's functionality. can i embed a
> GEF viewer in a row? that's the primary use case i'm interested in.

I believe that CTableTree is lightweight. CompositeTable works by
pasting together existing SWT controls to look and behave like a table.

> i'm assuming that this means the row heights can be set individually.

Currently all rows must be the same height. If you need flexibility
here, please file a bug or better yet, contribute a patch. :-)

> how does CompositeTable compare to CTableTree in general?

CompositeTable makes no attempts to be a tree and it's best to think of
it as like a *really* powerful tabular layout manager because it
fundamentally works with other controls that you supply.

The advantage is that you get complete flexibility for how the users
will interact with your table as well as complete flexibility about
mixing and/or matching lightweight and heavyweight controls inside your
table. The disadvantage is that a highly-optimized lightweight control
will draw and, resize, and scroll somewhat faster.

To see both the advantages and disadvantages in action at once, try
running the DayEditorTest demo, which implements an Outlook-like work
week calendar control. It really powerful and looks nice, but when you
load a lot of data into it, there are a few visible artifacts when you
scroll where you can see the layout managers delegating layout semantics
to all of the embedded controls.

DayEditor is an extreme example both of how graphical you can get with
CompositeTable and also pushes the limits of what you can do nicely with
it performance-wise, so it's a pretty good example to study.


Regards,

Dave Orme




Regards,

Dave Orme
Re: CompositeTable has landed. :-) [message #567343 is a reply to message #14910] Sat, 21 October 2006 20:43 Go to previous message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
Al Major wrote:
> one difference appears to be tree functionality. i'm assuming
> CompositeTable doesn't provide any. but is there an easy way to do
> master/detail rows (basically a tree of depth 2)?

A row can currently contain *anything* you want as long as consecutive
rows in the same table are all the same height.


Best regards,

Dave Orme
Re: CompositeTable has landed. :-) [message #567363 is a reply to message #14930] Sat, 21 October 2006 21:03 Go to previous message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
Chris Gross wrote:
> It should be noted that you can use an TableEditor/TreeEditor to embed
> any widget in even the standard SWT Tree and Table.

True, but you can't lay them out however you want. :-) For example,
the following kind of repeating row layout is hard to do with the
standard table, but is dirt simple with CompositeTable:

CheckNo Clr Description Debit Credit Balance
Memo Category
CheckNo Clr Description Debit Credit Balance
Memo Category
CheckNo Clr Description Debit Credit Balance
Memo Category
.....


Best Regards,

Dave Orme
Re: CompositeTable has landed. :-) [message #567382 is a reply to message #14855] Sat, 21 October 2006 21:17 Go to previous message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
Al Major wrote:
> does CompositeTable use content providers ala JFace? if so, does it
> support ITreePathContentProvider?

CompositeTable uses a concept similar to JFace content providers by
default (since it's virtual). Again, because CompositeTable is virtual,
it is actually impossible to use CompositeTable in any way other than
via some sort of MVC pattern--either using CompositeTable's native API
or via data binding.

CompositeTable's native API is intentionally designed to be conceptually
similar to JFace, but because of the requirement to be able to put any
kind of control anywhere in a row using any layout manager, the API
necessarily isn't exactly the same as JFace.

In addition, CompositeTable supports the new JFace data binding API
right now. (We actually have deployed CompositeTable in a 2 million
plus line enterprise application using data binding as the MVC layer.)

So CompositeTable supports a nice MVC separation of concerns either way.


Best regards,

Dave Orme
Re: CompositeTable has landed. :-) [message #567443 is a reply to message #15378] Sun, 22 October 2006 03:58 Go to previous message
Al Major is currently offline Al MajorFriend
Messages: 72
Registered: July 2009
Member
hmm. data binding isn't particularly important in this case.
architecture/API similarity/correspondence with other JFace viewers is
desirable. but i'll take a look at the actual CompositeTable code before
i comment further.

David J. Orme wrote:
> Al Major wrote:
>> does CompositeTable use content providers ala JFace? if so, does it
>> support ITreePathContentProvider?
>
> CompositeTable uses a concept similar to JFace content providers by
> default (since it's virtual). Again, because CompositeTable is virtual,
> it is actually impossible to use CompositeTable in any way other than
> via some sort of MVC pattern--either using CompositeTable's native API
> or via data binding.
>
> CompositeTable's native API is intentionally designed to be conceptually
> similar to JFace, but because of the requirement to be able to put any
> kind of control anywhere in a row using any layout manager, the API
> necessarily isn't exactly the same as JFace.
>
> In addition, CompositeTable supports the new JFace data binding API
> right now. (We actually have deployed CompositeTable in a 2 million
> plus line enterprise application using data binding as the MVC layer.)
>
> So CompositeTable supports a nice MVC separation of concerns either way.
>
>
> Best regards,
>
> Dave Orme
Re: CompositeTable has landed. :-) [message #567469 is a reply to message #14910] Sun, 22 October 2006 20:34 Go to previous message
Jeremy Dowdall is currently offline Jeremy DowdallFriend
Messages: 181
Registered: July 2009
Senior Member
> ...is there an easy way to do
> master/detail rows (basically a tree of depth 2)?

Master/Detail rows is what caused CTableTree to be created in the first
place, though maybe we're talking about different things here.

A master/detail block, as one might create using the Forms toolkit, has
a table on one side and a detail composite on the other. As the user
selects an item from the table, the appropriate info is filled in, and
is editable in, the child controls of the detail composite.
see the pic most of the way down this page:
http://www.eclipse.org/articles/Article-Forms/article.html

When using the CTableTree, each cell's title area effectively creates
the master table but rather than having a separate detail composite to
the side, it is in the child area of the cell (which can now span the
width of the table width if necessary).
see in the first pic's upper left, "Contacts", view part:
http://www.aspencloud.com/screenshots.php

Is there a reason you do not use the child area of the CTableTreeCell?
Re: CompositeTable has landed. :-) [message #567495 is a reply to message #15280] Sun, 22 October 2006 20:48 Go to previous message
Jeremy Dowdall is currently offline Jeremy DowdallFriend
Messages: 181
Registered: July 2009
Senior Member
David J. Orme wrote:
> I believe that CTableTree is lightweight. CompositeTable works by
> pasting together existing SWT controls to look and behave like a table.

CTableTree can be either, or both. It works by pasting together
CTableTreeCells which have a Title Area and a Child Area and thus allow
each cell to create and display itself in two stages.
One way to begin looking at a CTableTree is to view each column as a
vertical list of ExpandableComposites (or PGroups), where both the title
and child can contain anything, or have anything drawn on them using a GC.
Re: CompositeTable has landed. :-) [message #567523 is a reply to message #15247] Mon, 23 October 2006 08:03 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Comments in line:

Al Major schrieb:
> if this works as the snippet implies, one option for me would be to
> modify the standard JFace viewer so that it'll
>
> a) provide a model that allows a representation of arbitrary widgets in
> rows, kinda like CTableTreeViewer

https://bugs.eclipse.org/bugs/show_bug.cgi?id=36977 The only problem I
could think of are resources needed when using arbitary widgets like
Steve says in https://bugs.eclipse.org/bugs/show_bug.cgi?id=36977#c6

> b) use the ***Editor classes within this modified viewer to implement
> the arbitrary widgets using the standard Tree controls
> c) change the row-height of TreeItem (on a first glance at the code,
> this actually seems to be the only thing that the current design makes
> difficult).

The limitation of SWT Tree/Table is that *all* rows in your table need
to have the same row height!

>
> this seems a bit like re-inventing CTableTreeViewer without the
> tree-in-every-cell feature (which i don't need). but since that viewer
> needs to be modified to support my use-case (ITreePathContentProvider),
> this may actually be the easiest option for me.
>
> however, this is such a common use-case (i think) that it begs to be
> abstracted. it probably should be in JFace to begin with. or somewhere
> else where it can be re-used.
>

By the way we have been actively working on JFace-Viewer support for
nebula already and provide draft solutions how this could work.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=154329

together with:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=153993
https://bugs.eclipse.org/bugs/show_bug.cgi?id=151295
https://bugs.eclipse.org/bugs/show_bug.cgi?id=36977

Will make JFace a really powerfully editing platform.

>>
>> Regarding JFace viewers, I believe you can use a viewer and still
>> create and use a regular SWT TableEditor. JFace viewers also have a
>> paradigm for using its own cell editors which are typically triggered
>> by clicking on the cell. I'm not sure if JFace has a way to keep an
>> editor active.

Yes that's true. You can use Table/TreeEditor together with CellEditors
currently although you need some custom code to deactivate the
Table/TreeEditor. Although I have tried it myself it seems to work.

http://dev.eclipse.org/newslists/news.eclipse.platform/msg58 930.html

I'll revisit this topic once I'll start working on
https://bugs.eclipse.org/bugs/show_bug.cgi?id=36977 but there are more
important JFace topics on my personal priority list and because
CompositeTable provides what is requested here the priority is lowered
once more ;-)

By the way CompositeTable is really cool stuff David how good is it
tested in real world applications. Do you think it could already be used
in commercial projects?

Tom
Re: CompositeTable has landed. :-) [message #567548 is a reply to message #15510] Mon, 23 October 2006 12:16 Go to previous message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
Tom Schindl wrote:
> By the way CompositeTable is really cool stuff David how good is it
> tested in real world applications. Do you think it could already be used
> in commercial projects?

Thanks. :-)

We're using CompositeTable successfully in a two million plus line
enterprise RCP application, plus I have used it on small in-house projects.

One thing CompositeTable does to eliminate the SWT resource issue is: it
only creates SWT controls to represent *visible* rows. So there is a
hard upper bound on how many SWT controls CompositeTable will ever
create at a given time.


Best regards,

Dave Orme
Re: CompositeTable has landed. :-) [message #567570 is a reply to message #15477] Mon, 23 October 2006 12:16 Go to previous message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
Jeremy Dowdall wrote:
> David J. Orme wrote:
>> I believe that CTableTree is lightweight. CompositeTable works by
>> pasting together existing SWT controls to look and behave like a table.
>
> CTableTree can be either, or both. It works by pasting together
> CTableTreeCells which have a Title Area and a Child Area and thus allow
> each cell to create and display itself in two stages.
> One way to begin looking at a CTableTree is to view each column as a
> vertical list of ExpandableComposites (or PGroups), where both the title
> and child can contain anything, or have anything drawn on them using a GC.

That's pretty cool. :-)


Dave
Previous Topic:CompositeTable has landed. :-)
Next Topic:How to display a checkbox in front of the text in a cell ?
Goto Forum:
  


Current Time: Fri Apr 19 19:57:15 GMT 2024

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

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

Back to the top