Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » AdapterFactoryObservableList not responsive to changes in the underlying model ?
AdapterFactoryObservableList not responsive to changes in the underlying model ? [message #1696186] Fri, 22 May 2015 15:46 Go to next message
Thomas Elskens is currently offline Thomas ElskensFriend
Messages: 159
Registered: September 2014
Location: Brussels - Belgium
Senior Member
Hello,

I was trying to populate a ListView using a AdapterFactoryObservableList when I noticed the ListView is not updated when the underlying model changes.

One very simple example to illustrate this (using EMF Transaction but when reverting back to plain EMF.Edit the behaviour turns out to be the same)

ListView<IEmployer> myListView = new ListView<>();
domain = (AdapterFactoryEditingDomain) TransactionalEditingDomain.Registry.INSTANCE.getEditingDomain("my_id") ;
TransactionalCommandStack stack = (TransactionalCommandStack) domain.getCommandStack() ;
Resource mainResource = new ResourceImpl(URI.createFileURI("path_to_xmi") );
domain.getResourceSet().getResources().add(mainResource) ;

List<IEmployer> employers = fetchSomeData();

try 
{
	stack.execute(new RecordingCommand((TransactionalEditingDomain)domain)
	{
		@Override
		protected void doExecute()
		{					
mainResource.getContents().addAll(employers.subList(0, 10)) ;
		}
	}, Collections.emptyMap());
} 
catch(...)

myListView.setItems(new AdapterFactoryObservableList<IEmployer>(adapterFactory, mainResource)) ;
		
try {
	         stack.execute(new RecordingCommand((TransactionalEditingDomain)domain)
		{
			@Override
			protected void doExecute()
		        {

mainResource.getContents().addAll(employers.subList(11, employers.size())) ;
			}
		}, Collections.emptyMap()) ;
	}
catch(...)


The result of this code is that the first ten elements appear are displayed in the ListView, while the remainder is not.

Is there anything I can do to change this behaviour ?

Thomas Elskens
Re: AdapterFactoryObservableList not responsive to changes in the underlying model ? [message #1696290 is a reply to message #1696186] Mon, 25 May 2015 10:01 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
Hi Thomas,

are you using the nightlies or are you using 1.2? There has been some considerable work on AdapterFactoryObservableList for 2.0.

Christoph
Re: AdapterFactoryObservableList not responsive to changes in the underlying model ? [message #1696378 is a reply to message #1696290] Tue, 26 May 2015 08:43 Go to previous messageGo to next message
Thomas Elskens is currently offline Thomas ElskensFriend
Messages: 159
Registered: September 2014
Location: Brussels - Belgium
Senior Member
Hello Christoph,

I am using the nightlies, but with Eclipse Luna. Might that be an issue ?

Thomas
Re: AdapterFactoryObservableList not responsive to changes in the underlying model ? [message #1696387 is a reply to message #1696378] Tue, 26 May 2015 09:15 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
You could try it with the version from 1.2 to see if a regression has been introduced with 2.0.
I have no experience with EMF Transaction, so I can't comment on the code.
Re: AdapterFactoryObservableList not responsive to changes in the underlying model ? [message #1696501 is a reply to message #1696387] Tue, 26 May 2015 19:03 Go to previous messageGo to next message
Thomas Elskens is currently offline Thomas ElskensFriend
Messages: 159
Registered: September 2014
Location: Brussels - Belgium
Senior Member
You are right, it does seem like a regression.

In attachment you can find two very simple efx4 applications, with the same (extremely simple) emf data model.

The first one reacts as expected (displaying six elements in the listview) and resolves against efxclipse 1.2.

The second one is broken (displaying only three elements) and resolves against efxclipse_nigthly.
The examples do not use EMF Transaction, only plain EMF Edit.

If it's desirable to file a bug for this in the efxclipse bugtracker, let me know.

Thomas
Re: AdapterFactoryObservableList not responsive to changes in the underlying model ? [message #1696530 is a reply to message #1696501] Wed, 27 May 2015 06:52 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Yes we definately need a bug report with the sources attached there!

Tom

On 26.05.15 21:03, Thomas Elskens wrote:
> You are right, it does seem like a regression.
>
> In attachment you can find two very simple efx4 applications, with the same (extremely simple) emf data model.
>
> The first one reacts as expected (displaying six elements in the listview) and resolves against efxclipse 1.2.
>
> The second one is broken (displaying only three elements) and resolves against efxclipse_nigthly.
> The examples do not use EMF Transaction, only plain EMF Edit.
>
> If it's desirable to file a bug for this in the efxclipse bugtracker, let me know.
>
> Thomas
>
Re: AdapterFactoryObservableList not responsive to changes in the underlying model ? [message #1696535 is a reply to message #1696530] Wed, 27 May 2015 07:22 Go to previous messageGo to next message
Thomas Elskens is currently offline Thomas ElskensFriend
Messages: 159
Registered: September 2014
Location: Brussels - Belgium
Senior Member
Bug created : https://bugs.eclipse.org/bugs/show_bug.cgi?id=468433
Re: AdapterFactoryObservableList not responsive to changes in the underlying model ? [message #1696536 is a reply to message #1696530] Wed, 27 May 2015 07:23 Go to previous message
Thomas Elskens is currently offline Thomas ElskensFriend
Messages: 159
Registered: September 2014
Location: Brussels - Belgium
Senior Member
Bug created : https://bugs.eclipse.org/bugs/show_bug.cgi?id=468433
Previous Topic:jfxswt not on the classpath
Next Topic:setVisible performance on MPart or MPartStack
Goto Forum:
  


Current Time: Wed Apr 24 22:41:42 GMT 2024

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

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

Back to the top