Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » TableViewer binding
TableViewer binding [message #661369] Thu, 24 March 2011 12:16 Go to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 61
Registered: February 2011
Member
Hello guys. How can i bind tableviewer to emf datamodel? I have this code:
IObservableList list = EMFObservables.observeList(
				resource.getWtpBase(), WtpdbPackage.Literals.WTPBASE__GROUPS);
		groupViewer.setInput(list);

resource is IModelResource(like in Tom's foundation example project), resource.getWtpBase() is root object and WtpdbPackage.Literals.WTPBASE__GROUPS is that, what i see in tableviewer. This code works, but i can't see any changes in resource object():
@Override
	public boolean isDirty() {
		return resource.isDirty();
	}

maybe my tableviewer binding approach is not correct?
Re: TableViewer binding [message #661438 is a reply to message #661369] Thu, 24 March 2011 16:36 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30551
Registered: July 2009
Senior Member
You'll want to use the observables factory from
org.eclipse.emf.databinding.edit

Alex wrote:
> Hello guys. How can i bind tableviewer to emf datamodel? I have this
> code:
>
> IObservableList list = EMFObservables.observeList(
> resource.getWtpBase(),
> WtpdbPackage.Literals.WTPBASE__GROUPS);
> groupViewer.setInput(list);
>
> resource is IModelResource(like in Tom's foundation example project),
> resource.getWtpBase() is root object and
> WtpdbPackage.Literals.WTPBASE__GROUPS is that, what i see in
> tableviewer. This code works, but i can't see any changes in resource
> object():
>
> @Override
> public boolean isDirty() {
> return resource.isDirty();
> }
>
> maybe my tableviewer binding approach is not correct?
Re: TableViewer binding [message #661454 is a reply to message #661438] Thu, 24 March 2011 17:57 Go to previous messageGo to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 61
Registered: February 2011
Member
Ed, thank you. Maybe you can give me some example?
Re: TableViewer binding [message #661483 is a reply to message #661454] Thu, 24 March 2011 20:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30551
Registered: July 2009
Senior Member
Alex,

It works exactly the same way. Just use EMFEditObservables instead...


Alex wrote:
> Ed, thank you. Maybe you can give me some example?
Re: TableViewer binding [message #661685 is a reply to message #661369] Sat, 26 March 2011 05:07 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6505
Registered: July 2009
Senior Member
What is your content provider? It has to be an
ObservableListContentProvider!

Tom

Am 24.03.11 05:16, schrieb Alex:
> Hello guys. How can i bind tableviewer to emf datamodel? I have this code:
>
> IObservableList list = EMFObservables.observeList(
> resource.getWtpBase(),
> WtpdbPackage.Literals.WTPBASE__GROUPS);
> groupViewer.setInput(list);
>
> resource is IModelResource(like in Tom's foundation example project),
> resource.getWtpBase() is root object and
> WtpdbPackage.Literals.WTPBASE__GROUPS is that, what i see in
> tableviewer. This code works, but i can't see any changes in resource
> object():
>
> @Override
> public boolean isDirty() {
> return resource.isDirty();
> }
>
> maybe my tableviewer binding approach is not correct?
Re: TableViewer binding [message #661691 is a reply to message #661685] Sat, 26 March 2011 09:33 Go to previous message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 61
Registered: February 2011
Member
year, thank you Tom.I have already coped with this problem.
Previous Topic:Export from GenModel to XSD missing lots of details
Next Topic:Regarding GSoC project-"EMF - EMF Databinding for Apache CXF"
Goto Forum:
  


Current Time: Sun Oct 20 14:28:01 GMT 2019

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

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

Back to the top