Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Implementing rowNumber in CompositeTable
Implementing rowNumber in CompositeTable [message #26604] Sun, 04 February 2007 05:13 Go to next message
John Ye is currently offline John YeFriend
Messages: 20
Registered: July 2009
Junior Member
Hi Dave,

I tried to implement row numbers in CompositeTable as follows:

1. Use a label as the first child of my row composite.
2. In the refresh method, set the row number as follows:

public void refresh(CompositeTable sender, int currentObjectOffset,
Control rowControl) {
Row row = (Row) rowControl;
row.rowNumber.setText("" + (currentObjectOffset+1));

3. In the deleteRow method of IDeleteHandler(), add table.refreshAllRows()
at the end.

The problem is that deleteRow is called before deletion actually takes
place. So row numbers are one bigger after the deletion position.

If refreshAllRows() is added after line 1197 of InternalCompositeTable
(line 1197 reads internalSetSelection(currentColumn, currentRow, true);),
then row numbers are working fine and step 3 above is not necessary.

Is there a better way to display row numbers? Any potential problems over
the above change in InternalCompositeTable?

Thanks,
John
Re: Implementing rowNumber in CompositeTable [message #26693 is a reply to message #26604] Mon, 05 February 2007 17:55 Go to previous message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
I just added

public void rowDeleted(int rowInCollection);

which is called after the delete operation completes to IDeleteHandler.

Thanks for your feedback!


Dave

John Ye wrote:
>
> Hi Dave,
>
> I tried to implement row numbers in CompositeTable as follows:
>
> 1. Use a label as the first child of my row composite.
> 2. In the refresh method, set the row number as follows:
>
> public void refresh(CompositeTable sender, int currentObjectOffset,
> Control rowControl) {
> Row row = (Row) rowControl;
> row.rowNumber.setText("" + (currentObjectOffset+1));
>
> 3. In the deleteRow method of IDeleteHandler(), add
> table.refreshAllRows() at the end.
>
> The problem is that deleteRow is called before deletion actually takes
> place. So row numbers are one bigger after the deletion position.
>
> If refreshAllRows() is added after line 1197 of InternalCompositeTable
> (line 1197 reads internalSetSelection(currentColumn, currentRow,
> true);), then row numbers are working fine and step 3 above is not
> necessary.
>
> Is there a better way to display row numbers? Any potential problems
> over the above change in InternalCompositeTable?
> Thanks,
> John


--
Senior Consultant, Trainer
Coconut Palm Software, Inc.
http://www.coconut-palm-software.com
Re: Implementing rowNumber in CompositeTable [message #577339 is a reply to message #26604] Mon, 05 February 2007 17:55 Go to previous message
Dave Orme is currently offline Dave OrmeFriend
Messages: 424
Registered: July 2009
Senior Member
I just added

public void rowDeleted(int rowInCollection);

which is called after the delete operation completes to IDeleteHandler.

Thanks for your feedback!


Dave

John Ye wrote:
>
> Hi Dave,
>
> I tried to implement row numbers in CompositeTable as follows:
>
> 1. Use a label as the first child of my row composite.
> 2. In the refresh method, set the row number as follows:
>
> public void refresh(CompositeTable sender, int currentObjectOffset,
> Control rowControl) {
> Row row = (Row) rowControl;
> row.rowNumber.setText("" + (currentObjectOffset+1));
>
> 3. In the deleteRow method of IDeleteHandler(), add
> table.refreshAllRows() at the end.
>
> The problem is that deleteRow is called before deletion actually takes
> place. So row numbers are one bigger after the deletion position.
>
> If refreshAllRows() is added after line 1197 of InternalCompositeTable
> (line 1197 reads internalSetSelection(currentColumn, currentRow,
> true);), then row numbers are working fine and step 3 above is not
> necessary.
>
> Is there a better way to display row numbers? Any potential problems
> over the above change in InternalCompositeTable?
> Thanks,
> John


--
Senior Consultant, Trainer
Coconut Palm Software, Inc.
http://www.coconut-palm-software.com
Previous Topic:Grid item updates
Next Topic:[CompositeTable] 0.9.2.1 released
Goto Forum:
  


Current Time: Thu Mar 28 19:37:16 GMT 2024

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

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

Back to the top