Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » The code of method getNodeVisualID(View, EObject) is exceeding the 65535 bytes limit
The code of method getNodeVisualID(View, EObject) is exceeding the 65535 bytes limit [message #651290] Fri, 28 January 2011 13:06 Go to next message
Eclipse UserFriend
HI,

while generating gmf codes i got the flowing error in the ApplicationVisualIDRegistry, i tried to modify the template
instead of:
Quote:

switch (containerVisualID) {
case HtmlGM.diagram.edit.parts.PageEditPart.VISUAL_ID:
if (HtmlGM.HtmlGMPackage.eINSTANCE.getHtml().isSuperTypeOf(
domainElement.eClass())) {
return HtmlGM.diagram.edit.parts.ApplicationEditPart.VISUAL_ID;
}



i try to have something like:
Quote:

switch (containerVisualID) {
case HtmlGM.diagram.edit.parts.PageEditPart.VISUAL_ID:
return getViewChildrenForApplicationEditPart(domainElement);
}


and to have this method defined outside
Quote:

private static int getViewChildrenForApplicationEditPart(EObject domainElement) {
if (HtmlGM.HtmlGMPackage.eINSTANCE.getHtml().isSuperTypeOf(
domainElement.eClass()))
return HtmlGM.diagram.edit.parts.ApplicationEditPart.VISUAL_ID;
return -1;
}


so i change the template :
Quote:

«DEFINE genAllMethodNodeCase FOR gmfgen::GenDiagram»
«EXPAND caseMethod FOREACH getAllContainers()-»
«ENDDEFINE»

«DEFINE caseMethod FOR gmfgen::GenContainerBase-»
«EXPAND caseMethodNodeNode FOREACH getContainedSemanticNodes(self)-»
«ENDDEFINE»
«DEFINE caseMethodNodeNode FOR gmfgen::GenCommonBase»
private static int getViewChildrenFor«self.editPartClassName»«e»(org.eclips e.emf.ecore.EObject domainElement){
if («EXPAND checkSemanticElement»)return «EXPAND visualID»;
return -1;
}
«ENDDEFINE»



but it genarete several method with the same name giving the following error:
Quote:

Duplicate method getViewChildrenApplicationEditPart(EObject) in type ApplicationVisualIDRegistry



any ideas how i could solve this problem

thanks

[Updated on: Fri, 28 January 2011 13:07] by Moderator

Re: The code of method getNodeVisualID(View, EObject) is exceeding the 65535 bytes limit [message #651601 is a reply to message #651290] Mon, 31 January 2011 15:12 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

you are calling caseMethodNodeNode with a FOREACH.
That is why there are several times the same method.

regards,
Re: The code of method getNodeVisualID(View, EObject) is exceeding the 65535 bytes limit [message #651688 is a reply to message #651601] Tue, 01 February 2011 05:03 Go to previous messageGo to next message
Eclipse UserFriend

Hi Aurelien,

i tried what you said, but i got this error
Quote:

Problems while generating code
Exception (No Definition caseMethodNodeNode for Sequence(GenTopLevelNode) could be found!) while generating code
No Definition caseMethodNodeNode for Sequence(GenTopLevelNode) could be found!



thanks again
Re: The code of method getNodeVisualID(View, EObject) is exceeding the 65535 bytes limit [message #657308 is a reply to message #651688] Wed, 02 March 2011 06:52 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Any ideas, how can i manage to solve this problem?
Re: The code of method getNodeVisualID(View, EObject) is exceeding the 65535 bytes limit [message #657792 is a reply to message #657308] Fri, 04 March 2011 00:01 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

The problem is not that you are calling that NodeNode expand FOREACH, thats correct.

The problem is that your method name does not depend on the pair <parent, child> but only on <child>, so if you have PopularChildEditPart as a possible child for 2 different parents, you will get 2 identically named methods.

You may solve this by collecting all the children into the set, or (a bit ugly, but should work) just by generating 1 method for every pair:
«DEFINE caseMethod FOR gmfgen::GenContainerBase-»
«EXPAND caseMethodNodeNode(self) FOREACH getContainedSemanticNodes(self)-»
«ENDDEFINE»
«DEFINE caseMethodNodeNode(parent : gmfgen::GenCommonBase) FOR gmfgen::GenCommonBase»
private static int getViewChildrenForParent«parent.editPartClassName»OfType«self.editPartClassName»(org.eclips e.emf.ecore.EObject domainElement){
if («EXPAND checkSemanticElement»)return «EXPAND visualID»;
return -1;
}
«ENDDEFINE»
Re: The code of method getNodeVisualID(View, EObject) is exceeding the 65535 bytes limit [message #657835 is a reply to message #657792] Fri, 04 March 2011 04:48 Go to previous message
Eclipse UserFriend
HI Michael,

Thanks you saved me a lout of trouble, because i split the method into several sub method to avoid this problem.

Thanks again
Previous Topic:Difference between Children Feature and Containment Feature?
Next Topic:A Creation Tool for every model/figure?
Goto Forum:
  


Current Time: Thu Jul 03 17:34:43 EDT 2025

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

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

Back to the top