[Eugenia] Problem generating the Diagram. [message #590645] |
Thu, 15 July 2010 05:30 |
Eclipse User |
|
|
|
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 ;
}
|
|
|
Powered by
FUDForum. Page generated in 0.03263 seconds