diff options
author | Vincent Lorenzo | 2017-05-03 12:59:08 +0000 |
---|---|---|
committer | vincent lorenzo | 2017-05-22 18:27:31 +0000 |
commit | 883a5e399966977c972ff66998fdea157ed3ec95 (patch) | |
tree | c51027284262f8a6ffc3d8828462007767a40aa2 /plugins | |
parent | cac8ea589d8c8149866680b7da4884c7ea579af1 (diff) | |
download | org.eclipse.papyrus-883a5e399966977c972ff66998fdea157ed3ec95.tar.gz org.eclipse.papyrus-883a5e399966977c972ff66998fdea157ed3ec95.tar.xz org.eclipse.papyrus-883a5e399966977c972ff66998fdea157ed3ec95.zip |
Bug 516106: [Expressions] Papyrus must provide a developer tool to generate ExpressionCatalog for Uml profile
Change-Id: I1ec67865f1d1acb6e2b1dac4ee73be02c488c31c
Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
Diffstat (limited to 'plugins')
20 files changed, 965 insertions, 3 deletions
diff --git a/plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions/META-INF/MANIFEST.MF b/plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions/META-INF/MANIFEST.MF index fecf9a6ce3a..cb78dded60c 100755 --- a/plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions/META-INF/MANIFEST.MF +++ b/plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions/META-INF/MANIFEST.MF @@ -15,7 +15,8 @@ Export-Package: org.eclipse.papyrus.infra.emf.expressions, org.eclipse.papyrus.infra.emf.expressions.catalog, org.eclipse.papyrus.infra.emf.expressions.impl, org.eclipse.papyrus.infra.emf.expressions.util, - org.eclipse.papyrus.infra.emf.expressions.util.custom + org.eclipse.papyrus.infra.emf.expressions.util.custom, + org.eclipse.papyrus.infra.emf.expressions.utils Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)";resolution:=optional;x-installation:=greedy, org.eclipse.emf.ecore;bundle-version="[2.12.0,3.0.0)", org.eclipse.emf.ecore.xmi;bundle-version="[2.12.0,3.0.0)" diff --git a/plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions/src/org/eclipse/papyrus/infra/emf/expressions/utils/ExpressionNameComparator.java b/plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions/src/org/eclipse/papyrus/infra/emf/expressions/utils/ExpressionNameComparator.java new file mode 100755 index 00000000000..a5829b3e105 --- /dev/null +++ b/plugins/infra/emf/expressions/org.eclipse.papyrus.infra.emf.expressions/src/org/eclipse/papyrus/infra/emf/expressions/utils/ExpressionNameComparator.java @@ -0,0 +1,44 @@ +/***************************************************************************** + * Copyright (c) 2017 CEA LIST and others. + * + * 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: + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.emf.expressions.utils; + +import java.util.Comparator; + +import org.eclipse.papyrus.infra.emf.expressions.IBasicExpressionElement; + + + +/** + * Comparator used to sort IBasicExpressionElement + */ +public class ExpressionNameComparator implements Comparator<IBasicExpressionElement> { + + private final String EMPTY_STRING = ""; //$NON-NLS-1$ + + /** + * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) + * + * @param arg0 + * @param arg1 + * @return + */ + @Override + public int compare(final IBasicExpressionElement arg0, final IBasicExpressionElement arg1) { + final String name0 = null == arg0 ? EMPTY_STRING : null != arg0.getName() ? arg0.getName() : EMPTY_STRING; + final String name1 = null == arg1 ? EMPTY_STRING : null != arg1.getName() ? arg1.getName() : EMPTY_STRING; + return name0.compareTo(name1); + } + + +} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.classpath b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.classpath new file mode 100755 index 00000000000..eca7bdba8f0 --- /dev/null +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.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/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.project b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.project new file mode 100755 index 00000000000..7aef34f2032 --- /dev/null +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.toolsmiths.expressions</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> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.settings/org.eclipse.jdt.core.prefs b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.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/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.settings/org.eclipse.jdt.ui.prefs b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.settings/org.eclipse.jdt.ui.prefs new file mode 100755 index 00000000000..954281dbc31 --- /dev/null +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.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/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.settings/org.eclipse.pde.api.tools.prefs b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.settings/org.eclipse.pde.api.tools.prefs new file mode 100755 index 00000000000..23fb95e120f --- /dev/null +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/.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/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/META-INF/MANIFEST.MF b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/META-INF/MANIFEST.MF new file mode 100755 index 00000000000..7ead800ae43 --- /dev/null +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/META-INF/MANIFEST.MF @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-SymbolicName: org.eclipse.papyrus.toolsmiths.expressions;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: %Bundle-Vendor +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Require-Bundle: org.eclipse.papyrus.infra.core.log;bundle-version="[1.2.0,2.0.0)", + org.eclipse.ui.workbench;bundle-version="[3.110.0,4.0.0)", + org.eclipse.uml2.uml;bundle-version="[5.3.0,6.0.0)", + org.eclipse.papyrus.uml.expressions;bundle-version="[1.0.0,2.0.0)", + org.eclipse.ui;bundle-version="[3.109.0,4.0.0)", + org.eclipse.core.expressions;bundle-version="[3.6.0,4.0.0)", + org.eclipse.papyrus.infra.ui;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.emf.expressions;bundle-version="[1.0.0,2.0.0)" +Bundle-Activator: org.eclipse.papyrus.toolsmiths.expressions.Activator +Bundle-ActivationPolicy: lazy +Bundle-Description: %Bundle-Description diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/OSGI-INF/l10n/bundle.properties b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/OSGI-INF/l10n/bundle.properties new file mode 100755 index 00000000000..cc5a440f321 --- /dev/null +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,6 @@ +#Properties file for org.eclipse.papyrus.uml.expressions.toolsmiths +Bundle-Vendor = Eclipse Modeling Project +Bundle-Name = Papyrus Toolsmiths Expressions +Bundle-Description = This plugin provides handlers to create Papyrus Expressions for UML. +command.description = This command allows to create the UML Expressions required for the given profile +command.name = Create an ExpressionCatalog for the Profile
\ No newline at end of file diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/about.html b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/about.html new file mode 100755 index 00000000000..598b3684879 --- /dev/null +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/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>May 12, 2008</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). 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, "Program" 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 ("Redistributor") 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/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/build.properties b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/build.properties new file mode 100755 index 00000000000..2e9f19484e7 --- /dev/null +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.xml,\ + icons/,\ + OSGI-INF/l10n/bundle.properties diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/icons/ExpressionCatalog.gif b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/icons/ExpressionCatalog.gif Binary files differnew file mode 100755 index 00000000000..794bab8aa5f --- /dev/null +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/icons/ExpressionCatalog.gif diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/plugin.xml b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/plugin.xml new file mode 100755 index 00000000000..e187ce1859b --- /dev/null +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/plugin.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.4"?> +<plugin> + <extension + point="org.eclipse.ui.commands"> + <command + categoryId="org.eclipse.papyrus.editor.category" + description="%command.description" + id="org.eclipse.papyrus.toolsmiths.expressions.createExpressionsForUMLProfile" + name="%command.name"> + </command> + </extension> + <extension + point="org.eclipse.ui.menus"> + <menuContribution + allPopups="false" + locationURI="popup:org.eclipse.papyrus.uml.profile.types.generator.ui.generateMenu?after=additions"> + <command + commandId="org.eclipse.papyrus.toolsmiths.expressions.createExpressionsForUMLProfile" + icon="icons/ExpressionCatalog.gif" + style="push"> + <visibleWhen + checkEnabled="true"> + </visibleWhen> + </command> + </menuContribution> + </extension> + <extension + point="org.eclipse.ui.handlers"> + <handler + class="org.eclipse.papyrus.toolsmiths.expressions.handlers.GenerateProfileCatalogHandler" + commandId="org.eclipse.papyrus.toolsmiths.expressions.createExpressionsForUMLProfile"> + <activeWhen> + <with + variable="selection"> + <and> + <count + value="1"> + </count> + <iterate + ifEmpty="false" + operator="and"> + <adapt + type="org.eclipse.emf.ecore.EObject"> + <instanceof + value="org.eclipse.uml2.uml.Profile"> + </instanceof> + </adapt> + </iterate> + </and> + </with> + </activeWhen> + </handler> + </extension> + +</plugin> diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/pom.xml b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/pom.xml new file mode 100755 index 00000000000..20e8581a797 --- /dev/null +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/pom.xml @@ -0,0 +1,14 @@ +<?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.toolsmiths</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <artifactId>org.eclipse.papyrus.toolsmiths.expressions</artifactId> + <version>1.0.0-SNAPSHOT</version> + <packaging>eclipse-plugin</packaging> + <description>This plugin provides handlers to create Papyrus Expressions for UML.</description> +</project>
\ No newline at end of file diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/src/org/eclipse/papyrus/toolsmiths/expressions/Activator.java b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/src/org/eclipse/papyrus/toolsmiths/expressions/Activator.java new file mode 100755 index 00000000000..254d7ce88af --- /dev/null +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/src/org/eclipse/papyrus/toolsmiths/expressions/Activator.java @@ -0,0 +1,71 @@ +/***************************************************************************** + * 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: + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.toolsmiths.expressions; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +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 plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.toolsmiths.expressions"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + public static LogHelper log; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (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; + log = new LogHelper(plugin); + } + + /* + * (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; + } + +} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/src/org/eclipse/papyrus/toolsmiths/expressions/handlers/GenerateProfileCatalogHandler.java b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/src/org/eclipse/papyrus/toolsmiths/expressions/handlers/GenerateProfileCatalogHandler.java new file mode 100755 index 00000000000..e23ebb24b0e --- /dev/null +++ b/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.expressions/src/org/eclipse/papyrus/toolsmiths/expressions/handlers/GenerateProfileCatalogHandler.java @@ -0,0 +1,160 @@ +/***************************************************************************** + * Copyright (c) 2017 CEA LIST and others. + * + * 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: + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.toolsmiths.expressions.handlers; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.osgi.util.NLS; +import org.eclipse.papyrus.infra.emf.expressions.ExpressionCatalog; +import org.eclipse.papyrus.infra.emf.expressions.ExpressionsFactory; +import org.eclipse.papyrus.infra.emf.expressions.IExpression; +import org.eclipse.papyrus.infra.emf.expressions.util.custom.ExpressionsResource; +import org.eclipse.papyrus.infra.emf.expressions.util.custom.ExpressionsResourceFactory; +import org.eclipse.papyrus.infra.emf.expressions.utils.ExpressionNameComparator; +import org.eclipse.papyrus.infra.emf.utils.EMFHelper; +import org.eclipse.papyrus.infra.ui.util.SelectionHelper; +import org.eclipse.papyrus.toolsmiths.expressions.Activator; +import org.eclipse.papyrus.uml.expressions.umlexpressions.IsStereotypedWithExpression; +import org.eclipse.papyrus.uml.expressions.umlexpressions.UMLExpressionsFactory; +import org.eclipse.papyrus.uml.expressions.umlexpressions.utils.UMLExpressionsUtils; +import org.eclipse.uml2.uml.Profile; +import org.eclipse.uml2.uml.Stereotype; + +/** + * This handlers allow to create a new Catalog providing the IsStereotypedWith expressions required to manipulate a given Profile + * + * The generation is always done from the top profile. + * + * The field {@link IsStereotypedWithExpression#getProfileURI()} is always set with the URI of the top profile + * + */ +public class GenerateProfileCatalogHandler extends AbstractHandler { + + /** + * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) + * + * @param event + * @return + * @throws ExecutionException + */ + @Override + public Object execute(final ExecutionEvent event) throws ExecutionException { + final Profile profile = getSelectedProfile(); + if (null != profile) { + ExpressionCatalog catalog = createExpressionCatalog(profile); + URI profileURI = profile.eResource().getURI(); + profileURI = profileURI.trimFileExtension(); + profileURI = profileURI.trimFileExtension(); + + profileURI = profileURI.appendFileExtension(ExpressionsResource.EXPRESSIONS_RESOURCE_FILE_EXTENSION); + Resource res = new ExpressionsResourceFactory().createResource(profileURI); + res.getContents().add(catalog); + try { + res.save(null); + } catch (IOException e) { + Activator.log.error(e); + } + } + return null; + } + + /** + * @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object) + * + * @param evaluationContext + */ + @Override + public void setEnabled(Object evaluationContext) { + setBaseEnabled(null != getSelectedProfile()); + } + + /** + * + * @return + * the selected profile or <code>null</code> if the current selection is not a profile + */ + private Profile getSelectedProfile() { + final IStructuredSelection selection = SelectionHelper.getCurrentStructuredSelection(); + if (null != selection) { + Object selectedObject = selection.getFirstElement(); + selectedObject = EMFHelper.getEObject(selectedObject); + if (selectedObject instanceof Profile) { + return (Profile) selectedObject; + } + } + return null; + } + + /** + * + * @param profile + * the selected profile + * @return + * the expression catalog for the given profile. This catalog will contains one {@link IsStereotypedWithExpression} for each stereotype owned in this profile or one of its subprofile + */ + private ExpressionCatalog createExpressionCatalog(final Profile profile) { + final ExpressionCatalog catalog = ExpressionsFactory.eINSTANCE.createExpressionCatalog(); + final String profileName = profile.getName(); + + final StringBuilder catalogNameBuilder = new StringBuilder(profileName); + catalogNameBuilder.append("ExpressionCatalog"); //$NON-NLS-1$ + catalog.setName(catalogNameBuilder.toString()); + + final String description = NLS.bind("This catalog provides expressions for the profile {0}.", profileName);//$NON-NLS-1$ + catalog.setDescription(description); + fillExpressionExpressionToCatalog(profile, catalog); + return catalog; + } + + /** + * + * @param profile + * a profile + * @param catalog + * the catalog to fill with the expressions created for each stereotype of this profile + */ + private void fillExpressionExpressionToCatalog(final Profile profile, final ExpressionCatalog catalog) { + final List<IExpression<?, ?>> list = new ArrayList<IExpression<?, ?>>(); + final Iterator<EObject> iter = profile.eAllContents(); + while (iter.hasNext()) { + final EObject current = iter.next(); + if (current instanceof Stereotype) { + final Stereotype stereotype = (Stereotype) current; + final String stereotypeQN = stereotype.getQualifiedName(); + final IsStereotypedWithExpression exp = UMLExpressionsFactory.eINSTANCE.createIsStereotypedWithExpression(); + + final String expressionDescription = NLS.bind("This expression returns TRUE if the Element is stereotyped with {0} and FALSE otherwise.", stereotypeQN); //$NON-NLS-1$ + exp.setName(new StringBuilder("IsStereotypedWith_").append(stereotypeQN).toString()); + exp.setDescription(expressionDescription); + exp.setStereotypeQualifiedName(stereotypeQN); + + // it is not a mistake, we always take the uri of the top profile, because often only this one has a defined uri + exp.setProfileURI(UMLExpressionsUtils.getTopProfileURI(stereotype)); + list.add(exp); + } + } + list.sort(new ExpressionNameComparator()); + catalog.getExpressions().addAll(list); + } +} diff --git a/plugins/toolsmiths/pom.xml b/plugins/toolsmiths/pom.xml index b2464944f45..82b108b236f 100644 --- a/plugins/toolsmiths/pom.xml +++ b/plugins/toolsmiths/pom.xml @@ -16,5 +16,6 @@ <modules> <module>org.eclipse.papyrus.toolsmiths</module> <module>org.eclipse.papyrus.toolsmiths.palette</module> + <module>org.eclipse.papyrus.toolsmiths.expressions</module> </modules> </project> diff --git a/plugins/uml/expressions/org.eclipse.papyrus.uml.expressions/META-INF/MANIFEST.MF b/plugins/uml/expressions/org.eclipse.papyrus.uml.expressions/META-INF/MANIFEST.MF index f9ef4b9d0b5..a1572e3d214 100755 --- a/plugins/uml/expressions/org.eclipse.papyrus.uml.expressions/META-INF/MANIFEST.MF +++ b/plugins/uml/expressions/org.eclipse.papyrus.uml.expressions/META-INF/MANIFEST.MF @@ -10,7 +10,8 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: org.eclipse.papyrus.uml.expressions.umlexpressions, org.eclipse.papyrus.uml.expressions.umlexpressions.custom, org.eclipse.papyrus.uml.expressions.umlexpressions.impl, - org.eclipse.papyrus.uml.expressions.umlexpressions.util + org.eclipse.papyrus.uml.expressions.umlexpressions.util, + org.eclipse.papyrus.uml.expressions.umlexpressions.utils Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)", org.eclipse.emf.ecore;bundle-version="[2.12.0,3.0.0)", org.eclipse.papyrus.infra.emf.expressions;bundle-version="[1.0.0,2.0.0)", diff --git a/plugins/uml/expressions/org.eclipse.papyrus.uml.expressions/src/org/eclipse/papyrus/uml/expressions/umlexpressions/custom/CustomIsStereotypedWithExpression.java b/plugins/uml/expressions/org.eclipse.papyrus.uml.expressions/src/org/eclipse/papyrus/uml/expressions/umlexpressions/custom/CustomIsStereotypedWithExpression.java index f6280de9505..fba185d6522 100755 --- a/plugins/uml/expressions/org.eclipse.papyrus.uml.expressions/src/org/eclipse/papyrus/uml/expressions/umlexpressions/custom/CustomIsStereotypedWithExpression.java +++ b/plugins/uml/expressions/org.eclipse.papyrus.uml.expressions/src/org/eclipse/papyrus/uml/expressions/umlexpressions/custom/CustomIsStereotypedWithExpression.java @@ -16,6 +16,7 @@ import java.util.Iterator; import org.eclipse.emf.ecore.EObject; import org.eclipse.papyrus.uml.expressions.umlexpressions.impl.IsStereotypedWithExpressionImpl; +import org.eclipse.papyrus.uml.expressions.umlexpressions.utils.UMLExpressionsUtils; import org.eclipse.uml2.uml.Element; import org.eclipse.uml2.uml.Stereotype; @@ -41,7 +42,8 @@ public class CustomIsStereotypedWithExpression extends IsStereotypedWithExpressi final Stereotype current = iter.next(); if (this.stereotypeQualifiedName.equals(current.getQualifiedName())) { if (null != this.profileURI && !this.profileURI.isEmpty()) { - result = profileURI.equals(current.getProfile().getURI()); + // we use the uri of the top profile, because often the subprofiles don't have defined uri + result = profileURI.equals(UMLExpressionsUtils.getTopProfileURI(current)); } else { result = true; } diff --git a/plugins/uml/expressions/org.eclipse.papyrus.uml.expressions/src/org/eclipse/papyrus/uml/expressions/umlexpressions/utils/UMLExpressionsUtils.java b/plugins/uml/expressions/org.eclipse.papyrus.uml.expressions/src/org/eclipse/papyrus/uml/expressions/umlexpressions/utils/UMLExpressionsUtils.java new file mode 100755 index 00000000000..04c01663b4f --- /dev/null +++ b/plugins/uml/expressions/org.eclipse.papyrus.uml.expressions/src/org/eclipse/papyrus/uml/expressions/umlexpressions/utils/UMLExpressionsUtils.java @@ -0,0 +1,59 @@ +/***************************************************************************** + * Copyright (c) 2017 CEA LIST and others. + * + * 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: + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.uml.expressions.umlexpressions.utils; + +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Profile; + +/** + * Utils methods for UML Expressions Framework + * + */ +public class UMLExpressionsUtils { + + + /** + * Constructor. + * + */ + private UMLExpressionsUtils() { + // to prevent instanciation + } + + /** + * + * @param element + * a profile + * @return + * the uri of the top profile owning the element or an empty string + * + * Warning, doesn't change this method, it is also used by the UML Expressions toolsmiths generating catalog for profile + */ + public static final String getTopProfileURI(final Element element) { + Element parent = element; + Profile topProfile = null; + if (element instanceof Profile) { + topProfile = (Profile) element; + } + + while (null != parent.getOwner()) { + parent = parent.getOwner(); + if (parent instanceof Profile) { + topProfile = (Profile) parent; + } + } + + return null != topProfile ? topProfile.getURI() : ""; //$NON-NLS-1$ + } +} |