Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Making a custom GridItem
Making a custom GridItem [message #62953] Mon, 23 March 2009 12:50 Go to next message
David F. is currently offline David F.Friend
Messages: 12
Registered: July 2009
Junior Member
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 14:37 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
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 14:37 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
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
>
Previous Topic:Making a custom GridItem
Next Topic:GanttChart horizontal scroll fixed range
Goto Forum:
  


Current Time: Thu Jul 04 09:22:43 GMT 2024

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

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

Back to the top