Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF databinding TableViewer
EMF databinding TableViewer [message #421466] Thu, 07 August 2008 15:13 Go to next message
Axel Nitert is currently offline Axel NitertFriend
Messages: 13
Registered: July 2009
Junior Member
Hi guys,

I am currently struggling with Toms approach of using databinding for
1:n TableViewers.
I have (or at least I think I have) followed the instructions and almost
copied the example of Tom (thanks for the great work).
My problem is that the list remains empty and I would very much
appreciate any hint about what I'm doing wrong or how I can debug this.

Here is the code of the View Part:

public void createPartControl(Composite parent) {
super.createPartControl(parent);

// my small example model
Domain dn = DomainFactory.eINSTANCE.createDomain();
Person p = DomainFactory.eINSTANCE.createPerson();
dn.getPersons().add(p);

// create the viewer
viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL |
SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL,
true, true, 1, 1));

// set up the table
Table table = viewer.getTable();
TableLayout layout = new TableLayout();
table.setLayout(layout);
table.setHeaderVisible(true);
table.setLinesVisible(true);

// Define one exmaple column Columns
TableViewerColumn viewerColumn;
viewerColumn = new TableViewerColumn(viewer, SWT.NONE);

// for simplification I use the standard labelprovider
viewerColumn.setLabelProvider(new ColumnLabelProvider());
viewerColumn.getColumn().setText("Last Name, First Name");
viewerColumn.getColumn().setWidth(200);
viewerColumn.getColumn().setMoveable(true);

// Content Provider
ObservableListContentProvider contentProvider = new
ObservableListContentProvider();
viewer.setContentProvider(contentProvider);

// set input
IObservableList list = EMFObservables.observeList(dn,
DomainPackage.Literals.PERSON__SEMESTERS);
viewer.setInput(list);

}

Thanks for your help.
Axel
Re: EMF databinding TableViewer [message #421469 is a reply to message #421466] Thu, 07 August 2008 15:58 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Axel Nitert schrieb:
> Hi guys,
>
> I am currently struggling with Toms approach of using databinding for
> 1:n TableViewers.
> I have (or at least I think I have) followed the instructions and almost
> copied the example of Tom (thanks for the great work).
> My problem is that the list remains empty and I would very much
> appreciate any hint about what I'm doing wrong or how I can debug this.
>
> Here is the code of the View Part:
>
> public void createPartControl(Composite parent) {
> super.createPartControl(parent);
>
> // my small example model
> Domain dn = DomainFactory.eINSTANCE.createDomain();
> Person p = DomainFactory.eINSTANCE.createPerson();
> dn.getPersons().add(p);
>
> // create the viewer
> viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL |
> SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
> viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL,
> true, true, 1, 1));
>
> // set up the table
> Table table = viewer.getTable();
> TableLayout layout = new TableLayout();
> table.setLayout(layout);
> table.setHeaderVisible(true);
> table.setLinesVisible(true);
>
> // Define one exmaple column Columns
> TableViewerColumn viewerColumn;
> viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
>
> // for simplification I use the standard labelprovider
> viewerColumn.setLabelProvider(new ColumnLabelProvider());
> viewerColumn.getColumn().setText("Last Name, First Name");
> viewerColumn.getColumn().setWidth(200);
> viewerColumn.getColumn().setMoveable(true);
>
> // Content Provider
> ObservableListContentProvider contentProvider = new
> ObservableListContentProvider();
> viewer.setContentProvider(contentProvider);
>
> // set input
> IObservableList list = EMFObservables.observeList(dn,
> DomainPackage.Literals.PERSON__SEMESTERS);
> viewer.setInput(list);
>
> }

My guess is that you are getting an exception in your error-log but you
have not been running under -consoleLog because the feature you want to
observe DOMAIN__PERSONS-Feature or am I missing something obvious (I
make the assumption from the title of the column 'Last Name, First Name' ).

My guess of your model looks like this:

Domain
1 - n Person
1 - n Semesters

Is that correct? So what would you like to represent in the viewer?

The list of persons => The viewer is the master
The semsters of a person => The viewer is the detail and you need to use
a EMFObservable#observeDetailList.

So taking this together I think you need to modify your code from above
like this:

--------8<--------
// set input
IObservableList list = EMFObservables.observeList(
dn,
DomainPackage.Literals.DOMAIN__PERSONS);

viewer.setInput(list);

IObservableValue master = ViewerObservables.observeSingleSelection(viewer);

// The detail viewer
TableViewer semesterViewer = new TableViewer(....);

TableViewerColumn c = ......

ObservableListContentProvider contentProvider2 = new
ObservableListContentProvider();
semesterViewer.setContentProvider(contentProvider2);

IObservableList detailList = EMFObservables.observeDetailList(
Realm.getDefault(),
master
DomainPackage.Literals.PERSON__SEMESTERS);
semesterViewer.setInput(detailList);

--------8<--------

This is untested code and based on the assumptions I made from your code
so it might be inaccurate :-)

Tom


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: EMF databinding TableViewer [message #421471 is a reply to message #421469] Thu, 07 August 2008 16:46 Go to previous messageGo to next message
Axel Nitert is currently offline Axel NitertFriend
Messages: 13
Registered: July 2009
Junior Member
Tom Schindl schrieb:
> Axel Nitert schrieb:
>> Hi guys,
>>
>> I am currently struggling with Toms approach of using databinding for
>> 1:n TableViewers.
>> I have (or at least I think I have) followed the instructions and
>> almost copied the example of Tom (thanks for the great work).
>> My problem is that the list remains empty and I would very much
>> appreciate any hint about what I'm doing wrong or how I can debug this.
>>
>> Here is the code of the View Part:
>>
>> public void createPartControl(Composite parent) {
>> super.createPartControl(parent);
>> // my small example model Domain dn =
>> DomainFactory.eINSTANCE.createDomain();
>> Person p = DomainFactory.eINSTANCE.createPerson();
>> dn.getPersons().add(p);
>> // create the viewer viewer = new TableViewer(parent,
>> SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER |
>> SWT.FULL_SELECTION);
>> viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL,
>> true, true, 1, 1));
>>
>> // set up the table
>> Table table = viewer.getTable();
>> TableLayout layout = new TableLayout();
>> table.setLayout(layout);
>> table.setHeaderVisible(true);
>> table.setLinesVisible(true);
>> // Define one exmaple column Columns
>> TableViewerColumn viewerColumn;
>> viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
>>
>> // for simplification I use the standard labelprovider
>> viewerColumn.setLabelProvider(new ColumnLabelProvider());
>> viewerColumn.getColumn().setText("Last Name, First Name");
>> viewerColumn.getColumn().setWidth(200);
>> viewerColumn.getColumn().setMoveable(true);
>> // Content Provider ObservableListContentProvider
>> contentProvider = new ObservableListContentProvider();
>> viewer.setContentProvider(contentProvider);
>>
>> // set input
>> IObservableList list = EMFObservables.observeList(dn,
>> DomainPackage.Literals.PERSON__SEMESTERS);
>> viewer.setInput(list);
>> }
>
> My guess is that you are getting an exception in your error-log but you
> have not been running under -consoleLog because the feature you want to
> observe DOMAIN__PERSONS-Feature or am I missing something obvious (I
> make the assumption from the title of the column 'Last Name, First Name' ).
>
> My guess of your model looks like this:
>
> Domain
> 1 - n Person
> 1 - n Semesters
>
> Is that correct? So what would you like to represent in the viewer?
>
> The list of persons => The viewer is the master
> The semsters of a person => The viewer is the detail and you need to use
> a EMFObservable#observeDetailList.
>
> So taking this together I think you need to modify your code from above
> like this:
>
> --------8<--------
> // set input
> IObservableList list = EMFObservables.observeList(
> dn,
> DomainPackage.Literals.DOMAIN__PERSONS);
>
> viewer.setInput(list);
>
> IObservableValue master = ViewerObservables.observeSingleSelection(viewer);
>
> // The detail viewer
> TableViewer semesterViewer = new TableViewer(....);
>
> TableViewerColumn c = ......
>
> ObservableListContentProvider contentProvider2 = new
> ObservableListContentProvider();
> semesterViewer.setContentProvider(contentProvider2);
>
> IObservableList detailList = EMFObservables.observeDetailList(
> Realm.getDefault(),
> master
> DomainPackage.Literals.PERSON__SEMESTERS);
> semesterViewer.setInput(detailList);
>
> --------8<--------
>
> This is untested code and based on the assumptions I made from your code
> so it might be inaccurate :-)
>
> Tom
>
>

Hi Tom,

thanks for the answer. The issue that I am struggling with is more
complex. I want to use the observable list with an EMF linked to a
database (TENEO, Hibernate). In order to narrow down the issue I have
reduced the code and this is why I left PERSON__SEMESTERS in the list.

You are totally right when I replace then code

IObservableList list = EMFObservables.observeList(dn,
DomainPackage.Literals.PERSON__SEMESTERS);

with
IObservableList list = EMFObservables.observeList(dn,
DomainPackage.Literals.DOMAIN__PERSONS);

my example works fine.

NOW, back to the original issue. If I use the same code with a


// this prints 3 elements
System.out.println(DomainUtil.getRoot().getPersons().size()) ;

IObservableList list = EMFObservables.observeList(DomainUtil.getRoot(),
DomainPackage.Literals.DOMAIN__PERSONS);

viewer.setInput(list);

The list is still empty and I do not get any exceptions (I have now
-consoleLog switched on ;-) ).

The method DomainUtil.getRoot simply returns the root object that was
create with the following code (the resource is a hibernate teneo resource):

try {
resource.load(Collections.EMPTY_MAP);
} catch (IOException e) {
e.printStackTrace();
}

if (resource.getContents().size()>0) {
root = (Domain)resource.getContents().get(0);
}

Do you have any idea what can make the difference here?

By the way thanks for the master detail code this is one of the next
viewers that I am going to create.

Best regards
Axel
Re: EMF databinding TableViewer [message #421477 is a reply to message #421471] Thu, 07 August 2008 17:58 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
This certainly looks like a teneo/proxy issue? I guess simply asking for
the for size of a list won't materialize it but I really really have no
idea what's going on here, I've never used teneo myself but if the code
you posted previously works it must be some issue with teneo or proxies.

Did you tried steping through the code with a debugger to see what's
really going on? The only thing you now know is that databinding works
appropiately and the problem is some where else :-(

Tom

Axel Nitert schrieb:
> Tom Schindl schrieb:
>> Axel Nitert schrieb:
>>> Hi guys,
>>>
>>> I am currently struggling with Toms approach of using databinding for
>>> 1:n TableViewers.
>>> I have (or at least I think I have) followed the instructions and
>>> almost copied the example of Tom (thanks for the great work).
>>> My problem is that the list remains empty and I would very much
>>> appreciate any hint about what I'm doing wrong or how I can debug this.
>>>
>>> Here is the code of the View Part:
>>>
>>> public void createPartControl(Composite parent) {
>>> super.createPartControl(parent);
>>> // my small example model Domain dn =
>>> DomainFactory.eINSTANCE.createDomain();
>>> Person p = DomainFactory.eINSTANCE.createPerson();
>>> dn.getPersons().add(p);
>>> // create the viewer viewer = new TableViewer(parent,
>>> SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER |
>>> SWT.FULL_SELECTION);
>>> viewer.getControl().setLayoutData(new GridData(SWT.FILL,
>>> SWT.FILL, true, true, 1, 1));
>>>
>>> // set up the table
>>> Table table = viewer.getTable();
>>> TableLayout layout = new TableLayout();
>>> table.setLayout(layout);
>>> table.setHeaderVisible(true);
>>> table.setLinesVisible(true);
>>> // Define one exmaple column Columns
>>> TableViewerColumn viewerColumn;
>>> viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
>>>
>>> // for simplification I use the standard labelprovider
>>> viewerColumn.setLabelProvider(new ColumnLabelProvider());
>>> viewerColumn.getColumn().setText("Last Name, First Name");
>>> viewerColumn.getColumn().setWidth(200);
>>> viewerColumn.getColumn().setMoveable(true);
>>> // Content Provider ObservableListContentProvider
>>> contentProvider = new ObservableListContentProvider();
>>> viewer.setContentProvider(contentProvider);
>>>
>>> // set input
>>> IObservableList list = EMFObservables.observeList(dn,
>>> DomainPackage.Literals.PERSON__SEMESTERS);
>>> viewer.setInput(list);
>>> }
>>
>> My guess is that you are getting an exception in your error-log but
>> you have not been running under -consoleLog because the feature you
>> want to observe DOMAIN__PERSONS-Feature or am I missing something
>> obvious (I make the assumption from the title of the column 'Last
>> Name, First Name' ).
>>
>> My guess of your model looks like this:
>>
>> Domain
>> 1 - n Person
>> 1 - n Semesters
>>
>> Is that correct? So what would you like to represent in the viewer?
>>
>> The list of persons => The viewer is the master
>> The semsters of a person => The viewer is the detail and you need to
>> use a EMFObservable#observeDetailList.
>>
>> So taking this together I think you need to modify your code from
>> above like this:
>>
>> --------8<--------
>> // set input
>> IObservableList list = EMFObservables.observeList(
>> dn,
>> DomainPackage.Literals.DOMAIN__PERSONS);
>>
>> viewer.setInput(list);
>>
>> IObservableValue master =
>> ViewerObservables.observeSingleSelection(viewer);
>>
>> // The detail viewer
>> TableViewer semesterViewer = new TableViewer(....);
>>
>> TableViewerColumn c = ......
>>
>> ObservableListContentProvider contentProvider2 = new
>> ObservableListContentProvider();
>> semesterViewer.setContentProvider(contentProvider2);
>>
>> IObservableList detailList = EMFObservables.observeDetailList(
>> Realm.getDefault(),
>> master
>> DomainPackage.Literals.PERSON__SEMESTERS);
>> semesterViewer.setInput(detailList);
>>
>> --------8<--------
>>
>> This is untested code and based on the assumptions I made from your
>> code so it might be inaccurate :-)
>>
>> Tom
>>
>>
>
> Hi Tom,
>
> thanks for the answer. The issue that I am struggling with is more
> complex. I want to use the observable list with an EMF linked to a
> database (TENEO, Hibernate). In order to narrow down the issue I have
> reduced the code and this is why I left PERSON__SEMESTERS in the list.
>
> You are totally right when I replace then code
>
> IObservableList list = EMFObservables.observeList(dn,
> DomainPackage.Literals.PERSON__SEMESTERS);
>
> with
> IObservableList list = EMFObservables.observeList(dn,
> DomainPackage.Literals.DOMAIN__PERSONS);
>
> my example works fine.
>
> NOW, back to the original issue. If I use the same code with a
>
>
> // this prints 3 elements
> System.out.println(DomainUtil.getRoot().getPersons().size()) ;
>
> IObservableList list = EMFObservables.observeList(DomainUtil.getRoot(),
> DomainPackage.Literals.DOMAIN__PERSONS);
>
> viewer.setInput(list);
>
> The list is still empty and I do not get any exceptions (I have now
> -consoleLog switched on ;-) ).
>
> The method DomainUtil.getRoot simply returns the root object that was
> create with the following code (the resource is a hibernate teneo
> resource):
>
> try {
> resource.load(Collections.EMPTY_MAP);
> } catch (IOException e) {
> e.printStackTrace();
> }
>
> if (resource.getContents().size()>0) {
> root = (Domain)resource.getContents().get(0);
> }
>
> Do you have any idea what can make the difference here?
>
> By the way thanks for the master detail code this is one of the next
> viewers that I am going to create.
>
> Best regards
> Axel
>
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: EMF databinding TableViewer [message #421481 is a reply to message #421477] Thu, 07 August 2008 18:41 Go to previous messageGo to next message
Axel Nitert is currently offline Axel NitertFriend
Messages: 13
Registered: July 2009
Junior Member
Tom,

thanks for the reply.

I agree that it obviously has got something to do with teneo. I tried to
go through the code using the debugger but the thing is that I have no
idea what happens after I call setInput. I thought that the
ContenProviders method getElements should be called. But it isn't.

Do you have an additional hint where the best place would be to set the
breakpoint?

The IObeservableList looks good as far as I can see. there are three
elements in the list.

May be I'll have a look at the teneo forum. It could be a bug with the
setup I chose.

Teneo is really a great framework to persist the EMF model to a
relational database without spending too much time with matching fields
to table columns.

Thanks and best regards
Axel



Tom Schindl schrieb:
> This certainly looks like a teneo/proxy issue? I guess simply asking for
> the for size of a list won't materialize it but I really really have no
> idea what's going on here, I've never used teneo myself but if the code
> you posted previously works it must be some issue with teneo or proxies.
>
> Did you tried steping through the code with a debugger to see what's
> really going on? The only thing you now know is that databinding works
> appropiately and the problem is some where else :-(
>
> Tom
>
> Axel Nitert schrieb:
>> Tom Schindl schrieb:
>>> Axel Nitert schrieb:
>>>> Hi guys,
>>>>
>>>> I am currently struggling with Toms approach of using databinding
>>>> for 1:n TableViewers.
>>>> I have (or at least I think I have) followed the instructions and
>>>> almost copied the example of Tom (thanks for the great work).
>>>> My problem is that the list remains empty and I would very much
>>>> appreciate any hint about what I'm doing wrong or how I can debug this.
>>>>
>>>> Here is the code of the View Part:
>>>>
>>>> public void createPartControl(Composite parent) {
>>>> super.createPartControl(parent);
>>>> // my small example model Domain dn =
>>>> DomainFactory.eINSTANCE.createDomain();
>>>> Person p = DomainFactory.eINSTANCE.createPerson();
>>>> dn.getPersons().add(p);
>>>> // create the viewer viewer = new TableViewer(parent,
>>>> SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER |
>>>> SWT.FULL_SELECTION);
>>>> viewer.getControl().setLayoutData(new GridData(SWT.FILL,
>>>> SWT.FILL, true, true, 1, 1));
>>>>
>>>> // set up the table
>>>> Table table = viewer.getTable();
>>>> TableLayout layout = new TableLayout();
>>>> table.setLayout(layout);
>>>> table.setHeaderVisible(true);
>>>> table.setLinesVisible(true);
>>>> // Define one exmaple column Columns
>>>> TableViewerColumn viewerColumn;
>>>> viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
>>>>
>>>> // for simplification I use the standard labelprovider
>>>> viewerColumn.setLabelProvider(new ColumnLabelProvider());
>>>> viewerColumn.getColumn().setText("Last Name, First Name");
>>>> viewerColumn.getColumn().setWidth(200);
>>>> viewerColumn.getColumn().setMoveable(true);
>>>> // Content Provider ObservableListContentProvider
>>>> contentProvider = new ObservableListContentProvider();
>>>> viewer.setContentProvider(contentProvider);
>>>>
>>>> // set input
>>>> IObservableList list = EMFObservables.observeList(dn,
>>>> DomainPackage.Literals.PERSON__SEMESTERS);
>>>> viewer.setInput(list);
>>>> }
>>>
>>> My guess is that you are getting an exception in your error-log but
>>> you have not been running under -consoleLog because the feature you
>>> want to observe DOMAIN__PERSONS-Feature or am I missing something
>>> obvious (I make the assumption from the title of the column 'Last
>>> Name, First Name' ).
>>>
>>> My guess of your model looks like this:
>>>
>>> Domain
>>> 1 - n Person
>>> 1 - n Semesters
>>>
>>> Is that correct? So what would you like to represent in the viewer?
>>>
>>> The list of persons => The viewer is the master
>>> The semsters of a person => The viewer is the detail and you need to
>>> use a EMFObservable#observeDetailList.
>>>
>>> So taking this together I think you need to modify your code from
>>> above like this:
>>>
>>> --------8<--------
>>> // set input
>>> IObservableList list = EMFObservables.observeList(
>>> dn,
>>> DomainPackage.Literals.DOMAIN__PERSONS);
>>>
>>> viewer.setInput(list);
>>>
>>> IObservableValue master =
>>> ViewerObservables.observeSingleSelection(viewer);
>>>
>>> // The detail viewer
>>> TableViewer semesterViewer = new TableViewer(....);
>>>
>>> TableViewerColumn c = ......
>>>
>>> ObservableListContentProvider contentProvider2 = new
>>> ObservableListContentProvider();
>>> semesterViewer.setContentProvider(contentProvider2);
>>>
>>> IObservableList detailList = EMFObservables.observeDetailList(
>>> Realm.getDefault(),
>>> master
>>> DomainPackage.Literals.PERSON__SEMESTERS);
>>> semesterViewer.setInput(detailList);
>>>
>>> --------8<--------
>>>
>>> This is untested code and based on the assumptions I made from your
>>> code so it might be inaccurate :-)
>>>
>>> Tom
>>>
>>>
>>
>> Hi Tom,
>>
>> thanks for the answer. The issue that I am struggling with is more
>> complex. I want to use the observable list with an EMF linked to a
>> database (TENEO, Hibernate). In order to narrow down the issue I have
>> reduced the code and this is why I left PERSON__SEMESTERS in the list.
>>
>> You are totally right when I replace then code
>>
>> IObservableList list = EMFObservables.observeList(dn,
>> DomainPackage.Literals.PERSON__SEMESTERS);
>>
>> with
>> IObservableList list = EMFObservables.observeList(dn,
>> DomainPackage.Literals.DOMAIN__PERSONS);
>>
>> my example works fine.
>>
>> NOW, back to the original issue. If I use the same code with a
>>
>>
>> // this prints 3 elements
>> System.out.println(DomainUtil.getRoot().getPersons().size()) ;
>>
>> IObservableList list =
>> EMFObservables.observeList(DomainUtil.getRoot(),
>> DomainPackage.Literals.DOMAIN__PERSONS);
>>
>> viewer.setInput(list);
>>
>> The list is still empty and I do not get any exceptions (I have now
>> -consoleLog switched on ;-) ).
>>
>> The method DomainUtil.getRoot simply returns the root object that was
>> create with the following code (the resource is a hibernate teneo
>> resource):
>>
>> try {
>> resource.load(Collections.EMPTY_MAP);
>> } catch (IOException e) {
>> e.printStackTrace();
>> }
>> if (resource.getContents().size()>0) {
>> root = (Domain)resource.getContents().get(0);
>> }
>>
>> Do you have any idea what can make the difference here?
>>
>> By the way thanks for the master detail code this is one of the next
>> viewers that I am going to create.
>>
>> Best regards
>> Axel
>>
>>
>>
>
>
Re: EMF databinding TableViewer [message #421486 is a reply to message #421481] Thu, 07 August 2008 19:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Axel,

I don't see anything obviously wrong. Generally Teneo will just surface
things in a transparent way so everything ought to be working nicely.


Axel Nitert wrote:
> Tom,
>
> thanks for the reply.
>
> I agree that it obviously has got something to do with teneo. I tried
> to go through the code using the debugger but the thing is that I have
> no idea what happens after I call setInput. I thought that the
> ContenProviders method getElements should be called. But it isn't.
>
> Do you have an additional hint where the best place would be to set
> the breakpoint?
>
> The IObeservableList looks good as far as I can see. there are three
> elements in the list.
>
> May be I'll have a look at the teneo forum. It could be a bug with the
> setup I chose.
>
> Teneo is really a great framework to persist the EMF model to a
> relational database without spending too much time with matching
> fields to table columns.
>
> Thanks and best regards
> Axel
>
>
>
> Tom Schindl schrieb:
>> This certainly looks like a teneo/proxy issue? I guess simply asking
>> for the for size of a list won't materialize it but I really really
>> have no idea what's going on here, I've never used teneo myself but
>> if the code you posted previously works it must be some issue with
>> teneo or proxies.
>>
>> Did you tried steping through the code with a debugger to see what's
>> really going on? The only thing you now know is that databinding
>> works appropiately and the problem is some where else :-(
>>
>> Tom
>>
>> Axel Nitert schrieb:
>>> Tom Schindl schrieb:
>>>> Axel Nitert schrieb:
>>>>> Hi guys,
>>>>>
>>>>> I am currently struggling with Toms approach of using databinding
>>>>> for 1:n TableViewers.
>>>>> I have (or at least I think I have) followed the instructions and
>>>>> almost copied the example of Tom (thanks for the great work).
>>>>> My problem is that the list remains empty and I would very much
>>>>> appreciate any hint about what I'm doing wrong or how I can debug
>>>>> this.
>>>>>
>>>>> Here is the code of the View Part:
>>>>>
>>>>> public void createPartControl(Composite parent) {
>>>>> super.createPartControl(parent);
>>>>> // my small example model Domain dn =
>>>>> DomainFactory.eINSTANCE.createDomain();
>>>>> Person p = DomainFactory.eINSTANCE.createPerson();
>>>>> dn.getPersons().add(p);
>>>>> // create the viewer viewer = new
>>>>> TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL |
>>>>> SWT.BORDER | SWT.FULL_SELECTION);
>>>>> viewer.getControl().setLayoutData(new GridData(SWT.FILL,
>>>>> SWT.FILL, true, true, 1, 1));
>>>>>
>>>>> // set up the table
>>>>> Table table = viewer.getTable();
>>>>> TableLayout layout = new TableLayout();
>>>>> table.setLayout(layout);
>>>>> table.setHeaderVisible(true);
>>>>> table.setLinesVisible(true);
>>>>> // Define one exmaple column Columns
>>>>> TableViewerColumn viewerColumn;
>>>>> viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
>>>>>
>>>>> // for simplification I use the standard labelprovider
>>>>> viewerColumn.setLabelProvider(new ColumnLabelProvider());
>>>>> viewerColumn.getColumn().setText("Last Name, First Name");
>>>>> viewerColumn.getColumn().setWidth(200);
>>>>> viewerColumn.getColumn().setMoveable(true);
>>>>> // Content Provider
>>>>> ObservableListContentProvider contentProvider = new
>>>>> ObservableListContentProvider();
>>>>> viewer.setContentProvider(contentProvider);
>>>>>
>>>>> // set input
>>>>> IObservableList list = EMFObservables.observeList(dn,
>>>>> DomainPackage.Literals.PERSON__SEMESTERS);
>>>>> viewer.setInput(list);
>>>>> }
>>>>
>>>> My guess is that you are getting an exception in your error-log but
>>>> you have not been running under -consoleLog because the feature you
>>>> want to observe DOMAIN__PERSONS-Feature or am I missing something
>>>> obvious (I make the assumption from the title of the column 'Last
>>>> Name, First Name' ).
>>>>
>>>> My guess of your model looks like this:
>>>>
>>>> Domain
>>>> 1 - n Person
>>>> 1 - n Semesters
>>>>
>>>> Is that correct? So what would you like to represent in the viewer?
>>>>
>>>> The list of persons => The viewer is the master
>>>> The semsters of a person => The viewer is the detail and you need
>>>> to use a EMFObservable#observeDetailList.
>>>>
>>>> So taking this together I think you need to modify your code from
>>>> above like this:
>>>>
>>>> --------8<--------
>>>> // set input
>>>> IObservableList list = EMFObservables.observeList(
>>>> dn,
>>>> DomainPackage.Literals.DOMAIN__PERSONS);
>>>>
>>>> viewer.setInput(list);
>>>>
>>>> IObservableValue master =
>>>> ViewerObservables.observeSingleSelection(viewer);
>>>>
>>>> // The detail viewer
>>>> TableViewer semesterViewer = new TableViewer(....);
>>>>
>>>> TableViewerColumn c = ......
>>>>
>>>> ObservableListContentProvider contentProvider2 = new
>>>> ObservableListContentProvider();
>>>> semesterViewer.setContentProvider(contentProvider2);
>>>>
>>>> IObservableList detailList = EMFObservables.observeDetailList(
>>>> Realm.getDefault(),
>>>> master
>>>> DomainPackage.Literals.PERSON__SEMESTERS);
>>>> semesterViewer.setInput(detailList);
>>>>
>>>> --------8<--------
>>>>
>>>> This is untested code and based on the assumptions I made from your
>>>> code so it might be inaccurate :-)
>>>>
>>>> Tom
>>>>
>>>>
>>>
>>> Hi Tom,
>>>
>>> thanks for the answer. The issue that I am struggling with is more
>>> complex. I want to use the observable list with an EMF linked to a
>>> database (TENEO, Hibernate). In order to narrow down the issue I
>>> have reduced the code and this is why I left PERSON__SEMESTERS in
>>> the list.
>>>
>>> You are totally right when I replace then code
>>>
>>> IObservableList list = EMFObservables.observeList(dn,
>>> DomainPackage.Literals.PERSON__SEMESTERS);
>>>
>>> with
>>> IObservableList list = EMFObservables.observeList(dn,
>>> DomainPackage.Literals.DOMAIN__PERSONS);
>>>
>>> my example works fine.
>>>
>>> NOW, back to the original issue. If I use the same code with a
>>>
>>>
>>> // this prints 3 elements
>>> System.out.println(DomainUtil.getRoot().getPersons().size()) ;
>>>
>>> IObservableList list =
>>> EMFObservables.observeList(DomainUtil.getRoot(),
>>> DomainPackage.Literals.DOMAIN__PERSONS);
If you print out the DomainUtil.getRoot() list it's not empty? It's
really a list of Domain instances?
>>>
>>> viewer.setInput(list);
Should the observable list really be the input? Probably dumb question....
>>>
>>> The list is still empty and I do not get any exceptions (I have now
>>> -consoleLog switched on ;-) ).
>>>
>>> The method DomainUtil.getRoot simply returns the root object that
>>> was create with the following code (the resource is a hibernate
>>> teneo resource):
>>>
>>> try {
>>> resource.load(Collections.EMPTY_MAP);
>>> } catch (IOException e) {
>>> e.printStackTrace();
>>> }
>>> if (resource.getContents().size()>0) {
>>> root = (Domain)resource.getContents().get(0);
>>> }
>>>
>>> Do you have any idea what can make the difference here?
>>>
>>> By the way thanks for the master detail code this is one of the next
>>> viewers that I am going to create.
>>>
>>> Best regards
>>> Axel
>>>
>>>
>>>
>>
>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF databinding TableViewer [message #421488 is a reply to message #421486] Thu, 07 August 2008 20:37 Go to previous messageGo to next message
Axel Nitert is currently offline Axel NitertFriend
Messages: 13
Registered: July 2009
Junior Member
Ed,

I was successfully using the following content and label providers before:

viewer.setContentProvider(new
AdapterFactoryContentProvider(editingDomain.getAdapterFactor y()));
viewer.setLabelProvider(new
AdapterFactoryLabelProvider(editingDomain.getAdapterFactory( )));

and set the input with:

viewer.setInput(new
ItemProvider("Persons",null,DomainUtil.getRoot().getPersons()));

This was working great except that the view didn't update when adding or
removing persons in the model.

Back to your questions:

// this prints 3 elements
System.out.println(DomainUtil.getRoot().getPersons().size()) ;

IObservableList list = EMFObservables.observeList(DomainUtil.getRoot(),
DomainPackage.Literals.DOMAIN__PERSONS);

If you print out the DomainUtil.getRoot() list it's not empty? It's
really a list of Domain instances?

-> Well, getRoot() returns one single element: the Domain. The domain
itself has a method called getPersons(). It's a 1:n relation. I thought
that I have to create the observablelist with the code mentioned above.
May be I am doing something wrong here.

viewer.setInput(list);

Should the observable list really be the input? Probably dumb question....

-> I don't know another way to show the person list of the Domain object.

Any further suffestion for debugging?

Best regards
Axel


Ed Merks schrieb:
> Axel,
>
> I don't see anything obviously wrong. Generally Teneo will just surface
> things in a transparent way so everything ought to be working nicely.
>
>
> Axel Nitert wrote:
>> Tom,
>>
>> thanks for the reply.
>>
>> I agree that it obviously has got something to do with teneo. I tried
>> to go through the code using the debugger but the thing is that I have
>> no idea what happens after I call setInput. I thought that the
>> ContenProviders method getElements should be called. But it isn't.
>>
>> Do you have an additional hint where the best place would be to set
>> the breakpoint?
>>
>> The IObeservableList looks good as far as I can see. there are three
>> elements in the list.
>>
>> May be I'll have a look at the teneo forum. It could be a bug with the
>> setup I chose.
>>
>> Teneo is really a great framework to persist the EMF model to a
>> relational database without spending too much time with matching
>> fields to table columns.
>>
>> Thanks and best regards
>> Axel
>>
>>
>>
>> Tom Schindl schrieb:
>>> This certainly looks like a teneo/proxy issue? I guess simply asking
>>> for the for size of a list won't materialize it but I really really
>>> have no idea what's going on here, I've never used teneo myself but
>>> if the code you posted previously works it must be some issue with
>>> teneo or proxies.
>>>
>>> Did you tried steping through the code with a debugger to see what's
>>> really going on? The only thing you now know is that databinding
>>> works appropiately and the problem is some where else :-(
>>>
>>> Tom
>>>
>>> Axel Nitert schrieb:
>>>> Tom Schindl schrieb:
>>>>> Axel Nitert schrieb:
>>>>>> Hi guys,
>>>>>>
>>>>>> I am currently struggling with Toms approach of using databinding
>>>>>> for 1:n TableViewers.
>>>>>> I have (or at least I think I have) followed the instructions and
>>>>>> almost copied the example of Tom (thanks for the great work).
>>>>>> My problem is that the list remains empty and I would very much
>>>>>> appreciate any hint about what I'm doing wrong or how I can debug
>>>>>> this.
>>>>>>
>>>>>> Here is the code of the View Part:
>>>>>>
>>>>>> public void createPartControl(Composite parent) {
>>>>>> super.createPartControl(parent);
>>>>>> // my small example model Domain dn =
>>>>>> DomainFactory.eINSTANCE.createDomain();
>>>>>> Person p = DomainFactory.eINSTANCE.createPerson();
>>>>>> dn.getPersons().add(p);
>>>>>> // create the viewer viewer = new
>>>>>> TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL |
>>>>>> SWT.BORDER | SWT.FULL_SELECTION);
>>>>>> viewer.getControl().setLayoutData(new GridData(SWT.FILL,
>>>>>> SWT.FILL, true, true, 1, 1));
>>>>>>
>>>>>> // set up the table
>>>>>> Table table = viewer.getTable();
>>>>>> TableLayout layout = new TableLayout();
>>>>>> table.setLayout(layout);
>>>>>> table.setHeaderVisible(true);
>>>>>> table.setLinesVisible(true);
>>>>>> // Define one exmaple column Columns
>>>>>> TableViewerColumn viewerColumn;
>>>>>> viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
>>>>>>
>>>>>> // for simplification I use the standard labelprovider
>>>>>> viewerColumn.setLabelProvider(new ColumnLabelProvider());
>>>>>> viewerColumn.getColumn().setText("Last Name, First Name");
>>>>>> viewerColumn.getColumn().setWidth(200);
>>>>>> viewerColumn.getColumn().setMoveable(true);
>>>>>> // Content Provider
>>>>>> ObservableListContentProvider contentProvider = new
>>>>>> ObservableListContentProvider();
>>>>>> viewer.setContentProvider(contentProvider);
>>>>>>
>>>>>> // set input
>>>>>> IObservableList list = EMFObservables.observeList(dn,
>>>>>> DomainPackage.Literals.PERSON__SEMESTERS);
>>>>>> viewer.setInput(list);
>>>>>> }
>>>>>
>>>>> My guess is that you are getting an exception in your error-log but
>>>>> you have not been running under -consoleLog because the feature you
>>>>> want to observe DOMAIN__PERSONS-Feature or am I missing something
>>>>> obvious (I make the assumption from the title of the column 'Last
>>>>> Name, First Name' ).
>>>>>
>>>>> My guess of your model looks like this:
>>>>>
>>>>> Domain
>>>>> 1 - n Person
>>>>> 1 - n Semesters
>>>>>
>>>>> Is that correct? So what would you like to represent in the viewer?
>>>>>
>>>>> The list of persons => The viewer is the master
>>>>> The semsters of a person => The viewer is the detail and you need
>>>>> to use a EMFObservable#observeDetailList.
>>>>>
>>>>> So taking this together I think you need to modify your code from
>>>>> above like this:
>>>>>
>>>>> --------8<--------
>>>>> // set input
>>>>> IObservableList list = EMFObservables.observeList(
>>>>> dn,
>>>>> DomainPackage.Literals.DOMAIN__PERSONS);
>>>>>
>>>>> viewer.setInput(list);
>>>>>
>>>>> IObservableValue master =
>>>>> ViewerObservables.observeSingleSelection(viewer);
>>>>>
>>>>> // The detail viewer
>>>>> TableViewer semesterViewer = new TableViewer(....);
>>>>>
>>>>> TableViewerColumn c = ......
>>>>>
>>>>> ObservableListContentProvider contentProvider2 = new
>>>>> ObservableListContentProvider();
>>>>> semesterViewer.setContentProvider(contentProvider2);
>>>>>
>>>>> IObservableList detailList = EMFObservables.observeDetailList(
>>>>> Realm.getDefault(),
>>>>> master
>>>>> DomainPackage.Literals.PERSON__SEMESTERS);
>>>>> semesterViewer.setInput(detailList);
>>>>>
>>>>> --------8<--------
>>>>>
>>>>> This is untested code and based on the assumptions I made from your
>>>>> code so it might be inaccurate :-)
>>>>>
>>>>> Tom
>>>>>
>>>>>
>>>>
>>>> Hi Tom,
>>>>
>>>> thanks for the answer. The issue that I am struggling with is more
>>>> complex. I want to use the observable list with an EMF linked to a
>>>> database (TENEO, Hibernate). In order to narrow down the issue I
>>>> have reduced the code and this is why I left PERSON__SEMESTERS in
>>>> the list.
>>>>
>>>> You are totally right when I replace then code
>>>>
>>>> IObservableList list = EMFObservables.observeList(dn,
>>>> DomainPackage.Literals.PERSON__SEMESTERS);
>>>>
>>>> with
>>>> IObservableList list = EMFObservables.observeList(dn,
>>>> DomainPackage.Literals.DOMAIN__PERSONS);
>>>>
>>>> my example works fine.
>>>>
>>>> NOW, back to the original issue. If I use the same code with a
>>>>
>>>>
>>>> // this prints 3 elements
>>>> System.out.println(DomainUtil.getRoot().getPersons().size()) ;
>>>>
>>>> IObservableList list =
>>>> EMFObservables.observeList(DomainUtil.getRoot(),
>>>> DomainPackage.Literals.DOMAIN__PERSONS);
> If you print out the DomainUtil.getRoot() list it's not empty? It's
> really a list of Domain instances?
>>>>
>>>> viewer.setInput(list);
> Should the observable list really be the input? Probably dumb question....
>>>>
>>>> The list is still empty and I do not get any exceptions (I have now
>>>> -consoleLog switched on ;-) ).
>>>>
>>>> The method DomainUtil.getRoot simply returns the root object that
>>>> was create with the following code (the resource is a hibernate
>>>> teneo resource):
>>>>
>>>> try {
>>>> resource.load(Collections.EMPTY_MAP);
>>>> } catch (IOException e) {
>>>> e.printStackTrace();
>>>> }
>>>> if (resource.getContents().size()>0) {
>>>> root = (Domain)resource.getContents().get(0);
>>>> }
>>>>
>>>> Do you have any idea what can make the difference here?
>>>>
>>>> By the way thanks for the master detail code this is one of the next
>>>> viewers that I am going to create.
>>>>
>>>> Best regards
>>>> Axel
>>>>
>>>>
>>>>
>>>
>>>
Re: EMF databinding TableViewer [message #421490 is a reply to message #421488] Thu, 07 August 2008 20:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Axel,

Comments below.

Axel Nitert wrote:
> Ed,
>
> I was successfully using the following content and label providers
> before:
>
> viewer.setContentProvider(new
> AdapterFactoryContentProvider(editingDomain.getAdapterFactor y()));
> viewer.setLabelProvider(new
> AdapterFactoryLabelProvider(editingDomain.getAdapterFactory( )));
>
> and set the input with:
>
> viewer.setInput(new
> ItemProvider("Persons",null,DomainUtil.getRoot().getPersons()));
>
> This was working great except that the view didn't update when adding
> or removing persons in the model.
It seems to me the input should have been the getRoot() object. What
happens if you did that instead? Does it show more than just the
persons list?
>
> Back to your questions:
>
> // this prints 3 elements
> System.out.println(DomainUtil.getRoot().getPersons().size()) ;
>
> IObservableList list =
> EMFObservables.observeList(DomainUtil.getRoot(),
> DomainPackage.Literals.DOMAIN__PERSONS);
>
> If you print out the DomainUtil.getRoot() list it's not empty? It's
> really a list of Domain instances?
>
> -> Well, getRoot() returns one single element: the Domain. The domain
> itself has a method called getPersons(). It's a 1:n relation. I
> thought that I have to create the observablelist with the code
> mentioned above. May be I am doing something wrong here.
>
> viewer.setInput(list);
I'm not sure the viewer has any special support for an observable list;
maybe that's just my data binding ignorance.
>
> Should the observable list really be the input? Probably dumb
> question....
>
> -> I don't know another way to show the person list of the Domain object.
>
> Any further suffestion for debugging?
But a breakpoint some of the AdapteFactoryContentProvider methods like
getElements and getChildren. Likely you'll find the list is the
"object" passed in and it can't be adapted hence you get nothing in the
view...
>
> Best regards
> Axel
>
>
> Ed Merks schrieb:
>> Axel,
>>
>> I don't see anything obviously wrong. Generally Teneo will just
>> surface things in a transparent way so everything ought to be working
>> nicely.
>>
>>
>> Axel Nitert wrote:
>>> Tom,
>>>
>>> thanks for the reply.
>>>
>>> I agree that it obviously has got something to do with teneo. I
>>> tried to go through the code using the debugger but the thing is
>>> that I have no idea what happens after I call setInput. I thought
>>> that the ContenProviders method getElements should be called. But it
>>> isn't.
>>>
>>> Do you have an additional hint where the best place would be to set
>>> the breakpoint?
>>>
>>> The IObeservableList looks good as far as I can see. there are three
>>> elements in the list.
>>>
>>> May be I'll have a look at the teneo forum. It could be a bug with
>>> the setup I chose.
>>>
>>> Teneo is really a great framework to persist the EMF model to a
>>> relational database without spending too much time with matching
>>> fields to table columns.
>>>
>>> Thanks and best regards
>>> Axel
>>>
>>>
>>>
>>> Tom Schindl schrieb:
>>>> This certainly looks like a teneo/proxy issue? I guess simply
>>>> asking for the for size of a list won't materialize it but I really
>>>> really have no idea what's going on here, I've never used teneo
>>>> myself but if the code you posted previously works it must be some
>>>> issue with teneo or proxies.
>>>>
>>>> Did you tried steping through the code with a debugger to see
>>>> what's really going on? The only thing you now know is that
>>>> databinding works appropiately and the problem is some where else :-(
>>>>
>>>> Tom
>>>>
>>>> Axel Nitert schrieb:
>>>>> Tom Schindl schrieb:
>>>>>> Axel Nitert schrieb:
>>>>>>> Hi guys,
>>>>>>>
>>>>>>> I am currently struggling with Toms approach of using
>>>>>>> databinding for 1:n TableViewers.
>>>>>>> I have (or at least I think I have) followed the instructions
>>>>>>> and almost copied the example of Tom (thanks for the great work).
>>>>>>> My problem is that the list remains empty and I would very much
>>>>>>> appreciate any hint about what I'm doing wrong or how I can
>>>>>>> debug this.
>>>>>>>
>>>>>>> Here is the code of the View Part:
>>>>>>>
>>>>>>> public void createPartControl(Composite parent) {
>>>>>>> super.createPartControl(parent);
>>>>>>> // my small example model Domain dn =
>>>>>>> DomainFactory.eINSTANCE.createDomain();
>>>>>>> Person p = DomainFactory.eINSTANCE.createPerson();
>>>>>>> dn.getPersons().add(p);
>>>>>>> // create the viewer viewer = new
>>>>>>> TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL |
>>>>>>> SWT.BORDER | SWT.FULL_SELECTION);
>>>>>>> viewer.getControl().setLayoutData(new GridData(SWT.FILL,
>>>>>>> SWT.FILL, true, true, 1, 1));
>>>>>>>
>>>>>>> // set up the table
>>>>>>> Table table = viewer.getTable();
>>>>>>> TableLayout layout = new TableLayout();
>>>>>>> table.setLayout(layout);
>>>>>>> table.setHeaderVisible(true);
>>>>>>> table.setLinesVisible(true);
>>>>>>> // Define one exmaple column Columns
>>>>>>> TableViewerColumn viewerColumn;
>>>>>>> viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
>>>>>>>
>>>>>>> // for simplification I use the standard labelprovider
>>>>>>> viewerColumn.setLabelProvider(new ColumnLabelProvider());
>>>>>>> viewerColumn.getColumn().setText("Last Name, First Name");
>>>>>>> viewerColumn.getColumn().setWidth(200);
>>>>>>> viewerColumn.getColumn().setMoveable(true);
>>>>>>> // Content Provider
>>>>>>> ObservableListContentProvider contentProvider = new
>>>>>>> ObservableListContentProvider();
>>>>>>> viewer.setContentProvider(contentProvider);
>>>>>>>
>>>>>>> // set input
>>>>>>> IObservableList list = EMFObservables.observeList(dn,
>>>>>>> DomainPackage.Literals.PERSON__SEMESTERS);
>>>>>>> viewer.setInput(list);
>>>>>>> }
>>>>>>
>>>>>> My guess is that you are getting an exception in your error-log
>>>>>> but you have not been running under -consoleLog because the
>>>>>> feature you want to observe DOMAIN__PERSONS-Feature or am I
>>>>>> missing something obvious (I make the assumption from the title
>>>>>> of the column 'Last Name, First Name' ).
>>>>>>
>>>>>> My guess of your model looks like this:
>>>>>>
>>>>>> Domain
>>>>>> 1 - n Person
>>>>>> 1 - n Semesters
>>>>>>
>>>>>> Is that correct? So what would you like to represent in the viewer?
>>>>>>
>>>>>> The list of persons => The viewer is the master
>>>>>> The semsters of a person => The viewer is the detail and you need
>>>>>> to use a EMFObservable#observeDetailList.
>>>>>>
>>>>>> So taking this together I think you need to modify your code from
>>>>>> above like this:
>>>>>>
>>>>>> --------8<--------
>>>>>> // set input
>>>>>> IObservableList list = EMFObservables.observeList(
>>>>>> dn,
>>>>>> DomainPackage.Literals.DOMAIN__PERSONS);
>>>>>>
>>>>>> viewer.setInput(list);
>>>>>>
>>>>>> IObservableValue master =
>>>>>> ViewerObservables.observeSingleSelection(viewer);
>>>>>>
>>>>>> // The detail viewer
>>>>>> TableViewer semesterViewer = new TableViewer(....);
>>>>>>
>>>>>> TableViewerColumn c = ......
>>>>>>
>>>>>> ObservableListContentProvider contentProvider2 = new
>>>>>> ObservableListContentProvider();
>>>>>> semesterViewer.setContentProvider(contentProvider2);
>>>>>>
>>>>>> IObservableList detailList = EMFObservables.observeDetailList(
>>>>>> Realm.getDefault(),
>>>>>> master
>>>>>> DomainPackage.Literals.PERSON__SEMESTERS);
>>>>>> semesterViewer.setInput(detailList);
>>>>>>
>>>>>> --------8<--------
>>>>>>
>>>>>> This is untested code and based on the assumptions I made from
>>>>>> your code so it might be inaccurate :-)
>>>>>>
>>>>>> Tom
>>>>>>
>>>>>>
>>>>>
>>>>> Hi Tom,
>>>>>
>>>>> thanks for the answer. The issue that I am struggling with is more
>>>>> complex. I want to use the observable list with an EMF linked to a
>>>>> database (TENEO, Hibernate). In order to narrow down the issue I
>>>>> have reduced the code and this is why I left PERSON__SEMESTERS in
>>>>> the list.
>>>>>
>>>>> You are totally right when I replace then code
>>>>>
>>>>> IObservableList list = EMFObservables.observeList(dn,
>>>>> DomainPackage.Literals.PERSON__SEMESTERS);
>>>>>
>>>>> with
>>>>> IObservableList list = EMFObservables.observeList(dn,
>>>>> DomainPackage.Literals.DOMAIN__PERSONS);
>>>>>
>>>>> my example works fine.
>>>>>
>>>>> NOW, back to the original issue. If I use the same code with a
>>>>>
>>>>>
>>>>> // this prints 3 elements
>>>>> System.out.println(DomainUtil.getRoot().getPersons().size()) ;
>>>>>
>>>>> IObservableList list =
>>>>> EMFObservables.observeList(DomainUtil.getRoot(),
>>>>> DomainPackage.Literals.DOMAIN__PERSONS);
>> If you print out the DomainUtil.getRoot() list it's not empty? It's
>> really a list of Domain instances?
>>>>>
>>>>> viewer.setInput(list);
>> Should the observable list really be the input? Probably dumb
>> question....
>>>>>
>>>>> The list is still empty and I do not get any exceptions (I have
>>>>> now -consoleLog switched on ;-) ).
>>>>>
>>>>> The method DomainUtil.getRoot simply returns the root object that
>>>>> was create with the following code (the resource is a hibernate
>>>>> teneo resource):
>>>>>
>>>>> try {
>>>>> resource.load(Collections.EMPTY_MAP);
>>>>> } catch (IOException e) {
>>>>> e.printStackTrace();
>>>>> }
>>>>> if (resource.getContents().size()>0) {
>>>>> root = (Domain)resource.getContents().get(0);
>>>>> }
>>>>>
>>>>> Do you have any idea what can make the difference here?
>>>>>
>>>>> By the way thanks for the master detail code this is one of the
>>>>> next viewers that I am going to create.
>>>>>
>>>>> Best regards
>>>>> Axel
>>>>>
>>>>>
>>>>>
>>>>
>>>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF databinding TableViewer [message #421502 is a reply to message #421488] Fri, 08 August 2008 07:08 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
[...]
> viewer.setInput(list);
>
> Should the observable list really be the input? Probably dumb question....
>

Yes IObservableList is the correct one because
ObservableListContentProvider depends on it (the content provider
internally registers itself as change listener and updates the viewer
appropiately).

What really makes me think is that you say that getElements() method is
not called which is impossible or did I get that wrong?

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: EMF databinding TableViewer [message #421554 is a reply to message #421502] Sat, 09 August 2008 08:23 Go to previous messageGo to next message
Axel Nitert is currently offline Axel NitertFriend
Messages: 13
Registered: July 2009
Junior Member
Tom, Ed,

thanks for sharing your ideas with me.

In fact the ContentProviders getElements method is not called and it
seems not to be so easy to debug something that is not called ;-) .

However, I could narrow down the issue to the following call:

viewer.setInput
calls ContentViewer.setInput
calls ObservableListContentProvider.setInput
calls knownelements.addAll
calls DetailObservableList.addAll
calls WritableSet.addAll
calls ObservableSet.fireSetChange
calls ChangeManager.fireEvent
-> here we have the issue I think

The method findListenerTypeIndex returns -1 and therefore the event is
not dispatched to any listener.

I was not able to figure out if this is causing the issue that
getElements is not called. But It seems to me that there is something
going wrong here.

One more remark: I am not sure if I have set up the editing domain
correctly. Could it have something to do with this? If yes, could you
please provide some example code so that I can check this?

I have not done any further debugging with the
AdapterFactoryContentProvider because it's working fine. I was just
trying use the databinding aproach for my viewer.

Your comments are always welcome.

Nice weekend
Axel



Tom Schindl schrieb:
> [...]
>> viewer.setInput(list);
>>
>> Should the observable list really be the input? Probably dumb
>> question....
>>
>
> Yes IObservableList is the correct one because
> ObservableListContentProvider depends on it (the content provider
> internally registers itself as change listener and updates the viewer
> appropiately).
>
> What really makes me think is that you say that getElements() method is
> not called which is impossible or did I get that wrong?
>
> Tom
>
Re: EMF databinding TableViewer [message #421557 is a reply to message #421554] Sat, 09 August 2008 11:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Axel,

What would be most useful would be for us to be able to reproduce the
problem, but it sounds like a lot of set up would be involved. I
certainly don't have a database to hook into and you've implied the
problem is specific to a model backed by Teneo... Certainly if you
could manufacture a test case that could be exported to a zip file so we
could reproduce the problem, we'd have an easier time helping...

I really don't know much about how all the data binding infrastructure
works so I definitely need to see it in action to understand much about
it. Tom's likely to have more insights based on only descriptive text...


Axel Nitert wrote:
> Tom, Ed,
>
> thanks for sharing your ideas with me.
>
> In fact the ContentProviders getElements method is not called and it
> seems not to be so easy to debug something that is not called ;-) .
>
> However, I could narrow down the issue to the following call:
>
> viewer.setInput
> calls ContentViewer.setInput
> calls ObservableListContentProvider.setInput
> calls knownelements.addAll
> calls DetailObservableList.addAll
> calls WritableSet.addAll
> calls ObservableSet.fireSetChange
> calls ChangeManager.fireEvent
> -> here we have the issue I think
>
> The method findListenerTypeIndex returns -1 and therefore the event is
> not dispatched to any listener.
>
> I was not able to figure out if this is causing the issue that
> getElements is not called. But It seems to me that there is something
> going wrong here.
>
> One more remark: I am not sure if I have set up the editing domain
> correctly. Could it have something to do with this? If yes, could you
> please provide some example code so that I can check this?
>
> I have not done any further debugging with the
> AdapterFactoryContentProvider because it's working fine. I was just
> trying use the databinding aproach for my viewer.
>
> Your comments are always welcome.
>
> Nice weekend
> Axel
>
>
>
> Tom Schindl schrieb:
>> [...]
>>> viewer.setInput(list);
>>>
>>> Should the observable list really be the input? Probably dumb
>>> question....
>>>
>>
>> Yes IObservableList is the correct one because
>> ObservableListContentProvider depends on it (the content provider
>> internally registers itself as change listener and updates the viewer
>> appropiately).
>>
>> What really makes me think is that you say that getElements() method
>> is not called which is impossible or did I get that wrong?
>>
>> Tom
>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF databinding TableViewer [message #421593 is a reply to message #421554] Mon, 11 August 2008 09:52 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi Axel,

It's hard to say what's the problem. I think I need code to execute it
locally and debug it myself in comparision to a none teneo setup.

If you need a full example of a working XMI solution to compare with
yours you can take a look at an example project I'm just working on [1]
(currently persistence is only XMI but I'm planning to add teneo and CDO
once everything is implemented appropriately).

If someone wants to add support for CDO/Teneo they are welcome to help
me and add those technologies. This project could provide a complete
overview for all EMF technologies when we talk about datacentric emf
based applications:

- EMF
- EMF/JavaBeans/SWT-Databinding
- Usage of Extension Points (inculding creating custom ones)
- Usage of Commands and Expressions-Framework
- Persistance-Technologies (XMI, Teneo, CDO, ...)

I think I designed the application in a way those technologies could be
added by people who know what they are doing and we can point people to
a complete application with medium complexity.

Maybe we can even mix validation with OCL and other cool things into the
picture.

Tom

[1] http://publicsvn.bestsolution.at/repos/java/examples/EMF-Dat abinding/

Axel Nitert schrieb:
> Tom, Ed,
>
> thanks for sharing your ideas with me.
>
> In fact the ContentProviders getElements method is not called and it
> seems not to be so easy to debug something that is not called ;-) .
>
> However, I could narrow down the issue to the following call:
>
> viewer.setInput
> calls ContentViewer.setInput
> calls ObservableListContentProvider.setInput
> calls knownelements.addAll
> calls DetailObservableList.addAll
> calls WritableSet.addAll
> calls ObservableSet.fireSetChange
> calls ChangeManager.fireEvent
> -> here we have the issue I think
>
> The method findListenerTypeIndex returns -1 and therefore the event is
> not dispatched to any listener.
>
> I was not able to figure out if this is causing the issue that
> getElements is not called. But It seems to me that there is something
> going wrong here.
>
> One more remark: I am not sure if I have set up the editing domain
> correctly. Could it have something to do with this? If yes, could you
> please provide some example code so that I can check this?
>
> I have not done any further debugging with the
> AdapterFactoryContentProvider because it's working fine. I was just
> trying use the databinding aproach for my viewer.
>
> Your comments are always welcome.
>
> Nice weekend
> Axel
>
>
>
> Tom Schindl schrieb:
>> [...]
>>> viewer.setInput(list);
>>>
>>> Should the observable list really be the input? Probably dumb
>>> question....
>>>
>>
>> Yes IObservableList is the correct one because
>> ObservableListContentProvider depends on it (the content provider
>> internally registers itself as change listener and updates the viewer
>> appropiately).
>>
>> What really makes me think is that you say that getElements() method
>> is not called which is impossible or did I get that wrong?
>>
>> Tom
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: EMF databinding TableViewer [message #421618 is a reply to message #421593] Mon, 11 August 2008 16:34 Go to previous messageGo to next message
Axel Nitert is currently offline Axel NitertFriend
Messages: 13
Registered: July 2009
Junior Member
Tom, Ed,

I will have a look into Toms EMF Data-Binding example. But this week I
am very busy. Either I find the solution myself or I will send you an
example which isolates the problem.

It's great to have an example which combines all these fancy
technologies. May be I can add some ideas for Teneo to your example.

Let's see. Thanks so far.

Axel
Re: EMF databinding TableViewer [message #421720 is a reply to message #421618] Tue, 12 August 2008 12:52 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi Axel,

Yesterday I proposed a talk about this tutorial for ESE. You can follow
the submission here [1] or leave a comment.

Tom

[1] https://www.eclipsecon.org/submissions/view_talk.php?id=48

Axel Nitert schrieb:
> Tom, Ed,
>
> I will have a look into Toms EMF Data-Binding example. But this week I
> am very busy. Either I find the solution myself or I will send you an
> example which isolates the problem.
>
> It's great to have an example which combines all these fancy
> technologies. May be I can add some ideas for Teneo to your example.
>
> Let's see. Thanks so far.
>
> Axel


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: EMF databinding TableViewer [message #421755 is a reply to message #421488] Wed, 13 August 2008 09:58 Go to previous messageGo to next message
gitanjali punj is currently offline gitanjali punjFriend
Messages: 59
Registered: July 2009
Member
hello,

for any xsd import does there need to be meta model for
it (xmi meta model)like for emof/cmof xml file import we
needed to create an emof/cmof metamodel. so is the same
required for xsd import.
waiting for reply
Re: EMF databinding TableViewer [message #421763 is a reply to message #421755] Wed, 13 August 2008 10:47 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Gitanjali,

Comments below.

Gitanjali Punj wrote:
> hello,
>
> for any xsd import does there need to be meta model for it (xmi meta
> model)like for emof/cmof xml file import
There's org.eclipse.xsd/model/XSD.ecore.
> we needed to create an emof/cmof metamodel. so is the same
> required for xsd import.
Yes, the org.eclipse.xsd plugin provides an EMF-based implementation for
reading, writing, and manipulating *.xsd files.
> waiting for reply
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF databinding TableViewer [message #421934 is a reply to message #421720] Mon, 18 August 2008 19:15 Go to previous messageGo to next message
Axel Nitert is currently offline Axel NitertFriend
Messages: 13
Registered: July 2009
Junior Member
Hi Tom,

I didn't have much time to go through your code and unfortunately a
BundleException when I was trying to run the example (using Ganymede on
mac os and windows).
However, I was able to understand what the code is about and I have to
say that this is really a very interesting example which covers lots of
differenf aspects of a data based RCP application.

Honestly, I think it is even a bit too complex to go into the topic of
data binding. Going through the way of Datasource, DatasourceService,
PersistenceService and PersistenceRegistry really consumes a lot of time
without the appropriate examplanation.

So, I am really hoping that you are adding a great tutorial to this
excellent piece of code.


Now, self-interested as I am ;-) I would like to come back to my
original problem which I still wasn't able to solve.

But at least I think I found out what the problem is.

HibernatePersistableEList<E>(PersistableEList<E>).equals(Object) line: 550
EditingDomainEObjectObservableList(ObservableList).equals(Ob ject) line: 87
TableViewer(StructuredViewer).equals(Object, Object) line: 684
TableViewer(AbstractTableViewer).internalRefresh(Object, boolean) line: 631
TableViewer(AbstractTableViewer).internalRefresh(Object) line: 620
AbstractTableViewer$2.run() line: 576

The internally used PersistableEList is not equal to the
EditingDomainEObjectObservableList which prevents the function
internalRefresh from calling internalRefreshAll which then calls
getElements().

The code is still the same as in ther very beginning of my example and
it seems that this issue is really related to teneo.

May be, you have another idea why the two lists are different.

BTW, the function internalRefresh is called twice. 1. on
viewer.setLabelProvider which is then correctly calling
internalRefreshAll but without any data to display and then 2. on
setInput with the behaviour described above.

I will go on debugging but would really appreciate any additional help.

Thanks.
Axel

Tom Schindl schrieb:
> Hi Axel,
>
> Yesterday I proposed a talk about this tutorial for ESE. You can follow
> the submission here [1] or leave a comment.
>
> Tom
>
> [1] https://www.eclipsecon.org/submissions/view_talk.php?id=48
>
> Axel Nitert schrieb:
>> Tom, Ed,
>>
>> I will have a look into Toms EMF Data-Binding example. But this week I
>> am very busy. Either I find the solution myself or I will send you an
>> example which isolates the problem.
>>
>> It's great to have an example which combines all these fancy
>> technologies. May be I can add some ideas for Teneo to your example.
>>
>> Let's see. Thanks so far.
>>
>> Axel
>
>
Re: EMF databinding TableViewer [message #421938 is a reply to message #421934] Mon, 18 August 2008 19:47 Go to previous messageGo to next message
Axel Nitert is currently offline Axel NitertFriend
Messages: 13
Registered: July 2009
Junior Member
Hi again,

I found a workaround after I wrote the last post. It simply came to my
mind after pressing save.

I have added a comparer to my TableViewer which looks like this:

IElementComparer elistComparer = new IElementComparer() {

public boolean equals(Object a, Object b) {
if (a instanceof EditingDomainEObjectObservableList
&& b instanceof EditingDomainEObjectObservableList) {
return a==b;
}
return a.equals(b);
}

public int hashCode(Object element) {
return element.hashCode();
}
};

And then of course I added viewer.setComparer(elistComparer).

I don't know if this is the best way but at least it solved my problem
so far.

What do you think?

Axel

Axel Nitert schrieb:
> Hi Tom,
>
> I didn't have much time to go through your code and unfortunately a
> BundleException when I was trying to run the example (using Ganymede on
> mac os and windows).
> However, I was able to understand what the code is about and I have to
> say that this is really a very interesting example which covers lots of
> differenf aspects of a data based RCP application.
>
> Honestly, I think it is even a bit too complex to go into the topic of
> data binding. Going through the way of Datasource, DatasourceService,
> PersistenceService and PersistenceRegistry really consumes a lot of time
> without the appropriate examplanation.
>
> So, I am really hoping that you are adding a great tutorial to this
> excellent piece of code.
>
>
> Now, self-interested as I am ;-) I would like to come back to my
> original problem which I still wasn't able to solve.
>
> But at least I think I found out what the problem is.
>
> HibernatePersistableEList<E>(PersistableEList<E>).equals(Object) line:
> 550
> EditingDomainEObjectObservableList(ObservableList).equals(Ob ject) line:
> 87
> TableViewer(StructuredViewer).equals(Object, Object) line: 684
> TableViewer(AbstractTableViewer).internalRefresh(Object, boolean) line:
> 631
> TableViewer(AbstractTableViewer).internalRefresh(Object) line: 620
> AbstractTableViewer$2.run() line: 576
>
> The internally used PersistableEList is not equal to the
> EditingDomainEObjectObservableList which prevents the function
> internalRefresh from calling internalRefreshAll which then calls
> getElements().
>
> The code is still the same as in ther very beginning of my example and
> it seems that this issue is really related to teneo.
>
> May be, you have another idea why the two lists are different.
>
> BTW, the function internalRefresh is called twice. 1. on
> viewer.setLabelProvider which is then correctly calling
> internalRefreshAll but without any data to display and then 2. on
> setInput with the behaviour described above.
>
> I will go on debugging but would really appreciate any additional help.
>
> Thanks.
> Axel
>
> Tom Schindl schrieb:
>> Hi Axel,
>>
>> Yesterday I proposed a talk about this tutorial for ESE. You can
>> follow the submission here [1] or leave a comment.
>>
>> Tom
>>
>> [1] https://www.eclipsecon.org/submissions/view_talk.php?id=48
>>
>> Axel Nitert schrieb:
>>> Tom, Ed,
>>>
>>> I will have a look into Toms EMF Data-Binding example. But this week
>>> I am very busy. Either I find the solution myself or I will send you
>>> an example which isolates the problem.
>>>
>>> It's great to have an example which combines all these fancy
>>> technologies. May be I can add some ideas for Teneo to your example.
>>>
>>> Let's see. Thanks so far.
>>>
>>> Axel
>>
>>
Re: EMF databinding TableViewer [message #421951 is a reply to message #421938] Tue, 19 August 2008 09:48 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi Axel,

I really need a sample project to track this down :-) What is the call
stack to get to internalRefresh(Object,boolean)?

Tom

Axel Nitert schrieb:
> Hi again,
>
> I found a workaround after I wrote the last post. It simply came to my
> mind after pressing save.
>
> I have added a comparer to my TableViewer which looks like this:
>
> IElementComparer elistComparer = new IElementComparer() {
>
> public boolean equals(Object a, Object b) {
> if (a instanceof EditingDomainEObjectObservableList
> && b instanceof EditingDomainEObjectObservableList) {
> return a==b;
> }
> return a.equals(b);
> }
>
> public int hashCode(Object element) {
> return element.hashCode();
> }
> };
>
> And then of course I added viewer.setComparer(elistComparer).
>
> I don't know if this is the best way but at least it solved my problem
> so far.
>
> What do you think?
>
> Axel
>
> Axel Nitert schrieb:
>> Hi Tom,
>>
>> I didn't have much time to go through your code and unfortunately a
>> BundleException when I was trying to run the example (using Ganymede
>> on mac os and windows).
>> However, I was able to understand what the code is about and I have to
>> say that this is really a very interesting example which covers lots
>> of differenf aspects of a data based RCP application.
>>
>> Honestly, I think it is even a bit too complex to go into the topic of
>> data binding. Going through the way of Datasource, DatasourceService,
>> PersistenceService and PersistenceRegistry really consumes a lot of
>> time without the appropriate examplanation.
>>
>> So, I am really hoping that you are adding a great tutorial to this
>> excellent piece of code.
>>
>>
>> Now, self-interested as I am ;-) I would like to come back to my
>> original problem which I still wasn't able to solve.
>>
>> But at least I think I found out what the problem is.
>>
>> HibernatePersistableEList<E>(PersistableEList<E>).equals(Object) line:
>> 550
>> EditingDomainEObjectObservableList(ObservableList).equals(Ob ject)
>> line: 87 TableViewer(StructuredViewer).equals(Object, Object) line:
>> 684 TableViewer(AbstractTableViewer).internalRefresh(Object,
>> boolean) line: 631
>> TableViewer(AbstractTableViewer).internalRefresh(Object) line: 620
>> AbstractTableViewer$2.run() line: 576
>> The internally used PersistableEList is not equal to the
>> EditingDomainEObjectObservableList which prevents the function
>> internalRefresh from calling internalRefreshAll which then calls
>> getElements().
>>
>> The code is still the same as in ther very beginning of my example and
>> it seems that this issue is really related to teneo.
>>
>> May be, you have another idea why the two lists are different.
>>
>> BTW, the function internalRefresh is called twice. 1. on
>> viewer.setLabelProvider which is then correctly calling
>> internalRefreshAll but without any data to display and then 2. on
>> setInput with the behaviour described above.
>>
>> I will go on debugging but would really appreciate any additional help.
>>
>> Thanks.
>> Axel
>>
>> Tom Schindl schrieb:
>>> Hi Axel,
>>>
>>> Yesterday I proposed a talk about this tutorial for ESE. You can
>>> follow the submission here [1] or leave a comment.
>>>
>>> Tom
>>>
>>> [1] https://www.eclipsecon.org/submissions/view_talk.php?id=48
>>>
>>> Axel Nitert schrieb:
>>>> Tom, Ed,
>>>>
>>>> I will have a look into Toms EMF Data-Binding example. But this week
>>>> I am very busy. Either I find the solution myself or I will send you
>>>> an example which isolates the problem.
>>>>
>>>> It's great to have an example which combines all these fancy
>>>> technologies. May be I can add some ideas for Teneo to your example.
>>>>
>>>> Let's see. Thanks so far.
>>>>
>>>> Axel
>>>
>>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: EMF databinding TableViewer [message #421953 is a reply to message #421934] Tue, 19 August 2008 09:56 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Axel Nitert schrieb:
> Hi Tom,
>
> I didn't have much time to go through your code and unfortunately a
> BundleException when I was trying to run the example (using Ganymede on
> mac os and windows).

Could you post the stack for the exception? I'm also using Ganymede on
OS-X ;-)

> However, I was able to understand what the code is about and I have to
> say that this is really a very interesting example which covers lots of
> differenf aspects of a data based RCP application.
>

Yes. I try to cover all aspects of data-centric RCP-Applications. An
introduction tutorial to databinding I'm also working on is:

http://wiki.eclipse.org/Wire_EMF_Databinding_RCP

which doesn't use EMF-Databinding but the JavaBean-Databinding
implementation still I the Domain-Model is implemented in EMF ;-)

> Honestly, I think it is even a bit too complex to go into the topic of
> data binding. Going through the way of Datasource, DatasourceService,
> PersistenceService and PersistenceRegistry really consumes a lot of time
> without the appropriate examplanation.
>

Yes. It's meant to give insights into writing first class data centric
applications and using EMF/EditingDomain/... in custom written code. I
could e.g. find a tutorial how to setup your own editing domain because
it looks like most people use the generated code and customize it.

> So, I am really hoping that you are adding a great tutorial to this
> excellent piece of code.
>
>

I know. I started writing an "book" explaining all the techonologies
used and take the code in this example to explain how one has to
implement such an application.

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: EMF databinding TableViewer [message #421970 is a reply to message #421953] Tue, 19 August 2008 18:41 Go to previous messageGo to next message
Axel Nitert is currently offline Axel NitertFriend
Messages: 13
Registered: July 2009
Junior Member
This is a multi-part message in MIME format.
--------------090203000302050807000107
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi Tom,

I have attched the stack trace of the error message that I have received.
Steps:
- check out project
- rightclick on SoccerStat.product
- choose Run As / Eclipse application
- in the run configurations I clicked on Add Required Plugins
- added some missing plugins manually because they have somehow not
beeen added.
- run the application
- click on file / Datasources/configure datasources

This is when I receive the error message and the dialog does not open.

I hope that this helps.

I will try to create a sample project but it's not that simple. I will
hopefully be able to add it on Thursday.

Axel





--------------090203000302050807000107
Content-Type: text/plain;
name="trace.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="trace.txt"

eclipse.buildId=unknown
java.version=1.5.0_13
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86, WS=carbon, NL=de_DE
Framework arguments: -product at.bestsolution.soccer.app.product
Command-line arguments: -product at.bestsolution.soccer.app.product -data /<bla...>/eclipse3.4/../runtime-SoccerStat.product -dev file:<bla...> /eclipse3.4/.metadata/.plugins/org.eclipse.pde.core/SoccerSt at.product/dev.properties -os macosx -ws carbon -arch x86

!ENTRY org.eclipse.osgi 4 0 2008-08-19 20:35:50.645
!MESSAGE An error occurred while automatically activating bundle org.eclipse.emf.ecore (20).
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.emf.ecore.plugin.EcorePlugin$Implementation.star t() of bundle org.eclipse.emf.ecore.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1028)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:427)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374 )
at org.eclipse.emf.edit.EMFEditPlugin$Implementation.<init>(EMFEditPlugin.java:314)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:4 94)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:141)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:980)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:427)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374 )
at at.bestsolution.soccer.ui.datasource.internal.ServicesTitleA reaDialog.createDialogArea(ServicesTitleAreaDialog.java:108)
at org.eclipse.jface.dialogs.TitleAreaDialog.createContents(Tit leAreaDialog.java:147)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
at org.eclipse.jface.window.Window.open(Window.java:790)
at at.bestsolution.soccer.ui.datasource.internal.OpenDatasource ConfigurationHandler.execute(OpenDatasourceConfigurationHand ler.java:12)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:281)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:247)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:619)
at org.eclipse.ui.menus.CommandContributionItem.access$10(Comma ndContributionItem.java:605)
at org.eclipse.ui.menus.CommandContributionItem$4.handleEvent(C ommandContributionItem.java:595)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1561)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1585)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1570)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 360)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3474)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3064)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at at.bestsolution.soccer.app.intro.Application.start(Applicati on.java:20)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/core/resources/ResourcesPlugin
at org.eclipse.emf.ecore.plugin.EcorePlugin$Implementation.star t(EcorePlugin.java:505)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
... 80 more
Root exception:
java.lang.NoClassDefFoundError: org/eclipse/core/resources/ResourcesPlugin
at org.eclipse.emf.ecore.plugin.EcorePlugin$Implementation.star t(EcorePlugin.java:505)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:427)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374 )
at org.eclipse.emf.edit.EMFEditPlugin$Implementation.<init>(EMFEditPlugin.java:314)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:4 94)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:141)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:980)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:427)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374 )
at at.bestsolution.soccer.ui.datasource.internal.ServicesTitleA reaDialog.createDialogArea(ServicesTitleAreaDialog.java:108)
at org.eclipse.jface.dialogs.TitleAreaDialog.createContents(Tit leAreaDialog.java:147)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
at org.eclipse.jface.window.Window.open(Window.java:790)
at at.bestsolution.soccer.ui.datasource.internal.OpenDatasource ConfigurationHandler.execute(OpenDatasourceConfigurationHand ler.java:12)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:281)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:247)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:619)
at org.eclipse.ui.menus.CommandContributionItem.access$10(Comma ndContributionItem.java:605)
at org.eclipse.ui.menus.CommandContributionItem$4.handleEvent(C ommandContributionItem.java:595)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1561)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1585)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1570)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 360)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3474)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3064)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at at.bestsolution.soccer.app.intro.Application.start(Applicati on.java:20)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)

!ENTRY org.eclipse.osgi 4 0 2008-08-19 20:35:50.651
!MESSAGE An error occurred while automatically activating bundle org.eclipse.emf.edit (21).
!STACK 0
org.osgi.framework.BundleException: The activator org.eclipse.emf.edit.EMFEditPlugin$Implementation for bundle org.eclipse.emf.edit is invalid
at org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:146)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:980)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:427)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374 )
at at.bestsolution.soccer.ui.datasource.internal.ServicesTitleA reaDialog.createDialogArea(ServicesTitleAreaDialog.java:108)
at org.eclipse.jface.dialogs.TitleAreaDialog.createContents(Tit leAreaDialog.java:147)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
at org.eclipse.jface.window.Window.open(Window.java:790)
at at.bestsolution.soccer.ui.datasource.internal.OpenDatasource ConfigurationHandler.execute(OpenDatasourceConfigurationHand ler.java:12)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:281)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:247)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:619)
at org.eclipse.ui.menus.CommandContributionItem.access$10(Comma ndContributionItem.java:605)
at org.eclipse.ui.menus.CommandContributionItem$4.handleEvent(C ommandContributionItem.java:595)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1561)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1585)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1570)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 360)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3474)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3064)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at at.bestsolution.soccer.app.intro.Application.start(Applicati on.java:20)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/emf/ecore/plugin/RegistryReader
at org.eclipse.emf.edit.EMFEditPlugin$Implementation.<init>(EMFEditPlugin.java:314)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:4 94)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:141)
... 57 more
Root exception:
java.lang.NoClassDefFoundError: org/eclipse/emf/ecore/plugin/RegistryReader
at org.eclipse.emf.edit.EMFEditPlugin$Implementation.<init>(EMFEditPlugin.java:314)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:4 94)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:141)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:980)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:427)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374 )
at at.bestsolution.soccer.ui.datasource.internal.ServicesTitleA reaDialog.createDialogArea(ServicesTitleAreaDialog.java:108)
at org.eclipse.jface.dialogs.TitleAreaDialog.createContents(Tit leAreaDialog.java:147)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
at org.eclipse.jface.window.Window.open(Window.java:790)
at at.bestsolution.soccer.ui.datasource.internal.OpenDatasource ConfigurationHandler.execute(OpenDatasourceConfigurationHand ler.java:12)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:281)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:247)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:619)
at org.eclipse.ui.menus.CommandContributionItem.access$10(Comma ndContributionItem.java:605)
at org.eclipse.ui.menus.CommandContributionItem$4.handleEvent(C ommandContributionItem.java:595)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1561)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1585)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1570)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 360)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3474)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3064)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at at.bestsolution.soccer.app.intro.Application.start(Applicati on.java:20)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)

!ENTRY org.eclipse.ui 4 0 2008-08-19 20:35:50.659
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/emf/edit/domain/EditingDomain
at at.bestsolution.soccer.ui.datasource.internal.ServicesTitleA reaDialog.createDialogArea(ServicesTitleAreaDialog.java:108)
at org.eclipse.jface.dialogs.TitleAreaDialog.createContents(Tit leAreaDialog.java:147)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
at org.eclipse.jface.window.Window.open(Window.java:790)
at at.bestsolution.soccer.ui.datasource.internal.OpenDatasource ConfigurationHandler.execute(OpenDatasourceConfigurationHand ler.java:12)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:281)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:247)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:619)
at org.eclipse.ui.menus.CommandContributionItem.access$10(Comma ndContributionItem.java:605)
at org.eclipse.ui.menus.CommandContributionItem$4.handleEvent(C ommandContributionItem.java:595)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1561)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1585)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1570)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 360)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3474)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3064)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at at.bestsolution.soccer.app.intro.Application.start(Applicati on.java:20)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)

--------------090203000302050807000107--
Re: EMF databinding TableViewer [message #422159 is a reply to message #421970] Sat, 23 August 2008 12:37 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Ok. I got the same exception now when deleting my old launch config and
creating a new one.

What helped me to fix it was to select "Configuration > Clear the
configuation area before launching" in the Launch Configuration Dialog.
Looks a like a strange Equinox-Caching-Problem.

I've now fixed the .product-File to hold all plugins so this should not
be a problem any more in future.

Tom

Axel Nitert schrieb:
> Hi Tom,
>
> I have attched the stack trace of the error message that I have received.
> Steps:
> - check out project
> - rightclick on SoccerStat.product
> - choose Run As / Eclipse application
> - in the run configurations I clicked on Add Required Plugins
> - added some missing plugins manually because they have somehow not
> beeen added.
> - run the application
> - click on file / Datasources/configure datasources
>
> This is when I receive the error message and the dialog does not open.
>
> I hope that this helps.
>
> I will try to create a sample project but it's not that simple. I will
> hopefully be able to add it on Thursday.
>
> Axel
>
>
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: EMF databinding TableViewer [message #422209 is a reply to message #422159] Mon, 25 August 2008 18:44 Go to previous messageGo to next message
Axel Nitert is currently offline Axel NitertFriend
Messages: 13
Registered: July 2009
Junior Member
Hi Tom,

You are right the problem is solved now. But after configuring a new
data source I have opened the association administration and receive the
attached exception in the view on the right hand side.

May be I am still doing something wrong.

By the way I have finished preparing my example project which you could
use to check my original problem. I will send it to you via email shortly.

Thanks again
Axel


java.lang.NullPointerException
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSettingDelegate (BasicEObjectImpl.java:1532)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1027)
at
at.bestsolution.soccer.core.model.soccer.impl.SoccerImpl.eGe t(SoccerImpl.java:196)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1012)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1004)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:999)
at
org.eclipse.emf.databinding.EObjectObservableMap.doGet(EObje ctObservableMap.java:83)
at
org.eclipse.core.databinding.observable.map.ComputedObservab leMap$1.handleSetChange(ComputedObservableMap.java:52)
at
org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
at
org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
at
org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
at
org.eclipse.core.internal.databinding.observable.Unmodifiabl eObservableSet.access$0(UnmodifiableObservableSet.java:1)
at
org.eclipse.core.internal.databinding.observable.Unmodifiabl eObservableSet$1.handleSetChange(UnmodifiableObservableSet.j ava:30)
at
org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
at
org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
at
org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
at
org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet.access$1(DetailObservableSet.java:1)
at
org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet$1.handleSetChange(DetailObservableSet. java:42)
at
org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
at
org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
at
org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
at
org.eclipse.core.databinding.observable.set.WritableSet.add( WritableSet.java:90)
at
org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet.add(DetailObservableSet.java:106)
at
org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider$TreeNode. <init>(ObservableCollectionTreeContentProvider.java:284)
at
org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getOrCreateNode(ObservableCollect ionTreeContentProvider.java:181)
at
org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getChildren(ObservableCollectionT reeContentProvider.java:162)
at
org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getElements(ObservableCollectionT reeContentProvider.java:158)
at
org.eclipse.jface.databinding.viewers.ObservableListTreeCont entProvider.getElements(ObservableListTreeContentProvider.ja va:155)
at
org.eclipse.jface.viewers.StructuredViewer.getRawChildren(St ructuredViewer.java:937)
at
org.eclipse.jface.viewers.ColumnViewer.getRawChildren(Column Viewer.java:703)
at
org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren( AbstractTreeViewer.java:1330)
at org.eclipse.jface.viewers.TreeViewer.getRawChildren(TreeView er.java:385)
at
org.eclipse.jface.viewers.AbstractTreeViewer.getFilteredChil dren(AbstractTreeViewer.java:636)
at
org.eclipse.jface.viewers.AbstractTreeViewer.getSortedChildr en(AbstractTreeViewer.java:602)
at
org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractT reeViewer.java:799)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.jface.viewers.AbstractTreeViewer.createChildren( AbstractTreeViewer.java:776)
at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeView er.java:634)
at
org.eclipse.jface.viewers.AbstractTreeViewer.internalInitial izeTree(AbstractTreeViewer.java:1490)
at
org.eclipse.jface.viewers.TreeViewer.internalInitializeTree( TreeViewer.java:823)
at
org.eclipse.jface.viewers.AbstractTreeViewer$5.run(AbstractT reeViewer.java:1474)
at
org.eclipse.jface.viewers.StructuredViewer.preservingSelecti on(StructuredViewer.java:1365)
at
org.eclipse.jface.viewers.TreeViewer.preservingSelection(Tre eViewer.java:397)
at
org.eclipse.jface.viewers.StructuredViewer.preservingSelecti on(StructuredViewer.java:1328)
at
org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(Ab stractTreeViewer.java:1467)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentView er.java:251)
at
org.eclipse.jface.viewers.StructuredViewer.setInput(Structur edViewer.java:1603)
at
at.bestsolution.soccer.ui.associationadmin.AssociationAdmini strationViewPart.updateState(AssociationAdministrationViewPa rt.java:243)
at
at.bestsolution.soccer.ui.associationadmin.AssociationAdmini strationViewPart.createPartControl(AssociationAdministration ViewPart.java:212)
at
org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:371)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:230)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:2127)
at
org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:1062)
at org.eclipse.ui.internal.WorkbenchPage$19.run(WorkbenchPage.j ava:3773)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:3770)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:3746)
at
at.bestsolution.soccer.ui.associationadmin.handler.OpenAssoc iationAdministrationHandler.execute(OpenAssociationAdministr ationHandler.java:22)
at
org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:281)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at
org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at
org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at
org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:247)
at
org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:619)
at
org.eclipse.ui.menus.CommandContributionItem.access$10(Comma ndContributionItem.java:605)
at
org.eclipse.ui.menus.CommandContributionItem$4.handleEvent(C ommandContributionItem.java:595)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1561)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1585)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1570)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 360)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3474)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3064)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at at.bestsolution.soccer.app.intro.Application.start(Applicati on.java:20)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Re: EMF databinding TableViewer [message #422210 is a reply to message #422209] Mon, 25 August 2008 18:56 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Ah you need to use jface.databinding from 3.4.1-maint or head. The
databinding guys fixed a bug in their implementation. I'll add a version
to my MANIFEST.MF.

Tom

Axel Nitert schrieb:
> Hi Tom,
>
> You are right the problem is solved now. But after configuring a new
> data source I have opened the association administration and receive the
> attached exception in the view on the right hand side.
>
> May be I am still doing something wrong.
>
> By the way I have finished preparing my example project which you could
> use to check my original problem. I will send it to you via email shortly.
>
> Thanks again
> Axel
>
>
> java.lang.NullPointerException
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSettingDelegate (BasicEObjectImpl.java:1532)
>
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1027)
>
> at
> at.bestsolution.soccer.core.model.soccer.impl.SoccerImpl.eGe t(SoccerImpl.java:196)
>
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1012)
>
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1004)
>
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:999)
> at
> org.eclipse.emf.databinding.EObjectObservableMap.doGet(EObje ctObservableMap.java:83)
>
> at
> org.eclipse.core.databinding.observable.map.ComputedObservab leMap$1.handleSetChange(ComputedObservableMap.java:52)
>
> at
> org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
>
> at
> org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
>
> at
> org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
>
> at
> org.eclipse.core.internal.databinding.observable.Unmodifiabl eObservableSet.access$0(UnmodifiableObservableSet.java:1)
>
> at
> org.eclipse.core.internal.databinding.observable.Unmodifiabl eObservableSet$1.handleSetChange(UnmodifiableObservableSet.j ava:30)
>
> at
> org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
>
> at
> org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
>
> at
> org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
>
> at
> org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet.access$1(DetailObservableSet.java:1)
>
> at
> org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet$1.handleSetChange(DetailObservableSet. java:42)
>
> at
> org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
>
> at
> org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
>
> at
> org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
>
> at
> org.eclipse.core.databinding.observable.set.WritableSet.add( WritableSet.java:90)
>
> at
> org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet.add(DetailObservableSet.java:106)
>
> at
> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider$TreeNode. <init>(ObservableCollectionTreeContentProvider.java:284)
>
> at
> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getOrCreateNode(ObservableCollect ionTreeContentProvider.java:181)
>
> at
> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getChildren(ObservableCollectionT reeContentProvider.java:162)
>
> at
> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getElements(ObservableCollectionT reeContentProvider.java:158)
>
> at
> org.eclipse.jface.databinding.viewers.ObservableListTreeCont entProvider.getElements(ObservableListTreeContentProvider.ja va:155)
>
> at
> org.eclipse.jface.viewers.StructuredViewer.getRawChildren(St ructuredViewer.java:937)
>
> at
> org.eclipse.jface.viewers.ColumnViewer.getRawChildren(Column Viewer.java:703)
>
> at
> org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren( AbstractTreeViewer.java:1330)
>
> at
> org.eclipse.jface.viewers.TreeViewer.getRawChildren(TreeView er.java:385)
> at
> org.eclipse.jface.viewers.AbstractTreeViewer.getFilteredChil dren(AbstractTreeViewer.java:636)
>
> at
> org.eclipse.jface.viewers.AbstractTreeViewer.getSortedChildr en(AbstractTreeViewer.java:602)
>
> at
> org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractT reeViewer.java:799)
>
> at
> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
> at
> org.eclipse.jface.viewers.AbstractTreeViewer.createChildren( AbstractTreeViewer.java:776)
>
> at
> org.eclipse.jface.viewers.TreeViewer.createChildren(TreeView er.java:634)
> at
> org.eclipse.jface.viewers.AbstractTreeViewer.internalInitial izeTree(AbstractTreeViewer.java:1490)
>
> at
> org.eclipse.jface.viewers.TreeViewer.internalInitializeTree( TreeViewer.java:823)
>
> at
> org.eclipse.jface.viewers.AbstractTreeViewer$5.run(AbstractT reeViewer.java:1474)
>
> at
> org.eclipse.jface.viewers.StructuredViewer.preservingSelecti on(StructuredViewer.java:1365)
>
> at
> org.eclipse.jface.viewers.TreeViewer.preservingSelection(Tre eViewer.java:397)
>
> at
> org.eclipse.jface.viewers.StructuredViewer.preservingSelecti on(StructuredViewer.java:1328)
>
> at
> org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(Ab stractTreeViewer.java:1467)
>
> at
> org.eclipse.jface.viewers.ContentViewer.setInput(ContentView er.java:251)
> at
> org.eclipse.jface.viewers.StructuredViewer.setInput(Structur edViewer.java:1603)
>
> at
> at.bestsolution.soccer.ui.associationadmin.AssociationAdmini strationViewPart.updateState(AssociationAdministrationViewPa rt.java:243)
>
> at
> at.bestsolution.soccer.ui.associationadmin.AssociationAdmini strationViewPart.createPartControl(AssociationAdministration ViewPart.java:212)
>
> at
> org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:371)
>
> at
> org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:230)
> at
> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
>
> at org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:2127)
> at
> org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:1062)
> at
> org.eclipse.ui.internal.WorkbenchPage$19.run(WorkbenchPage.j ava:3773)
> at
> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
> at
> org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:3770)
> at
> org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:3746)
> at
> at.bestsolution.soccer.ui.associationadmin.handler.OpenAssoc iationAdministrationHandler.execute(OpenAssociationAdministr ationHandler.java:22)
>
> at
> org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:281)
>
> at
> org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
> at
> org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
>
> at
> org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
>
> at
> org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:247)
>
> at
> org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:619)
>
> at
> org.eclipse.ui.menus.CommandContributionItem.access$10(Comma ndContributionItem.java:605)
>
> at
> org.eclipse.ui.menus.CommandContributionItem$4.handleEvent(C ommandContributionItem.java:595)
>
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1561)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1585)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1570)
> at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 360)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3474)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3064)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> at.bestsolution.soccer.app.intro.Application.start(Applicati on.java:20)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1212)


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: EMF databinding TableViewer [message #422211 is a reply to message #422210] Mon, 25 August 2008 18:57 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Could please file a bug against EMF attach me to it? Please also post
the bug number to this thread.

Tom

Tom Schindl schrieb:
> Ah you need to use jface.databinding from 3.4.1-maint or head. The
> databinding guys fixed a bug in their implementation. I'll add a version
> to my MANIFEST.MF.
>
> Tom
>
> Axel Nitert schrieb:
>> Hi Tom,
>>
>> You are right the problem is solved now. But after configuring a new
>> data source I have opened the association administration and receive
>> the attached exception in the view on the right hand side.
>>
>> May be I am still doing something wrong.
>>
>> By the way I have finished preparing my example project which you
>> could use to check my original problem. I will send it to you via
>> email shortly.
>>
>> Thanks again
>> Axel
>>
>>
>> java.lang.NullPointerException
>> at
>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSettingDelegate (BasicEObjectImpl.java:1532)
>>
>> at
>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1027)
>>
>> at
>> at.bestsolution.soccer.core.model.soccer.impl.SoccerImpl.eGe t(SoccerImpl.java:196)
>>
>> at
>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1012)
>>
>> at
>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1004)
>>
>> at
>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:999)
>>
>> at
>> org.eclipse.emf.databinding.EObjectObservableMap.doGet(EObje ctObservableMap.java:83)
>>
>> at
>> org.eclipse.core.databinding.observable.map.ComputedObservab leMap$1.handleSetChange(ComputedObservableMap.java:52)
>>
>> at
>> org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
>>
>> at
>> org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
>>
>> at
>> org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
>>
>> at
>> org.eclipse.core.internal.databinding.observable.Unmodifiabl eObservableSet.access$0(UnmodifiableObservableSet.java:1)
>>
>> at
>> org.eclipse.core.internal.databinding.observable.Unmodifiabl eObservableSet$1.handleSetChange(UnmodifiableObservableSet.j ava:30)
>>
>> at
>> org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
>>
>> at
>> org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
>>
>> at
>> org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
>>
>> at
>> org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet.access$1(DetailObservableSet.java:1)
>>
>> at
>> org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet$1.handleSetChange(DetailObservableSet. java:42)
>>
>> at
>> org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
>>
>> at
>> org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
>>
>> at
>> org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
>>
>> at
>> org.eclipse.core.databinding.observable.set.WritableSet.add( WritableSet.java:90)
>>
>> at
>> org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet.add(DetailObservableSet.java:106)
>>
>> at
>> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider$TreeNode. <init>(ObservableCollectionTreeContentProvider.java:284)
>>
>> at
>> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getOrCreateNode(ObservableCollect ionTreeContentProvider.java:181)
>>
>> at
>> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getChildren(ObservableCollectionT reeContentProvider.java:162)
>>
>> at
>> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getElements(ObservableCollectionT reeContentProvider.java:158)
>>
>> at
>> org.eclipse.jface.databinding.viewers.ObservableListTreeCont entProvider.getElements(ObservableListTreeContentProvider.ja va:155)
>>
>> at
>> org.eclipse.jface.viewers.StructuredViewer.getRawChildren(St ructuredViewer.java:937)
>>
>> at
>> org.eclipse.jface.viewers.ColumnViewer.getRawChildren(Column Viewer.java:703)
>>
>> at
>> org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren( AbstractTreeViewer.java:1330)
>>
>> at
>> org.eclipse.jface.viewers.TreeViewer.getRawChildren(TreeView er.java:385)
>> at
>> org.eclipse.jface.viewers.AbstractTreeViewer.getFilteredChil dren(AbstractTreeViewer.java:636)
>>
>> at
>> org.eclipse.jface.viewers.AbstractTreeViewer.getSortedChildr en(AbstractTreeViewer.java:602)
>>
>> at
>> org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractT reeViewer.java:799)
>>
>> at
>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>> at
>> org.eclipse.jface.viewers.AbstractTreeViewer.createChildren( AbstractTreeViewer.java:776)
>>
>> at
>> org.eclipse.jface.viewers.TreeViewer.createChildren(TreeView er.java:634)
>> at
>> org.eclipse.jface.viewers.AbstractTreeViewer.internalInitial izeTree(AbstractTreeViewer.java:1490)
>>
>> at
>> org.eclipse.jface.viewers.TreeViewer.internalInitializeTree( TreeViewer.java:823)
>>
>> at
>> org.eclipse.jface.viewers.AbstractTreeViewer$5.run(AbstractT reeViewer.java:1474)
>>
>> at
>> org.eclipse.jface.viewers.StructuredViewer.preservingSelecti on(StructuredViewer.java:1365)
>>
>> at
>> org.eclipse.jface.viewers.TreeViewer.preservingSelection(Tre eViewer.java:397)
>>
>> at
>> org.eclipse.jface.viewers.StructuredViewer.preservingSelecti on(StructuredViewer.java:1328)
>>
>> at
>> org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(Ab stractTreeViewer.java:1467)
>>
>> at
>> org.eclipse.jface.viewers.ContentViewer.setInput(ContentView er.java:251)
>> at
>> org.eclipse.jface.viewers.StructuredViewer.setInput(Structur edViewer.java:1603)
>>
>> at
>> at.bestsolution.soccer.ui.associationadmin.AssociationAdmini strationViewPart.updateState(AssociationAdministrationViewPa rt.java:243)
>>
>> at
>> at.bestsolution.soccer.ui.associationadmin.AssociationAdmini strationViewPart.createPartControl(AssociationAdministration ViewPart.java:212)
>>
>> at
>> org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:371)
>>
>> at
>> org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:230)
>> at
>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
>>
>> at
>> org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:2127)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:1062)
>>
>> at
>> org.eclipse.ui.internal.WorkbenchPage$19.run(WorkbenchPage.j ava:3773)
>> at
>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:3770)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:3746)
>> at
>> at.bestsolution.soccer.ui.associationadmin.handler.OpenAssoc iationAdministrationHandler.execute(OpenAssociationAdministr ationHandler.java:22)
>>
>> at
>> org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:281)
>>
>> at
>> org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
>> at
>> org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
>>
>> at
>> org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
>>
>> at
>> org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:247)
>>
>> at
>> org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:619)
>>
>> at
>> org.eclipse.ui.menus.CommandContributionItem.access$10(Comma ndContributionItem.java:605)
>>
>> at
>> org.eclipse.ui.menus.CommandContributionItem$4.handleEvent(C ommandContributionItem.java:595)
>>
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1561)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1585)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1570)
>> at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 360)
>> at
>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3474)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3064)
>> at
>> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
>>
>> at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
>>
>> at
>> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>> at
>> at.bestsolution.soccer.app.intro.Application.start(Applicati on.java:20)
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
>>
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>>
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:585)
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
[Teneo] Violates List.equal()-contract [was Re: EMF databinding TableViewe] [message #422213 is a reply to message #422211] Mon, 25 August 2008 22:47 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi Axel,

Thanks for the project. It's in fact a Teneo vs Standard-List definition
problem. PersistableEList is breaking the List.equals-contract defined
in the List-interface which defines the following:

/**
* Compares the specified object with this list for equality. Returns
* <tt>true</tt> if and only if the specified object is also a list, both
* lists have the same size, and all corresponding pairs of elements in
* the two lists are <i>equal</i>. (Two elements <tt>e1</tt> and
* <tt>e2</tt> are <i>equal</i> if <tt>(e1==null ? e2==null :
* e1.equals(e2))</tt>.) In other words, two lists are defined to be
* equal if they contain the same elements in the same order. This
* definition ensures that the equals method works properly across
* different implementations of the <tt>List</tt> interface.
*
* @param o the object to be compared for equality with this list.
* @return <tt>true</tt> if the specified object is equal to this list.
*/
boolean equals(Object o);

But I think Teneo has good reasons to violate this contract because
without violating LazyLoading would not work, I guess because the whole
list has to materialized to compare to Lists (Am I right Martin?).

IMHO there are multiple things to fix.

a) Databinding uses a highly in effecient way to check the equality of
its wrapped lists. I filed [1] and with this fix even Teneo-Lists
work aproppiately.

b) Teneos PersistableEList should IMHO at least use Object#hashCode() in
its equal check if it can not fullfill the List#equals-contract so
databindings design with WrappedLists would work too. If Databinding
doesn't release a fix in time for 3.4.1 (whose deadline is already
tomorrow I has Ed whether we could get a fix in the
EMF-Observables-List)

Tom

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=245183


Tom Schindl schrieb:
> Could please file a bug against EMF attach me to it? Please also post
> the bug number to this thread.
>
> Tom
>
> Tom Schindl schrieb:
>> Ah you need to use jface.databinding from 3.4.1-maint or head. The
>> databinding guys fixed a bug in their implementation. I'll add a
>> version to my MANIFEST.MF.
>>
>> Tom
>>
>> Axel Nitert schrieb:
>>> Hi Tom,
>>>
>>> You are right the problem is solved now. But after configuring a new
>>> data source I have opened the association administration and receive
>>> the attached exception in the view on the right hand side.
>>>
>>> May be I am still doing something wrong.
>>>
>>> By the way I have finished preparing my example project which you
>>> could use to check my original problem. I will send it to you via
>>> email shortly.
>>>
>>> Thanks again
>>> Axel
>>>
>>>
>>> java.lang.NullPointerException
>>> at
>>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSettingDelegate (BasicEObjectImpl.java:1532)
>>>
>>> at
>>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1027)
>>>
>>> at
>>> at.bestsolution.soccer.core.model.soccer.impl.SoccerImpl.eGe t(SoccerImpl.java:196)
>>>
>>> at
>>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1012)
>>>
>>> at
>>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1004)
>>>
>>> at
>>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:999)
>>>
>>> at
>>> org.eclipse.emf.databinding.EObjectObservableMap.doGet(EObje ctObservableMap.java:83)
>>>
>>> at
>>> org.eclipse.core.databinding.observable.map.ComputedObservab leMap$1.handleSetChange(ComputedObservableMap.java:52)
>>>
>>> at
>>> org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
>>>
>>> at
>>> org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
>>>
>>> at
>>> org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
>>>
>>> at
>>> org.eclipse.core.internal.databinding.observable.Unmodifiabl eObservableSet.access$0(UnmodifiableObservableSet.java:1)
>>>
>>> at
>>> org.eclipse.core.internal.databinding.observable.Unmodifiabl eObservableSet$1.handleSetChange(UnmodifiableObservableSet.j ava:30)
>>>
>>> at
>>> org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
>>>
>>> at
>>> org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
>>>
>>> at
>>> org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
>>>
>>> at
>>> org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet.access$1(DetailObservableSet.java:1)
>>>
>>> at
>>> org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet$1.handleSetChange(DetailObservableSet. java:42)
>>>
>>> at
>>> org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
>>>
>>> at
>>> org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
>>>
>>> at
>>> org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
>>>
>>> at
>>> org.eclipse.core.databinding.observable.set.WritableSet.add( WritableSet.java:90)
>>>
>>> at
>>> org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet.add(DetailObservableSet.java:106)
>>>
>>> at
>>> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider$TreeNode. <init>(ObservableCollectionTreeContentProvider.java:284)
>>>
>>> at
>>> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getOrCreateNode(ObservableCollect ionTreeContentProvider.java:181)
>>>
>>> at
>>> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getChildren(ObservableCollectionT reeContentProvider.java:162)
>>>
>>> at
>>> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getElements(ObservableCollectionT reeContentProvider.java:158)
>>>
>>> at
>>> org.eclipse.jface.databinding.viewers.ObservableListTreeCont entProvider.getElements(ObservableListTreeContentProvider.ja va:155)
>>>
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer.getRawChildren(St ructuredViewer.java:937)
>>>
>>> at
>>> org.eclipse.jface.viewers.ColumnViewer.getRawChildren(Column Viewer.java:703)
>>>
>>> at
>>> org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren( AbstractTreeViewer.java:1330)
>>>
>>> at
>>> org.eclipse.jface.viewers.TreeViewer.getRawChildren(TreeView er.java:385)
>>> at
>>> org.eclipse.jface.viewers.AbstractTreeViewer.getFilteredChil dren(AbstractTreeViewer.java:636)
>>>
>>> at
>>> org.eclipse.jface.viewers.AbstractTreeViewer.getSortedChildr en(AbstractTreeViewer.java:602)
>>>
>>> at
>>> org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractT reeViewer.java:799)
>>>
>>> at
>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>>> at
>>> org.eclipse.jface.viewers.AbstractTreeViewer.createChildren( AbstractTreeViewer.java:776)
>>>
>>> at
>>> org.eclipse.jface.viewers.TreeViewer.createChildren(TreeView er.java:634)
>>> at
>>> org.eclipse.jface.viewers.AbstractTreeViewer.internalInitial izeTree(AbstractTreeViewer.java:1490)
>>>
>>> at
>>> org.eclipse.jface.viewers.TreeViewer.internalInitializeTree( TreeViewer.java:823)
>>>
>>> at
>>> org.eclipse.jface.viewers.AbstractTreeViewer$5.run(AbstractT reeViewer.java:1474)
>>>
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer.preservingSelecti on(StructuredViewer.java:1365)
>>>
>>> at
>>> org.eclipse.jface.viewers.TreeViewer.preservingSelection(Tre eViewer.java:397)
>>>
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer.preservingSelecti on(StructuredViewer.java:1328)
>>>
>>> at
>>> org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(Ab stractTreeViewer.java:1467)
>>>
>>> at
>>> org.eclipse.jface.viewers.ContentViewer.setInput(ContentView er.java:251)
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer.setInput(Structur edViewer.java:1603)
>>>
>>> at
>>> at.bestsolution.soccer.ui.associationadmin.AssociationAdmini strationViewPart.updateState(AssociationAdministrationViewPa rt.java:243)
>>>
>>> at
>>> at.bestsolution.soccer.ui.associationadmin.AssociationAdmini strationViewPart.createPartControl(AssociationAdministration ViewPart.java:212)
>>>
>>> at
>>> org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:371)
>>>
>>> at
>>> org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:230)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
>>>
>>> at
>>> org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:2127)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:1062)
>>>
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage$19.run(WorkbenchPage.j ava:3773)
>>> at
>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:3770)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:3746)
>>> at
>>> at.bestsolution.soccer.ui.associationadmin.handler.OpenAssoc iationAdministrationHandler.execute(OpenAssociationAdministr ationHandler.java:22)
>>>
>>> at
>>> org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:281)
>>>
>>> at
>>> org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
>>> at
>>> org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
>>>
>>> at
>>> org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
>>>
>>> at
>>> org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:247)
>>>
>>> at
>>> org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:619)
>>>
>>> at
>>> org.eclipse.ui.menus.CommandContributionItem.access$10(Comma ndContributionItem.java:605)
>>>
>>> at
>>> org.eclipse.ui.menus.CommandContributionItem$4.handleEvent(C ommandContributionItem.java:595)
>>>
>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1561)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1585)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1570)
>>> at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 360)
>>> at
>>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3474)
>>> at
>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3064)
>>> at
>>> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
>>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
>>> at
>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
>>>
>>> at
>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
>>>
>>> at
>>> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>> at
>>> at.bestsolution.soccer.app.intro.Application.start(Applicati on.java:20)
>>> at
>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
>>>
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>>>
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>>>
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
>>>
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>>>
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>
>>> at java.lang.reflect.Method.invoke(Method.java:585)
>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
>>
>>
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: [Teneo] Violates List.equal()-contract [was Re: EMF databinding TableViewe] [message #422220 is a reply to message #422213] Tue, 26 August 2008 12:19 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Tom,
That's right, that's why Teneo violates the equals of a list implementation. I can make it so that
it does a real equals if the list has already been loaded but that only solves part of the issues.
Fyi, Hibernate also does equals on collections in a bit different way (uses the key of the owner and
the name of the efeature holding the collection).

I need to know a bit more about how the equals check is done.
Can you post the code snippet that does the equals on the elist (and the equals implementation of
the list wrapper)? What gets passed to the equals, the wrapped list or the wrapperlist?

gr. Martin

Tom Schindl wrote:
> Hi Axel,
>
> Thanks for the project. It's in fact a Teneo vs Standard-List definition
> problem. PersistableEList is breaking the List.equals-contract defined
> in the List-interface which defines the following:
>
> /**
> * Compares the specified object with this list for equality. Returns
> * <tt>true</tt> if and only if the specified object is also a list, both
> * lists have the same size, and all corresponding pairs of elements in
> * the two lists are <i>equal</i>. (Two elements <tt>e1</tt> and
> * <tt>e2</tt> are <i>equal</i> if <tt>(e1==null ? e2==null :
> * e1.equals(e2))</tt>.) In other words, two lists are defined to be
> * equal if they contain the same elements in the same order. This
> * definition ensures that the equals method works properly across
> * different implementations of the <tt>List</tt> interface.
> *
> * @param o the object to be compared for equality with this list.
> * @return <tt>true</tt> if the specified object is equal to this list.
> */
> boolean equals(Object o);
>
> But I think Teneo has good reasons to violate this contract because
> without violating LazyLoading would not work, I guess because the whole
> list has to materialized to compare to Lists (Am I right Martin?).
>
> IMHO there are multiple things to fix.
>
> a) Databinding uses a highly in effecient way to check the equality of
> its wrapped lists. I filed [1] and with this fix even Teneo-Lists
> work aproppiately.
>
> b) Teneos PersistableEList should IMHO at least use Object#hashCode() in
> its equal check if it can not fullfill the List#equals-contract so
> databindings design with WrappedLists would work too. If Databinding
> doesn't release a fix in time for 3.4.1 (whose deadline is already
> tomorrow I has Ed whether we could get a fix in the
> EMF-Observables-List)
>
> Tom
>
> [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=245183
>
>
> Tom Schindl schrieb:
>> Could please file a bug against EMF attach me to it? Please also post
>> the bug number to this thread.
>>
>> Tom
>>
>> Tom Schindl schrieb:
>>> Ah you need to use jface.databinding from 3.4.1-maint or head. The
>>> databinding guys fixed a bug in their implementation. I'll add a
>>> version to my MANIFEST.MF.
>>>
>>> Tom
>>>
>>> Axel Nitert schrieb:
>>>> Hi Tom,
>>>>
>>>> You are right the problem is solved now. But after configuring a new
>>>> data source I have opened the association administration and receive
>>>> the attached exception in the view on the right hand side.
>>>>
>>>> May be I am still doing something wrong.
>>>>
>>>> By the way I have finished preparing my example project which you
>>>> could use to check my original problem. I will send it to you via
>>>> email shortly.
>>>>
>>>> Thanks again
>>>> Axel
>>>>
>>>>
>>>> java.lang.NullPointerException
>>>> at
>>>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSettingDelegate (BasicEObjectImpl.java:1532)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1027)
>>>>
>>>> at
>>>> at.bestsolution.soccer.core.model.soccer.impl.SoccerImpl.eGe t(SoccerImpl.java:196)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1012)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1004)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:999)
>>>>
>>>> at
>>>> org.eclipse.emf.databinding.EObjectObservableMap.doGet(EObje ctObservableMap.java:83)
>>>>
>>>> at
>>>> org.eclipse.core.databinding.observable.map.ComputedObservab leMap$1.handleSetChange(ComputedObservableMap.java:52)
>>>>
>>>> at
>>>> org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
>>>>
>>>> at
>>>> org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
>>>>
>>>> at
>>>> org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
>>>>
>>>> at
>>>> org.eclipse.core.internal.databinding.observable.Unmodifiabl eObservableSet.access$0(UnmodifiableObservableSet.java:1)
>>>>
>>>> at
>>>> org.eclipse.core.internal.databinding.observable.Unmodifiabl eObservableSet$1.handleSetChange(UnmodifiableObservableSet.j ava:30)
>>>>
>>>> at
>>>> org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
>>>>
>>>> at
>>>> org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
>>>>
>>>> at
>>>> org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
>>>>
>>>> at
>>>> org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet.access$1(DetailObservableSet.java:1)
>>>>
>>>> at
>>>> org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet$1.handleSetChange(DetailObservableSet. java:42)
>>>>
>>>> at
>>>> org.eclipse.core.databinding.observable.set.SetChangeEvent.d ispatch(SetChangeEvent.java:61)
>>>>
>>>> at
>>>> org.eclipse.core.databinding.observable.ChangeManager.fireEv ent(ChangeManager.java:129)
>>>>
>>>> at
>>>> org.eclipse.core.databinding.observable.set.ObservableSet.fi reSetChange(ObservableSet.java:67)
>>>>
>>>> at
>>>> org.eclipse.core.databinding.observable.set.WritableSet.add( WritableSet.java:90)
>>>>
>>>> at
>>>> org.eclipse.core.internal.databinding.observable.masterdetai l.DetailObservableSet.add(DetailObservableSet.java:106)
>>>>
>>>> at
>>>> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider$TreeNode. <init>(ObservableCollectionTreeContentProvider.java:284)
>>>>
>>>> at
>>>> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getOrCreateNode(ObservableCollect ionTreeContentProvider.java:181)
>>>>
>>>> at
>>>> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getChildren(ObservableCollectionT reeContentProvider.java:162)
>>>>
>>>> at
>>>> org.eclipse.jface.internal.databinding.viewers.ObservableCol lectionTreeContentProvider.getElements(ObservableCollectionT reeContentProvider.java:158)
>>>>
>>>> at
>>>> org.eclipse.jface.databinding.viewers.ObservableListTreeCont entProvider.getElements(ObservableListTreeContentProvider.ja va:155)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.StructuredViewer.getRawChildren(St ructuredViewer.java:937)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.ColumnViewer.getRawChildren(Column Viewer.java:703)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren( AbstractTreeViewer.java:1330)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.TreeViewer.getRawChildren(TreeView er.java:385)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.AbstractTreeViewer.getFilteredChil dren(AbstractTreeViewer.java:636)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.AbstractTreeViewer.getSortedChildr en(AbstractTreeViewer.java:602)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractT reeViewer.java:799)
>>>>
>>>> at
>>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>>>> at
>>>> org.eclipse.jface.viewers.AbstractTreeViewer.createChildren( AbstractTreeViewer.java:776)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.TreeViewer.createChildren(TreeView er.java:634)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.AbstractTreeViewer.internalInitial izeTree(AbstractTreeViewer.java:1490)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.TreeViewer.internalInitializeTree( TreeViewer.java:823)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.AbstractTreeViewer$5.run(AbstractT reeViewer.java:1474)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.StructuredViewer.preservingSelecti on(StructuredViewer.java:1365)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.TreeViewer.preservingSelection(Tre eViewer.java:397)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.StructuredViewer.preservingSelecti on(StructuredViewer.java:1328)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(Ab stractTreeViewer.java:1467)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.ContentViewer.setInput(ContentView er.java:251)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.StructuredViewer.setInput(Structur edViewer.java:1603)
>>>>
>>>> at
>>>> at.bestsolution.soccer.ui.associationadmin.AssociationAdmini strationViewPart.updateState(AssociationAdministrationViewPa rt.java:243)
>>>>
>>>> at
>>>> at.bestsolution.soccer.ui.associationadmin.AssociationAdmini strationViewPart.createPartControl(AssociationAdministration ViewPart.java:212)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:371)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:230)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:2127)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:1062)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage$19.run(WorkbenchPage.j ava:3773)
>>>> at
>>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:3770)
>>>> at
>>>> org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:3746)
>>>> at
>>>> at.bestsolution.soccer.ui.associationadmin.handler.OpenAssoc iationAdministrationHandler.execute(OpenAssociationAdministr ationHandler.java:22)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:281)
>>>>
>>>> at
>>>> org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
>>>> at
>>>> org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:247)
>>>>
>>>> at
>>>> org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:619)
>>>>
>>>> at
>>>> org.eclipse.ui.menus.CommandContributionItem.access$10(Comma ndContributionItem.java:605)
>>>>
>>>> at
>>>> org.eclipse.ui.menus.CommandContributionItem$4.handleEvent(C ommandContributionItem.java:595)
>>>>
>>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1561)
>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1585)
>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1570)
>>>> at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 360)
>>>> at
>>>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3474)
>>>> at
>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3064)
>>>> at
>>>> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
>>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
>>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
>>>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
>>>> at
>>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
>>>>
>>>> at
>>>> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>>> at
>>>> at.bestsolution.soccer.app.intro.Application.start(Applicati on.java:20)
>>>> at
>>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
>>>>
>>>> at
>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>>>>
>>>> at
>>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>>>>
>>>> at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
>>>>
>>>> at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>>>>
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>>>
>>>> at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>>>
>>>> at java.lang.reflect.Method.invoke(Method.java:585)
>>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
>>>
>>>
>>
>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Violates List.equal()-contract [was Re: EMF databinding TableViewe] [message #422221 is a reply to message #422220] Tue, 26 August 2008 12:52 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi Martin,

The code in question is shown in
org/eclipse/core/databinding/observable/list/ObservableList. java

Until now the code looked like this:

----------8<----------
public boolean equals(Object o) {
getterCalled();
return wrappedList.equals(o);
}
----------8<----------


So when you have

ObservableList a(ObservableList (id=140))
a.wrappedList(PersistableEList(id=141))

ObservableList b(ObservableList (id=140))
b.wrappedList(PersistableEList(id=141))

and you call a.equals(b) you'll get false because the code executed in
then is

wrappedList(PersistableEList(id=141)).equals(o(ObservableLis t (id=140)))

which will result in false because of the equals definition in
PersistableEList. Matt and Boris already approved the following change
to the ObservableList#equals() for 3.4.1 (today is the last dev day for
3.4.1).

----------8<----------
public boolean equals(Object o) {
getterCalled();
if( o == this ) {
return true;
}
return wrappedList.equals(o);
}
----------8<----------

I also proposed a second patch (in the bug report 245183) where I was
passing on the wrapped list but it looks like this won't make it in the
general framework. This is not ideal because then we'll have the same
problem we have before in cases like this:

----------8<----------
ObservableList a(ObservableList (id=142))
a.wrappedList(PersistableEList(id=141))

ObservableList b(ObservableList (id=140))
b.wrappedList(PersistableEList(id=141))
----------8<----------

If the situation stays like this we have 2 possibilities:

a) You rewrite the equals-method of PersistableEList like this:

equals(Object o) {
if( o == this ) {
return true;
} else if( o.hashCode() == this.hashCode() ) {
return true;
}

// Maybe do the full compare when list is materialized
return false;
}

b) We (Ed) overloads equals in
org.eclipse.emf.databinding.EObjectObservableList and does what I
proposed in https://bugs.eclipse.org/bugs/show_bug.cgi?id=245183#c2


Tom

Martin Taal schrieb:
> Hi Tom,
> That's right, that's why Teneo violates the equals of a list
> implementation. I can make it so that it does a real equals if the list
> has already been loaded but that only solves part of the issues.
> Fyi, Hibernate also does equals on collections in a bit different way
> (uses the key of the owner and the name of the efeature holding the
> collection).
>
> I need to know a bit more about how the equals check is done.
> Can you post the code snippet that does the equals on the elist (and the
> equals implementation of the list wrapper)? What gets passed to the
> equals, the wrapped list or the wrapperlist?
>
> gr. Martin
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: [Teneo] Violates List.equal()-contract [was Re: EMF databinding TableViewe] [message #422222 is a reply to message #422221] Tue, 26 August 2008 13:24 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Tom,
Hmm, would it make sense that the ObservableList.equals would do something like this:
public boolean equals(Object o) {
getterCalled();
if( o == this ) {
return true;
}
if (o instanceof ObservableList) {
final List otherWrappedList = ((ObservableList)o).getWrappedList();
return wrappedList.equals(otherWrappedList);
}
return wrappedList.equals(o);
}

ObservableList does not have a getWrappedList method, but maybe something else can be used to get to
the wrappedList member.

So when equaling on a ObservableList, that if the wrappedLists of two ObservableLists are equal then
the ObservableLists are equal. I am not limited by any knowledge of ObservableList :-) but it seems
an okay definition imho.

What do you think?

gr. Martin

Tom Schindl wrote:
> Hi Martin,
>
> The code in question is shown in
> org/eclipse/core/databinding/observable/list/ObservableList. java
>
> Until now the code looked like this:
>
> ----------8<----------
> public boolean equals(Object o) {
> getterCalled();
> return wrappedList.equals(o);
> }
> ----------8<----------
>
>
> So when you have
>
> ObservableList a(ObservableList (id=140))
> a.wrappedList(PersistableEList(id=141))
>
> ObservableList b(ObservableList (id=140))
> b.wrappedList(PersistableEList(id=141))
>
> and you call a.equals(b) you'll get false because the code executed in
> then is
>
> wrappedList(PersistableEList(id=141)).equals(o(ObservableLis t (id=140)))
>
> which will result in false because of the equals definition in
> PersistableEList. Matt and Boris already approved the following change
> to the ObservableList#equals() for 3.4.1 (today is the last dev day for
> 3.4.1).
>
> ----------8<----------
> public boolean equals(Object o) {
> getterCalled();
> if( o == this ) {
> return true;
> }
> return wrappedList.equals(o);
> }
> ----------8<----------
>
> I also proposed a second patch (in the bug report 245183) where I was
> passing on the wrapped list but it looks like this won't make it in the
> general framework. This is not ideal because then we'll have the same
> problem we have before in cases like this:
>
> ----------8<----------
> ObservableList a(ObservableList (id=142))
> a.wrappedList(PersistableEList(id=141))
>
> ObservableList b(ObservableList (id=140))
> b.wrappedList(PersistableEList(id=141))
> ----------8<----------
>
> If the situation stays like this we have 2 possibilities:
>
> a) You rewrite the equals-method of PersistableEList like this:
>
> equals(Object o) {
> if( o == this ) {
> return true;
> } else if( o.hashCode() == this.hashCode() ) {
> return true;
> }
>
> // Maybe do the full compare when list is materialized
> return false;
> }
>
> b) We (Ed) overloads equals in
> org.eclipse.emf.databinding.EObjectObservableList and does what I
> proposed in https://bugs.eclipse.org/bugs/show_bug.cgi?id=245183#c2
>
>
> Tom
>
> Martin Taal schrieb:
>> Hi Tom,
>> That's right, that's why Teneo violates the equals of a list
>> implementation. I can make it so that it does a real equals if the
>> list has already been loaded but that only solves part of the issues.
>> Fyi, Hibernate also does equals on collections in a bit different way
>> (uses the key of the owner and the name of the efeature holding the
>> collection).
>>
>> I need to know a bit more about how the equals check is done.
>> Can you post the code snippet that does the equals on the elist (and
>> the equals implementation of the list wrapper)? What gets passed to
>> the equals, the wrapped list or the wrapperlist?
>>
>> gr. Martin
>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Violates List.equal()-contract [was Re: EMF databinding TableViewe] [message #422223 is a reply to message #422222] Tue, 26 August 2008 13:32 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
It's quite easy to get access to the wrappedList because you can simply
do ((ObservableList)o).wrappedList which is protected so could also be
reach in subclasses too ;-)

And that's what I proposed in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=245183#c2 and Matt replied
in comment 3 voting against. I once more asked for clarification and
potential addition of this in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=245183#c17

I think we should continue discussion in the bug report because I don't
know if Boris and Matt are following this newsgroup.

Tom


Martin Taal schrieb:
> Hi Tom,
> Hmm, would it make sense that the ObservableList.equals would do
> something like this:
> public boolean equals(Object o) {
> getterCalled();
> if( o == this ) {
> return true;
> }
> if (o instanceof ObservableList) {
> final List otherWrappedList = ((ObservableList)o).getWrappedList();
> return wrappedList.equals(otherWrappedList);
> }
> return wrappedList.equals(o);
> }
>
> ObservableList does not have a getWrappedList method, but maybe
> something else can be used to get to the wrappedList member.
>
> So when equaling on a ObservableList, that if the wrappedLists of two
> ObservableLists are equal then the ObservableLists are equal. I am not
> limited by any knowledge of ObservableList :-) but it seems an okay
> definition imho.
>
> What do you think?
>
> gr. Martin
>
> Tom Schindl wrote:
>> Hi Martin,
>>
>> The code in question is shown in
>> org/eclipse/core/databinding/observable/list/ObservableList. java
>>
>> Until now the code looked like this:
>>
>> ----------8<----------
>> public boolean equals(Object o) {
>> getterCalled();
>> return wrappedList.equals(o);
>> }
>> ----------8<----------
>>
>>
>> So when you have
>>
>> ObservableList a(ObservableList (id=140))
>> a.wrappedList(PersistableEList(id=141))
>>
>> ObservableList b(ObservableList (id=140))
>> b.wrappedList(PersistableEList(id=141))
>>
>> and you call a.equals(b) you'll get false because the code executed in
>> then is
>>
>> wrappedList(PersistableEList(id=141)).equals(o(ObservableLis t (id=140)))
>>
>> which will result in false because of the equals definition in
>> PersistableEList. Matt and Boris already approved the following change
>> to the ObservableList#equals() for 3.4.1 (today is the last dev day
>> for 3.4.1).
>>
>> ----------8<----------
>> public boolean equals(Object o) {
>> getterCalled();
>> if( o == this ) {
>> return true;
>> }
>> return wrappedList.equals(o);
>> }
>> ----------8<----------
>>
>> I also proposed a second patch (in the bug report 245183) where I was
>> passing on the wrapped list but it looks like this won't make it in
>> the general framework. This is not ideal because then we'll have the
>> same problem we have before in cases like this:
>>
>> ----------8<----------
>> ObservableList a(ObservableList (id=142))
>> a.wrappedList(PersistableEList(id=141))
>>
>> ObservableList b(ObservableList (id=140))
>> b.wrappedList(PersistableEList(id=141))
>> ----------8<----------
>>
>> If the situation stays like this we have 2 possibilities:
>>
>> a) You rewrite the equals-method of PersistableEList like this:
>>
>> equals(Object o) {
>> if( o == this ) {
>> return true;
>> } else if( o.hashCode() == this.hashCode() ) {
>> return true;
>> }
>>
>> // Maybe do the full compare when list is materialized
>> return false;
>> }
>>
>> b) We (Ed) overloads equals in
>> org.eclipse.emf.databinding.EObjectObservableList and does what I
>> proposed in https://bugs.eclipse.org/bugs/show_bug.cgi?id=245183#c2
>>
>>
>> Tom
>>
>> Martin Taal schrieb:
>>> Hi Tom,
>>> That's right, that's why Teneo violates the equals of a list
>>> implementation. I can make it so that it does a real equals if the
>>> list has already been loaded but that only solves part of the issues.
>>> Fyi, Hibernate also does equals on collections in a bit different way
>>> (uses the key of the owner and the name of the efeature holding the
>>> collection).
>>>
>>> I need to know a bit more about how the equals check is done.
>>> Can you post the code snippet that does the equals on the elist (and
>>> the equals implementation of the list wrapper)? What gets passed to
>>> the equals, the wrapped list or the wrapperlist?
>>>
>>> gr. Martin
>>>
>>
>>
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: EMF databinding TableViewer [message #422228 is a reply to message #422211] Tue, 26 August 2008 15:52 Go to previous messageGo to next message
Axel Nitert is currently offline Axel NitertFriend
Messages: 13
Registered: July 2009
Junior Member
Hi Tom,

I saw that you have already filed a bug and created a new thread.

Thanks for that.
Axel


Tom Schindl schrieb:
> Could please file a bug against EMF attach me to it? Please also post
> the bug number to this thread.
>
> Tom
>
Re: EMF databinding TableViewer [message #422229 is a reply to message #422228] Tue, 26 August 2008 16:07 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Yeah. I did it myself so that we have a chance to get it into 3.4.1 (RC1
is due for end of this week). Looks like we get a fix.

Tom

Axel Nitert schrieb:
> Hi Tom,
>
> I saw that you have already filed a bug and created a new thread.
>
> Thanks for that.
> Axel
>
>
> Tom Schindl schrieb:
>> Could please file a bug against EMF attach me to it? Please also post
>> the bug number to this thread.
>>
>> Tom
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: [Teneo] Violates List.equal()-contract [was Re: EMF databinding TableViewe] [message #422256 is a reply to message #422223] Wed, 27 August 2008 12:47 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Just for the ones who are not described to the bug. Thanks to the quick
response of Matt and Boris a fix (which we are all happy with went) into
3.4.1.

Tom

Tom Schindl schrieb:
> It's quite easy to get access to the wrappedList because you can simply
> do ((ObservableList)o).wrappedList which is protected so could also be
> reach in subclasses too ;-)
>
> And that's what I proposed in
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=245183#c2 and Matt replied
> in comment 3 voting against. I once more asked for clarification and
> potential addition of this in
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=245183#c17
>
> I think we should continue discussion in the bug report because I don't
> know if Boris and Matt are following this newsgroup.
>
> Tom
>
>
> Martin Taal schrieb:
>> Hi Tom,
>> Hmm, would it make sense that the ObservableList.equals would do
>> something like this:
>> public boolean equals(Object o) {
>> getterCalled();
>> if( o == this ) {
>> return true;
>> }
>> if (o instanceof ObservableList) {
>> final List otherWrappedList =
>> ((ObservableList)o).getWrappedList();
>> return wrappedList.equals(otherWrappedList);
>> }
>> return wrappedList.equals(o);
>> }
>>
>> ObservableList does not have a getWrappedList method, but maybe
>> something else can be used to get to the wrappedList member.
>>
>> So when equaling on a ObservableList, that if the wrappedLists of two
>> ObservableLists are equal then the ObservableLists are equal. I am not
>> limited by any knowledge of ObservableList :-) but it seems an okay
>> definition imho.
>>
>> What do you think?
>>
>> gr. Martin
>>
>> Tom Schindl wrote:
>>> Hi Martin,
>>>
>>> The code in question is shown in
>>> org/eclipse/core/databinding/observable/list/ObservableList. java
>>>
>>> Until now the code looked like this:
>>>
>>> ----------8<----------
>>> public boolean equals(Object o) {
>>> getterCalled();
>>> return wrappedList.equals(o);
>>> }
>>> ----------8<----------
>>>
>>>
>>> So when you have
>>>
>>> ObservableList a(ObservableList (id=140))
>>> a.wrappedList(PersistableEList(id=141))
>>>
>>> ObservableList b(ObservableList (id=140))
>>> b.wrappedList(PersistableEList(id=141))
>>>
>>> and you call a.equals(b) you'll get false because the code executed
>>> in then is
>>>
>>> wrappedList(PersistableEList(id=141)).equals(o(ObservableLis t (id=140)))
>>>
>>> which will result in false because of the equals definition in
>>> PersistableEList. Matt and Boris already approved the following
>>> change to the ObservableList#equals() for 3.4.1 (today is the last
>>> dev day for 3.4.1).
>>>
>>> ----------8<----------
>>> public boolean equals(Object o) {
>>> getterCalled();
>>> if( o == this ) {
>>> return true;
>>> }
>>> return wrappedList.equals(o);
>>> }
>>> ----------8<----------
>>>
>>> I also proposed a second patch (in the bug report 245183) where I was
>>> passing on the wrapped list but it looks like this won't make it in
>>> the general framework. This is not ideal because then we'll have the
>>> same problem we have before in cases like this:
>>>
>>> ----------8<----------
>>> ObservableList a(ObservableList (id=142))
>>> a.wrappedList(PersistableEList(id=141))
>>>
>>> ObservableList b(ObservableList (id=140))
>>> b.wrappedList(PersistableEList(id=141))
>>> ----------8<----------
>>>
>>> If the situation stays like this we have 2 possibilities:
>>>
>>> a) You rewrite the equals-method of PersistableEList like this:
>>>
>>> equals(Object o) {
>>> if( o == this ) {
>>> return true;
>>> } else if( o.hashCode() == this.hashCode() ) {
>>> return true;
>>> }
>>>
>>> // Maybe do the full compare when list is materialized
>>> return false;
>>> }
>>>
>>> b) We (Ed) overloads equals in
>>> org.eclipse.emf.databinding.EObjectObservableList and does what I
>>> proposed in https://bugs.eclipse.org/bugs/show_bug.cgi?id=245183#c2
>>>
>>>
>>> Tom
>>>
>>> Martin Taal schrieb:
>>>> Hi Tom,
>>>> That's right, that's why Teneo violates the equals of a list
>>>> implementation. I can make it so that it does a real equals if the
>>>> list has already been loaded but that only solves part of the issues.
>>>> Fyi, Hibernate also does equals on collections in a bit different
>>>> way (uses the key of the owner and the name of the efeature holding
>>>> the collection).
>>>>
>>>> I need to know a bit more about how the equals check is done.
>>>> Can you post the code snippet that does the equals on the elist (and
>>>> the equals implementation of the list wrapper)? What gets passed to
>>>> the equals, the wrapped list or the wrapperlist?
>>>>
>>>> gr. Martin
>>>>
>>>
>>>
>>
>>
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Previous Topic:Controlling ecore file name
Next Topic:EMF workflow engine design issue
Goto Forum:
  


Current Time: Sat Sep 21 07:32:45 GMT 2024

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

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

Back to the top