Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Modify one instance's contents in the xtext editors automatically
Modify one instance's contents in the xtext editors automatically [message #1104687] Sun, 08 September 2013 20:29 Go to next message
junior developer is currently offline junior developerFriend
Messages: 354
Registered: January 2013
Senior Member
Hi all,

I want to change one instance content.

such as

when I create a list instance ,I want to create one default item .and then
if list type is changed , its default item contents are changed .is it possible.

I can use handle.notification or changer.notification ? How can I do this with xtext.

Can you help me ?

Re: Modify one instance's contents in the xtext editors automatically [message #1104870 is a reply to message #1104687] Mon, 09 September 2013 03:25 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Sorry, but it is really difficult to understand what you are asking.

- henrik

On 2013-08-09 22:29, junior developer wrote:
> Hi all,
>
> I want to change one instance content.
>
> such as
> when I create a list instance ,I want to create one default item .and
> then if list type is changed , its default item contents are changed .is
> it possible.
>
> I can use handle.notification or changer.notification ? How can I do
> this with xtext.
>
> Can you help me ?
>
>
Re: Modify one instance's contents in the xtext editors automatically [message #1104977 is a reply to message #1104870] Mon, 09 September 2013 07:14 Go to previous message
junior developer is currently offline junior developerFriend
Messages: 354
Registered: January 2013
Senior Member
Hi Henrik,

My grammar's related part is below :

CustomList returns CustomList:
	'CustomList'
	name=QualifiedName
	'{'
	'displayName' '=' displayName=STRING
        ('description' '=' description=STRING)?
	 'type' '=' type=ListType
	 ('contentTypes' '{' ownedContentType+=ContentType 
         (ownedContentType+=ContentType)* '}' )?                           
		
	'}';
      
       ContentType returns ContentType:
	'ContentType'
	name=QualifiedName
	'{'
		'displayName' '=' displayName=STRING
		('description' '=' description=STRING)?
		('group' '=' group=STRING)?
		('parentContentType' '=' parentContentType=        [ContentType|QualifiedName])?
		('fields' '{' ownedField+=Field (ownedField+=Field)* '}' )?
		('releatedTable' '=' releatedTable=[Table|QualifiedName])?
	'}';
Field returns Field:
	LookupField | TextField 
	;
enum ListType :
custom|DocumentLibrary


When I create a CustomList instance and I select type =custom in the xtext editor ,
Automatically created ContentType item and ContentType's contens that are field :
TextField or LookupField are created automatically.And then
if I select type=DocumnetLibrary ,previously created "item" ContentType's name will change with "documentlibrary" and its default fields will change.

I want to automatically instance and change its name and contents automatically

I hope I can explain my problem Sad
Previous Topic:Incorporating the context of code generation in validation
Next Topic:SyntexErrorMessageProvider for unordered group
Goto Forum:
  


Current Time: Tue Apr 30 00:14:11 GMT 2024

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

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

Back to the top