Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [Eugenia] Problem generating the Diagram.
[Eugenia] Problem generating the Diagram. [message #547048] Thu, 15 July 2010 09:30 Go to next message
Toñi Reina is currently offline Toñi ReinaFriend
Messages: 209
Registered: July 2009
Senior Member
Hi all,

once I've tested the Eugenia tutorials successfully ;-), I've started
to create my own editor.

During the process, everything is OK, but the last step, the
diagram generation from the gmfgen file, produces an error. The problem
is in the Java generated, concretely in the method
protected boolean provides(CreateNodeViewOperation op) that belongs to
the class MyDSLViewProvider.

This is the generated method, and the problem is in the last return.
There is a variable or a value missing.

/**
* @generated
*/
protected boolean provides(CreateNodeViewOperation op) {
if (op.getContainerView() == null) {
return false;
}
IElementType elementType = getSemanticElementType(op
.getSemanticAdapter());
EObject domainElement = getSemanticElement(op.getSemanticAdapter());
int visualID;
if (op.getSemanticHint() == null) {
// Semantic hint is not specified. Can be a result of call from
CanonicalEditPolicy.
// In this situation there should be NO elementType, visualID will be
determined
// by VisualIDRegistry.getNodeVisualID() for domainElement.
if (elementType != null || domainElement == null) {
return false;
}
visualID = GuaranaVisualIDRegistry.getNodeVisualID(op
.getContainerView(), domainElement);
} else {
visualID = GuaranaVisualIDRegistry
.getVisualID(op.getSemanticHint());
if (elementType != null) {
if (!GuaranaElementTypes.isKnownElementType(elementType)
|| (!(elementType instanceof IHintedType))) {
return false; // foreign element type
}
String elementTypeHint = ((IHintedType) elementType)
.getSemanticHint();
if (!op.getSemanticHint().equals(elementTypeHint)) {
return false; // if semantic hint is specified it should be the
same as in element type
}
if (domainElement != null
&& visualID != GuaranaVisualIDRegistry.getNodeVisualID(
op.getContainerView(), domainElement)) {
return false; // visual id for node EClass should match visual id
from element type
}
} else {
if (!SolutionEditPart.MODEL_ID.equals(GuaranaVisualIDRegistry
.getModelID(op.getContainerView()))) {
return false; // foreign diagram
}
switch (visualID) {
default:
return false;
}
}
}
return ;
}
Re: [Eugenia] Problem generating the Diagram. [message #547049 is a reply to message #547048] Thu, 15 July 2010 09:32 Go to previous messageGo to next message
Toñi Reina is currently offline Toñi ReinaFriend
Messages: 209
Registered: July 2009
Senior Member
Sorry,

I sent the previous before finishing it.

The question is: Is the problem I described in the previous message
due to some information I have forgotten in my metamodel annotations?


El 15/07/2010 11:30, Toñi Reina Quintero escribió:
> Hi all,
>
> once I've tested the Eugenia tutorials successfully ;-), I've started to
> create my own editor.
>
> During the process, everything is OK, but the last step, the diagram
> generation from the gmfgen file, produces an error. The problem is in
> the Java generated, concretely in the method
> protected boolean provides(CreateNodeViewOperation op) that belongs to
> the class MyDSLViewProvider.
>
> This is the generated method, and the problem is in the last return.
> There is a variable or a value missing.
>
> /**
> * @generated
> */
> protected boolean provides(CreateNodeViewOperation op) {
> if (op.getContainerView() == null) {
> return false;
> }
> IElementType elementType = getSemanticElementType(op
> .getSemanticAdapter());
> EObject domainElement = getSemanticElement(op.getSemanticAdapter());
> int visualID;
> if (op.getSemanticHint() == null) {
> // Semantic hint is not specified. Can be a result of call from
> CanonicalEditPolicy.
> // In this situation there should be NO elementType, visualID will be
> determined
> // by VisualIDRegistry.getNodeVisualID() for domainElement.
> if (elementType != null || domainElement == null) {
> return false;
> }
> visualID = GuaranaVisualIDRegistry.getNodeVisualID(op
> .getContainerView(), domainElement);
> } else {
> visualID = GuaranaVisualIDRegistry
> .getVisualID(op.getSemanticHint());
> if (elementType != null) {
> if (!GuaranaElementTypes.isKnownElementType(elementType)
> || (!(elementType instanceof IHintedType))) {
> return false; // foreign element type
> }
> String elementTypeHint = ((IHintedType) elementType)
> .getSemanticHint();
> if (!op.getSemanticHint().equals(elementTypeHint)) {
> return false; // if semantic hint is specified it should be the same as
> in element type
> }
> if (domainElement != null
> && visualID != GuaranaVisualIDRegistry.getNodeVisualID(
> op.getContainerView(), domainElement)) {
> return false; // visual id for node EClass should match visual id from
> element type
> }
> } else {
> if (!SolutionEditPart.MODEL_ID.equals(GuaranaVisualIDRegistry
> .getModelID(op.getContainerView()))) {
> return false; // foreign diagram
> }
> switch (visualID) {
> default:
> return false;
> }
> }
> }
> return ;
> }
Re: [Eugenia] Problem generating the Diagram. [message #547153 is a reply to message #547049] Thu, 15 July 2010 17:07 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Toni,

It'd probably help if I could have a look at the annotated metamodel.

Cheers,
Dimitris

On 15/07/2010 10:32, Toñi Reina Quintero wrote:
> Sorry,
>
> I sent the previous before finishing it.
>
> The question is: Is the problem I described in the previous message due
> to some information I have forgotten in my metamodel annotations?
>
>
> El 15/07/2010 11:30, Toñi Reina Quintero escribió:
>> Hi all,
>>
>> once I've tested the Eugenia tutorials successfully ;-), I've started to
>> create my own editor.
>>
>> During the process, everything is OK, but the last step, the diagram
>> generation from the gmfgen file, produces an error. The problem is in
>> the Java generated, concretely in the method
>> protected boolean provides(CreateNodeViewOperation op) that belongs to
>> the class MyDSLViewProvider.
>>
>> This is the generated method, and the problem is in the last return.
>> There is a variable or a value missing.
>>
>> /**
>> * @generated
>> */
>> protected boolean provides(CreateNodeViewOperation op) {
>> if (op.getContainerView() == null) {
>> return false;
>> }
>> IElementType elementType = getSemanticElementType(op
>> .getSemanticAdapter());
>> EObject domainElement = getSemanticElement(op.getSemanticAdapter());
>> int visualID;
>> if (op.getSemanticHint() == null) {
>> // Semantic hint is not specified. Can be a result of call from
>> CanonicalEditPolicy.
>> // In this situation there should be NO elementType, visualID will be
>> determined
>> // by VisualIDRegistry.getNodeVisualID() for domainElement.
>> if (elementType != null || domainElement == null) {
>> return false;
>> }
>> visualID = GuaranaVisualIDRegistry.getNodeVisualID(op
>> .getContainerView(), domainElement);
>> } else {
>> visualID = GuaranaVisualIDRegistry
>> .getVisualID(op.getSemanticHint());
>> if (elementType != null) {
>> if (!GuaranaElementTypes.isKnownElementType(elementType)
>> || (!(elementType instanceof IHintedType))) {
>> return false; // foreign element type
>> }
>> String elementTypeHint = ((IHintedType) elementType)
>> .getSemanticHint();
>> if (!op.getSemanticHint().equals(elementTypeHint)) {
>> return false; // if semantic hint is specified it should be the same as
>> in element type
>> }
>> if (domainElement != null
>> && visualID != GuaranaVisualIDRegistry.getNodeVisualID(
>> op.getContainerView(), domainElement)) {
>> return false; // visual id for node EClass should match visual id from
>> element type
>> }
>> } else {
>> if (!SolutionEditPart.MODEL_ID.equals(GuaranaVisualIDRegistry
>> .getModelID(op.getContainerView()))) {
>> return false; // foreign diagram
>> }
>> switch (visualID) {
>> default:
>> return false;
>> }
>> }
>> }
>> return ;
>> }
>
Re: [Eugenia] Problem generating the Diagram. [message #547485 is a reply to message #547153] Sat, 17 July 2010 14:48 Go to previous message
Toñi Reina is currently offline Toñi ReinaFriend
Messages: 209
Registered: July 2009
Senior Member
Hi Dimitris,

thanks for your offer, but I'm afraid I have been modifying the
annotated metamodel, trying to solve the problem, and now, I can not
reproduce the same error. Fortunately, now I can generate the editor.

Regards,
Toñi

El 15/07/2010 19:07, Dimitris Kolovos escribió:
> Hi Toni,
>
> It'd probably help if I could have a look at the annotated metamodel.
>
> Cheers,
> Dimitris
>
> On 15/07/2010 10:32, Toñi Reina Quintero wrote:
>> Sorry,
>>
>> I sent the previous before finishing it.
>>
>> The question is: Is the problem I described in the previous message due
>> to some information I have forgotten in my metamodel annotations?
>>
>>
>> El 15/07/2010 11:30, Toñi Reina Quintero escribió:
>>> Hi all,
>>>
>>> once I've tested the Eugenia tutorials successfully ;-), I've started to
>>> create my own editor.
>>>
>>> During the process, everything is OK, but the last step, the diagram
>>> generation from the gmfgen file, produces an error. The problem is in
>>> the Java generated, concretely in the method
>>> protected boolean provides(CreateNodeViewOperation op) that belongs to
>>> the class MyDSLViewProvider.
>>>
>>> This is the generated method, and the problem is in the last return.
>>> There is a variable or a value missing.
>>>
>>> /**
>>> * @generated
>>> */
>>> protected boolean provides(CreateNodeViewOperation op) {
>>> if (op.getContainerView() == null) {
>>> return false;
>>> }
>>> IElementType elementType = getSemanticElementType(op
>>> .getSemanticAdapter());
>>> EObject domainElement = getSemanticElement(op.getSemanticAdapter());
>>> int visualID;
>>> if (op.getSemanticHint() == null) {
>>> // Semantic hint is not specified. Can be a result of call from
>>> CanonicalEditPolicy.
>>> // In this situation there should be NO elementType, visualID will be
>>> determined
>>> // by VisualIDRegistry.getNodeVisualID() for domainElement.
>>> if (elementType != null || domainElement == null) {
>>> return false;
>>> }
>>> visualID = GuaranaVisualIDRegistry.getNodeVisualID(op
>>> .getContainerView(), domainElement);
>>> } else {
>>> visualID = GuaranaVisualIDRegistry
>>> .getVisualID(op.getSemanticHint());
>>> if (elementType != null) {
>>> if (!GuaranaElementTypes.isKnownElementType(elementType)
>>> || (!(elementType instanceof IHintedType))) {
>>> return false; // foreign element type
>>> }
>>> String elementTypeHint = ((IHintedType) elementType)
>>> .getSemanticHint();
>>> if (!op.getSemanticHint().equals(elementTypeHint)) {
>>> return false; // if semantic hint is specified it should be the same as
>>> in element type
>>> }
>>> if (domainElement != null
>>> && visualID != GuaranaVisualIDRegistry.getNodeVisualID(
>>> op.getContainerView(), domainElement)) {
>>> return false; // visual id for node EClass should match visual id from
>>> element type
>>> }
>>> } else {
>>> if (!SolutionEditPart.MODEL_ID.equals(GuaranaVisualIDRegistry
>>> .getModelID(op.getContainerView()))) {
>>> return false; // foreign diagram
>>> }
>>> switch (visualID) {
>>> default:
>>> return false;
>>> }
>>> }
>>> }
>>> return ;
>>> }
>>
>
Re: [Eugenia] Problem generating the Diagram. [message #590652 is a reply to message #547048] Thu, 15 July 2010 09:32 Go to previous message
Toñi Reina is currently offline Toñi ReinaFriend
Messages: 209
Registered: July 2009
Senior Member
Sorry,

I sent the previous before finishing it.

The question is: Is the problem I described in the previous message
due to some information I have forgotten in my metamodel annotations?


El 15/07/2010 11:30, Toñi Reina Quintero escribió:
> Hi all,
>
> once I've tested the Eugenia tutorials successfully ;-), I've started to
> create my own editor.
>
> During the process, everything is OK, but the last step, the diagram
> generation from the gmfgen file, produces an error. The problem is in
> the Java generated, concretely in the method
> protected boolean provides(CreateNodeViewOperation op) that belongs to
> the class MyDSLViewProvider.
>
> This is the generated method, and the problem is in the last return.
> There is a variable or a value missing.
>
> /**
> * @generated
> */
> protected boolean provides(CreateNodeViewOperation op) {
> if (op.getContainerView() == null) {
> return false;
> }
> IElementType elementType = getSemanticElementType(op
> .getSemanticAdapter());
> EObject domainElement = getSemanticElement(op.getSemanticAdapter());
> int visualID;
> if (op.getSemanticHint() == null) {
> // Semantic hint is not specified. Can be a result of call from
> CanonicalEditPolicy.
> // In this situation there should be NO elementType, visualID will be
> determined
> // by VisualIDRegistry.getNodeVisualID() for domainElement.
> if (elementType != null || domainElement == null) {
> return false;
> }
> visualID = GuaranaVisualIDRegistry.getNodeVisualID(op
> .getContainerView(), domainElement);
> } else {
> visualID = GuaranaVisualIDRegistry
> .getVisualID(op.getSemanticHint());
> if (elementType != null) {
> if (!GuaranaElementTypes.isKnownElementType(elementType)
> || (!(elementType instanceof IHintedType))) {
> return false; // foreign element type
> }
> String elementTypeHint = ((IHintedType) elementType)
> .getSemanticHint();
> if (!op.getSemanticHint().equals(elementTypeHint)) {
> return false; // if semantic hint is specified it should be the same as
> in element type
> }
> if (domainElement != null
> && visualID != GuaranaVisualIDRegistry.getNodeVisualID(
> op.getContainerView(), domainElement)) {
> return false; // visual id for node EClass should match visual id from
> element type
> }
> } else {
> if (!SolutionEditPart.MODEL_ID.equals(GuaranaVisualIDRegistry
> .getModelID(op.getContainerView()))) {
> return false; // foreign diagram
> }
> switch (visualID) {
> default:
> return false;
> }
> }
> }
> return ;
> }
Re: [Eugenia] Problem generating the Diagram. [message #590699 is a reply to message #547049] Thu, 15 July 2010 17:07 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Toni,

It'd probably help if I could have a look at the annotated metamodel.

Cheers,
Dimitris

On 15/07/2010 10:32, Toñi Reina Quintero wrote:
> Sorry,
>
> I sent the previous before finishing it.
>
> The question is: Is the problem I described in the previous message due
> to some information I have forgotten in my metamodel annotations?
>
>
> El 15/07/2010 11:30, Toñi Reina Quintero escribió:
>> Hi all,
>>
>> once I've tested the Eugenia tutorials successfully ;-), I've started to
>> create my own editor.
>>
>> During the process, everything is OK, but the last step, the diagram
>> generation from the gmfgen file, produces an error. The problem is in
>> the Java generated, concretely in the method
>> protected boolean provides(CreateNodeViewOperation op) that belongs to
>> the class MyDSLViewProvider.
>>
>> This is the generated method, and the problem is in the last return.
>> There is a variable or a value missing.
>>
>> /**
>> * @generated
>> */
>> protected boolean provides(CreateNodeViewOperation op) {
>> if (op.getContainerView() == null) {
>> return false;
>> }
>> IElementType elementType = getSemanticElementType(op
>> .getSemanticAdapter());
>> EObject domainElement = getSemanticElement(op.getSemanticAdapter());
>> int visualID;
>> if (op.getSemanticHint() == null) {
>> // Semantic hint is not specified. Can be a result of call from
>> CanonicalEditPolicy.
>> // In this situation there should be NO elementType, visualID will be
>> determined
>> // by VisualIDRegistry.getNodeVisualID() for domainElement.
>> if (elementType != null || domainElement == null) {
>> return false;
>> }
>> visualID = GuaranaVisualIDRegistry.getNodeVisualID(op
>> .getContainerView(), domainElement);
>> } else {
>> visualID = GuaranaVisualIDRegistry
>> .getVisualID(op.getSemanticHint());
>> if (elementType != null) {
>> if (!GuaranaElementTypes.isKnownElementType(elementType)
>> || (!(elementType instanceof IHintedType))) {
>> return false; // foreign element type
>> }
>> String elementTypeHint = ((IHintedType) elementType)
>> .getSemanticHint();
>> if (!op.getSemanticHint().equals(elementTypeHint)) {
>> return false; // if semantic hint is specified it should be the same as
>> in element type
>> }
>> if (domainElement != null
>> && visualID != GuaranaVisualIDRegistry.getNodeVisualID(
>> op.getContainerView(), domainElement)) {
>> return false; // visual id for node EClass should match visual id from
>> element type
>> }
>> } else {
>> if (!SolutionEditPart.MODEL_ID.equals(GuaranaVisualIDRegistry
>> .getModelID(op.getContainerView()))) {
>> return false; // foreign diagram
>> }
>> switch (visualID) {
>> default:
>> return false;
>> }
>> }
>> }
>> return ;
>> }
>
Re: [Eugenia] Problem generating the Diagram. [message #590752 is a reply to message #547153] Sat, 17 July 2010 14:48 Go to previous message
Toñi Reina is currently offline Toñi ReinaFriend
Messages: 209
Registered: July 2009
Senior Member
Hi Dimitris,

thanks for your offer, but I'm afraid I have been modifying the
annotated metamodel, trying to solve the problem, and now, I can not
reproduce the same error. Fortunately, now I can generate the editor.

Regards,
Toñi

El 15/07/2010 19:07, Dimitris Kolovos escribió:
> Hi Toni,
>
> It'd probably help if I could have a look at the annotated metamodel.
>
> Cheers,
> Dimitris
>
> On 15/07/2010 10:32, Toñi Reina Quintero wrote:
>> Sorry,
>>
>> I sent the previous before finishing it.
>>
>> The question is: Is the problem I described in the previous message due
>> to some information I have forgotten in my metamodel annotations?
>>
>>
>> El 15/07/2010 11:30, Toñi Reina Quintero escribió:
>>> Hi all,
>>>
>>> once I've tested the Eugenia tutorials successfully ;-), I've started to
>>> create my own editor.
>>>
>>> During the process, everything is OK, but the last step, the diagram
>>> generation from the gmfgen file, produces an error. The problem is in
>>> the Java generated, concretely in the method
>>> protected boolean provides(CreateNodeViewOperation op) that belongs to
>>> the class MyDSLViewProvider.
>>>
>>> This is the generated method, and the problem is in the last return.
>>> There is a variable or a value missing.
>>>
>>> /**
>>> * @generated
>>> */
>>> protected boolean provides(CreateNodeViewOperation op) {
>>> if (op.getContainerView() == null) {
>>> return false;
>>> }
>>> IElementType elementType = getSemanticElementType(op
>>> .getSemanticAdapter());
>>> EObject domainElement = getSemanticElement(op.getSemanticAdapter());
>>> int visualID;
>>> if (op.getSemanticHint() == null) {
>>> // Semantic hint is not specified. Can be a result of call from
>>> CanonicalEditPolicy.
>>> // In this situation there should be NO elementType, visualID will be
>>> determined
>>> // by VisualIDRegistry.getNodeVisualID() for domainElement.
>>> if (elementType != null || domainElement == null) {
>>> return false;
>>> }
>>> visualID = GuaranaVisualIDRegistry.getNodeVisualID(op
>>> .getContainerView(), domainElement);
>>> } else {
>>> visualID = GuaranaVisualIDRegistry
>>> .getVisualID(op.getSemanticHint());
>>> if (elementType != null) {
>>> if (!GuaranaElementTypes.isKnownElementType(elementType)
>>> || (!(elementType instanceof IHintedType))) {
>>> return false; // foreign element type
>>> }
>>> String elementTypeHint = ((IHintedType) elementType)
>>> .getSemanticHint();
>>> if (!op.getSemanticHint().equals(elementTypeHint)) {
>>> return false; // if semantic hint is specified it should be the same as
>>> in element type
>>> }
>>> if (domainElement != null
>>> && visualID != GuaranaVisualIDRegistry.getNodeVisualID(
>>> op.getContainerView(), domainElement)) {
>>> return false; // visual id for node EClass should match visual id from
>>> element type
>>> }
>>> } else {
>>> if (!SolutionEditPart.MODEL_ID.equals(GuaranaVisualIDRegistry
>>> .getModelID(op.getContainerView()))) {
>>> return false; // foreign diagram
>>> }
>>> switch (visualID) {
>>> default:
>>> return false;
>>> }
>>> }
>>> }
>>> return ;
>>> }
>>
>
Previous Topic:[Epsilon] Revisiting problems with examples.friends.
Next Topic:[Epsilon] Revisiting problems with examples.friends.
Goto Forum:
  


Current Time: Mon Dec 22 12:06:16 GMT 2014

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

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