Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 18:06 Go to next message
Elhamlaoui Mahmoud is currently offline Elhamlaoui MahmoudFriend
Messages: 268
Registered: March 2010
Senior Member
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 18:07]

Report message to a 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 20:12 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

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

regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
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 10:03 Go to previous messageGo to next message
Elhamlaoui Mahmoud is currently offline Elhamlaoui MahmoudFriend
Messages: 268
Registered: March 2010
Senior Member

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 11:52 Go to previous messageGo to next message
Elhamlaoui Mahmoud is currently offline Elhamlaoui MahmoudFriend
Messages: 268
Registered: March 2010
Senior Member
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 05:01 Go to previous messageGo to next message
Michael Golubev is currently offline Michael GolubevFriend
Messages: 383
Registered: July 2009
Senior Member
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 09:48 Go to previous message
Elhamlaoui Mahmoud is currently offline Elhamlaoui MahmoudFriend
Messages: 268
Registered: March 2010
Senior Member
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: Sun Nov 03 01:36:41 GMT 2024

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

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

Back to the top