Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EVL] Question about the HasName constraint in the filesystemExample.
[EVL] Question about the HasName constraint in the filesystemExample. [message #550514] Fri, 30 July 2010 15:40 Go to next message
Toñi Reina is currently offline Toñi ReinaFriend
Messages: 209
Registered: July 2009
Senior Member
Hi,

I'm testing the filesystem example validation part explained in
http://www.eclipse.org/gmt/epsilon/doc/articles/evl-gmf-inte gration/ My
question is about the HasName constraint whose context is File. I'm
wondering if this constraint is really needed, I mean, if write my
metamodel constraining the cardinality name, as I write above, the
editor shouldn't let you write a not defined name, should it?

@gmf.node(figure="figures.FileFigure",
label.icon="false", label="name", label.placement="external")
class File {
attr String [1]name;
}

Concerning to this question, I'm also wondering if the eugenia generated
editor is able to validate some cardinality constraints, without any evl
extra code. For example, if I change the Folder class to restrict the
number of files it can include (as it is shown below), could the editor
avoid the user add more than one file to a folder?

@gmf.node(label=name)
class Folder {
attr String name;
@gmf.compartment(layout="free",collapsible="true")
val File[1] contents;
}


Thanks a lot
Re: [EVL] Question about the HasName constraint in the filesystemExample. [message #550566 is a reply to message #550514] Fri, 30 July 2010 19:04 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Toni,


On 30/07/2010 18:40, Toñi Reina Quintero wrote:
> Hi,
>
> I'm testing the filesystem example validation part explained in
> http://www.eclipse.org/gmt/epsilon/doc/articles/evl-gmf-inte gration/ My
> question is about the HasName constraint whose context is File. I'm
> wondering if this constraint is really needed, I mean, if write my
> metamodel constraining the cardinality name, as I write above, the
> editor shouldn't let you write a not defined name, should it?
>
> @gmf.node(figure="figures.FileFigure",
> label.icon="false", label="name", label.placement="external")
> class File {
> attr String [1]name;
> }

I think you're right. We just used HasName as a simple example
demonstrating simple EVL constraints.

>
> Concerning to this question, I'm also wondering if the eugenia generated
> editor is able to validate some cardinality constraints, without any evl
> extra code. For example, if I change the Folder class to restrict the
> number of files it can include (as it is shown below), could the editor
> avoid the user add more than one file to a folder?
>
> @gmf.node(label=name)
> class Folder {
> attr String name;
> @gmf.compartment(layout="free",collapsible="true")
> val File[1] contents;
> }

It should.

>
>
> Thanks a lot

Cheers,
Dimitris
Re: [EVL] Question about the HasName constraint in the filesystemExample. [message #591092 is a reply to message #550514] Fri, 30 July 2010 19:04 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Toni,


On 30/07/2010 18:40, Toñi Reina Quintero wrote:
> Hi,
>
> I'm testing the filesystem example validation part explained in
> http://www.eclipse.org/gmt/epsilon/doc/articles/evl-gmf-inte gration/ My
> question is about the HasName constraint whose context is File. I'm
> wondering if this constraint is really needed, I mean, if write my
> metamodel constraining the cardinality name, as I write above, the
> editor shouldn't let you write a not defined name, should it?
>
> @gmf.node(figure="figures.FileFigure",
> label.icon="false", label="name", label.placement="external")
> class File {
> attr String [1]name;
> }

I think you're right. We just used HasName as a simple example
demonstrating simple EVL constraints.

>
> Concerning to this question, I'm also wondering if the eugenia generated
> editor is able to validate some cardinality constraints, without any evl
> extra code. For example, if I change the Folder class to restrict the
> number of files it can include (as it is shown below), could the editor
> avoid the user add more than one file to a folder?
>
> @gmf.node(label=name)
> class Folder {
> attr String name;
> @gmf.compartment(layout="free",collapsible="true")
> val File[1] contents;
> }

It should.

>
>
> Thanks a lot

Cheers,
Dimitris
Previous Topic:[EVL] Question about the HasName constraint in the filesystemExample.
Next Topic:[EuGENia] attribute declarations with multiplicity expressions
Goto Forum:
  


Current Time: Thu Dec 18 10:38:12 GMT 2014

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

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