Skip to main content



      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 11:46 Go to next message
Eclipse UserFriend
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 06:01 Go to previous messageGo to next message
Eclipse UserFriend
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 04:43 Go to previous messageGo to next message
Eclipse UserFriend
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 05:15 Go to previous messageGo to next message
Eclipse UserFriend
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 15:03 Go to previous messageGo to next message
Eclipse UserFriend
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 02:52 Go to previous messageGo to next message
Eclipse UserFriend
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 03:22 Go to previous messageGo to next message
Eclipse UserFriend
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 03:23 Go to previous message
Eclipse UserFriend
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: Sun Jul 20 12:20:27 EDT 2025

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

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

Back to the top