Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Access xml file-path from PossibleValuesService or ListPropertyBinding implementation
Access xml file-path from PossibleValuesService or ListPropertyBinding implementation [message #1733116] Tue, 24 May 2016 06:32 Go to next message
Reinhart Herzog is currently offline Reinhart HerzogFriend
Messages: 11
Registered: December 2015
Junior Member
Hi guys!

how can I get the path of the xml-file the Sapphire GUI is displaying from a PossibleValuesService or ListPropertyBinding implementation?

In either cases I need to consider the content of other files that reside on the same path as the currently open xml-file.

For EL-Function implementations a reference to the open xml-file can be easily obtained by casting the root-parent of the FunctionContext to a SapphireEditorForXml and then calling getEditorInput().

Kind regards, reinhart
Re: Access xml file-path from PossibleValuesService or ListPropertyBinding implementation [message #1733136 is a reply to message #1733116] Tue, 24 May 2016 16:58 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Any place you have access to an Element from you model, you can call element.adapt( IFile.class ). To get Element from within a Service, call context( Element.class ). To get Element from within PropertyBinding, call property().element().

[Updated on: Tue, 24 May 2016 16:59]

Report message to a moderator

Re: Access xml file-path from PossibleValuesService or ListPropertyBinding implementation [message #1733814 is a reply to message #1733136] Wed, 01 June 2016 07:29 Go to previous messageGo to next message
Reinhart Herzog is currently offline Reinhart HerzogFriend
Messages: 11
Registered: December 2015
Junior Member
Thank you Konstantin! Are these kind of features documented anywhere else but in the Source-Code?

[Updated on: Wed, 01 June 2016 12:10]

Report message to a moderator

Re: Access xml file-path from PossibleValuesService or ListPropertyBinding implementation [message #1733874 is a reply to message #1733814] Wed, 01 June 2016 16:32 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
There are some API articles in the sapphire.doc plugin (Sapphire Developer Guide under Help), but most API documentation is in the form of javadoc. If javadoc for a particular method or class is lacking sufficient detail, please open a bug report.

[Updated on: Wed, 01 June 2016 16:33]

Report message to a moderator

Previous Topic:generate sdef
Next Topic:show/hide outline elements during runtime
Goto Forum:
  


Current Time: Fri Sep 21 00:47:58 GMT 2018

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

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

Back to the top