diff --git a/gama.annotations/src/gama/annotations/precompiler/GamlAnnotations.java b/gama.annotations/src/gama/annotations/precompiler/GamlAnnotations.java index 5fae85da78..36bbc27f5e 100644 --- a/gama.annotations/src/gama/annotations/precompiler/GamlAnnotations.java +++ b/gama.annotations/src/gama/annotations/precompiler/GamlAnnotations.java @@ -1,7 +1,6 @@ /******************************************************************************************************* * - * GamlAnnotations.java, in gama.annotations, is part of the source code of the GAMA modeling and simulation - * platform . + * GamlAnnotations.java, in gama.annotations, is part of the source code of the GAMA modeling and simulation platform . * * (c) 2007-2024 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) * @@ -444,7 +443,6 @@ boolean internal() doc[] doc() default {}; } - /** * * The class action. Used to tag a method that will be considered as an action (or primitive) in GAML. The method @@ -1096,9 +1094,16 @@ String comment() * An @usage can also be used for defining a template for a GAML structure, and in that case requires the following * to be defined : * - * A name (attribute "name"), optional, but better A description (attribute "value"), optional A menu name - * (attribute "menu"), optional A hierarchical path within this menu (attribute "path"), optional A pattern - * (attribute "pattern" or concatenation of the @example present in "examples" that define "isPattern" as true) + * A name (attribute "name"), optional, but better + * + * A description (attribute "value"), optional + * + * A menu name (attribute "menu"), optional + * + * A hierarchical path within this menu (attribute "path"), optional + * + * A pattern (attribute "pattern" or concatenation of the @example present in "examples" that define "isPattern" as + * true) * * (see org.eclipse.jface.text.templates.Template) These templates are then classified and accessible * during runtime for editing models diff --git a/gama.core/src/gama/gaml/compilation/GamlAddition.java b/gama.core/src/gama/gaml/compilation/GamlAddition.java index 08619b8396..1d052c0228 100644 --- a/gama.core/src/gama/gaml/compilation/GamlAddition.java +++ b/gama.core/src/gama/gaml/compilation/GamlAddition.java @@ -1,7 +1,6 @@ /******************************************************************************************************* * - * GamlAddition.java, in gama.core, is part of the source code of the GAMA modeling and simulation platform - * . + * GamlAddition.java, in gama.core, is part of the source code of the GAMA modeling and simulation platform . * * (c) 2007-2024 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) * @@ -13,6 +12,7 @@ import java.lang.reflect.AnnotatedElement; import gama.annotations.precompiler.GamlAnnotations.doc; +import gama.annotations.precompiler.GamlAnnotations.example; import gama.annotations.precompiler.GamlAnnotations.usage; import gama.gaml.interfaces.IGamlDescription; @@ -76,7 +76,15 @@ public Doc getDocumentation() { String s = d.value(); if (s != null && !s.isEmpty()) { documentation.append(s).append("
"); } usage[] usages = d.usages(); - for (usage u : usages) { documentation.append(u.value()).append("
"); } + for (usage u : usages) { + documentation.append(u.value()).append("
");
+					for (example e : u.examples()) {
+						s = e.value();
+						if (s != null && !s.isEmpty()) { documentation.append("	").append(s).append("
"); } + } + documentation.append("
"); + + } s = d.deprecated(); if (s != null && !s.isEmpty()) { documentation.append("Deprecated: ").append("").append(s).append("
");