Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to open the file specified by "importURI"?(Just open the file when Ctrl-click on the import statement)
How to open the file specified by "importURI"? [message #715720] Mon, 15 August 2011 09:58 Go to next message
alex.ren2006 is currently offline alex.ren2006Friend
Messages: 46
Registered: June 2011
Member
By the importURI feature (such as 'import' importURI=STRING) of Xtext, it's very easy to implement cross-reference among multiple files. When we Ctrl-click certain element in the current file, the corresponding new file will be opened and the cursor will be located to the right place. Besides this, I also want to open the new file when Ctrl-click on the import statement itself. Is there any simple way to do this in Xtext? Thanks a lot.
Re: How to open the file specified by "importURI"? [message #715721 is a reply to message #715720] Mon, 15 August 2011 10:01 Go to previous message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

as the import is simply a string and not a cross reference, the wanted behaviour is not provided out of the box. You can adapt the HyperlinkHelper in order to create a hyperlink for the import. Node(Model)Utils should help you to check whether there is an import at the given location.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Previous Topic:How to replace ANTLR?
Next Topic:issues with hidden and formatter
Goto Forum:
  


Current Time: Fri Sep 20 19:50:32 GMT 2024

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

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

Back to the top