CompositeEditor tr = new CompositeEditor(binding, Container.GROUP);
tr.setCaption(binding.getName());
tr.setLayoutManager(new HorizontalLayouter());
if (binding.getValue() == null) {
binding.setValue(new GeoPt(0f, 0f), null); // Silent
}
binding.addBindingChangeListener(new IBindingChangeListener<Object>() {
public void valueChanged(ISetDelta<Object> valueElements) {
// TODO Auto-generated method stub
return;
}
public void enablementChanged(boolean isEnabled) {
Collection<String> childs = binding.getKnownChilds();
for (String ch : childs) {
Binding b = binding.getBinding(ch);
b.setReadOnly(!isEnabled);
}
}
public void changed() {
// TODO Auto-generated method stub
return;
}
});
final Binding binding2 = new Binding(binding, "Latitude");
final Binding binding3 = new Binding(binding, "Longitude");
// binding2.refresh();
// binding3.refresh();
IBindingChangeListener<Object> l = new IBindingChangeListener<Object>() {
public void changed() {
}
public void enablementChanged(boolean isEnabled) {
}
public void valueChanged(ISetDelta<Object> valueElements) {
Object val1 = binding2.getValue();
Object val2 = binding3.getValue();
if (val1 instanceof GeoPt) {
val1 = ((GeoPt) val1).getLatitude();
}
if (val2 instanceof GeoPt) {
val2 = ((GeoPt) val2).getLongitude();
}
if (val1 instanceof Number && val2 instanceof Number) {
Number value = (Number) val1;
Number value2 = (Number) val2;
GeoPt pt = new GeoPt((value.floatValue()/* / 1000000 */),
value2.floatValue()/* / 1000000 */);
binding.setValueSilent(pt);
}
}