Multiple Equal Elements in a TableViewer

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple Equal Elements in a TableViewer

Bruce Alspaugh-2
On 9/1/06, Jesse Wilson <[hidden email]> wrote:
re: TableViewer has no delete(int index) method
   We absolutely need to file a JFace bug on this, it's an API hole
   that should be fixed. Doing things by value is absolutely wrong!
   Imagine a table showing the upcoming performances of a
   Canadian rock band:
     Toronto, Portland, San Jose, Regina, Toronto
... now assume they decide to drop the 2nd Toronto show. You can't!
Then the EventList would be inconsistent with the TableViewer,
and my head would explode. Terrible! Somebody file a bug?

Reply | Threaded
Open this post in threaded view
|

Re: Multiple Equal Elements in a TableViewer

Jesse Wilson
Rock on, thanks for the links.

On 9/2/06, Bruce Alspaugh <[hidden email]> wrote:

> On 9/1/06, Jesse Wilson <[hidden email]> wrote:
>
> > re: TableViewer has no delete(int index) method
> >    We absolutely need to file a JFace bug on this, it's an API hole
> >    that should be fixed. Doing things by value is absolutely wrong!
> >    Imagine a table showing the upcoming performances of a
> >    Canadian rock band:
> >      Toronto, Portland, San Jose, Regina, Toronto
> > ... now assume they decide to drop the 2nd Toronto show. You can't!
> > Then the EventList would be inconsistent with the TableViewer,
> > and my head would explode. Terrible! Somebody file a bug?
>
> I think they already have.  Check out the API reference for
> StructuredViewer.internalUpdate(...).
> http://help.eclipse.org/help32/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/StructuredViewer.html
>
> See also:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=76482
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=89606
>
> Bruce
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Multiple Equal Elements in a TableViewer

Bruce Alspaugh-2
I agree this a big problem.  Apparently it is due for a fix in the Eclipse 3.3 timeframe, but that is next June assuming they hold to their annual release schedule.

Could there be a way to make EventTableContentProvider.getElements (..) wrap the list elements to force them to be unique?  Then everywhere we use an element, we just call an unwrap method on it to get the bean? 

We could make the wrapper functionally quite useful beyond just a bug workaround.  It would be really handy if the wrapper also had a bit of reflection/introspection in it so we could get and set property values by name or index.  I keep trying to reuse TableFormat to do that now, but it gets a bit awkward.  Also it would be nice if the wrapper had parsing/formatting capabilities so dates, currency, floating point values, etc. would look nice and have proper internationalization.  If it had a factory method that returned the proper Comparator for a given property, that would be really sweet.

Just an idea.  I'm not an expert on reflection/introspection, so I could use a little help on this.

Bruce

On 9/3/06, Jesse Wilson <[hidden email]> wrote:
Rock on, thanks for the links.

On 9/2/06, Bruce Alspaugh < [hidden email]> wrote:

> On 9/1/06, Jesse Wilson <[hidden email]> wrote:
>
> > re: TableViewer has no delete(int index) method
> >    We absolutely need to file a JFace bug on this, it's an API hole
> >    that should be fixed. Doing things by value is absolutely wrong!
> >    Imagine a table showing the upcoming performances of a
> >    Canadian rock band:
> >      Toronto, Portland, San Jose, Regina, Toronto
> > ... now assume they decide to drop the 2nd Toronto show. You can't!
> > Then the EventList would be inconsistent with the TableViewer,
> > and my head would explode. Terrible! Somebody file a bug?
>
> I think they already have.  Check out the API reference for
> StructuredViewer.internalUpdate(...).
> http://help.eclipse.org/help32/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/StructuredViewer.html
>
> See also:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=76482
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=89606
>
> Bruce
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Multiple Equal Elements in a TableViewer

Bruce Alspaugh-2
On 9/3/06, Bruce Alspaugh <[hidden email]> wrote:
I agree this a big problem.  Apparently it is due for a fix in the Eclipse 3.3 timeframe, but that is next June assuming they hold to their annual release schedule.

Could there be a way to make EventTableContentProvider.getElements (..) wrap the list elements to force them to be unique?  Then everywhere we use an element, we just call an unwrap method on it to get the bean? 

We could make the wrapper functionally quite useful beyond just a bug workaround.  It would be really handy if the wrapper also had a bit of reflection/introspection in it so we could get and set property values by name or index.  I keep trying to reuse TableFormat to do that now, but it gets a bit awkward.  Also it would be nice if the wrapper had parsing/formatting capabilities so dates, currency, floating point values, etc. would look nice and have proper internationalization.  If it had a factory method that returned the proper Comparator for a given property, that would be really sweet.

Just an idea.  I'm not an expert on reflection/introspection, so I could use a little help on this.

Bruce

I forgot to add that SpringFramework has a BeanWrapper that we might be able to leverage to do something like what I'm suggesting.  See:  http://www.springframework.org/docs/reference/validation.html

Bruce

On 9/3/06, Jesse Wilson <[hidden email]> wrote:
Rock on, thanks for the links.

On 9/2/06, Bruce Alspaugh < [hidden email]> wrote:

> On 9/1/06, Jesse Wilson <[hidden email]> wrote:
>
> > re: TableViewer has no delete(int index) method
> >    We absolutely need to file a JFace bug on this, it's an API hole
> >    that should be fixed. Doing things by value is absolutely wrong!
> >    Imagine a table showing the upcoming performances of a
> >    Canadian rock band:
> >      Toronto, Portland, San Jose, Regina, Toronto
> > ... now assume they decide to drop the 2nd Toronto show. You can't!
> > Then the EventList would be inconsistent with the TableViewer,
> > and my head would explode. Terrible! Somebody file a bug?
>
> I think they already have.  Check out the API reference for
> StructuredViewer.internalUpdate(...).
> <a href="http://help.eclipse.org/help32/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/StructuredViewer.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://help.eclipse.org/help32/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/StructuredViewer.html
>
> See also:
> <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=76482" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> https://bugs.eclipse.org/bugs/show_bug.cgi?id=76482
> <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=89606" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://bugs.eclipse.org/bugs/show_bug.cgi?id=89606
>
> Bruce
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]