Making a custom GridItem [message #62953] |
Mon, 23 March 2009 08:50  |
Eclipse User |
|
|
|
Hi,
In order to make a custom nebula grid (a calendar with holidays, public
holidays, etc), I make my own cellrenderer and emptycellrenderer.
I need also a custom GridItem for storing informations for particular days.
Because I want to keep all usefull code of the original GridItem, I paste
all the code in my own GridItem.
But I have tried another thing : extends the GridItem and modify the
original source code to replace "private" by "protected" on some methods :
- ensureSize(ArrayList al)
- columnRemoved(int index)
- columnAdded(int index)
- insertValue(int index)
- removeValue(int index)
- handleVirtual()
- clear(boolean allChildren)
I think it's better because it avoids redundancy of code. But perhaps,
there is a reason that all method are private ?
What do you think about that ? Is it interesting to ask that GridItem can
be extended ?
Thanks for your answers,
David
|
|
|
Re: Making a custom GridItem [message #62955 is a reply to message #62953] |
Mon, 23 March 2009 10:37  |
Eclipse User |
|
|
|
Hi,
The more API we offer the more we have to support in future and the
harder it gets to add new features because we are bound to the API-contract.
Which data are you restoring in the GridItem you can't using the
setData(String,Object) slots?
Tom
David schrieb:
> Hi,
>
> In order to make a custom nebula grid (a calendar with holidays, public
> holidays, etc), I make my own cellrenderer and emptycellrenderer.
> I need also a custom GridItem for storing informations for particular days.
> Because I want to keep all usefull code of the original GridItem, I
> paste all the code in my own GridItem.
>
> But I have tried another thing : extends the GridItem and modify the
> original source code to replace "private" by "protected" on some methods :
> - ensureSize(ArrayList al)
> - columnRemoved(int index)
> - columnAdded(int index)
> - insertValue(int index)
> - removeValue(int index)
> - handleVirtual()
> - clear(boolean allChildren)
>
> I think it's better because it avoids redundancy of code. But perhaps,
> there is a reason that all method are private ?
> What do you think about that ? Is it interesting to ask that GridItem
> can be extended ?
>
> Thanks for your answers,
>
> David
>
|
|
|
Re: Making a custom GridItem [message #594134 is a reply to message #62953] |
Mon, 23 March 2009 10:37  |
Eclipse User |
|
|
|
Hi,
The more API we offer the more we have to support in future and the
harder it gets to add new features because we are bound to the API-contract.
Which data are you restoring in the GridItem you can't using the
setData(String,Object) slots?
Tom
David schrieb:
> Hi,
>
> In order to make a custom nebula grid (a calendar with holidays, public
> holidays, etc), I make my own cellrenderer and emptycellrenderer.
> I need also a custom GridItem for storing informations for particular days.
> Because I want to keep all usefull code of the original GridItem, I
> paste all the code in my own GridItem.
>
> But I have tried another thing : extends the GridItem and modify the
> original source code to replace "private" by "protected" on some methods :
> - ensureSize(ArrayList al)
> - columnRemoved(int index)
> - columnAdded(int index)
> - insertValue(int index)
> - removeValue(int index)
> - handleVirtual()
> - clear(boolean allChildren)
>
> I think it's better because it avoids redundancy of code. But perhaps,
> there is a reason that all method are private ?
> What do you think about that ? Is it interesting to ask that GridItem
> can be extended ?
>
> Thanks for your answers,
>
> David
>
|
|
|
Powered by
FUDForum. Page generated in 0.03656 seconds