Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Getting IEditorInput in validator
Getting IEditorInput in validator [message #1059627] Mon, 20 May 2013 22:48
Roza Ghamari is currently offline Roza GhamariFriend
Messages: 82
Registered: January 2013
Member
Hi all,

I need to do some validation on my grammar based on the association of the file with a specific object I called MyResource. The command for opening the xtext editor is handled when user is right clicking on MyResource, hence I extended the FileEditorInput (called it MyEditorInput) and store the Myresource instance for the editor input there. However, I cannot get the instance of MyEditorInput in the MyGrammarJavaEditor code. I tried using PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorInput()

but this it throw NullPointerException. Do you know any ways to get the editor input in validator? Do you think my solution for associating an external object with the xtext editor/file/resource is correct? Any other suggestions?

Thank you very much in advance!
Previous Topic:[Xtext 2.3] Problem with left-recursive grammar and operator priority
Next Topic:Setting up URI imports
Goto Forum:
  


Current Time: Fri Apr 26 19:33:58 GMT 2024

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

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

Back to the top