Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/.classpath7
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/.project52
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.jdt.core.prefs291
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.jdt.ui.prefs68
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.pde.api.tools.prefs98
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/META-INF/MANIFEST.MF27
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/about.html28
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/build.properties9
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/plugin.properties3
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/plugin.xml192
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/pom.xml13
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/resources/css/simpletree.css88
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/resources/icons/exportAll.pngbin0 -> 847 bytes
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/resources/icons/export_wiz_16x16-papyrusColor.gifbin0 -> 609 bytes
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/resources/js/hyperlink.js9
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/resources/js/script.js36
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/resources/js/simpletreemenu.js139
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/resources/js/split.min.js2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/resources/schema/generation.exsd223
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/Activator.java120
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/HTMLExportHelper.java111
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/HTMLExportRunner.java93
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/AdditionalInformations.java28
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/AnnotateSVG.java34
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/HTMLExtensionRegistry.java167
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/CommentAnnotateSVG.java62
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/DiagramPathAdditionalInformations.java40
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/HyperlinkAnnotateSVG.java67
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/IconpathAdditionalInformations.java43
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/PapyrusCopyToImageUtil.java115
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/PapyrusDiagramSVGGenerator.java273
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/internal/OpenAPIDiagramSVGGenerator.java443
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/internal/OpenRenderedMapModeGraphics.java29
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/tree/Node.java119
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/tree/UMLTreeFactory.java234
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/ui/ExportHtmlHandler.java221
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/ui/HTMLExportPreferencesPage.java544
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/FileUtil.java75
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/HTMLUtil.java43
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/IconHelper.java140
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ImageUtil.java93
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/IndexHelper.java118
-rw-r--r--plugins/uml/pom.xml1
45 files changed, 4502 insertions, 0 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/.classpath b/plugins/uml/org.eclipse.papyrus.uml.export/.classpath
new file mode 100644
index 00000000000..eca7bdba8f0
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/.project b/plugins/uml/org.eclipse.papyrus.uml.export/.project
new file mode 100644
index 00000000000..8e6859ae96b
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/.project
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.uml.export</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.oomph.version.VersionBuilder</name>
+ <arguments>
+ <dictionary>
+ <key>check.maven.pom</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>ignore.lower.bound.dependency.ranges</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>release.path</key>
+ <value>/org.eclipse.papyrus.releng.main.release/release.xml</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.oomph.version.VersionNature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.core.resources.prefs b/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000000..896a9a53a53
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8 \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.core.runtime.prefs b/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 00000000000..5a0ad22d2a7
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.jdt.core.prefs b/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..62a08f4494d
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,291 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=260
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=false
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=260
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.jdt.ui.prefs b/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..954281dbc31
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,68 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_functional_interfaces=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.insert_inferred_type_arguments=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_redundant_type_arguments=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_anonymous_class_creation=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_lambda=true
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup.use_type_arguments=false
+cleanup_profile=_Papyrus
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_profile=_Papyrus
+formatter_settings_version=12
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * Constructor.\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*****************************************************************************\n * Copyright (c) ${year} CEA LIST and others.\n * \n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * CEA LIST - Initial API and implementation\n * \n *****************************************************************************/\n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\n * ${see_to_overridden}\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${see_to_target}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.pde.api.tools.prefs b/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.pde.api.tools.prefs
new file mode 100644
index 00000000000..23fb95e120f
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/.settings/org.eclipse.pde.api.tools.prefs
@@ -0,0 +1,98 @@
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_ANNOTATION=Ignore
+INVALID_JAVADOC_TAG=Ignore
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=Enabled
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Warning
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/META-INF/MANIFEST.MF b/plugins/uml/org.eclipse.papyrus.uml.export/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..ca3487c9657
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/META-INF/MANIFEST.MF
@@ -0,0 +1,27 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.uml.export;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Require-Bundle: org.eclipse.jdt.ui;bundle-version="[3.13.50,4.0.0)",
+ org.eclipse.uml2.uml;bundle-version="[5.3.0,6.0.0)",
+ org.apache.batik.dom.svg;bundle-version="[1.6.0,1.7.0)",
+ com.google.gson;bundle-version="2.7.0",
+ org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="[1.7.0,2.0.0)",
+ org.eclipse.gmf.runtime.draw2d.ui.render.awt;bundle-version="[1.7.0,2.0.0)",
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.papyrus.infra.gmfdiag.export;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.papyrus.infra.emf;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.papyrus.infra.onefile;bundle-version="[2.0.0,3.0.0)"
+Bundle-Activator: org.eclipse.papyrus.uml.export.Activator
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: %Bundle-Vendor
+Export-Package: org.eclipse.papyrus.uml.export,
+ org.eclipse.papyrus.uml.export.extension,
+ org.eclipse.papyrus.uml.export.extension.contribution,
+ org.eclipse.papyrus.uml.export.svgextension,
+ org.eclipse.papyrus.uml.export.svgextension.internal;x-internal:=true,
+ org.eclipse.papyrus.uml.export.tree,
+ org.eclipse.papyrus.uml.export.ui,
+ org.eclipse.papyrus.uml.export.util
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/about.html b/plugins/uml/org.eclipse.papyrus.uml.export/about.html
new file mode 100644
index 00000000000..209103075a7
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>November 14, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/build.properties b/plugins/uml/org.eclipse.papyrus.uml.export/build.properties
new file mode 100644
index 00000000000..d52546a24bd
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ about.html,\
+ plugin.properties,\
+ resources/
+src.includes = about.html
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/plugin.properties b/plugins/uml/org.eclipse.papyrus.uml.export/plugin.properties
new file mode 100644
index 00000000000..7f3ae1052fe
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/plugin.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.papyrus.import
+providerName = Eclipse Modeling Project
+pluginName = Papyrus UML HTMl Export \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/plugin.xml b/plugins/uml/org.eclipse.papyrus.uml.export/plugin.xml
new file mode 100644
index 00000000000..b6ac6be6c57
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/plugin.xml
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension-point id="org.eclipse.papyrus.uml.export.generation" name="Annotate Generation" schema="resources/schema/generation.exsd"/>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ id="prototype.export.html"
+ name="ExportAllDiagrams">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.papyrus.uml.export.ui.ExportHtmlHandler"
+ commandId="prototype.export.html">
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.papyrus.infra.gmfdiag.export.propertytester.ExportableSelectionPropertyTester"
+ id="org.eclipse.papyrus.export.propertyTester"
+ namespace="org.eclipse.papyrus.export"
+ properties="isFileExportable"
+ type="org.eclipse.core.resources.IFile">
+ </propertyTester>
+ <propertyTester
+ class="org.eclipse.papyrus.infra.gmfdiag.export.propertytester.ExportableSelectionPropertyTester"
+ id="org.eclipse.papyrus.export.propertyTester"
+ namespace="org.eclipse.papyrus.export"
+ properties="isCollectionExportable"
+ type="java.util.Collection">
+ </propertyTester>
+ <propertyTester
+ class="org.eclipse.papyrus.infra.gmfdiag.export.propertytester.ExportableSelectionPropertyTester"
+ id="org.eclipse.papyrus.export.propertyTester"
+ namespace="org.eclipse.papyrus.export"
+ properties="isExportableModel"
+ type="org.eclipse.jface.viewers.IStructuredSelection">
+ </propertyTester>
+ </extension>
+
+ <!-- in model explorer -->
+
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="true"
+ locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?after=org.eclipse.papyrus.uml.export.menu">
+ <menu
+ id="org.eclipse.papyrus.infra.gmfdiag.export.menu"
+ label="&amp;Export"
+ icon="resources/icons/export_wiz_16x16-papyrusColor.gif"
+ tooltip="Papyrus Export Menu">
+ <command
+ commandId="prototype.export.html"
+ icon="resources/icons/exportAll.png"
+ id="org.eclipse.papyrus.export.exportToHTML"
+ label="Export to HTML..."
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="selection">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.export.isExportableModel">
+ </test>
+ </with>
+ </visibleWhen>
+ </command>
+ </menu>
+ </menuContribution>
+ </extension>
+ <extension
+ id="tooltip.comment"
+ name="Display Comment as Tooltip"
+ point="org.eclipse.papyrus.uml.export.generation">
+ <annotation
+ annotation="org.eclipse.papyrus.uml.export.extension.contribution.CommentAnnotateSVG">
+ </annotation>
+ </extension>
+ <extension
+ id="script.default"
+ name="Default script"
+ point="org.eclipse.papyrus.uml.export.generation">
+ <html
+ header="true"
+ priority="1"
+ text="&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot; src=&quot;resources/js/script.js&quot;&gt;&lt;/script&gt;">
+ </html>
+ <copyFile
+ from="platform:/plugin/org.eclipse.papyrus.uml.export/resources/js/script.js"
+ to="resources/js/script.js">
+ </copyFile>
+ </extension>
+ <extension
+ id="script.tree"
+ name="Simple tree script"
+ point="org.eclipse.papyrus.uml.export.generation">
+ <html
+ header="true"
+ priority="1"
+ text="&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot; src=&quot;resources/js/simpletreemenu.js&quot;&gt;&lt;/script&gt;">
+ </html>
+ <html
+ header="false"
+ priority="1"
+ text="&lt;script&gt;ddtreemenu.createTree(&quot;diagram-explorer&quot;, true, 5);&lt;/script&gt;">
+ </html>
+ <copyFile
+ from="platform:/plugin/org.eclipse.papyrus.uml.export/resources/js/simpletreemenu.js"
+ to="resources/js/simpletreemenu.js">
+ </copyFile>
+ </extension>
+ <extension
+ id="css.default"
+ name="Default css"
+ point="org.eclipse.papyrus.uml.export.generation">
+ <html
+ header="true"
+ priority="1"
+ text="&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;resources/css/simpletree.css&quot;/&gt;">
+ </html>
+ <copyFile
+ from="platform:/plugin/org.eclipse.papyrus.uml.export/resources/css/simpletree.css"
+ to="resources/css/simpletree.css">
+ </copyFile>
+ </extension>
+ <extension
+ id="doubleclick.hyperlink"
+ name="Hyperlink strategy"
+ point="org.eclipse.papyrus.uml.export.generation">
+ <annotation
+ annotation="org.eclipse.papyrus.uml.export.extension.contribution.HyperlinkAnnotateSVG">
+ </annotation>
+ <html
+ header="false"
+ priority="1"
+ text="&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot; src=&quot;resources/js/hyperlink.js&quot;&gt;&lt;/script&gt;">
+ </html>
+ <copyFile
+ from="platform:/plugin/org.eclipse.papyrus.uml.export/resources/js/hyperlink.js"
+ to="resources/js/hyperlink.js">
+ </copyFile>
+ </extension>
+ <extension
+ id="additional.information"
+ name="Additionnal Info"
+ point="org.eclipse.papyrus.uml.export.generation">
+ <additionnalInformation
+ data="org.eclipse.papyrus.uml.export.extension.contribution.IconpathAdditionalInformations"
+ key="iconpath">
+ </additionnalInformation>
+ <additionnalInformation
+ data="org.eclipse.papyrus.uml.export.extension.contribution.DiagramPathAdditionalInformations"
+ key="diagramPath">
+ </additionnalInformation>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ id="org.eclipse.papyrus.export.html.preferences"
+ category="org.eclipse.papyrus.infra.core.sasheditor.preferences.generalcategory"
+ class="org.eclipse.papyrus.uml.export.ui.HTMLExportPreferencesPage"
+ name="HTML Export">
+ </page>
+ </extension>
+ <extension
+ id="script.tree"
+ name="Split script"
+ point="org.eclipse.papyrus.uml.export.generation">
+ <html
+ header="true"
+ priority="1"
+ text="&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot; src=&quot;resources/js/split.min.js&quot;&gt;&lt;/script&gt;">
+ </html>
+ <html
+ header="false"
+ priority="1"
+ text="&lt;script&gt;Split([&apos;#diagram-explorer-div&apos;, &apos;#diagram-div&apos;], {sizes: [20, 80],minSize: 0,cursor: &apos;col-resize&apos;});&lt;/script&gt;">
+ </html>
+ <copyFile
+ from="platform:/plugin/org.eclipse.papyrus.uml.export/resources/js/split.min.js"
+ to="resources/js/split.min.js">
+ </copyFile>
+ </extension>
+
+
+</plugin>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/pom.xml b/plugins/uml/org.eclipse.papyrus.uml.export/pom.xml
new file mode 100644
index 00000000000..4d9899b18d7
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/pom.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.papyrus</groupId>
+ <artifactId>org.eclipse.papyrus.uml</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.papyrus.uml.export</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/resources/css/simpletree.css b/plugins/uml/org.eclipse.papyrus.uml.export/resources/css/simpletree.css
new file mode 100644
index 00000000000..0e945e43ab9
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/resources/css/simpletree.css
@@ -0,0 +1,88 @@
+/* IE 11 hack to avoid overflow */
+@media all and (-ms-high-contrast:none)
+{
+ *::-ms-backdrop, object { height: 80% } / IE11 */
+}
+
+.diagram-explorer-div{
+ float:left;
+ width: 20%;
+}
+
+.diagram-div{
+ float:right;
+ width: 80%;
+}
+
+.html-editor{
+ width: 100%;
+}
+
+ul {
+ list-style-type: none;
+ margin: 0;
+}
+
+li {
+ list-style-type: none;
+ white-space: nowrap;
+}
+
+.diagram-explorer ul{ /*CSS for Simple Tree Menu*/
+ margin: 0;
+ padding: 0;
+}
+
+.diagram-explorer li{ /*Style for LI elements in general (excludes an LI that contains sub lists)*/
+ background: white url(../icons/list.gif) no-repeat left center;
+ list-style-type: none;
+ padding-left: 22px;
+ margin-bottom: 3px;
+}
+
+.diagram-explorer li.submenu{ /* Style for LI that contains sub lists (other ULs). */
+ background: white url(../icons/closed.gif) no-repeat left 1px;
+ cursor: hand !important;
+ cursor: pointer !important;
+}
+
+
+.diagram-explorer li.submenu ul{ /*Style for ULs that are children of LIs (submenu) */
+ display: none; /*Hide them by default. Don't delete. */
+}
+
+.diagram-explorer .submenu ul li{ /*Style for LIs of ULs that are children of LIs (submenu) */
+ cursor: default;
+}
+
+
+.api {
+ height: 750px;
+ border: 1px solid #ddd;
+ border-radius: 4px;
+}
+
+.split p {
+ padding: 5px;
+}
+
+.split {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+
+.gutter {
+ background-color: #eee;
+ background-repeat: no-repeat;
+ background-position: 50%;
+}
+
+.split.split-horizontal, .gutter.gutter-horizontal {
+ height: 100%;
+ float: left;
+}
+
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/resources/icons/exportAll.png b/plugins/uml/org.eclipse.papyrus.uml.export/resources/icons/exportAll.png
new file mode 100644
index 00000000000..2b3bf74e8df
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/resources/icons/exportAll.png
Binary files differ
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/resources/icons/export_wiz_16x16-papyrusColor.gif b/plugins/uml/org.eclipse.papyrus.uml.export/resources/icons/export_wiz_16x16-papyrusColor.gif
new file mode 100644
index 00000000000..9b4b9015f01
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/resources/icons/export_wiz_16x16-papyrusColor.gif
Binary files differ
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/resources/js/hyperlink.js b/plugins/uml/org.eclipse.papyrus.uml.export/resources/js/hyperlink.js
new file mode 100644
index 00000000000..db7c31aebfc
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/resources/js/hyperlink.js
@@ -0,0 +1,9 @@
+// Eclipse Public License Copyright (c) 2017 CEA LIST
+// use to interpret Papyrus hyperlinks
+
+function displayMessage (evt) { changeDiagram(evt.data);}
+if (window.addEventListener) {
+ window.addEventListener("message", displayMessage, false);
+}else {
+ window.attachEvent("onmessage", displayMessage);
+} \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/resources/js/script.js b/plugins/uml/org.eclipse.papyrus.uml.export/resources/js/script.js
new file mode 100644
index 00000000000..6e234707ead
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/resources/js/script.js
@@ -0,0 +1,36 @@
+// Eclipse Public License Copyright (c) 2017 CEA LIST
+
+
+var changeDiagram = function(value) {
+ document.getElementById("diagram").data = value;
+};
+
+
+var displayJson = function(value) {
+var res = "";
+if (value){
+ res = res +"<li"
+ if (value.id){
+ res = res + " id="+value.id;
+ }
+ res = res + ">"
+ if (value.additionalInformations.iconpath){
+ res = res + "<img src='icons/"+value.additionalInformations.iconpath+"'/>";
+ }
+ if (value.additionalInformations.diagramPath) {
+ res = res + "<a onclick=\"changeDiagram('"+value.additionalInformations.diagramPath+"')\">"+ value.text+"</a>";
+ }else {
+ res = res + value.text;
+ }
+
+ if (value.childs && value.childs.length > 0){
+ res = res + "<ul>"
+ for (var i = 0; i < value.childs.length ; i++) {
+ res = res + displayJson(value.childs[i])
+ }
+ res = res + "</ul>"
+ }
+ return res+"</li>";
+}
+return "novalue";
+}; \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/resources/js/simpletreemenu.js b/plugins/uml/org.eclipse.papyrus.uml.export/resources/js/simpletreemenu.js
new file mode 100644
index 00000000000..8fb6f2e3952
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/resources/js/simpletreemenu.js
@@ -0,0 +1,139 @@
+/***********************************************
+* Dynamic Countdown script- � Dynamic Drive (http://www.dynamicdrive.com)
+* This notice MUST stay intact for legal use
+* Visit http://www.dynamicdrive.com/ for this script and 100s more.
+***********************************************/
+
+var persisteduls=new Object()
+var ddtreemenu=new Object()
+
+//ddtreemenu.closefolder="icons/closed.gif" //set image path to "closed" folder image
+//ddtreemenu.openfolder="icons/open.gif" //set image path to "open" folder image
+
+//////////No need to edit beyond here///////////////////////////
+
+ddtreemenu.createTree=function(treeid, enablepersist, persistdays){
+var ultags=document.getElementById(treeid).getElementsByTagName("ul")
+if (typeof persisteduls[treeid]=="undefined")
+persisteduls[treeid]=(enablepersist==true && ddtreemenu.getCookie(treeid)!="")? ddtreemenu.getCookie(treeid).split(",") : ""
+for (var i=0; i<ultags.length; i++)
+ddtreemenu.buildSubTree(treeid, ultags[i], i)
+if (enablepersist==true){ //if enable persist feature
+var durationdays=(typeof persistdays=="undefined")? 1 : parseInt(persistdays)
+ddtreemenu.dotask(window, function(){ddtreemenu.rememberstate(treeid, durationdays)}, "unload") //save opened UL indexes on body unload
+}
+}
+
+ddtreemenu.buildSubTree=function(treeid, ulelement, index){
+ulelement.parentNode.className="submenu"
+if (typeof persisteduls[treeid]=="object"){ //if cookie exists (persisteduls[treeid] is an array versus "" string)
+if (ddtreemenu.searcharray(persisteduls[treeid], index)){
+ulelement.setAttribute("rel", "open")
+ulelement.style.display="block"
+ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
+}
+else
+ulelement.setAttribute("rel", "closed")
+} //end cookie persist code
+else if (ulelement.getAttribute("rel")==null || ulelement.getAttribute("rel")==false) //if no cookie and UL has NO rel attribute explicted added by user
+ulelement.setAttribute("rel", "closed")
+else if (ulelement.getAttribute("rel")=="open") //else if no cookie and this UL has an explicit rel value of "open"
+ddtreemenu.expandSubTree(treeid, ulelement) //expand this UL plus all parent ULs (so the most inner UL is revealed!)
+ulelement.parentNode.onclick=function(e){
+var submenu=this.getElementsByTagName("ul")[0]
+if (submenu.getAttribute("rel")=="closed"){
+submenu.style.display="block"
+submenu.setAttribute("rel", "open")
+ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
+}
+else if (submenu.getAttribute("rel")=="open"){
+submenu.style.display="none"
+submenu.setAttribute("rel", "closed")
+ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.closefolder+")"
+}
+ddtreemenu.preventpropagate(e)
+}
+ulelement.onclick=function(e){
+ddtreemenu.preventpropagate(e)
+}
+}
+
+ddtreemenu.expandSubTree=function(treeid, ulelement){ //expand a UL element and any of its parent ULs
+var rootnode=document.getElementById(treeid)
+var currentnode=ulelement
+currentnode.style.display="block"
+currentnode.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
+while (currentnode!=rootnode){
+if (currentnode.tagName=="UL"){ //if parent node is a UL, expand it too
+currentnode.style.display="block"
+currentnode.setAttribute("rel", "open") //indicate it's open
+currentnode.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
+}
+currentnode=currentnode.parentNode
+}
+}
+
+ddtreemenu.flatten=function(treeid, action){ //expand or contract all UL elements
+var ultags=document.getElementById(treeid).getElementsByTagName("ul")
+for (var i=0; i<ultags.length; i++){
+ultags[i].style.display=(action=="expand")? "block" : "none"
+var relvalue=(action=="expand")? "open" : "closed"
+ultags[i].setAttribute("rel", relvalue)
+ultags[i].parentNode.style.backgroundImage=(action=="expand")? "url("+ddtreemenu.openfolder+")" : "url("+ddtreemenu.closefolder+")"
+}
+}
+
+ddtreemenu.rememberstate=function(treeid, durationdays){ //store index of opened ULs relative to other ULs in Tree into cookie
+var ultags=document.getElementById(treeid).getElementsByTagName("ul")
+var openuls=new Array()
+for (var i=0; i<ultags.length; i++){
+if (ultags[i].getAttribute("rel")=="open")
+openuls[openuls.length]=i //save the index of the opened UL (relative to the entire list of ULs) as an array element
+}
+if (openuls.length==0) //if there are no opened ULs to save/persist
+openuls[0]="none open" //set array value to string to simply indicate all ULs should persist with state being closed
+ddtreemenu.setCookie(treeid, openuls.join(","), durationdays) //populate cookie with value treeid=1,2,3 etc (where 1,2... are the indexes of the opened ULs)
+}
+
+////A few utility functions below//////////////////////
+
+ddtreemenu.getCookie=function(Name){ //get cookie value
+var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
+if (document.cookie.match(re)) //if cookie found
+return document.cookie.match(re)[0].split("=")[1] //return its value
+return ""
+}
+
+ddtreemenu.setCookie=function(name, value, days){ //set cookei value
+var expireDate = new Date()
+//set "expstring" to either future or past date, to set or delete cookie, respectively
+var expstring=expireDate.setDate(expireDate.getDate()+parseInt(days))
+document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";
+}
+
+ddtreemenu.searcharray=function(thearray, value){ //searches an array for the entered value. If found, delete value from array
+var isfound=false
+for (var i=0; i<thearray.length; i++){
+if (thearray[i]==value){
+isfound=true
+thearray.shift() //delete this element from array for efficiency sake
+break
+}
+}
+return isfound
+}
+
+ddtreemenu.preventpropagate=function(e){ //prevent action from bubbling upwards
+if (typeof e!="undefined")
+e.stopPropagation()
+else
+event.cancelBubble=true
+}
+
+ddtreemenu.dotask=function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
+var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
+if (target.addEventListener)
+target.addEventListener(tasktype, functionref, false)
+else if (target.attachEvent)
+target.attachEvent(tasktype, functionref)
+} \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/resources/js/split.min.js b/plugins/uml/org.eclipse.papyrus.uml.export/resources/js/split.min.js
new file mode 100644
index 00000000000..652da169283
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/resources/js/split.min.js
@@ -0,0 +1,2 @@
+/*! Split.js - v1.3.5 */
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Split=t()}(this,function(){"use strict";var e=window,t=e.document,n="addEventListener",i="removeEventListener",r="getBoundingClientRect",s=function(){return!1},o=e.attachEvent&&!e[n],a=["","-webkit-","-moz-","-o-"].filter(function(e){var n=t.createElement("div");return n.style.cssText="width:"+e+"calc(9px)",!!n.style.length}).shift()+"calc",l=function(e){return"string"==typeof e||e instanceof String?t.querySelector(e):e};return function(u,c){function z(e,t,n){var i=A(y,t,n);Object.keys(i).forEach(function(t){return e.style[t]=i[t]})}function h(e,t){var n=B(y,t);Object.keys(n).forEach(function(t){return e.style[t]=n[t]})}function f(e){var t=E[this.a],n=E[this.b],i=t.size+n.size;t.size=e/this.size*i,n.size=i-e/this.size*i,z(t.element,t.size,this.aGutterSize),z(n.element,n.size,this.bGutterSize)}function m(e){var t;this.dragging&&((t="touches"in e?e.touches[0][b]-this.start:e[b]-this.start)<=E[this.a].minSize+M+this.aGutterSize?t=E[this.a].minSize+this.aGutterSize:t>=this.size-(E[this.b].minSize+M+this.bGutterSize)&&(t=this.size-(E[this.b].minSize+this.bGutterSize)),f.call(this,t),c.onDrag&&c.onDrag())}function g(){var e=E[this.a].element,t=E[this.b].element;this.size=e[r]()[y]+t[r]()[y]+this.aGutterSize+this.bGutterSize,this.start=e[r]()[G]}function d(){var t=this,n=E[t.a].element,r=E[t.b].element;t.dragging&&c.onDragEnd&&c.onDragEnd(),t.dragging=!1,e[i]("mouseup",t.stop),e[i]("touchend",t.stop),e[i]("touchcancel",t.stop),t.parent[i]("mousemove",t.move),t.parent[i]("touchmove",t.move),delete t.stop,delete t.move,n[i]("selectstart",s),n[i]("dragstart",s),r[i]("selectstart",s),r[i]("dragstart",s),n.style.userSelect="",n.style.webkitUserSelect="",n.style.MozUserSelect="",n.style.pointerEvents="",r.style.userSelect="",r.style.webkitUserSelect="",r.style.MozUserSelect="",r.style.pointerEvents="",t.gutter.style.cursor="",t.parent.style.cursor=""}function S(t){var i=this,r=E[i.a].element,o=E[i.b].element;!i.dragging&&c.onDragStart&&c.onDragStart(),t.preventDefault(),i.dragging=!0,i.move=m.bind(i),i.stop=d.bind(i),e[n]("mouseup",i.stop),e[n]("touchend",i.stop),e[n]("touchcancel",i.stop),i.parent[n]("mousemove",i.move),i.parent[n]("touchmove",i.move),r[n]("selectstart",s),r[n]("dragstart",s),o[n]("selectstart",s),o[n]("dragstart",s),r.style.userSelect="none",r.style.webkitUserSelect="none",r.style.MozUserSelect="none",r.style.pointerEvents="none",o.style.userSelect="none",o.style.webkitUserSelect="none",o.style.MozUserSelect="none",o.style.pointerEvents="none",i.gutter.style.cursor=j,i.parent.style.cursor=j,g.call(i)}function v(e){e.forEach(function(t,n){if(n>0){var i=F[n-1],r=E[i.a],s=E[i.b];r.size=e[n-1],s.size=t,z(r.element,r.size,i.aGutterSize),z(s.element,s.size,i.bGutterSize)}})}function p(){F.forEach(function(e){e.parent.removeChild(e.gutter),E[e.a].element.style[y]="",E[e.b].element.style[y]=""})}void 0===c&&(c={});var y,b,G,E,w=l(u[0]).parentNode,D=e.getComputedStyle(w).flexDirection,U=c.sizes||u.map(function(){return 100/u.length}),k=void 0!==c.minSize?c.minSize:100,x=Array.isArray(k)?k:u.map(function(){return k}),L=void 0!==c.gutterSize?c.gutterSize:10,M=void 0!==c.snapOffset?c.snapOffset:30,O=c.direction||"horizontal",j=c.cursor||("horizontal"===O?"ew-resize":"ns-resize"),C=c.gutter||function(e,n){var i=t.createElement("div");return i.className="gutter gutter-"+n,i},A=c.elementStyle||function(e,t,n){var i={};return"string"==typeof t||t instanceof String?i[e]=t:i[e]=o?t+"%":a+"("+t+"% - "+n+"px)",i},B=c.gutterStyle||function(e,t){return n={},n[e]=t+"px",n;var n};"horizontal"===O?(y="width","clientWidth",b="clientX",G="left","paddingLeft"):"vertical"===O&&(y="height","clientHeight",b="clientY",G="top","paddingTop");var F=[];return E=u.map(function(e,t){var i,s={element:l(e),size:U[t],minSize:x[t]};if(t>0&&(i={a:t-1,b:t,dragging:!1,isFirst:1===t,isLast:t===u.length-1,direction:O,parent:w},i.aGutterSize=L,i.bGutterSize=L,i.isFirst&&(i.aGutterSize=L/2),i.isLast&&(i.bGutterSize=L/2),"row-reverse"===D||"column-reverse"===D)){var a=i.a;i.a=i.b,i.b=a}if(!o&&t>0){var c=C(t,O);h(c,L),c[n]("mousedown",S.bind(i)),c[n]("touchstart",S.bind(i)),w.insertBefore(c,s.element),i.gutter=c}0===t||t===u.length-1?z(s.element,s.size,L/2):z(s.element,s.size,L);var f=s.element[r]()[y];return f<s.minSize&&(s.minSize=f),t>0&&F.push(i),s}),o?{setSizes:v,destroy:p}:{setSizes:v,getSizes:function(){return E.map(function(e){return e.size})},collapse:function(e){if(e===F.length){var t=F[e-1];g.call(t),o||f.call(t,t.size-t.bGutterSize)}else{var n=F[e];g.call(n),o||f.call(n,n.aGutterSize)}},destroy:p}}});
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/resources/schema/generation.exsd b/plugins/uml/org.eclipse.papyrus.uml.export/resources/schema/generation.exsd
new file mode 100644
index 00000000000..93063be1a76
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/resources/schema/generation.exsd
@@ -0,0 +1,223 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.papyrus.uml.export" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.papyrus.uml.export" id="org.eclipse.papyrus.uml.export.generation" name="Annotate Generation"/>
+ </appinfo>
+ <documentation>
+ This extension point is used to enhance html export.
+
+You can add :
+ - new script and css
+ - additionnal datas in the generated json
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="annotation" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="additionnalInformation" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="html" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="copyFile" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="annotation">
+ <annotation>
+ <documentation>
+ annotation
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="annotation" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.uml.export.extension.AnnotateSVG"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="additionnalInformation">
+ <complexType>
+ <attribute name="key" type="string" use="required">
+ <annotation>
+ <documentation>
+ key to store the info (don&apos;&apos;t reuse the official ones)
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="data" type="string" use="required">
+ <annotation>
+ <documentation>
+ Fonctioanl instarfet to get the data from an object (in most of the case will be a Diagram)
+
+The data will ba available in the json tree representing the &quot;model explorer &quot; in the html file.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.uml.export.extension.AdditionalInformations"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="html">
+ <complexType>
+ <attribute name="header" type="boolean" use="default" value="true">
+ <annotation>
+ <documentation>
+ by default will be place in html header
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="priority" type="string">
+ <annotation>
+ <documentation>
+ integer to order the injection
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="text" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="copyFile">
+ <complexType>
+ <attribute name="from" type="string">
+ <annotation>
+ <documentation>
+ platform path
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="to" type="string">
+ <annotation>
+ <documentation>
+ relative path from target directory
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ Papyrus 3.3.0 (plugin version 1.0.0)
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ Inject the default script in index.html and copy the file:
+(id is mandatory)
+
+&lt;extension
+ id=&quot;script.default&quot;
+ name=&quot;Default script&quot;
+ point=&quot;org.eclipse.papyrus.uml.export.generation&quot;&gt;
+ &lt;html
+ header=&quot;true&quot;
+ priority=&quot;1&quot;
+ text=&quot;&amp;lt;script language=&amp;quot;JavaScript&amp;quot; type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;script.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&quot;&gt;
+ &lt;/html&gt;
+ &lt;copyFile
+ from=&quot;platform:/plugin/org.eclipse.papyrus.uml.export/resources/script.js&quot;
+ to=&quot;script.js&quot;&gt;
+ &lt;/copyFile&gt;
+&lt;/extension&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ The id for extansion is mandatory since it&apos;s used in preference page
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ Check org.eclipse.papyrus.uml.export/plugins.xml
+and following classes:
+
+org.eclipse.papyrus.uml.export.extension.contribution.CommentAnnotateSVG.java
+org.eclipse.papyrus.uml.export.extension.contribution.DiagramPathAdditionalInformations.java
+org.eclipse.papyrus.uml.export.extension.contribution.HyperlinkAnnotateSVG.java
+org.eclipse.papyrus.uml.export.extension.contribution.IconpathAdditionalInformations.java
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ /*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/Activator.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/Activator.java
new file mode 100644
index 00000000000..e29b66a7d2b
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/Activator.java
@@ -0,0 +1,120 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle.
+ */
+public class Activator extends AbstractUIPlugin {
+
+ /** The Constant PLUGIN_ID. */
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.export"; //$NON-NLS-1$
+
+ /** The plugin. */
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor.
+ */
+ public Activator() {
+ }
+
+ /**
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ *
+ * @param context
+ * @throws Exception
+ */
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.
+ * BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /**
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ *
+ * @param context
+ * @throws Exception
+ */
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance.
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Log the status.
+ *
+ * @param status the status
+ */
+ public static void log(IStatus status) {
+ Activator.getDefault().getLog().log(status);
+ }
+
+ /**
+ * Log the message.
+ *
+ * @param severity the severity
+ * @param message the message
+ */
+ public static void log(int severity, String message) {
+ log(new Status(severity, PLUGIN_ID, message));
+ }
+
+ /**
+ * Log the exception.
+ *
+ * @param throwable the throwable
+ */
+ public static void log(Throwable throwable) {
+ log(new Status(IStatus.ERROR, PLUGIN_ID, "An exception occured", throwable)); //$NON-NLS-1$
+ }
+
+ /**
+ * Debug.
+ *
+ * @param message the message
+ */
+ public static void debug(String message) {
+ log(new Status(IStatus.INFO, PLUGIN_ID, message));
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/HTMLExportHelper.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/HTMLExportHelper.java
new file mode 100644
index 00000000000..5663f0e23bd
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/HTMLExportHelper.java
@@ -0,0 +1,111 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.papyrus.uml.export.extension.AdditionalInformations;
+import org.eclipse.papyrus.uml.export.extension.AnnotateSVG;
+
+/**
+ * The Class HTMLExportHelper.
+ */
+public class HTMLExportHelper {
+
+ /** The annotations. */
+ private List<AnnotateSVG> annotations = new ArrayList<>();
+
+ /** The additionnal datas. */
+ private Map<String, AdditionalInformations> additionnalDatas = new HashMap<>();
+
+ /** The headers. */
+ private List<String> headers = new ArrayList<>();
+
+ /** The footers. */
+ private List<String> footers = new ArrayList<>();
+
+ /** The from TO. */
+ private Map<String, String> fromTO = new HashMap<>();
+
+ /**
+ * Gets the annotations.
+ *
+ * @return the annotations
+ */
+ public List<AnnotateSVG> getAnnotations() {
+ return annotations;
+ }
+
+ /**
+ * Gets the additionnal datas.
+ *
+ * @return the additionnal datas
+ */
+ public Map<String, AdditionalInformations> getAdditionnalDatas() {
+ return additionnalDatas;
+ }
+
+ /**
+ * Gets the headers.
+ *
+ * @return the headers
+ */
+ public List<String> getHeaders() {
+ return headers;
+ }
+
+ /**
+ * Gets the footers.
+ *
+ * @return the footers
+ */
+ public List<String> getFooters() {
+ return footers;
+ }
+
+ /**
+ * Gets the from TO.
+ *
+ * @return the from TO
+ */
+ public Map<String, String> getFromTO() {
+ return fromTO;
+ }
+
+
+ /**
+ * Instantiates a new HTML export helper.
+ */
+ public HTMLExportHelper() {}
+
+ /**
+ * Instantiates a new HTML export helper.
+ *
+ * @param annotations the annotations
+ * @param additionnalDatas the additionnal datas
+ * @param headers the headers
+ * @param footers the footers
+ * @param fromTO the from TO
+ */
+ public HTMLExportHelper(List<AnnotateSVG> annotations, Map<String, AdditionalInformations> additionnalDatas,
+ List<String> headers, List<String> footers, Map<String, String> fromTO) {
+ this.annotations = annotations;
+ this.additionnalDatas = additionnalDatas;
+ this.headers = headers;
+ this.footers = footers;
+ this.fromTO = fromTO;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/HTMLExportRunner.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/HTMLExportRunner.java
new file mode 100644
index 00000000000..636ce50ca07
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/HTMLExportRunner.java
@@ -0,0 +1,93 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map.Entry;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.uml.export.tree.UMLTreeFactory;
+import org.eclipse.papyrus.uml.export.util.FileUtil;
+import org.eclipse.papyrus.uml.export.util.IconHelper;
+import org.eclipse.papyrus.uml.export.util.ImageUtil;
+import org.eclipse.papyrus.uml.export.util.IndexHelper;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+
+/**
+ * The Class HTMLExportRunner.
+ */
+public class HTMLExportRunner {
+
+ /** The Constant ICONS_DIRECTORY. */
+ private static final String ICONS_DIRECTORY = "icons";
+
+ /**
+ * Generate html web site.
+ *
+ * @param targetDirectoryPath the target directory path
+ * @param allDiagrams the all diagrams
+ * @param helper the helper
+ * @return the i path
+ */
+ public static IPath generateHtmlWebSite(Path targetDirectoryPath, List<Diagram> allDiagrams, HTMLExportHelper helper) {
+
+ // Generate all svg files
+ for (Diagram diagram : allDiagrams) {
+ ImageUtil.reFactoredgenerateImg(targetDirectoryPath, diagram, helper.getAnnotations());
+ }
+
+ // generate json tree of diagrams
+ Gson gson = new GsonBuilder().setPrettyPrinting().create();
+
+ UMLTreeFactory diagramExplorer = new UMLTreeFactory(helper.getAdditionnalDatas());
+ for (Diagram diagram : allDiagrams) {
+ diagramExplorer.addDiagram(diagram);
+ }
+
+ IPath append = targetDirectoryPath.append("index.html");
+ File file = append.toFile();
+ try {
+ BufferedWriter out = new BufferedWriter(new FileWriter(file));
+ IndexHelper indexHelper = new IndexHelper(helper.getHeaders(),helper.getFooters());
+ out.write(indexHelper.getIndex(gson.toJsonTree(diagramExplorer.getTree()).toString()));
+ out.close();
+ }
+ catch (IOException e)
+ {
+ Activator.log(e);
+ }
+
+ for (Entry<String, String> entry : helper.getFromTO().entrySet()) {
+ FileUtil.copyFileFromPlatform(targetDirectoryPath,entry.getValue(), entry.getKey());
+ }
+
+ IPath iconDirPath = targetDirectoryPath.append(ICONS_DIRECTORY);
+ File iconDir = iconDirPath.toFile();
+ if (!iconDir.exists()) {
+ iconDir.mkdirs();
+ }
+
+ IconHelper.printIcon(iconDirPath);
+
+ return iconDirPath;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/AdditionalInformations.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/AdditionalInformations.java
new file mode 100644
index 00000000000..9e4e68b5aa5
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/AdditionalInformations.java
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.extension;
+
+
+/**
+ * The Interface AdditionalInformations.
+ */
+public interface AdditionalInformations {
+
+ /**
+ * Gets the data.
+ *
+ * @param object the object
+ * @return the data
+ */
+ // key in extension point
+ String getData(Object object);
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/AnnotateSVG.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/AnnotateSVG.java
new file mode 100644
index 00000000000..3578d62c201
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/AnnotateSVG.java
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.extension;
+
+import org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.export.GraphicsSVG;
+import org.eclipse.gmf.runtime.notation.View;
+import org.w3c.dom.Element;
+
+
+/**
+ * The Interface AnnotateSVG.
+ */
+public interface AnnotateSVG {
+
+ /**
+ * Adds the annotation.
+ *
+ * @param view the view
+ * @param svgG the svg G
+ * @param rectangle the rectangle
+ * @return true, if successful
+ */
+ boolean addAnnotation(View view, GraphicsSVG svgG, Element rectangle);
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/HTMLExtensionRegistry.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/HTMLExtensionRegistry.java
new file mode 100644
index 00000000000..9caa550a445
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/HTMLExtensionRegistry.java
@@ -0,0 +1,167 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.extension;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.papyrus.uml.export.Activator;
+import org.eclipse.papyrus.uml.export.HTMLExportHelper;
+
+
+/**
+ * The Class HTMLExtensionRegistry.
+ */
+public class HTMLExtensionRegistry {
+
+ /** The Constant ORG_ECLIPSE_PAPYRUS_EXPORT_HTML_GENERATE. */
+ private static final String ORG_ECLIPSE_PAPYRUS_EXPORT_HTML_GENERATE = "org.eclipse.papyrus.uml.export.generation"; //$NON-NLS-1$
+
+ /** The Constant ANNOTATION. */
+ // keys for exploiting extension point
+ private static final String ANNOTATION = "annotation"; //$NON-NLS-1$
+
+ /** The Constant ADDITIONNAL_INFO. */
+ private static final String ADDITIONNAL_INFO = "additionnalInformation"; //$NON-NLS-1$
+
+ /** The Constant DATA. */
+ private static final String DATA = "data";//$NON-NLS-1$
+
+ /** The Constant KEY. */
+ private static final String KEY = "key";//$NON-NLS-1$
+
+ /** The Constant HTML. */
+ private static final String HTML = "html";//$NON-NLS-1$
+
+ /** The Constant HEADER. */
+ private static final String HEADER = "header";//$NON-NLS-1$
+
+ /** The Constant TXT. */
+ private static final String TXT = "text";//$NON-NLS-1$
+
+ /** The Constant COPYFILE. */
+ private static final String COPYFILE = "copyFile";//$NON-NLS-1$
+
+ /** The Constant FROM. */
+ private static final String FROM = "from";//$NON-NLS-1$
+
+ /** The Constant TO. */
+ private static final String TO = "to";//$NON-NLS-1$
+
+ /** The instance. */
+ private static HTMLExtensionRegistry instance;
+
+ /**
+ * Instantiates a new HTML extension registry.
+ */
+ private HTMLExtensionRegistry() {
+ }
+
+ /**
+ * Gets the single instance of HTMLExtensionRegistry.
+ *
+ * @return single instance of HTMLExtensionRegistry
+ */
+ public static HTMLExtensionRegistry getInstance() {
+ if (instance == null) {
+ instance = new HTMLExtensionRegistry();
+ }
+ return instance;
+ }
+
+ /**
+ * Gets the all extension.
+ *
+ * @return the all extension
+ */
+ public List<IExtension> getAllExtension() {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtension[] extensions = registry.getExtensionPoint(ORG_ECLIPSE_PAPYRUS_EXPORT_HTML_GENERATE).getExtensions();
+ return Arrays.asList(extensions);
+ }
+
+ /**
+ * Gets the helper from prefs.
+ *
+ * @param activatePref the activate pref
+ * @return the helper from prefs
+ */
+ public static HTMLExportHelper getHelperFromPrefs(List<String> activatePref) {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint extensionPoint = registry.getExtensionPoint(ORG_ECLIPSE_PAPYRUS_EXPORT_HTML_GENERATE);
+ IExtension[] extensions = extensionPoint.getExtensions();
+
+ HTMLExportHelper helper = new HTMLExportHelper();
+ for (int i = 0; i < extensions.length; i++) {
+ String simpleIdentifier = extensions[i].getUniqueIdentifier();
+ if (activatePref.contains(simpleIdentifier)) {
+ IConfigurationElement[] configurationElements = extensions[i].getConfigurationElements();
+ for (int j = 0; j < configurationElements.length; j++) {
+ readExtension(configurationElements[j], helper);
+ }
+ }
+
+ }
+ return helper;
+ }
+
+
+ /**
+ * Read extension.
+ *
+ * @param configurationElementsFor the configuration elements for
+ * @param helper the helper
+ */
+ private static void readExtension(IConfigurationElement configurationElementsFor, HTMLExportHelper helper) {
+ String name = configurationElementsFor.getName();
+ try {
+ if (ANNOTATION.equals(name)) {
+ AnnotateSVG createExecutableExtension = (AnnotateSVG) configurationElementsFor
+ .createExecutableExtension(ANNOTATION);
+ helper.getAnnotations().add(createExecutableExtension);
+ }
+
+ if (ADDITIONNAL_INFO.equals(name)) {
+ AdditionalInformations createExecutableExtensionAdditionalInformations = (AdditionalInformations) configurationElementsFor
+ .createExecutableExtension(DATA);
+ String attribute = configurationElementsFor.getAttribute(KEY);
+ helper.getAdditionnalDatas().put(attribute, createExecutableExtensionAdditionalInformations);
+ }
+
+ if (HTML.equals(name)) {
+ String headerD = configurationElementsFor.getAttribute(HEADER);
+ String attribute = configurationElementsFor.getAttribute(TXT);
+ if (Boolean.parseBoolean(headerD)) {
+ helper.getHeaders().add(attribute);
+ } else {
+ helper.getFooters().add(attribute);
+ }
+ }
+
+ if (COPYFILE.equals(name)) {
+ String from = configurationElementsFor.getAttribute(FROM);
+ String to = configurationElementsFor.getAttribute(TO);
+ helper.getFromTO().put(from, to);
+ }
+
+ } catch (CoreException e) {
+ Activator.log(e);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/CommentAnnotateSVG.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/CommentAnnotateSVG.java
new file mode 100644
index 00000000000..5dc0858c082
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/CommentAnnotateSVG.java
@@ -0,0 +1,62 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.extension.contribution;
+
+import org.apache.batik.dom.svg.SVGDOMImplementation;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.export.GraphicsSVG;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.export.extension.AnnotateSVG;
+import org.eclipse.uml2.uml.Comment;
+import org.eclipse.uml2.uml.NamedElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Text;
+
+
+
+/**
+ * The Class CommentAnnotateSVG.
+ */
+public class CommentAnnotateSVG implements AnnotateSVG {
+
+ /** The Constant ATTRIBUTE_TITLE. */
+ // W3C title attribute
+ private static final String ATTRIBUTE_TITLE = "title";//$NON-NLS-1$
+
+ /**
+ * @see org.eclipse.papyrus.uml.export.extension.AnnotateSVG#addAnnotation(org.eclipse.gmf.runtime.notation.View, org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.export.GraphicsSVG, org.w3c.dom.Element)
+ *
+ * @param view
+ * @param svgG
+ * @param rectangle
+ * @return
+ */
+ @Override
+ public boolean addAnnotation(View view, GraphicsSVG svgG, Element rectangle) {
+ EObject eObject = view.getElement();
+ if (eObject instanceof NamedElement) {
+ NamedElement namedElement = (NamedElement) eObject;
+ EList<Comment> ownedComments = namedElement.getOwnedComments();
+ if (!ownedComments.isEmpty()) {
+ rectangle.setAttributeNS(null, ATTRIBUTE_TITLE, ownedComments.get(0).getBody());
+ Element title = svgG.getDocument().createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI, ATTRIBUTE_TITLE);
+ Text comment = svgG.getDocument().createTextNode(ownedComments.get(0).getBody());
+ title.appendChild(comment);
+ rectangle.appendChild(title);
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/DiagramPathAdditionalInformations.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/DiagramPathAdditionalInformations.java
new file mode 100644
index 00000000000..bbd485c04d6
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/DiagramPathAdditionalInformations.java
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.extension.contribution;
+
+import org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.uml.export.extension.AdditionalInformations;
+import org.eclipse.papyrus.uml.export.util.HTMLUtil;
+
+
+/**
+ * The Class DiagramPathAdditionalInformations.
+ */
+public class DiagramPathAdditionalInformations implements AdditionalInformations {
+
+ /**
+ * @see org.eclipse.papyrus.uml.export.extension.AdditionalInformations#getData(java.lang.Object)
+ *
+ * @param object
+ * @return
+ */
+ @Override
+ public String getData(Object object) {
+ if (object instanceof Diagram) {
+ Diagram diagram = (Diagram) object;
+ return HTMLUtil.diagramRelativPath(diagram)+"."+ImageFileFormat.SVG.toString(); //$NON-NLS-1$
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/HyperlinkAnnotateSVG.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/HyperlinkAnnotateSVG.java
new file mode 100644
index 00000000000..34e3b1426a4
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/HyperlinkAnnotateSVG.java
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.extension.contribution;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat;
+import org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.export.GraphicsSVG;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.export.extension.AnnotateSVG;
+import org.eclipse.papyrus.uml.export.util.HTMLUtil;
+import org.w3c.dom.Element;
+
+
+/**
+ * The Class HyperlinkAnnotateSVG.
+ */
+public class HyperlinkAnnotateSVG implements AnnotateSVG {
+
+ /** The Constant IS_DEFAULT_NAVIGATION. */
+ private static final String IS_DEFAULT_NAVIGATION = "is_default_navigation";//$NON-NLS-1$
+
+ /** The Constant PAPYRUS_HYPER_LINK_PAGE. */
+ private static final String PAPYRUS_HYPER_LINK_PAGE = "PapyrusHyperLink_Page";//$NON-NLS-1$
+
+ /**
+ * @see org.eclipse.papyrus.uml.export.extension.AnnotateSVG#addAnnotation(org.eclipse.gmf.runtime.notation.View, org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.export.GraphicsSVG, org.w3c.dom.Element)
+ *
+ * @param view
+ * @param svgG
+ * @param rectangle
+ * @return
+ */
+ @Override
+ public boolean addAnnotation(View view, GraphicsSVG svgG, Element rectangle) {
+ EAnnotation eAnnotation = view.getEAnnotation(PAPYRUS_HYPER_LINK_PAGE);
+ if (eAnnotation != null) {
+ String string = eAnnotation.getDetails().get(IS_DEFAULT_NAVIGATION);
+ if (Boolean.parseBoolean(string)) { // default
+ EList<EObject> references = eAnnotation.getReferences();
+ if (!references.isEmpty()) {
+ EObject eObject = references.get(0);
+ if (eObject instanceof Diagram) {
+ Diagram diagram = (Diagram) eObject;
+ String diagramRelativPath = HTMLUtil.diagramRelativPath(diagram) + "."+ImageFileFormat.SVG.toString();//$NON-NLS-1$
+ rectangle.setAttributeNS(null, "onclick","window.parent.postMessage('" + diagramRelativPath + "','*');");//$NON-NLS-1$
+ return true;
+ }
+
+ }
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/IconpathAdditionalInformations.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/IconpathAdditionalInformations.java
new file mode 100644
index 00000000000..6ec14c63967
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/extension/contribution/IconpathAdditionalInformations.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.extension.contribution;
+
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.uml.export.extension.AdditionalInformations;
+import org.eclipse.papyrus.uml.export.util.IconHelper;
+import org.eclipse.uml2.uml.Element;
+
+
+/**
+ * The Class IconpathAdditionalInformations.
+ */
+public class IconpathAdditionalInformations implements AdditionalInformations {
+
+ /**
+ * @see org.eclipse.papyrus.uml.export.extension.AdditionalInformations#getData(java.lang.Object)
+ *
+ * @param object
+ * @return
+ */
+ @Override
+ public String getData(Object object) {
+ if (object instanceof Diagram ) {
+ Diagram diagram = (Diagram) object;
+ return IconHelper.getIconName(diagram);
+ } else if (object instanceof Element ) {
+ Element element = (Element) object;
+ return IconHelper.getIconName(element);
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/PapyrusCopyToImageUtil.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/PapyrusCopyToImageUtil.java
new file mode 100644
index 00000000000..2e585cf41b4
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/PapyrusCopyToImageUtil.java
@@ -0,0 +1,115 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.svgextension;
+
+import java.awt.image.BufferedImage;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat;
+import org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator;
+import org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramImageGenerator;
+import org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramSVGGenerator;
+import org.eclipse.gmf.runtime.diagram.ui.render.util.CopyToImageUtil;
+import org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.image.ImageExporter;
+import org.eclipse.papyrus.uml.export.extension.AnnotateSVG;
+
+/**
+ * The Class PapyrusCopyToImageUtil.
+ */
+public class PapyrusCopyToImageUtil extends CopyToImageUtil{
+
+ /** The annotations. */
+ private List<AnnotateSVG> annotations = new ArrayList<>();
+
+ /**
+ * Instantiates a new papyrus copy to image util.
+ *
+ * @param annotations the annotations
+ */
+ public PapyrusCopyToImageUtil(List<AnnotateSVG> annotations) {
+ this.annotations = annotations;
+ }
+
+
+
+ /**
+ * Creates the appropriate <code>DiagramGenerator</code> from <code>DiagramEditPart</code>
+ * based on the supplied <code>ImageFileFormat</code>.
+ *
+ * @param diagramEP diagram editpart
+ * @param format image file format
+ * @return appropriate diagram generator
+ */
+ @Override
+ protected DiagramGenerator getDiagramGenerator(DiagramEditPart diagramEP, ImageFileFormat format) {
+ if (format.equals(ImageFileFormat.SVG) || format.equals(ImageFileFormat.PDF)) {
+ return new PapyrusDiagramSVGGenerator(diagramEP, annotations);
+ } else {
+ return new DiagramImageGenerator(diagramEP);
+ }
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.ui.render.util.CopyToImageUtil#copyToImage(org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator, java.util.List, org.eclipse.swt.graphics.Rectangle, org.eclipse.core.runtime.IPath, org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat, org.eclipse.core.runtime.IProgressMonitor)
+ *
+ * @param gen
+ * @param editParts
+ * @param imageRect
+ * @param destination
+ * @param format
+ * @param monitor
+ * @throws CoreException
+ */
+ @Override
+ protected void copyToImage(DiagramGenerator gen, List editParts,
+ org.eclipse.swt.graphics.Rectangle imageRect, IPath destination,
+ ImageFileFormat format, IProgressMonitor monitor)
+ throws CoreException {
+ boolean found = false;
+ if (format.equals(ImageFileFormat.SVG)
+ || format.equals(ImageFileFormat.PDF)) {
+ ((PapyrusDiagramSVGGenerator)gen).openCreateSWTImageDescriptorForParts(editParts, imageRect);
+ monitor.worked(1);
+ saveToFile(destination, (DiagramSVGGenerator) gen, format, monitor);
+ found = true;
+ } else if (format.equals(ImageFileFormat.JPEG)
+ || format.equals(ImageFileFormat.PNG)) {
+
+ String exportFormat = ImageExporter.JPEG_FILE;
+ if (format.equals(ImageFileFormat.PNG))
+ exportFormat = ImageExporter.PNG_FILE;
+
+ java.awt.Image image = gen.createAWTImageForParts(editParts,
+ imageRect);
+ monitor.worked(1);
+ if (image instanceof BufferedImage) {
+ ImageExporter.exportToFile(destination, (BufferedImage) image,
+ exportFormat, monitor, format.getQuality());
+ found = true;
+ }
+ }
+
+ if (!found) {
+ org.eclipse.swt.graphics.Image image = gen.createSWTImageDescriptorForParts(editParts,
+ imageRect).createImage();
+ monitor.worked(1);
+ saveToFile(destination, image, format, monitor);
+ image.dispose();
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/PapyrusDiagramSVGGenerator.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/PapyrusDiagramSVGGenerator.java
new file mode 100644
index 00000000000..8cb9874148e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/PapyrusDiagramSVGGenerator.java
@@ -0,0 +1,273 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.svgextension;
+
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.batik.dom.svg.SVGDOMImplementation;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.common.core.util.Log;
+import org.eclipse.gmf.runtime.common.core.util.Trace;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.image.PartPositionInfo;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.SharedImages;
+import org.eclipse.gmf.runtime.diagram.ui.render.internal.DiagramUIRenderDebugOptions;
+import org.eclipse.gmf.runtime.diagram.ui.render.internal.DiagramUIRenderPlugin;
+import org.eclipse.gmf.runtime.draw2d.ui.render.RenderedImage;
+import org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.image.ImageConverter;
+import org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.export.GraphicsSVG;
+import org.eclipse.gmf.runtime.draw2d.ui.render.factory.RenderedImageFactory;
+import org.eclipse.gmf.runtime.draw2d.ui.render.internal.RenderedImageDescriptor;
+import org.eclipse.gmf.runtime.notation.Shape;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.uml.export.Activator;
+import org.eclipse.papyrus.uml.export.extension.AnnotateSVG;
+import org.eclipse.papyrus.uml.export.svgextension.internal.OpenAPIDiagramSVGGenerator;
+import org.eclipse.uml2.uml.NamedElement;
+import org.w3c.dom.Element;
+
+/**
+ * The Class PapyrusDiagramSVGGenerator.
+ */
+public class PapyrusDiagramSVGGenerator extends OpenAPIDiagramSVGGenerator {
+
+ /** The annotations. */
+ private List<AnnotateSVG> annotations = new ArrayList<>();
+
+ /**
+ * Instantiates a new papyrus diagram SVG generator.
+ *
+ * @param diagramEditPart the diagram edit part
+ * @param annotations the annotations
+ */
+ public PapyrusDiagramSVGGenerator(DiagramEditPart diagramEditPart, List<AnnotateSVG> annotations ) {
+ super(diagramEditPart);
+ this.annotations = annotations;
+ }
+
+ /** The rendered image. */
+ private RenderedImage renderedImage = null;
+
+ /** The svg root. */
+ private Element svgRoot = null;
+
+ /** The view box. */
+ private Rectangle viewBox = null;
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramSVGGenerator#setUpGraphics(int, int)
+ *
+ * @param width
+ * @param height
+ * @return
+ */
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator#
+ * setUpGraphics(int, int)
+ */
+ @Override
+ protected Graphics setUpGraphics(int width, int height) {
+ viewBox = new Rectangle(0, 0, width, height);
+ return GraphicsSVG.getInstance(viewBox);
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramSVGGenerator#getImageDescriptor(org.eclipse.draw2d.Graphics)
+ *
+ * @param g
+ * @return
+ */
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator#
+ * getImageDescriptor(org.eclipse.draw2d.Graphics)
+ */
+ @Override
+ protected ImageDescriptor getImageDescriptor(Graphics g) {
+ try {
+ Activator.log(IStatus.INFO, "Start transformation from Graphics to image descriptor");
+
+ GraphicsSVG svgG = (GraphicsSVG) g;
+ svgRoot = svgG.getRoot();
+
+ //////// Papyrus Specific code //////////
+ List<PartPositionInfo> allPartPositionInfo = this.getDiagramPartInfo();
+
+ Collections.reverse(allPartPositionInfo);// Required to have property after class
+ for (PartPositionInfo partPositionInfo : allPartPositionInfo) {
+ Element rectangle = svgG.getDocument().createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI, "rect");
+ if (partPositionInfo.getSemanticElement() instanceof NamedElement) {
+ NamedElement nameElement = (NamedElement) partPositionInfo.getSemanticElement();
+ rectangle.setAttributeNS(null, "id", nameElement.getName());// useful for svg debug
+ }
+
+ rectangle.setAttributeNS(null, "x", String.valueOf(partPositionInfo.getPartX()));
+ rectangle.setAttributeNS(null, "y", String.valueOf(partPositionInfo.getPartY()));
+ rectangle.setAttributeNS(null, "width", String.valueOf(partPositionInfo.getPartWidth()));
+ rectangle.setAttributeNS(null, "height", String.valueOf(partPositionInfo.getPartHeight()));
+ rectangle.setAttributeNS(null, "fill-opacity", "0"); //transparent
+ rectangle.setAttributeNS(null, "stroke-opacity", "0"); // no border
+ View view = partPositionInfo.getView();
+ if (view instanceof Shape) { // filter on shape only to avoid duplication
+
+ boolean hasAnnotation = applyAll(view, svgG, rectangle);
+ if (hasAnnotation) {
+ svgRoot.appendChild(rectangle);
+ }
+ }
+
+ }
+
+ /////////////////////////
+
+
+ ByteArrayOutputStream os = new ByteArrayOutputStream(5000); // 5K
+ // buffer
+ stream(os);
+ os.close();
+
+ setRenderedImage(RenderedImageFactory.getInstance(os.toByteArray()));
+
+ return RenderedImageDescriptor
+ .createFromRenderedImage(getRenderedImage());
+ } catch (IOException ex) {
+ Log.error(DiagramUIRenderPlugin.getInstance(), IStatus.ERROR, ex
+ .getMessage(), ex);
+ }
+
+ return null;
+ }
+
+
+ /**
+ * Apply all.
+ *
+ * @param view the view
+ * @param svgG the svg G
+ * @param rectangle the rectangle
+ * @return true, if successful
+ */
+ public boolean applyAll(View view, GraphicsSVG svgG, Element rectangle) {
+ boolean res = false;
+ for (AnnotateSVG annotateSVG : annotations) {
+ res = res || annotateSVG.addAnnotation(view, svgG, rectangle);
+ }
+ return true;
+ }
+
+ /**
+ * Writes the SVG Model out to a file.
+ *
+ * @param outputStream
+ * output stream to store the SVG Model
+ */
+ public void stream(OutputStream outputStream) {
+ try {
+ // Define the view box
+ svgRoot.setAttributeNS(null, "viewBox", String.valueOf(viewBox.x) + " " + //$NON-NLS-1$ //$NON-NLS-2$
+ String.valueOf(viewBox.y) + " " + //$NON-NLS-1$
+ String.valueOf(viewBox.width) + " " + //$NON-NLS-1$
+ String.valueOf(viewBox.height));
+
+ // Write the document to the stream
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
+ transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
+
+ DOMSource source = new DOMSource(svgRoot);
+ StreamResult result = new StreamResult(outputStream);
+ transformer.transform(source, result);
+ } catch (Exception ex) {
+ Log.error(DiagramUIRenderPlugin.getInstance(), IStatus.ERROR, ex.getMessage(), ex);
+ }
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramSVGGenerator#createAWTImageForParts(java.util.List, org.eclipse.swt.graphics.Rectangle)
+ *
+ * @param editparts
+ * @param sourceRect
+ * @return
+ */
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.internal.clipboard.DiagramGenerator#
+ * createAWTImageForParts(java.util.List)
+ */
+ public Image createAWTImageForParts(List editparts, org.eclipse.swt.graphics.Rectangle sourceRect) {
+ createSWTImageDescriptorForParts(editparts, sourceRect);
+ if (getRenderedImage() != null) {
+ try {
+ BufferedImage bufImg = (BufferedImage) getRenderedImage().getAdapter(BufferedImage.class);
+ if (bufImg == null)
+ bufImg = ImageConverter.convert(getRenderedImage().getSWTImage());
+ return bufImg;
+ } catch (Error e) {
+ // log the Error but allow execution to continue
+ Trace.catching(DiagramUIRenderPlugin.getInstance(), DiagramUIRenderDebugOptions.EXCEPTIONS_THROWING,
+ getClass(), "createAWTImageForParts() failed to generate image", //$NON-NLS-1$
+ e);
+ return ImageConverter.convert(SharedImages.get(SharedImages.IMG_ERROR));
+
+ } catch (Exception ex) {
+ // log the Exception but allow execution to continue
+ Trace.catching(DiagramUIRenderPlugin.getInstance(), DiagramUIRenderDebugOptions.EXCEPTIONS_THROWING,
+ getClass(), "createAWTImageForParts() failed to generate image", //$NON-NLS-1$
+ ex);
+ return ImageConverter.convert(SharedImages.get(SharedImages.IMG_ERROR));
+ }
+ }
+
+ return ImageConverter.convert(SharedImages.get(SharedImages.IMG_ERROR));
+ }
+
+ /**
+ * Gets the rendered image.
+ *
+ * @return Returns the rendered image created by previous call to
+ * createSWTImageDescriptorForParts
+ */
+ public RenderedImage getRenderedImage() {
+ return renderedImage;
+ }
+
+ /**
+ * Sets the rendered image.
+ *
+ * @param renderedImage the new rendered image
+ */
+ private void setRenderedImage(RenderedImage renderedImage) {
+ this.renderedImage = renderedImage;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/internal/OpenAPIDiagramSVGGenerator.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/internal/OpenAPIDiagramSVGGenerator.java
new file mode 100644
index 00000000000..567cfab0036
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/internal/OpenAPIDiagramSVGGenerator.java
@@ -0,0 +1,443 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.svgextension.internal;
+
+import java.lang.reflect.Field;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Stack;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PrecisionRectangle;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.editparts.LayerManager;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IExpandableFigure;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.SharedImages;
+import org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramSVGGenerator;
+import org.eclipse.gmf.runtime.diagram.ui.render.util.DiagramImageUtils;
+import org.eclipse.gmf.runtime.diagram.ui.services.decorator.Decoration;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+import org.eclipse.gmf.runtime.draw2d.ui.render.internal.graphics.RenderedMapModeGraphics;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.uml.export.Activator;
+import org.eclipse.swt.graphics.ImageData;
+
+//This is an "open" version of DiagramSVGGenerator with public method/attribute
+public class OpenAPIDiagramSVGGenerator extends DiagramSVGGenerator {
+
+ private Point ltranslateOffset;
+
+ public OpenAPIDiagramSVGGenerator(DiagramEditPart diagramEditPart) {
+ super(diagramEditPart);
+ }
+
+ public ImageDescriptor openCreateSWTImageDescriptorForParts(List editparts,
+ org.eclipse.swt.graphics.Rectangle sourceRect) {
+
+ // initialize imageDesc to the error icon
+ ImageDescriptor imageDesc = new ImageDescriptor() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.resource.ImageDescriptor#getImageData()
+ */
+ public ImageData getImageData() {
+ return SharedImages.get(SharedImages.IMG_ERROR).getImageData();
+ }
+ };
+
+ Graphics graphics = null;
+ try {
+ IMapMode mm = getMapMode();
+
+ PrecisionRectangle rect = new PrecisionRectangle();
+ rect.setX(sourceRect.x);
+ rect.setY(sourceRect.y);
+ rect.setWidth(sourceRect.width);
+ rect.setHeight(sourceRect.height);
+
+ mm.LPtoDP(rect);
+
+ // Create the graphics and wrap it with the HiMetric graphics object
+ graphics = setUpGraphics((int) Math.round(rect.preciseWidth), (int) Math.round(rect.preciseHeight));
+
+ RenderedMapModeGraphics mapModeGraphics = new OpenRenderedMapModeGraphics(graphics, getMapMode());
+
+ openRenderToGraphics(mapModeGraphics, new Point(sourceRect.x, sourceRect.y), editparts);
+ imageDesc = getImageDescriptor(graphics);
+ } finally {
+ if (graphics != null)
+ disposeGraphics(graphics);
+ }
+
+ return imageDesc;
+ }
+
+
+ public void openRenderToGraphics(Graphics graphics, Point translateOffset, List editparts) {
+
+ this.ltranslateOffset = translateOffset;
+ graphics.translate((-translateOffset.x), (-translateOffset.y));
+ graphics.pushState();
+
+ List<GraphicalEditPart> connectionsToPaint = new LinkedList<>();
+
+ Map decorations = findDecorations(editparts);
+
+ for (Iterator editPartsItr = editparts.listIterator(); editPartsItr.hasNext();) {
+ IGraphicalEditPart editPart = (IGraphicalEditPart) editPartsItr.next();
+
+ // do not paint selected connection part
+ if (editPart instanceof ConnectionEditPart) {
+ connectionsToPaint.add(editPart);
+ } else {
+ connectionsToPaint.addAll(findConnectionsToPaint(editPart));
+ // paint shape figure
+ IFigure figure = editPart.getFigure();
+
+ paintFigure(graphics, figure, editPart);
+ paintDecorations(graphics, figure, decorations);
+ }
+ }
+
+ // paint the connection parts after shape parts paint
+ decorations = findDecorations(connectionsToPaint);
+
+ for (Iterator<GraphicalEditPart> connItr = connectionsToPaint.iterator(); connItr.hasNext();) {
+ IFigure figure = connItr.next().getFigure();
+ paintFigure(graphics, figure);
+ paintDecorations(graphics, figure, decorations);
+ }
+ }
+
+
+
+ public IFigure getPrintableLayer() {
+ Field f;
+ try {
+ f = this.getClass().getSuperclass().getSuperclass().getSuperclass().getDeclaredField("printableLayer");
+ f.setAccessible(true);
+ return (IFigure) f.get(this); // IllegalAccessException
+ } catch (NoSuchFieldException | SecurityException |IllegalArgumentException | IllegalAccessException e) {
+ Activator.log(e);
+ }
+ return null;
+ }
+
+ /**
+ * Collects all connections contained within the given edit part
+ *
+ * @param editPart
+ * the container editpart
+ * @return connections within it
+ */
+ public Collection<ConnectionEditPart> findConnectionsToPaint(IGraphicalEditPart editPart) {
+ /*
+ * Set of node editparts contained within the given editpart
+ */
+ HashSet<GraphicalEditPart> editParts = new HashSet<GraphicalEditPart>();
+
+ /*
+ * All connection editparts that have a source contained within the given
+ * editpart
+ */
+ HashSet<ConnectionEditPart> connectionEPs = new HashSet<ConnectionEditPart>();
+
+ /*
+ * Connections contained within the given editpart (or just the connections to
+ * paint
+ */
+ HashSet<ConnectionEditPart> connectionsToPaint = new HashSet<ConnectionEditPart>();
+
+ /*
+ * Populate the set of node editparts
+ */
+ getNestedEditParts(editPart, editParts);
+
+ /*
+ * Populate the set of connections whose source is within the given editpart
+ */
+ for (Iterator<GraphicalEditPart> editPartsItr = editParts.iterator(); editPartsItr.hasNext();) {
+ connectionEPs.addAll(getAllConnectionsFrom(editPartsItr.next()));
+ }
+
+ /*
+ * Create a set of connections constained within the given editpart
+ */
+ while (!connectionEPs.isEmpty()) {
+ /*
+ * Take the first connection and check whethe there is a path through that
+ * connection that leads to the target contained within the given editpart
+ */
+ Stack<ConnectionEditPart> connectionsPath = new Stack<ConnectionEditPart>();
+ ConnectionEditPart conn = connectionEPs.iterator().next();
+ connectionEPs.remove(conn);
+ connectionsPath.add(conn);
+
+ /*
+ * Initialize the target for the current path
+ */
+ EditPart target = conn.getTarget();
+ while (connectionEPs.contains(target)) {
+ /*
+ * If the target end is a connection, check if it's one of the connection's
+ * whose target is a connection and within the given editpart. Append it to the
+ * path if it is. Otherwise check if the target is within the actual connections
+ * or nodes contained within the given editpart
+ */
+ ConnectionEditPart targetConn = (ConnectionEditPart) target;
+ connectionEPs.remove(targetConn);
+ connectionsPath.add(targetConn);
+
+ /*
+ * Update the target for the new path
+ */
+ target = targetConn.getTarget();
+ }
+
+ /*
+ * The path is built, check if it's target is a node or a connection contained
+ * within the given editpart
+ */
+ if (editParts.contains(target) || connectionsToPaint.contains(target)) {
+ connectionsToPaint.addAll(connectionsPath);
+ }
+ }
+ return connectionsToPaint;
+ }
+
+ /**
+ * This method is used when a figure needs to be painted to the graphics. The
+ * figure will be translated based on its absolute positioning.
+ *
+ * @param graphics
+ * Graphics object to render figure
+ * @param figure
+ * the figure to be rendered
+ */
+ public void paintFigure(Graphics graphics, IFigure figure) {
+
+ if (!figure.isVisible() || figure.getBounds().isEmpty())
+ return;
+
+ // Calculate the Relative bounds and absolute bounds
+ Rectangle relBounds = null;
+ if (figure instanceof IExpandableFigure)
+ relBounds = ((IExpandableFigure) figure).getExtendedBounds().getCopy();
+ else
+ relBounds = figure.getBounds().getCopy();
+
+ Rectangle abBounds = relBounds.getCopy();
+ DiagramImageUtils.translateTo(abBounds, figure, getPrintableLayer());
+
+ // Calculate the difference
+ int transX = abBounds.x - relBounds.x;
+ int transY = abBounds.y - relBounds.y;
+
+ // Paint the figure
+ graphics.pushState();
+ graphics.translate(transX, transY);
+ figure.paint(graphics);
+
+ graphics.popState();
+ graphics.restoreState();
+ }
+
+ public void paintFigure(Graphics graphics, IFigure figure, IGraphicalEditPart editPart) {
+
+ if (!figure.isVisible() || figure.getBounds().isEmpty())
+ return;
+
+ // Calculate the Relative bounds and absolute bounds
+ Rectangle relBounds = null;
+ if (figure instanceof IExpandableFigure)
+ relBounds = ((IExpandableFigure) figure).getExtendedBounds().getCopy();
+ else
+ relBounds = figure.getBounds().getCopy();
+
+ Rectangle abBounds = relBounds.getCopy();
+ DiagramImageUtils.translateTo(abBounds, figure, getPrintableLayer());
+
+ // Calculate the difference
+ int transX = abBounds.x - relBounds.x;
+ int transY = abBounds.y - relBounds.y;
+
+ // Paint the figure
+ graphics.pushState();
+ graphics.translate(transX, transY);
+ figure.paint(graphics);
+
+ graphics.popState();
+ graphics.restoreState();
+ }
+
+
+ /**
+ * Find the decorations that adorn the specified <code>editParts</code>.
+ *
+ * @param editparts
+ * the list of <code>IGraphicalEditParts</code> for which to find
+ * decorations
+ * @return a mapping of {@link IFigure}to ({@link Decoration}or
+ * {@link Collection}of decorations})
+ */
+ public Map findDecorations(Collection editparts) {
+ // create inverse mapping of figures to edit parts (need this to map
+ // decorations to edit parts)
+ Map figureMap = mapFiguresToEditParts(editparts);
+
+ Map result = new java.util.HashMap();
+
+ if (!editparts.isEmpty()) {
+ IGraphicalEditPart first = (IGraphicalEditPart) editparts.iterator().next();
+
+ IFigure decorationLayer = LayerManager.Helper.find(first)
+ .getLayer(DiagramRootEditPart.DECORATION_PRINTABLE_LAYER);
+
+ if (decorationLayer != null) {
+ // compute the figures of the shapes
+ List figures = new java.util.ArrayList(editparts);
+ for (ListIterator iter = figures.listIterator(); iter.hasNext();) {
+ iter.set(((IGraphicalEditPart) iter.next()).getFigure());
+ }
+
+ // find the decorations on figures that were selected
+ for (Iterator iter = decorationLayer.getChildren().iterator(); iter.hasNext();) {
+ Object next = iter.next();
+
+ if (next instanceof Decoration) {
+ Decoration decoration = (Decoration) next;
+ IFigure owner = decoration.getOwnerFigure();
+
+ while (owner != null) {
+ if (figureMap.containsKey(owner)) {
+ Object existing = result.get(owner);
+
+ if (existing == null) {
+ result.put(owner, decoration);
+ } else if (existing instanceof Collection) {
+ ((Collection) existing).add(decoration);
+ } else {
+ Collection c = new java.util.ArrayList(2);
+ c.add(existing);
+ c.add(decoration);
+ result.put(owner, c);
+ }
+ break;
+ } else {
+ owner = owner.getParent();
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Constructs a mapping of figures to their corresponding edit parts.
+ *
+ * @param editParts
+ * a collection of <code>IGraphicalEditParts</code>
+ * @return a mapping of {@link IFigure}to {@link IGraphicalEditPart}
+ */
+ public Map mapFiguresToEditParts(Collection editParts) {
+ Map result = new java.util.HashMap();
+
+ for (Iterator iter = editParts.iterator(); iter.hasNext();) {
+ IGraphicalEditPart next = (IGraphicalEditPart) iter.next();
+
+ result.put(next.getFigure(), next);
+ }
+
+ return result;
+ }
+
+ /**
+ * This method is used to obtain the list of child edit parts for shape
+ * compartments.
+ *
+ * @param childEditPart
+ * base edit part to get the list of children editparts
+ * @param editParts
+ * list of nested shape edit parts
+ */
+ public void getNestedEditParts(IGraphicalEditPart childEditPart, Collection editParts) {
+
+ for (Iterator iter = childEditPart.getChildren().iterator(); iter.hasNext();) {
+
+ IGraphicalEditPart child = (IGraphicalEditPart) iter.next();
+ editParts.add(child);
+ getNestedEditParts(child, editParts);
+ }
+ }
+
+ /**
+ * Paints the decorations adorning the specified <code>figure</code>, if any.
+ *
+ * @param graphics
+ * the graphics to paint on
+ * @param figure
+ * the figure
+ * @param decorations
+ * mapping of figures to decorations, in which we will find the
+ * <code>figure</code>'s decorations
+ */
+ public void paintDecorations(Graphics graphics, IFigure figure, Map decorations) {
+ Object decoration = decorations.get(figure);
+
+ if (decoration != null) {
+ if (decoration instanceof Collection) {
+ for (Iterator iter = ((Collection) decoration).iterator(); iter.hasNext();) {
+ paintFigure(graphics, (IFigure) iter.next());
+ }
+ } else {
+ paintFigure(graphics, (IFigure) decoration);
+ }
+ }
+ }
+
+ /**
+ * Returns all connections orginating from a given editpart. All means that
+ * connections originating from connections that have a source given editpart
+ * will be included
+ *
+ * @param ep
+ * the editpart
+ * @return all source connections
+ */
+ public List<ConnectionEditPart> getAllConnectionsFrom(GraphicalEditPart ep) {
+ LinkedList<ConnectionEditPart> connections = new LinkedList<>();
+ for (Iterator itr = ep.getSourceConnections().iterator(); itr.hasNext();) {
+ ConnectionEditPart sourceConn = (ConnectionEditPart) itr.next();
+ connections.add(sourceConn);
+ connections.addAll(getAllConnectionsFrom(sourceConn));
+ }
+ return connections;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/internal/OpenRenderedMapModeGraphics.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/internal/OpenRenderedMapModeGraphics.java
new file mode 100644
index 00000000000..d9f50464fb2
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/svgextension/internal/OpenRenderedMapModeGraphics.java
@@ -0,0 +1,29 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.svgextension.internal;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+import org.eclipse.gmf.runtime.draw2d.ui.render.internal.graphics.RenderedMapModeGraphics;
+
+//This is an "open" version of RenderedMapModeGraphics with public method/attribute
+public class OpenRenderedMapModeGraphics extends RenderedMapModeGraphics {
+
+ public OpenRenderedMapModeGraphics(Graphics graphics, IMapMode mapMode) {
+ super(graphics, mapMode);
+ }
+
+ public Graphics openGetGraphics(){
+ return getGraphics();
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/tree/Node.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/tree/Node.java
new file mode 100644
index 00000000000..2a17deff908
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/tree/Node.java
@@ -0,0 +1,119 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.tree;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * The Class Node.
+ */
+public class Node {
+
+ // expected to be unique
+ /** The namespace. */
+ // required only for diagram
+ public String namespace = ""; // used as parameter to call the onclick
+
+ /** The text. */
+ public String text = ""; // text displayed in the tree
+
+ /** The childs. */
+ public List<Node> childs = new ArrayList<>();
+
+ /** The additional informations. */
+ private Map<String,String> additionalInformations = new HashMap<>();
+
+ /**
+ * Gets the additional informations.
+ *
+ * @return the additional informations
+ */
+ public Map<String, String> getAdditionalInformations() {
+ return additionalInformations;
+ }
+
+ /**
+ * Sets the additional informations.
+ *
+ * @param additionalInformations the additional informations
+ */
+ public void setAdditionalInformations(Map<String, String> additionalInformations) {
+ this.additionalInformations = additionalInformations;
+ }
+
+
+ /**
+ * Instantiates a new node.
+ *
+ * @param namespace the namespace
+ * @param text the text
+ */
+ public Node(String namespace, String text) {
+ this.namespace = namespace;
+ this.text = text;
+ }
+
+ /**
+ * Instantiates a new node.
+ *
+ * @param namespace the namespace
+ * @param text the text
+ * @param childs the childs
+ */
+ public Node(String namespace, String text, List<Node> childs) {
+ this.namespace = namespace;
+ this.text = text;
+ this.childs = childs;
+ }
+
+ /**
+ * Instantiates a new node.
+ *
+ * @param namespace the namespace
+ * @param text the text
+ * @param child the child
+ */
+ public Node(String namespace, String text, Node child) {
+ this.namespace = namespace;
+ this.text = text;
+ this.childs.add(child);
+ }
+
+ /**
+ * Gets the childby name.
+ *
+ * @param name the name
+ * @return the childby name
+ */
+ public Node getChildbyName(String name) {
+ for (Node node : childs) {
+ if (name.equals(node.text)) {
+ return node;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Adds the child.
+ *
+ * @param node the node
+ */
+ public void addChild(Node node) {
+ childs.add(node);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/tree/UMLTreeFactory.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/tree/UMLTreeFactory.java
new file mode 100644
index 00000000000..8f2a60e2da8
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/tree/UMLTreeFactory.java
@@ -0,0 +1,234 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.tree;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.gmfdiag.style.PapyrusDiagramStyle;
+import org.eclipse.papyrus.uml.export.extension.AdditionalInformations;
+import org.eclipse.uml2.uml.NamedElement;
+
+
+/**
+ * A factory for creating UMLTree objects.
+ */
+public class UMLTreeFactory {
+
+ /** The additionnal datas. */
+ private Map<String, AdditionalInformations> additionnalDatas = new HashMap<>();
+
+ /** The tree. */
+ private Node tree = null;
+
+ /**
+ * Instantiates a new UML tree factory.
+ *
+ * @param additionnalDatas the additionnal datas
+ */
+ public UMLTreeFactory(Map<String, AdditionalInformations> additionnalDatas) {
+ this.additionnalDatas = additionnalDatas;
+ }
+
+ /**
+ * Adds the diagram.
+ *
+ * @param diagram the diagram
+ * @return the node
+ */
+ public Node addDiagram(Diagram diagram) {
+ List<NamedElement> pathToRoot = getPathToRoot(diagram);
+ if (tree == null) {
+ tree = createSubTree(pathToRoot, diagram);
+ } else {
+ Collections.reverse(pathToRoot);
+ addElementToTree(tree, pathToRoot, diagram);
+ }
+ return tree;
+ }
+
+ /**
+ * Creates a new UMLTree object.
+ *
+ * @param pathToRoot the path to root
+ * @param diagram the diagram
+ * @return the node
+ */
+ private Node createSubTree(List<NamedElement> pathToRoot, Diagram diagram) {
+ Node node = createNode(diagram);
+ for (NamedElement namedElement : pathToRoot) {
+ node = createNode(namedElement, node);
+ }
+ return node;
+ }
+
+ /**
+ * Adds the element to tree.
+ *
+ * @param parentNode the parent node
+ * @param namespaceList the namespace list
+ * @param diagram the diagram
+ * @return the node
+ */
+ private Node addElementToTree(Node parentNode, List<NamedElement> namespaceList, Diagram diagram) {
+ if (namespaceList.size() > 1) {
+ NamedElement namedElement = namespaceList.get(1);
+ namespaceList.remove(0);
+ Node childbyName = parentNode.getChildbyName(namedElement.getName());
+ if (childbyName != null) {
+ addElementToTree(childbyName, namespaceList, diagram);
+ } else {
+ Node node = createNode(namedElement);
+ parentNode.addChild(node);
+ addElementToTree(node, namespaceList, diagram);
+ }
+ } else {
+ Node diagramLeaf = createNode(diagram);
+ parentNode.childs.add(diagramLeaf);
+ }
+ return parentNode;
+ }
+
+ /**
+ * Gets the additionnal datas.
+ *
+ * @return the additionnal datas
+ */
+ public Map<String, AdditionalInformations> getAdditionnalDatas() {
+ return additionnalDatas;
+ }
+
+ /**
+ * Sets the additionnal datas.
+ *
+ * @param additionnalDatas the additionnal datas
+ */
+ public void setAdditionnalDatas(Map<String, AdditionalInformations> additionnalDatas) {
+ this.additionnalDatas = additionnalDatas;
+ }
+
+ /**
+ * Gets the tree.
+ *
+ * @return the tree
+ */
+ public Node getTree() {
+ return tree;
+ }
+
+ /**
+ * Sets the tree.
+ *
+ * @param tree the new tree
+ */
+ public void setTree(Node tree) {
+ this.tree = tree;
+ }
+
+ /**
+ * Gets the path to root.
+ *
+ * @param diagram the diagram
+ * @return the path to root
+ */
+ public List<NamedElement> getPathToRoot(Diagram diagram) {
+ List<NamedElement> namespaceList = new ArrayList<>();
+ for (Object object : diagram.getStyles()) {
+ if (object instanceof PapyrusDiagramStyle) {
+ EObject owner = ((PapyrusDiagramStyle) object).getOwner();
+ while (owner instanceof NamedElement) {
+ NamedElement namedOwner = (NamedElement) owner;
+ namespaceList.add(namedOwner);
+ owner = namedOwner.getOwner();
+ }
+ }
+ }
+ return namespaceList;
+ }
+
+ /**
+ * Creates a new UMLTree object.
+ *
+ * @param diagram the diagram
+ * @return the node
+ */
+ public Node createNode(Diagram diagram) {
+ String name = diagram.getName();
+ Node node = new Node(name, name);
+ node.setAdditionalInformations(getAdditionalDatasFor(diagram));
+ return node;
+ }
+
+ /**
+ * Creates a new UMLTree object.
+ *
+ * @param namedElement the named element
+ * @return the node
+ */
+ public Node createNode(NamedElement namedElement) {
+ Node node = new Node(utilgetNamespace(namedElement), namedElement.getName());
+ node.setAdditionalInformations(getAdditionalDatasFor(namedElement));
+ return node;
+ }
+
+ /**
+ * Creates a new UMLTree object.
+ *
+ * @param namedElement the named element
+ * @param child the child
+ * @return the node
+ */
+ public Node createNode(NamedElement namedElement, Node child) {
+ Node node = new Node(utilgetNamespace(namedElement), namedElement.getName(), child);
+ node.setAdditionalInformations(getAdditionalDatasFor(namedElement));
+ return node;
+ }
+
+ /**
+ * Utilget namespace.
+ *
+ * @param namedElement the named element
+ * @return the string
+ */
+ private static String utilgetNamespace(NamedElement namedElement) {
+ String namespace = namedElement.getName();
+ while (namedElement.getOwner() != null) {
+ namespace = namedElement.getName() + namespace;
+ namedElement = (NamedElement) namedElement.getOwner();
+
+ }
+ return namespace;
+ }
+
+ /**
+ * Gets the additional datas for.
+ *
+ * @param object the object
+ * @return the additional datas for
+ */
+ public Map<String, String> getAdditionalDatasFor(Object object) {
+ Map<String, String> res = new HashMap<>();
+ for (Entry<String, AdditionalInformations> entry : additionnalDatas.entrySet()) {
+ String data = entry.getValue().getData(object);
+ if (data != null) {
+ res.put(entry.getKey(), data);
+ }
+ }
+ return res;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/ui/ExportHtmlHandler.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/ui/ExportHtmlHandler.java
new file mode 100644
index 00000000000..dcba2af402e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/ui/ExportHtmlHandler.java
@@ -0,0 +1,221 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.ui;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+import java.util.stream.Collectors;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.CommonPlugin;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.papyrus.infra.core.editor.ModelSetServiceFactory;
+import org.eclipse.papyrus.infra.core.resource.EditingDomainServiceFactory;
+import org.eclipse.papyrus.infra.core.resource.ModelMultiException;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.resource.ModelsReader;
+import org.eclipse.papyrus.infra.core.services.ExtensionServicesRegistry;
+import org.eclipse.papyrus.infra.core.services.ServiceDescriptor;
+import org.eclipse.papyrus.infra.core.services.ServiceDescriptor.ServiceTypeKind;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServiceStartKind;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils;
+import org.eclipse.papyrus.infra.gmfdiag.export.utils.SelectionHelper;
+import org.eclipse.papyrus.infra.ui.util.ServiceUtilsForSelection;
+import org.eclipse.papyrus.uml.export.Activator;
+import org.eclipse.papyrus.uml.export.HTMLExportHelper;
+import org.eclipse.papyrus.uml.export.HTMLExportRunner;
+import org.eclipse.papyrus.uml.export.extension.HTMLExtensionRegistry;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+
+/**
+ * Handler to export all diagrams of selected resource in Project Explorer and
+ * Model Explorer.
+ */
+public class ExportHtmlHandler extends AbstractHandler {
+
+ /**
+ * Execute.
+ *
+ * @param event
+ * the event
+ * @return the object
+ * @throws ExecutionException
+ * the execution exception
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ if (Activator.getDefault().isDebugging()) {
+ Activator.debug("Start html export in debug mode"); //$NON-NLS-1$
+ }
+
+ // Get selection from handler event
+ ISelection selection = HandlerUtil.getActiveMenuSelection(event);
+ ModelSet modelSetSelection = null;
+ try {
+ modelSetSelection = ServiceUtilsForSelection.getInstance().getModelSet(selection);
+ } catch (ServiceException e) {
+ // Do not log error the editor is simply not opened
+ IFile file = SelectionHelper.convertSelection2File(selection);
+ URI diFileUri = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
+ modelSetSelection = initialiseModelSet(diFileUri);
+ }
+
+ List<Diagram> allDiagrams = getAllDiagrams(modelSetSelection);
+ URI uriWithoutExtension = modelSetSelection.getURIWithoutExtension();
+ URI resolvedFile = CommonPlugin.resolve(uriWithoutExtension);
+ String fileString = resolvedFile.toFileString();
+ Path targetDirectoryPath = new Path(fileString);
+ List<String> activatePref = parseList(Activator.getDefault().getPreferenceStore().getString(HTMLExportPreferencesPage.ACTIVE_STRATEGIES));
+ if (activatePref.isEmpty()) {
+ activatePref = HTMLExtensionRegistry.getInstance().getAllExtension().stream().map(IExtension::getUniqueIdentifier).collect(Collectors.toList());
+ }
+
+ HTMLExportHelper helperFromPrefs = HTMLExtensionRegistry.getHelperFromPrefs(activatePref);
+ HTMLExportRunner.generateHtmlWebSite(targetDirectoryPath, allDiagrams, helperFromPrefs);
+ refreshworkspace();
+
+ if (Activator.getDefault().isDebugging()) {
+ Activator.debug("End html export in debug mode"); //$NON-NLS-1$
+ }
+ return null;
+ }
+
+ /**
+ * Gets the all diagrams.
+ *
+ * @param modelSet the model set
+ * @return the all diagrams
+ */
+ public static List<Diagram> getAllDiagrams(ModelSet modelSet) {
+
+ Iterable<Diagram> allNotations = NotationUtils.getAllNotations(modelSet, Diagram.class);
+ List<Diagram> copy = new ArrayList<>();
+ Iterator<Diagram> iterator = allNotations.iterator();
+ while (iterator.hasNext()) {
+ copy.add(iterator.next());
+ }
+ return copy;
+ }
+
+ /**
+ * Parses the list.
+ *
+ * @param listString the list string
+ * @return the list
+ */
+ public static List<String> parseList(String listString) {
+ List<String> list= new ArrayList<>(10);
+ StringTokenizer tokenizer= new StringTokenizer(listString, ","); //$NON-NLS-1$
+ while (tokenizer.hasMoreTokens())
+ list.add(tokenizer.nextToken());
+ return list;
+ }
+
+ /**
+ * Refreshworkspace.
+ */
+ private void refreshworkspace() {
+ try {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ root.refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ Activator.log(e);
+ }
+ }
+
+ /**
+ * Create Models set from selected file.
+ *
+ * @param diFileUri the di file uri
+ * @return the model set
+ */
+ private ModelSet initialiseModelSet(URI diFileUri) {
+ ServicesRegistry service = null;
+
+ try {
+ service = new ExtensionServicesRegistry();
+ } catch (ServiceException e) {
+ Activator.log(e);
+ service = new ServicesRegistry(); // This won't really work
+ }
+
+ // Override service factory for Model Set
+ ServiceDescriptor descriptor = new ServiceDescriptor(ModelSet.class, ModelSetServiceFactory.class.getName(),
+ ServiceStartKind.STARTUP, 10);
+ descriptor.setServiceTypeKind(ServiceTypeKind.serviceFactory);
+ service.add(descriptor);
+
+ // Override factory for editing domain
+ descriptor = new ServiceDescriptor(TransactionalEditingDomain.class,
+ EditingDomainServiceFactory.class.getName(), ServiceStartKind.STARTUP, 10,
+ Collections.singletonList(ModelSet.class.getName()));
+ descriptor.setServiceTypeKind(ServiceTypeKind.serviceFactory);
+ service.add(descriptor);
+
+ try {
+ service.startServicesByClassKeys(ModelSet.class, TransactionalEditingDomain.class);
+ } catch (ServiceException e) {
+ Activator.log(e);
+ }
+
+ ModelSet modelSet = null;
+ try {
+ modelSet = ServiceUtils.getInstance().getModelSet(service);
+ } catch (ServiceException e) {
+ // Ignore service exception
+ }
+
+ // Instantiate a Model set
+ if (modelSet == null) {
+ modelSet = new ModelSet();
+ try {
+ ModelSetServiceFactory.setServiceRegistry(modelSet, service);
+ } catch (ServiceException e) {
+ // Ignore service exception
+ }
+ }
+
+ // Read all Model from selected file
+ ModelsReader modelsReader = new ModelsReader();
+ modelsReader.readModel(modelSet);
+ try {
+ modelSet.loadModels(diFileUri);
+ } catch (ModelMultiException e) {
+ Activator.log(e);
+ }
+ // Initialize an editing domain
+ modelSet.getTransactionalEditingDomain();
+ return modelSet;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/ui/HTMLExportPreferencesPage.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/ui/HTMLExportPreferencesPage.java
new file mode 100644
index 00000000000..0d4435e944d
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/ui/HTMLExportPreferencesPage.java
@@ -0,0 +1,544 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.ui;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.jdt.internal.ui.util.TableLayoutComposite;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ContentViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.osgi.util.TextProcessor;
+import org.eclipse.papyrus.uml.export.Activator;
+import org.eclipse.papyrus.uml.export.extension.HTMLExtensionRegistry;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.TableEditor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+/**
+ * The Class HTMLExportPreferencesPage.
+ */
+public class HTMLExportPreferencesPage extends PreferencePage implements IWorkbenchPreferencePage{
+
+
+ /** The Constant ACTIVE_STRATEGIES. */
+ public static final String ACTIVE_STRATEGIES = "active.strategy";//$NON-NLS-1$
+
+ /** The Constant INACTIVE_STRATEGIES. */
+ public static final String INACTIVE_STRATEGIES = "inactive.strategy";//$NON-NLS-1$
+
+ /** The filter viewer label. */
+ private Label fFilterViewerLabel;
+
+ /** The filter table. */
+ private Table fFilterTable;
+
+ /** The filter viewer. */
+ private CheckboxTableViewer fFilterViewer;
+
+ /** The table editor. */
+ private TableEditor fTableEditor;
+
+ /** The stack filter content provider. */
+ private IdentifiedEntryStructuredContentProvider fStackFilterContentProvider;
+
+ /**
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ *
+ * @param workbench
+ */
+ @Override
+ public void init(IWorkbench workbench) {}
+
+ /**
+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ *
+ * @param parent
+ * @return
+ */
+ @Override
+ protected Control createContents(Composite parent) {
+ Composite composite= new Composite(parent, SWT.NULL);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 1;
+ layout.marginHeight= 0;
+ layout.marginWidth= 0;
+ composite.setLayout(layout);
+ GridData data= new GridData();
+ data.verticalAlignment= GridData.FILL;
+ data.horizontalAlignment= GridData.FILL;
+ composite.setLayoutData(data);
+
+ createStackFilterPreferences(composite);
+ Dialog.applyDialogFont(composite);
+ return composite;
+ }
+
+ /**
+ * Creates the stack filter preferences.
+ *
+ * @param composite the composite
+ */
+ /*
+ * Create a group to contain the step filter related widgets
+ */
+ private void createStackFilterPreferences(Composite composite) {
+ fFilterViewerLabel= new Label(composite, SWT.SINGLE | SWT.LEFT);
+ fFilterViewerLabel.setText("Available strategies to enhance default generation");
+
+ Composite container= new Composite(composite, SWT.NONE);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 2;
+ layout.marginHeight= 0;
+ layout.marginWidth= 0;
+ container.setLayout(layout);
+ GridData gd= new GridData(GridData.FILL_BOTH);
+ container.setLayoutData(gd);
+
+ createFilterTable(container);
+ }
+
+ /**
+ * Creates the filter table.
+ *
+ * @param container the container
+ */
+ private void createFilterTable(Composite container) {
+ TableLayoutComposite layouter= new TableLayoutComposite(container, SWT.NONE);
+ layouter.addColumnData(new ColumnWeightData(100));
+ layouter.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ fFilterTable= new Table(layouter, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
+
+ @SuppressWarnings("unused")
+ TableColumn tableColumn= new TableColumn(fFilterTable, SWT.NONE);
+ fFilterViewer= new CheckboxTableViewer(fFilterTable);
+ fStackFilterContentProvider= new IdentifiedEntryStructuredContentProvider();
+
+
+ fFilterViewer.setLabelProvider(new MyFilterLabelProvider());
+ fFilterViewer.setComparator(new MyFilterViewerSorter());
+
+ fFilterViewer.addCheckStateListener(new ICheckStateListener() {
+ @Override
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ IdentifiedEntry filter= (IdentifiedEntry) event.getElement();
+ fStackFilterContentProvider.toggleFilter(filter);
+ }
+ });
+
+ fFilterViewer.setContentProvider(fStackFilterContentProvider);
+ fFilterViewer.setInput(this); // input just needs to be non-null
+
+ fStackFilterContentProvider.refresh();
+ }
+
+ /**
+ * @see org.eclipse.jface.preference.PreferencePage#performOk()
+ *
+ * @return
+ */
+ @Override
+ public boolean performOk() {
+ fStackFilterContentProvider.saveFilters();
+ return true;
+ }
+
+ /**
+ * Content provider for the filter table. Content consists of instances of IdentifiedEntry.
+ */
+ private class IdentifiedEntryStructuredContentProvider implements IStructuredContentProvider {
+
+ /** The filters. */
+ private List<IdentifiedEntry> fFilters;
+
+ /**
+ * Instantiates a new identified entry structured content provider.
+ */
+ public IdentifiedEntryStructuredContentProvider() {
+ Map<String,String> active= new HashMap<>();
+ Map<String,String> inactive= new HashMap<>();
+
+ List<String> activeStrategies = parseList(Activator.getDefault().getPreferenceStore().getString(ACTIVE_STRATEGIES));
+ List<String> inactiveStrategies = parseList(Activator.getDefault().getPreferenceStore().getString(INACTIVE_STRATEGIES));
+
+ List<IExtension> allExtension = HTMLExtensionRegistry.getInstance().getAllExtension();
+
+ for (IExtension iExtension : allExtension) {
+ String uniqueIdentifier = iExtension.getUniqueIdentifier();
+ if (inactiveStrategies.contains(uniqueIdentifier)) {
+ inactive.put(uniqueIdentifier, iExtension.getLabel());
+ } else if (activeStrategies.contains(uniqueIdentifier)) {
+ active.put(uniqueIdentifier, iExtension.getLabel());
+ } else {
+ active.put(uniqueIdentifier, iExtension.getLabel()); // active by default
+ }
+
+ }
+
+
+ populateFilters(active, inactive);
+ }
+
+ /**
+ * Sets the defaults.
+ */
+ public void setDefaults() {
+ fFilterViewer.remove(fFilters.toArray());
+ Map<String,String> active= new HashMap<>();
+ Map<String,String> inactive= new HashMap<>();
+ populateFilters(active, inactive);
+ }
+
+ /**
+ * Populate filters.
+ *
+ * @param activeList the active list
+ * @param inactiveList the inactive list
+ */
+ protected void populateFilters(Map<String,String> activeList, Map<String,String> inactiveList) {
+ fFilters= new ArrayList<>(activeList.size() + inactiveList.size());
+ populateList(activeList, true);
+ if (!inactiveList.isEmpty())
+ populateList(inactiveList, false);
+ }
+
+ /**
+ * Populate list.
+ *
+ * @param list the list
+ * @param checked the checked
+ */
+ protected void populateList(Map<String,String> list, boolean checked) {
+ for (Entry<String,String> entry: list.entrySet()) {
+ addFilter(entry.getKey(),entry.getValue(), checked);
+ }
+ }
+
+ /**
+ * Adds the filter.
+ *
+ * @param id the id
+ * @param name the name
+ * @param checked the checked
+ * @return the identified entry
+ */
+ public IdentifiedEntry addFilter(String id, String name, boolean checked) {
+ IdentifiedEntry filter= new IdentifiedEntry(id, name, checked);
+ if (!fFilters.contains(filter)) {
+ fFilters.add(filter);
+ fFilterViewer.add(filter);
+ fFilterViewer.setChecked(filter, checked);
+ }
+ return filter;
+ }
+
+ /**
+ * Save filters.
+ */
+ public void saveFilters() {
+ List<String> active= new ArrayList<>(fFilters.size());
+ List<String> inactive= new ArrayList<>(fFilters.size());
+ Iterator<IdentifiedEntry> iterator= fFilters.iterator();
+ while (iterator.hasNext()) {
+ IdentifiedEntry filter= iterator.next();
+ String id= filter.getId();
+ if (filter.isChecked())
+ active.add(id);
+ else
+ inactive.add(id);
+ }
+ Activator.getDefault().getPreferenceStore().setValue(ACTIVE_STRATEGIES,serializeList(active.toArray(new String[active.size()])));
+ Activator.getDefault().getPreferenceStore().setValue(INACTIVE_STRATEGIES,serializeList(inactive.toArray(new String[inactive.size()])));
+ }
+
+ /**
+ * Serializes the array of strings into one comma-separated string.
+ *
+ * @param list array of strings
+ * @return a single string composed of the given list
+ */
+ public String serializeList(String[] list) {
+ if (list == null)
+ return ""; //$NON-NLS-1$
+
+ StringBuffer buffer= new StringBuffer();
+ for (int i= 0; i < list.length; i++) {
+ if (i > 0)
+ buffer.append(',');
+
+ buffer.append(list[i]);
+ }
+ return buffer.toString();
+ }
+
+ /**
+ * Parses the comma-separated string into an array of strings.
+ *
+ * @param listString a comma-separated string
+ * @return an array of strings
+ */
+ public List<String> parseList(String listString) {
+ List<String> list= new ArrayList<>(10);
+ StringTokenizer tokenizer= new StringTokenizer(listString, ","); //$NON-NLS-1$
+ while (tokenizer.hasMoreTokens())
+ list.add(tokenizer.nextToken());
+ return list;
+ }
+
+ /**
+ * Toggle filter.
+ *
+ * @param filter the filter
+ */
+ public void toggleFilter(IdentifiedEntry filter) {
+ boolean newState= !filter.isChecked();
+ filter.setChecked(newState);
+ fFilterViewer.setChecked(filter, newState);
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ *
+ * @param inputElement
+ * @return
+ */
+ @Override
+ public Object[] getElements(Object inputElement) {
+ return fFilters.toArray();
+ }
+
+ /**
+ * Refresh.
+ */
+ public void refresh() {
+ for (IdentifiedEntry filter2 : fFilters) {
+ fFilterViewer.setChecked(filter2, filter2.isChecked());
+ }
+ }
+
+
+ /**
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ *
+ * @param viewer
+ * @param oldInput
+ * @param newInput
+ */
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+
+ /**
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ *
+ */
+ @Override
+ public void dispose() {}
+
+ }
+
+ /**
+ * Model object that represents a single entry in the table.
+ */
+ private static class IdentifiedEntry {
+
+ /** The id. */
+ private String id;
+
+ /** The label. */
+ private String label;
+
+ /** The checked. */
+ private boolean checked;
+
+ /**
+ * Instantiates a new identified entry.
+ *
+ * @param id the id
+ * @param label the label
+ * @param checked the checked
+ */
+ public IdentifiedEntry(String id, String label, boolean checked) {
+ this.id = id;
+ this.label = label;
+ setChecked(checked);
+ }
+
+ /**
+ * Gets the label.
+ *
+ * @return the label
+ */
+ public String getLabel() {
+ return label;
+ }
+
+ /**
+ * Gets the id.
+ *
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Checks if is checked.
+ *
+ * @return true, if is checked
+ */
+ public boolean isChecked() {
+ return checked;
+ }
+
+ /**
+ * Sets the checked.
+ *
+ * @param checked the new checked
+ */
+ public void setChecked(boolean checked) {
+ this.checked= checked;
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ *
+ * @param o
+ * @return
+ */
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof IdentifiedEntry))
+ return false;
+
+ IdentifiedEntry other= (IdentifiedEntry) o;
+ return (getLabel().equals(other.getLabel()));
+ }
+
+ /**
+ * @see java.lang.Object#hashCode()
+ *
+ * @return
+ */
+ @Override
+ public int hashCode() {
+ return id.hashCode();
+ }
+ }
+
+ /**
+ * Sorter for the filter table; sorts alphabetically ascending.
+ */
+ private static class MyFilterViewerSorter extends ViewerComparator {
+
+ /**
+ * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ *
+ * @param viewer
+ * @param e1
+ * @param e2
+ * @return
+ */
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ ILabelProvider lprov= (ILabelProvider) ((ContentViewer) viewer).getLabelProvider();
+ String name1= lprov.getText(e1);
+ String name2= lprov.getText(e2);
+ if (name1 == null)
+ name1= ""; //$NON-NLS-1$
+
+ if (name2 == null)
+ name2= ""; //$NON-NLS-1$
+
+ if (name1.length() > 0 && name2.length() > 0) {
+ boolean isPackage1= name1.indexOf('*') != -1;
+ boolean isPackage2= name2.indexOf('*') != -1;
+ if (isPackage1 && !isPackage2)
+ return -1;
+
+ if (isPackage2 && !isPackage1)
+ return 1;
+ }
+ return getComparator().compare(name1, name2);
+ }
+ }
+
+ /**
+ * Label provider for Filter model objects.
+ */
+ private static class MyFilterLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+ /**
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+ *
+ * @param object
+ * @param column
+ * @return
+ */
+ @Override
+ public String getColumnText(Object object, int column) {
+ return (column == 0) ? getText(object) : ""; //$NON-NLS-1$
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
+ *
+ * @param element
+ * @return
+ */
+ @Override
+ public String getText(Object element) {
+ return TextProcessor.process(((IdentifiedEntry) element).getLabel());
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+ *
+ * @param object
+ * @param column
+ * @return
+ */
+ @Override
+ public Image getColumnImage(Object object, int column) {
+
+ //other filter
+ return null;
+ }
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/FileUtil.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/FileUtil.java
new file mode 100644
index 00000000000..9b4eb7106ce
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/FileUtil.java
@@ -0,0 +1,75 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.util;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.papyrus.uml.export.Activator;
+
+
+/**
+ * The Class FileUtil.
+ */
+public class FileUtil {
+
+ /**
+ * Copy file from platform.
+ *
+ * @param targetContainer the target container
+ * @param fileName the file name
+ * @param platformPath the platform path
+ */
+ public static void copyFileFromPlatform(IPath targetContainer, String fileName, String platformPath) {
+ try {
+ URL url = new URL(platformPath);
+ URL fileURL = FileLocator.toFileURL(url);
+ InputStream is = fileURL.openStream();
+ String string = targetContainer.append(fileName).toString();
+ File file = new File(string);
+ if (!file.getParentFile().exists()) {
+ file.getParentFile().mkdirs();
+ }
+ OutputStream os = new FileOutputStream(file);
+
+ byte[] b = new byte[2048];
+ int length;
+
+ while ((length = is.read(b)) != -1) {
+ os.write(b, 0, length);
+ }
+
+ is.close();
+ os.close();
+
+ } catch (IOException e) {
+ Activator.log(e);
+ }
+ }
+
+ /**
+ * Gets the name from platform URL.
+ *
+ * @param platformURL the platform URL
+ * @return the name from platform URL
+ */
+ public static String getNameFromPlatformURL(String platformURL) {
+ return new File(platformURL).getName();
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/HTMLUtil.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/HTMLUtil.java
new file mode 100644
index 00000000000..878ed900dbf
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/HTMLUtil.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.util;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.uml2.uml.NamedElement;
+
+
+/**
+ * The Class HTMLUtil.
+ */
+public class HTMLUtil {
+
+ // utily that get a coherent File Name from diagram Name
+ /**
+ * Diagram relativ path.
+ *
+ * @param diagram the diagram
+ * @return the string
+ */
+ // for the first version diagram with same name on same namespace isn't handled
+ public static String diagramRelativPath(Diagram diagram) {
+ String filename = diagram.getName();
+ EObject element = diagram.getElement();
+ if (element instanceof NamedElement) {
+ NamedElement namedElement = (NamedElement) element;
+ String qualifiedName1 = namedElement.getNearestPackage().getQualifiedName().replaceAll("::", "/"); // FIXME system separator
+ return qualifiedName1+"/"+filename.trim().replace(" ", "");
+ }
+ return filename.trim().replace(" ", "");
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/IconHelper.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/IconHelper.java
new file mode 100644
index 00000000000..ff687561748
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/IconHelper.java
@@ -0,0 +1,140 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.util;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.architecture.ArchitectureDomainManager;
+import org.eclipse.papyrus.infra.core.architecture.RepresentationKind;
+import org.eclipse.papyrus.infra.core.architecture.merged.MergedArchitectureContext;
+import org.eclipse.papyrus.infra.core.architecture.merged.MergedArchitectureDescriptionLanguage;
+import org.eclipse.papyrus.infra.gmfdiag.style.PapyrusDiagramStyle;
+import org.eclipse.uml2.uml.Element;
+
+
+/**
+ * A helper class to provide a a way to get icons from UML element and diagrams.
+ */
+public class IconHelper {
+
+ /** The Constant PREFIX_UML_PLATFORM_URL. */
+ private static final String PREFIX_UML_PLATFORM_URL = "platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/"; //$NON-NLS-1$
+
+ /** The Constant UNKNOW_ICON. */
+ public static final String UNKNOW_ICON = "unknow.jpg"; // TODO: also provide unknow diagram icon
+
+ // key: diagram type
+ /** The diagram kind id to icon name. */
+ // icon name
+ public static Map<String, String> diagramKindIdToIconName = new HashMap<>();
+
+ // key: icon name
+ /** The Icon name to platform URL. */
+ // platform path to the icon
+ public static Map<String, String> IconNameToPlatformURL = new HashMap<>();
+
+
+ /**
+ * Instantiates a new icon helper.
+ */
+ public IconHelper() {
+ }
+
+
+ /**
+ * Gets the icon name.
+ *
+ * @param d the d
+ * @return the icon name
+ */
+ public static String getIconName(Diagram d) {
+ for (Object object : d.getStyles()) {
+ if (object instanceof PapyrusDiagramStyle) {
+ PapyrusDiagramStyle papyrusDiagramStyle = (PapyrusDiagramStyle) object;
+ String diagramKindId = papyrusDiagramStyle.getDiagramKindId();
+ String cachedValue = diagramKindIdToIconName.get(diagramKindId);
+ if (cachedValue != null) {
+ return cachedValue;
+ }
+
+ RepresentationKind representationKindbyId = getRepresentationKindbyId(diagramKindId);
+ if (representationKindbyId != null) {
+ String platformURL = representationKindbyId.getIcon();
+ String iconName = FileUtil.getNameFromPlatformURL(platformURL);
+ diagramKindIdToIconName.put(diagramKindId, iconName);
+ IconNameToPlatformURL.put(iconName, platformURL);
+ return iconName;
+ }
+ }
+ }
+ return UNKNOW_ICON;
+ }
+
+ /**
+ * Gets the icon name.
+ *
+ * @param element the element
+ * @return the icon name
+ */
+ public static String getIconName(Element element) {
+ String name = element.eClass().getName();
+ String key = name+".gif";
+ IconNameToPlatformURL.put(key, PREFIX_UML_PLATFORM_URL+key);
+ return key;
+ }
+
+
+ /**
+ * Gets the representation kindby id.
+ *
+ * @param diagramKindId the diagram kind id
+ * @return the representation kindby id
+ */
+ public static RepresentationKind getRepresentationKindbyId(String diagramKindId) {
+ Collection<MergedArchitectureContext> visibleArchitectureContexts = ArchitectureDomainManager.getInstance()
+ .getVisibleArchitectureContexts();
+ for (MergedArchitectureContext mergedArchitectureContext : visibleArchitectureContexts) {
+ if (mergedArchitectureContext instanceof MergedArchitectureDescriptionLanguage) {
+ Collection<RepresentationKind> representationKinds = ((MergedArchitectureDescriptionLanguage) mergedArchitectureContext)
+ .getRepresentationKinds();
+ for (RepresentationKind representationKind : representationKinds) {
+ if (representationKind.getId().equals(diagramKindId)) {
+ return representationKind;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Prints the icon.
+ *
+ * @param targetContainer the target container
+ */
+ public static void printIcon(IPath targetContainer) { // return boolean ?
+ Set<Entry<String, String>> entrySet = IconNameToPlatformURL.entrySet();
+ for (Entry<String, String> entry : entrySet) {
+ FileUtil.copyFileFromPlatform(targetContainer, entry.getKey(), entry.getValue());
+ }
+ }
+
+
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ImageUtil.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ImageUtil.java
new file mode 100644
index 00000000000..9f3514732ac
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ImageUtil.java
@@ -0,0 +1,93 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.util;
+
+import java.io.File;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat;
+import org.eclipse.gmf.runtime.diagram.ui.image.PartPositionInfo;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.uml.export.Activator;
+import org.eclipse.papyrus.uml.export.extension.AnnotateSVG;
+import org.eclipse.papyrus.uml.export.svgextension.PapyrusCopyToImageUtil;
+
+/**
+ * The Class ImageUtil.
+ */
+public class ImageUtil {
+
+ /**
+ * Re factored generate img.
+ *
+ * @param path the path
+ * @param diagram the diagram
+ * @param annotations the annotations
+ * @return the list
+ */
+ public static List<PartPositionInfo> reFactoredgenerateImg(Path path, Diagram diagram, List<AnnotateSVG> annotations ) {
+ if (Activator.getDefault().isDebugging()) {
+ Activator.debug("Start generating svg for diagram " + diagram.getName() + " in " + path); //$NON-NLS-1$
+ }
+ PapyrusCopyToImageUtil copyToImageUtil = new PapyrusCopyToImageUtil(annotations);
+ String diagramNaming = HTMLUtil.diagramRelativPath(diagram);
+ IPath append = path.append(diagramNaming+"."+ImageFileFormat.SVG.toString());
+ return generateImg(append, copyToImageUtil, diagram, ImageFileFormat.SVG);
+ }
+
+
+ /**
+ * Generate img.
+ *
+ * @param imagePath the image path
+ * @param copyImageUtil the copy image util
+ * @param currentDiagram the current diagram
+ * @param fileFormat the file format
+ * @return the list
+ */
+ public static List<PartPositionInfo> generateImg(IPath imagePath, PapyrusCopyToImageUtil copyImageUtil, Diagram currentDiagram, ImageFileFormat fileFormat) {
+
+ Activator.log(IStatus.INFO, "Generate image to:"+imagePath.toString());
+
+ File file = imagePath.toFile();
+ File parentFile = file.getParentFile();
+ if (!parentFile.exists()) {
+ parentFile.mkdirs();
+ }
+ try {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ root.refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ Activator.log(e);
+ }
+ List<PartPositionInfo> copyToImage = Collections.emptyList();
+ try {
+ copyToImage = copyImageUtil.copyToImage(currentDiagram, imagePath, fileFormat, new NullProgressMonitor(),PreferencesHint.USE_DEFAULTS);
+ } catch (CoreException e) {
+ Activator.log(e);// Exception present when running in Project EXLPORE
+ }
+
+ return copyToImage;
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/IndexHelper.java b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/IndexHelper.java
new file mode 100644
index 00000000000..84652055b44
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/IndexHelper.java
@@ -0,0 +1,118 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benoit Maggi (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.export.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * Using a template library would probably be better but for the moment I try to
+ * avoid fancy dependencies in Papyrus.
+ */
+@SuppressWarnings("nls")
+public class IndexHelper {
+
+ /** The Constant EOL. */
+ private static final String EOL = System.getProperty("line.separator");
+
+ /** The headers. */
+ private List<String> headers = new ArrayList<>();
+
+ /** The footers. */
+ private List<String> footers = new ArrayList<>();
+
+ /**
+ * Instantiates a new index helper.
+ *
+ * @param headers the headers
+ * @param footers the footers
+ */
+ public IndexHelper(List<String> headers, List<String> footers) {
+ this.headers = headers;
+ this.footers = footers;
+
+ }
+
+ /**
+ * Gets the index.
+ *
+ * @param jsonData the json data
+ * @return the index
+ */
+ public String getIndex(String jsonData) {
+ StringBuilder stb = new StringBuilder();
+ stb.append(getHeader());
+ stb.append(getBody());
+ stb.append(getFooter(jsonData));
+ return stb.toString();
+ }
+
+ /**
+ * Gets the header.
+ *
+ * @return the header
+ */
+ public String getHeader() {
+ StringBuilder stb = new StringBuilder();
+ stb.append("<!DOCTYPE html>" + EOL);
+ stb.append("<html>" + EOL);
+ for (String header : headers) {
+ stb.append(header + EOL);
+ }
+ return stb.toString();
+ }
+
+ /**
+ * Gets the body.
+ *
+ * @return the body
+ */
+ public String getBody() {
+ StringBuilder stb = new StringBuilder();
+ stb.append("<body>" + EOL);
+ stb.append("<div id=\"html-editor\" class=\"html-editor api\">" + EOL);
+ stb.append("<div id=\"diagram-explorer-div\" class=\"diagram-explorer-div split split-horizontal\">" + EOL);
+ stb.append("<p id=\"diagram-explorer\">My diagram-explorer tree.</p>" + EOL);
+ stb.append("</div>" + EOL);
+ stb.append("<div id=\"diagram-div\" class=\"diagram-div split split-horizontal\" style=\"overflow: scroll;\">" + EOL);
+ stb.append("<object id=\"diagram\" type=\"image/svg+xml\">" + EOL);
+ stb.append("Your browser does not support SVG" + EOL);
+ stb.append("</object>" + EOL);
+ stb.append("</div>" + EOL);
+ stb.append("</div>" + EOL);
+ stb.append("</body>" + EOL);
+ return stb.toString();
+ }
+
+ /**
+ * Gets the footer.
+ *
+ * @param jsonData the json data
+ * @return the footer
+ */
+ public String getFooter(String jsonData) {
+ StringBuilder stb = new StringBuilder();
+ stb.append("<script>" + EOL);
+ stb.append("var jsondat = ");
+ stb.append("'" + jsonData + "';" + EOL);
+ stb.append("obj = JSON.parse(jsondat);" + EOL);
+ stb.append("document.getElementById(\"diagram-explorer\").innerHTML = displayJson(obj);" + EOL);
+ stb.append("</script>" + EOL);
+ for (String footer : footers) {
+ stb.append(footer + EOL);
+ }
+ stb.append("</html>" + EOL);
+ return stb.toString();
+ }
+
+}
diff --git a/plugins/uml/pom.xml b/plugins/uml/pom.xml
index 356246758f7..6693d9d9fdd 100644
--- a/plugins/uml/pom.xml
+++ b/plugins/uml/pom.xml
@@ -23,6 +23,7 @@
<module>org.eclipse.papyrus.uml.filters.edit</module>
<module>org.eclipse.papyrus.uml.icons</module>
<module>org.eclipse.papyrus.uml.import</module>
+ <module>org.eclipse.papyrus.uml.export</module>
<module>org.eclipse.papyrus.uml.modelrepair</module>
<module>org.eclipse.papyrus.uml.navigation</module>
<module>org.eclipse.papyrus.uml.oclconstraintevaluation</module>

Back to the top