Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Mandatory and optional attributes
Mandatory and optional attributes [message #654557] Wed, 16 February 2011 10:09 Go to next message
Chandramouli  is currently offline Chandramouli Friend
Messages: 6
Registered: June 2010
Junior Member
How to differentiate Mandatory and optional attributes at runtime?

I have created a poller component like this:

FilePoller :
'File::Poller' name=ID '{'
(
'directory' directory=STRING
('autoCreateDirectory' autoCreateDirectory=Boolean)?
)
'}';

Here, directory is mandatory and autoCreateDirectory is optional.

For the user, I want to provide different icons for content-assist.
I am currently hardcoding the attribute names in proposalprovider and giving different icons.

Is there any way to know it during runtime?
Re: Mandatory and optional attributes [message #654623 is a reply to message #654557] Wed, 16 February 2011 13:31 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Don't know if what you are asking is how to know what is stated in the
grammar - if so the GrammarAccess gives you access to just about everything.

- henrik

On 2/16/11 11:09 AM, Chandramouli wrote:
> How to differentiate Mandatory and optional attributes at runtime?
>
> I have created a poller component like this:
>
> FilePoller :
> 'File::Poller' name=ID '{'
> (
> 'directory' directory=STRING
> ('autoCreateDirectory' autoCreateDirectory=Boolean)?
> )
> '}';
>
> Here, directory is mandatory and autoCreateDirectory is optional.
>
> For the user, I want to provide different icons for content-assist.
> I am currently hardcoding the attribute names in proposalprovider and
> giving different icons.
>
> Is there any way to know it during runtime?
Previous Topic:Embedding an Xtext DSL in JDT / CDT editors
Next Topic:Reverting change to semantic model
Goto Forum:
  


Current Time: Tue Apr 23 09:11:46 GMT 2024

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

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

Back to the top