Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Referencing Java Types From A Manually Linked Grammar?
Referencing Java Types From A Manually Linked Grammar? [message #1099055] Sun, 01 September 2013 03:57
Chris Ainsley is currently offline Chris AinsleyFriend
Messages: 78
Registered: March 2010
Location: UK
Member
I have a grammar which I am manually linking due to values that can be placed in certain locations being heavily dynamic. Each field has a series of metadata which I maintain externally. One of the metadata fields is a hint as to the type of validations to perform on a field. This is working well.

As this is entirely dynamic, I use a single terminal rule for almost all types which captures a string with the appropriate escaping rules implemented. I now wish to add a new validation and content assist for Java Types.

So far, I have included the following line in my XText file:

import "platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.ecore" as types

I do not use the following type (because I only have one type, that of String, and the rest is handled by my custom validator):

types::JvmIdentifiableElement

So my two questions are:


  1. Now that my content proposal provide extends AbstractJavaBasedContentProposalProvider, how do I wire up my concrete proposal provider to show the Java Types list as and when I required it?
  2. How do I validate that a given string is a valid java class (or even better, a valid java class with a public constructor) in my validator class?



I hope this makes sense.
Previous Topic:mwe2 Workflow passed, but Eclipse can't start my DSL-Editor
Next Topic:DSL-Editor fails with my Codegenerator-Stub FormlayoutGenerator.xtend
Goto Forum:
  


Current Time: Fri Apr 26 00:19:48 GMT 2024

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

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

Back to the top