Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [Databinding] Unnecessary limitations of ComboObservableValue?
[Databinding] Unnecessary limitations of ComboObservableValue? [message #309518] Mon, 30 October 2006 07:30 Go to next message
Eclipse UserFriend
Hello,

recently there was a thread comparing jface.databinding with other
existing binding frameworks, e.g. with Karsten Lentzsch's data binding
from jgoodies found at

https://binding.dev.java.net/

Currently we do indeed use the later one, but would like to switch
to jface.binding in a future product release.
One very advantage of the jgoodies approach is that although there
exist type-checking facilities, the binding is not strictly bound to
that type. Let me explain that a little bit further: Most SWT
widget's have a String type target, which makes sense, but the Combo
family also has the concept of a selection. Regrettably the current
implementation of ComboObservableValue uses the immediate cast
from Object to String instead of the toString route:

if (index == -1) {
combo.setText((String) value);
} else {
...
}

Consider that we have a Mapper class, which e.g. contains some
kind of enumeration and has capabilities to map each enumeration
into a proper String. Furtheron this enumeration class has its
own equality check (e.g. via its equal method, but that is not a hard
constraint), which we would like to use (it might use uuids-comparisons
or something like that). How can we enforce the ComboObservableValue
to use the corresponding comparison (under the hood) instead of
raw String comparisons?
The jgoodies library has a very useful concept of something known as
"SelectionInList" which effectivly allows to use any arbitrary
"intelligent" selection holder to decide which items are considered to
be equal. Is something similar possible with jface.databinding? What is
the recommended way to go realize such a task (without writing my own
binding)?

Greetings from Bremen,

Daniel Krügler
Re: [Databinding] Unnecessary limitations of ComboObservableValue? [message #309705 is a reply to message #309518] Mon, 06 November 2006 08:06 Go to previous messageGo to next message
Eclipse UserFriend
Daniel Krügler wrote:

> How can we enforce the ComboObservableValue
> to use the corresponding comparison (under the hood) instead of
> raw String comparisons?

I have the same problem. Did you find a solution?

Regards,

--
Aaron Digulla
Re: [Databinding] Unnecessary limitations of ComboObservableValue? [message #309710 is a reply to message #309705] Mon, 06 November 2006 10:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bokowski.ca.ibm.com

Could you please enter this as a bug? I'm not sure I fully understand your
issue, so it would be good to have a small snippet that currently does not
work, but should.

ComboObservableValue is not very complex - about 100 lines of code. Wie
waer's mit einem Patch?

Viele Gruesse,
Boris.

"Aaron Digulla" <digulla@hepe.com> wrote in message
news:7a28cdbf5cf716396b7a0e7feaa2bba6$1@www.eclipse.org...
> Daniel Kr
Re: [Databinding] Unnecessary limitations of ComboObservableValue? [message #309721 is a reply to message #309710] Mon, 06 November 2006 12:01 Go to previous message
Eclipse UserFriend
Boris Bokowski wrote:

> ComboObservableValue is not very complex - about 100 lines of code. Wie
> waer's mit einem Patch?

It's not the 100 lines in there which worry me but the 1500 lines spread
over 150 class files ... :-)

Also, it's not ComboObservableValue which is broken but the code for the
ComboViewer (ie. when the elements of a combo are no strings).

I opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=163561 so you can
tell anyone interested that ComboViewer works again.

Regards,

--
Aaron Digulla
Previous Topic:Error in <projectSetImport>
Next Topic:com.ibm.icu ?
Goto Forum:
  


Current Time: Wed May 07 23:36:35 EDT 2025

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

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

Back to the top