diff --git a/introspector/plugins/org.polarsys.kitalpha.pdt.docgen/src/org/polarsys/kitalpha/pdt/docgen/helpers/ObjectHelpers.java b/introspector/plugins/org.polarsys.kitalpha.pdt.docgen/src/org/polarsys/kitalpha/pdt/docgen/helpers/ObjectHelpers.java index 04aabb1..8906824 100644 --- a/introspector/plugins/org.polarsys.kitalpha.pdt.docgen/src/org/polarsys/kitalpha/pdt/docgen/helpers/ObjectHelpers.java +++ b/introspector/plugins/org.polarsys.kitalpha.pdt.docgen/src/org/polarsys/kitalpha/pdt/docgen/helpers/ObjectHelpers.java @@ -21,8 +21,10 @@ import org.polarsys.kitalpha.pdt.metamodel.model.platform.Extension; import org.polarsys.kitalpha.pdt.metamodel.model.platform.ExtensionPoint; import org.polarsys.kitalpha.pdt.metamodel.model.platform.Feature; +import org.polarsys.kitalpha.pdt.metamodel.model.platform.Package; import org.polarsys.kitalpha.pdt.metamodel.model.platform.Plugin; import org.polarsys.kitalpha.pdt.metamodel.model.platform.Repository; +import org.polarsys.kitalpha.pdt.metamodel.model.platform.util.PlatformSwitch; /** * @@ -113,10 +115,49 @@ public String getFileName(EclipseModel eObject) { @Override public String getFileName(EObject eObject) { - String result = getFileName(eObject); + FileNameSwitch fileNameSwitch = new FileNameSwitch(); + String result = fileNameSwitch.doSwitch(eObject); if (result == null) { result = "Object not found"; } return result; } + + class FileNameSwitch extends PlatformSwitch { + + @Override + public String casePlugin(Plugin object) { + return getFileName(object); + } + + @Override + public String caseFeature(Feature object) { + return getFileName(object); + } + + @Override + public String caseExtensionPoint(ExtensionPoint object) { + return getFileName(object); + } + + @Override + public String caseExtension(Extension object) { + return getFileName(object); + } + + @Override + public String casePackage(Package object) { + return getFileName(object); + } + + @Override + public String caseRepository(Repository object) { + return getFileName(object); + } + + @Override + public String caseEclipseModel(EclipseModel object) { + return getFileName(object); + } + } }