Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » CompositeTable question
CompositeTable question [message #34149] Fri, 04 May 2007 20:29 Go to next message
Ali Naddaf is currently offline Ali NaddafFriend
Messages: 85
Registered: July 2009
Member
Hi all.

I am using composite table in my RCP app and am basically building cells
from "Labels". Since I need about 40 rows, I have put my table in a
ScrolledComposite. I am using "addRowConstructionListener" to assign
listeners to my cells (i.e. labels) and things like that (using the
rowConstructed() method of RowConstructionListener. The issue that I am
running into is that the construction of rows only happen when they are
made visible by scrolling down and at the beginning, only the visible
rows are constructed. I need to have all of them constructed at once so
is there a way to change the default behavior?

Many thanks
Ali.
Re: CompositeTable question [message #34328 is a reply to message #34149] Mon, 07 May 2007 20:40 Go to previous message
Eclipse UserFriend
Originally posted by: h3.miegel.org

Ali,

Yes, there is a way to change the behavior. Put your CompositeTable into a
ScrolledComposite and set the client height to be tall enough to hold all
your rows. Generally CompositeTable should not be put in a
ScrolledComposite because because CompositeTable itself handles the
scrolling in a far more scalable way. The reason all the rows are not being
created for you is probably because the preferred height of a CompositeTable
is not calculated correctly, and assumes two rows in the table. Set the
height of the scrolled content correctly and I am sure you will see all the
rows created at once.

CompositeTable is designed to scale efficiently to support a very large
number of rows. For this reason it is designed from the ground up to create
resources only for the visible rows, no resources being created for the rows
that are not visible. This design makes CompositeTable very attractive to
users who have large tables.

There may be better solutions to your problem, depending on why you need to
use CompositeTable, as opposed to Table or a Compsite with GridLayout. If
you only have 40 rows then scalability is obviously not an issue for you.
CompositeTable comes with a lot of good features, only one of which is the
scalability. You may be able to use the other features you require from
CompositeTable without actually using a CompositeTable control. For
example, if you need the flexibility of creating your own row controls and
you want them to line up with moveable column headers, then you can do this
without creating a CompositeTable.

Put all your row controls into a Composite, using a vertical RowLayout. You
would need to create the header control (derived from AbstractSortableHeader
or AbstractNativeHeader) and then create all your rows. If you want your
row controls to remain aligned with the header then you will need to use the
ResizeableGridRowLayout in your rows (this layout looks for the header
control and adds itself to the header as a ColumnControlListener listener).

Also, what is the reason for wanting to create controls that are not
visible? If a row is not visible then the user cannot be acting on the
control and the control cannot be generating events (unless you are relying
on the controls to generate events caused by changes in the model, which you
don't want to be doing when using a MVC design).

- Nigel

"Ali Naddaf" <ali@naddaf.org> wrote in message
news:f1g53f$gke$1@build.eclipse.org...
> Hi all.
>
> I am using composite table in my RCP app and am basically building cells
> from "Labels". Since I need about 40 rows, I have put my table in a
> ScrolledComposite. I am using "addRowConstructionListener" to assign
> listeners to my cells (i.e. labels) and things like that (using the
> rowConstructed() method of RowConstructionListener. The issue that I am
> running into is that the construction of rows only happen when they are
> made visible by scrolling down and at the beginning, only the visible rows
> are constructed. I need to have all of them constructed at once so is
> there a way to change the default behavior?
>
> Many thanks
> Ali.
Re: CompositeTable question [message #582025 is a reply to message #34149] Mon, 07 May 2007 20:40 Go to previous message
Nigel is currently offline NigelFriend
Messages: 12
Registered: July 2009
Junior Member
Ali,

Yes, there is a way to change the behavior. Put your CompositeTable into a
ScrolledComposite and set the client height to be tall enough to hold all
your rows. Generally CompositeTable should not be put in a
ScrolledComposite because because CompositeTable itself handles the
scrolling in a far more scalable way. The reason all the rows are not being
created for you is probably because the preferred height of a CompositeTable
is not calculated correctly, and assumes two rows in the table. Set the
height of the scrolled content correctly and I am sure you will see all the
rows created at once.

CompositeTable is designed to scale efficiently to support a very large
number of rows. For this reason it is designed from the ground up to create
resources only for the visible rows, no resources being created for the rows
that are not visible. This design makes CompositeTable very attractive to
users who have large tables.

There may be better solutions to your problem, depending on why you need to
use CompositeTable, as opposed to Table or a Compsite with GridLayout. If
you only have 40 rows then scalability is obviously not an issue for you.
CompositeTable comes with a lot of good features, only one of which is the
scalability. You may be able to use the other features you require from
CompositeTable without actually using a CompositeTable control. For
example, if you need the flexibility of creating your own row controls and
you want them to line up with moveable column headers, then you can do this
without creating a CompositeTable.

Put all your row controls into a Composite, using a vertical RowLayout. You
would need to create the header control (derived from AbstractSortableHeader
or AbstractNativeHeader) and then create all your rows. If you want your
row controls to remain aligned with the header then you will need to use the
ResizeableGridRowLayout in your rows (this layout looks for the header
control and adds itself to the header as a ColumnControlListener listener).

Also, what is the reason for wanting to create controls that are not
visible? If a row is not visible then the user cannot be acting on the
control and the control cannot be generating events (unless you are relying
on the controls to generate events caused by changes in the model, which you
don't want to be doing when using a MVC design).

- Nigel

"Ali Naddaf" <ali@naddaf.org> wrote in message
news:f1g53f$gke$1@build.eclipse.org...
> Hi all.
>
> I am using composite table in my RCP app and am basically building cells
> from "Labels". Since I need about 40 rows, I have put my table in a
> ScrolledComposite. I am using "addRowConstructionListener" to assign
> listeners to my cells (i.e. labels) and things like that (using the
> rowConstructed() method of RowConstructionListener. The issue that I am
> running into is that the construction of rows only happen when they are
> made visible by scrolling down and at the beginning, only the visible rows
> are constructed. I need to have all of them constructed at once so is
> there a way to change the default behavior?
>
> Many thanks
> Ali.
Previous Topic:CompositeTable question
Next Topic:[CompositeTable] UI and design questions
Goto Forum:
  


Current Time: Thu Sep 24 06:28:01 GMT 2020

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

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

Back to the top