Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [Eugenia] Problem generating the Diagram.
[Eugenia] Problem generating the Diagram. [message #590645] Thu, 15 July 2010 05:30
Toñi Reina is currently offline Toñi Reina
Messages: 204
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 ;
}
Previous Topic:[Eugenia] Newbie question. Problems in the generated editor with the Folder Item.
Next Topic:[Eugenia] Problem with tool.name annotation detail by using different metamodel
Goto Forum:
  


Current Time: Tue Jul 29 14:51:25 EDT 2014

Powered by FUDForum. Page generated in 0.02623 seconds