Skip to main content



      Home
Home » Eclipse Projects » Nebula » Making a custom GridItem
Making a custom GridItem [message #62953] Mon, 23 March 2009 08:50 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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: Sat May 03 11:01:54 EDT 2025

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

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

Back to the top