diff options
250 files changed, 16995 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/.classpath b/plugins/org.eclipse.emf.cdo.common/.classpath new file mode 100644 index 0000000000..64c5e31b7a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/.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/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/org.eclipse.emf.cdo.common/.cvsignore b/plugins/org.eclipse.emf.cdo.common/.cvsignore new file mode 100644 index 0000000000..693869726d --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/.cvsignore @@ -0,0 +1,2 @@ +bin +doc diff --git a/plugins/org.eclipse.emf.cdo.common/.options b/plugins/org.eclipse.emf.cdo.common/.options new file mode 100644 index 0000000000..aa9a2fe4f7 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/.options @@ -0,0 +1,12 @@ +# Debugging and tracing options + +org.eclipse.emf.cdo.common/debug = true +org.eclipse.emf.cdo.common/debug.protocol = true +org.eclipse.emf.cdo.common/debug.id = true +org.eclipse.emf.cdo.common/debug.model = true +org.eclipse.emf.cdo.common/debug.revision= true + +org.eclipse.emf.cdo.common/perf = false +org.eclipse.emf.cdo.common/perf.revision = false +org.eclipse.emf.cdo.common/perf.revision.reading = false +org.eclipse.emf.cdo.common/perf.revision.writing = false diff --git a/plugins/org.eclipse.emf.cdo.common/.project b/plugins/org.eclipse.emf.cdo.common/.project new file mode 100644 index 0000000000..0a3ede0bd0 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.emf.cdo.common</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/org.eclipse.emf.cdo.common/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..37f8e9c2be --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,271 @@ +#Mon Mar 03 16:35:09 CET 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 +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_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_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_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.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +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=next_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true +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=120 +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.format_guardian_clause_on_one_line=false +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=2 +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_member=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_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=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=do not 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_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_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_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_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_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_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_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.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=true +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +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=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=2 +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true diff --git a/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..6c777bd10a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,65 @@ +#Sat Feb 23 10:46:43 CET 2008 +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_serial_version_id=true +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_to_enhanced_for_loop=false +cleanup.correct_indentation=true +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +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=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=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_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=true +cleanup.use_this_for_non_static_field_access=true +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=true +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_EMFT +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_EMFT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=ex +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +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\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment"/><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"/><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">/***************************************************************************\r\n * Copyright (c) 2004 - 2008 Eike Stepper, Germany.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * Eike Stepper - initial API and implementation\r\n **************************************************************************/</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author Eike Stepper\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><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"/><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"/><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}\r\n${package_declaration}\r\n\r\n${typecomment}\r\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">\r\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">\r\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">\r\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">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" 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}</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/org.eclipse.emf.cdo.common/.settings/org.eclipse.mylyn.tasks.ui.prefs b/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 0000000000..2e5351b740 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +#Sun Mar 09 19:10:00 CET 2008 +eclipse.preferences.version=1 +project.repository.kind=bugzilla +project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.mylyn.team.ui.prefs b/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.mylyn.team.ui.prefs new file mode 100644 index 0000000000..fe4457ab48 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.mylyn.team.ui.prefs @@ -0,0 +1,3 @@ +#Sun Mar 09 19:10:00 CET 2008 +commit.comment.template=[${task.id}] ${task.description} \r\n${task.url} +eclipse.preferences.version=1 diff --git a/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..8027e18644 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF @@ -0,0 +1,31 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.emf.cdo.common +Bundle-Version: 1.0.0.qualifier +Bundle-Name: %pluginName +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-ActivationPolicy: lazy +Bundle-Activator: org.eclipse.emf.cdo.internal.common.bundle.OM$Activator +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-ClassPath: . +Require-Bundle: org.eclipse.net4j;bundle-version="[1.0.0,2.0.0)";visibility:=reexport +Import-Package: org.osgi.framework;version="1.3.0";resolution:=optional +Export-Package: org.eclipse.emf.cdo.common;version="1.0.0", + org.eclipse.emf.cdo.common.analyzer;version="1.0.0", + org.eclipse.emf.cdo.common.id;version="1.0.0", + org.eclipse.emf.cdo.common.model;version="1.0.0", + org.eclipse.emf.cdo.common.model.core;version="1.0.0", + org.eclipse.emf.cdo.common.model.resource;version="1.0.0", + org.eclipse.emf.cdo.common.revision;version="1.0.0", + org.eclipse.emf.cdo.common.revision.delta;version="1.0.0", + org.eclipse.emf.cdo.common.util;version="1.0.0", + org.eclipse.emf.cdo.internal.common;version="1.0.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo,org.eclipse.emf.cdo.server", + org.eclipse.emf.cdo.internal.common.bundle;version="1.0.0";x-internal:=true, + org.eclipse.emf.cdo.internal.common.id;version="1.0.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo,org.eclipse.emf.cdo.server", + org.eclipse.emf.cdo.internal.common.model;version="1.0.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo,org.eclipse.emf.cdo.server", + org.eclipse.emf.cdo.internal.common.model.core;version="1.0.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo,org.eclipse.emf.cdo.server", + org.eclipse.emf.cdo.internal.common.model.resource;version="1.0.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo,org.eclipse.emf.cdo.server", + org.eclipse.emf.cdo.internal.common.revision;version="1.0.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo,org.eclipse.emf.cdo.server", + org.eclipse.emf.cdo.internal.common.revision.delta;version="1.0.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo,org.eclipse.emf.cdo.server", + org.eclipse.emf.cdo.spi.common;version="1.0.0" diff --git a/plugins/org.eclipse.emf.cdo.common/about.html b/plugins/org.eclipse.emf.cdo.common/about.html new file mode 100644 index 0000000000..d35d5aed64 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/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>June 5, 2007</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> diff --git a/plugins/org.eclipse.emf.cdo.common/build.properties b/plugins/org.eclipse.emf.cdo.common/build.properties new file mode 100644 index 0000000000..eb76b6604c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/build.properties @@ -0,0 +1,21 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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: +# Eike Stepper - initial API and implementation + +# NLS_MESSAGEFORMAT_VAR + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + copyright.txt,\ + epl-v10.html,\ + license.html,\ + plugin.properties,\ + .options diff --git a/plugins/org.eclipse.emf.cdo.common/copyright.txt b/plugins/org.eclipse.emf.cdo.common/copyright.txt new file mode 100644 index 0000000000..529118d99e --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/copyright.txt @@ -0,0 +1,8 @@ +Copyright (c) 2004 - 2008 Eike Stepper, Germany. +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: + Eike Stepper - initial API and implementation
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.common/epl-v10.html b/plugins/org.eclipse.emf.cdo.common/epl-v10.html new file mode 100644 index 0000000000..d7b88e9416 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/epl-v10.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.common/license.html b/plugins/org.eclipse.emf.cdo.common/license.html new file mode 100644 index 0000000000..d7b88e9416 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/license.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.cdo.common/plugin.properties b/plugins/org.eclipse.emf.cdo.common/plugin.properties new file mode 100644 index 0000000000..bff85c1467 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/plugin.properties @@ -0,0 +1,25 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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: +# Eike Stepper - initial API and implementation + +# NLS_MESSAGEFORMAT_VAR + +# ============================================================================== +# Do not change the properties between this line and the last line containing: +# %%% END OF TRANSLATED PROPERTIES %%% +# Instead, either redefine an existing property, or create a new property, +# append it to the end of the file, and change the code to use the new name. +# ============================================================================== + +pluginName = CDO Protocol +providerName = Eclipse.org + +# ============================================================================== +# %%% END OF TRANSLATED PROPERTIES %%% +# The above properties have been shipped for translation. +# ============================================================================== diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocol.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocol.java new file mode 100644 index 0000000000..7dccf792b3 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocol.java @@ -0,0 +1,21 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common; + +import org.eclipse.net4j.protocol.IProtocol; + +/** + * @author Eike Stepper + */ +public interface CDOProtocol extends IProtocol +{ + public CDOProtocolSession getSession(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolConstants.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolConstants.java new file mode 100644 index 0000000000..f849caf4d5 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolConstants.java @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common; + +/** + * @author Eike Stepper + */ +public interface CDOProtocolConstants +{ + public static final String PROTOCOL_NAME = "cdo"; + + public static final short SIGNAL_OPEN_SESSION = 1; + + public static final short SIGNAL_LOAD_LIBRARIES = 2; + + public static final short SIGNAL_VIEWS_CHANGED = 3; + + public static final short SIGNAL_RESOURCE_ID = 4; + + public static final short SIGNAL_RESOURCE_PATH = 5; + + public static final short SIGNAL_LOAD_PACKAGE = 6; + + public static final short SIGNAL_LOAD_REVISION = 7; + + public static final short SIGNAL_LOAD_REVISION_BY_TIME = 8; + + public static final short SIGNAL_LOAD_REVISION_BY_VERSION = 9; + + public static final short SIGNAL_LOAD_CHUNK = 10; + + public static final short SIGNAL_VERIFY_REVISION = 11; + + public static final short SIGNAL_QUERY_OBJECT_TYPES = 12; + + public static final short SIGNAL_COMMIT_TRANSACTION = 13; + + public static final short SIGNAL_INVALIDATION = 14; + + public static final int ERROR_REPOSITORY_NOT_FOUND = -1; + + public static final int ERROR_NO_SESSION = -2; + + public static final byte VIEW_TRANSACTION = 1; + + public static final byte VIEW_AUDIT = 2; + + public static final byte VIEW_READONLY = 3; + + public static final byte VIEW_CLOSED = 4; +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolSession.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolSession.java new file mode 100644 index 0000000000..6c378a606b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolSession.java @@ -0,0 +1,27 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common; + +/** + * @author Eike Stepper + */ +public interface CDOProtocolSession +{ + public int getSessionID(); + + public CDOProtocol getProtocol(); + + public CDOProtocolView[] getViews(); + + public CDOProtocolView getView(int viewID); + + public boolean isLegacySupportEnabled(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolView.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolView.java new file mode 100644 index 0000000000..7099da4884 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolView.java @@ -0,0 +1,31 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common; + +/** + * @author Eike Stepper + */ +public interface CDOProtocolView +{ + public int getViewID(); + + public Type getViewType(); + + public CDOProtocolSession getSession(); + + /** + * @author Eike Stepper + */ + public enum Type + { + TRANSACTION, READONLY, AUDIT + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/analyzer/CDOFetchRule.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/analyzer/CDOFetchRule.java new file mode 100644 index 0000000000..eba01412fb --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/analyzer/CDOFetchRule.java @@ -0,0 +1,89 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.common.analyzer; + +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOClassRef; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.model.CDOModelUtil; +import org.eclipse.emf.cdo.common.model.CDOPackageManager; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Simon McDuff + */ +public final class CDOFetchRule +{ + private CDOClass cdoClass; + + private List<CDOFeature> features = new ArrayList<CDOFeature>(0); + + public CDOFetchRule(CDOClass cdoClass) + { + this.cdoClass = cdoClass; + } + + public CDOFetchRule(ExtendedDataInput in, CDOPackageManager packageManager) throws IOException + { + CDOClassRef classRef = CDOModelUtil.readClassRef(in); + cdoClass = classRef.resolve(packageManager); + int size = in.readInt(); + for (int i = 0; i < size; i++) + { + int featureID = in.readInt(); + CDOFeature feature = cdoClass.lookupFeature(featureID); + features.add(feature); + } + } + + public void write(ExtendedDataOutput out) throws IOException + { + CDOModelUtil.writeClassRef(out, cdoClass.createClassRef()); + out.writeInt(features.size()); + for (CDOFeature feature : features) + { + out.writeInt(feature.getFeatureID()); + } + } + + public CDOClass getCDOClass() + { + return cdoClass; + } + + public List<CDOFeature> getFeatures() + { + return features; + } + + public void addFeature(CDOFeature feature) + { + features.add(feature); + } + + public void removeFeature(CDOFeature feature) + { + features.remove(feature); + + } + + public boolean isEmpty() + { + return features.isEmpty(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOID.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOID.java new file mode 100644 index 0000000000..fb4b0d11bc --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOID.java @@ -0,0 +1,49 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.id; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; +import java.io.Serializable; + +/** + * @author Eike Stepper + */ +public interface CDOID extends Serializable +{ + public static final CDOID NULL = org.eclipse.emf.cdo.internal.common.id.CDOIDNullImpl.INSTANCE; + + public Type getType(); + + public boolean isNull(); + + public boolean isObject(); + + public boolean isLegacy(); + + public boolean isMeta(); + + public boolean isTemporary(); + + public void read(ExtendedDataInput in) throws IOException; + + public void write(ExtendedDataOutput out) throws IOException; + + /** + * @author Eike Stepper + */ + public enum Type + { + NULL, OBJECT, LEGACY_OBJECT, TEMP_OBJECT, META, TEMP_META + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDLibraryDescriptor.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDLibraryDescriptor.java new file mode 100644 index 0000000000..2a1a4f8e9b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDLibraryDescriptor.java @@ -0,0 +1,27 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.id; + +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public interface CDOIDLibraryDescriptor +{ + public String getFactoryName(); + + public String[] getLibraryNames(); + + public void write(ExtendedDataOutput out) throws IOException; +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDLibraryProvider.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDLibraryProvider.java new file mode 100644 index 0000000000..d3325dbaea --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDLibraryProvider.java @@ -0,0 +1,24 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.id; + +import java.io.IOException; +import java.io.InputStream; + +/** + * @author Eike Stepper + */ +public interface CDOIDLibraryProvider +{ + public int getSize(String libraryName); + + public InputStream getContents(String libraryName) throws IOException; +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDMeta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDMeta.java new file mode 100644 index 0000000000..691e09ac73 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDMeta.java @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.id; + +/** + * @author Eike Stepper + */ +public interface CDOIDMeta extends CDOID +{ + public long getLongValue(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDMetaRange.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDMetaRange.java new file mode 100644 index 0000000000..71fd9bd461 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDMetaRange.java @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.id; + +import org.eclipse.emf.cdo.common.id.CDOID.Type; + +import java.io.Serializable; + +/** + * @author Eike Stepper + */ +public interface CDOIDMetaRange extends Serializable +{ + public CDOID getLowerBound(); + + public CDOID getUpperBound(); + + public CDOID get(int index); + + public int size(); + + public boolean isEmpty(); + + public boolean contains(CDOID id); + + public CDOIDMetaRange increase(); + + public Type getType(); + + public boolean isTemporary(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDObject.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDObject.java new file mode 100644 index 0000000000..1f1ff18b3d --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDObject.java @@ -0,0 +1,23 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.id; + +import org.eclipse.emf.cdo.common.model.CDOClassRef; + +/** + * @author Eike Stepper + */ +public interface CDOIDObject extends CDOID +{ + public CDOClassRef getClassRef(); + + public CDOIDObject asLegacy(CDOClassRef classRef); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDObjectFactory.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDObjectFactory.java new file mode 100644 index 0000000000..65574730e2 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDObjectFactory.java @@ -0,0 +1,27 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.id; + +import org.eclipse.net4j.util.io.ExtendedDataInput; + +/** + * @author Eike Stepper + */ +public interface CDOIDObjectFactory +{ + /** + * Returns a new instance of CDOIDObject. The implementor of this method may use (read from) the given data input to + * determine which class to instantiate. The data input must not be used to fill the state of the new instance, this + * has to be done in the implementation of the {@link CDOID#read(ExtendedDataInput) read()} method of the new + * instance. + */ + public CDOIDObject createCDOIDObject(ExtendedDataInput in); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDProvider.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDProvider.java new file mode 100644 index 0000000000..cf92f30b74 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDProvider.java @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.id; + +/** + * @author Eike Stepper + */ +public interface CDOIDProvider +{ + public CDOID provideCDOID(Object idOrObject); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDTemp.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDTemp.java new file mode 100644 index 0000000000..ca9281d6b6 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDTemp.java @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.id; + +/** + * @author Eike Stepper + */ +public interface CDOIDTemp extends CDOID +{ + public int getIntValue(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java new file mode 100644 index 0000000000..85829635c6 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java @@ -0,0 +1,260 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.id; + +import org.eclipse.emf.cdo.common.id.CDOID.Type; +import org.eclipse.emf.cdo.common.model.CDOClassRef; +import org.eclipse.emf.cdo.common.model.CDOModelUtil; +import org.eclipse.emf.cdo.internal.common.bundle.OM; +import org.eclipse.emf.cdo.internal.common.id.CDOIDMetaImpl; +import org.eclipse.emf.cdo.internal.common.id.CDOIDMetaRangeImpl; +import org.eclipse.emf.cdo.internal.common.id.CDOIDTempMetaImpl; +import org.eclipse.emf.cdo.internal.common.id.CDOIDTempObjectImpl; +import org.eclipse.emf.cdo.spi.common.CDOIDLibraryDescriptorImpl; +import org.eclipse.emf.cdo.spi.common.CDOIDLongImpl; + +import org.eclipse.net4j.util.ImplementationError; +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; +import org.eclipse.net4j.util.om.trace.ContextTracer; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public final class CDOIDUtil +{ + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_MODEL, CDOIDUtil.class); + + private CDOIDUtil() + { + } + + public static long getLong(CDOID id) + { + if (id == null) + { + return 0L; + } + + switch (id.getType()) + { + case NULL: + return 0L; + case OBJECT: + case LEGACY_OBJECT: + if (id instanceof CDOIDLongImpl) + { + return ((CDOIDLongImpl)id).getLongValue(); + } + + throw new IllegalArgumentException("Unknown CDOIDObject implementation: " + id.getClass().getName()); + + case META: + return ((CDOIDMeta)id).getLongValue(); + case TEMP_META: + case TEMP_OBJECT: + throw new IllegalArgumentException("id instanceof CDOIDTemp"); + default: + throw new ImplementationError(); + } + } + + public static CDOIDTemp createTempMeta(int value) + { + return new CDOIDTempMetaImpl(value); + } + + public static CDOIDTemp createTempObject(int value) + { + return new CDOIDTempObjectImpl(value); + } + + public static CDOID createLong(long value) + { + if (value == 0L) + { + return CDOID.NULL; + } + + return new CDOIDLongImpl(value); + } + + public static CDOID read(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException + { + return read(in, factory, false); + } + + public static CDOID read(ExtendedDataInput in, CDOIDObjectFactory factory, boolean asLegacy) throws IOException + { + byte ordinal = in.readByte(); + if (TRACER.isEnabled()) + { + String type; + try + { + type = Type.values()[ordinal].toString(); + } + catch (RuntimeException ex) + { + type = ex.getMessage(); + } + + TRACER.format("Reading CDOID of type {0} ({1})", ordinal, type); + } + + Type type = Type.values()[ordinal]; + if (asLegacy) + { + switch (type) + { + case NULL: + case TEMP_OBJECT: + case TEMP_META: + case META: + case OBJECT: + throw new IllegalStateException("Missing classRef"); + + case LEGACY_OBJECT: + { + CDOIDObject id = factory.createCDOIDObject(in); + id.read(in); + CDOClassRef classRef = CDOModelUtil.readClassRef(in); + return id.asLegacy(classRef); + } + + default: + throw new ImplementationError(); + } + } + + // Not asLegacy + switch (type) + { + case NULL: + return CDOID.NULL; + + case TEMP_OBJECT: + return new CDOIDTempObjectImpl(in.readInt()); + + case TEMP_META: + return new CDOIDTempMetaImpl(in.readInt()); + + case META: + return new CDOIDMetaImpl(in.readLong()); + + case OBJECT: + { + CDOIDObject id = factory.createCDOIDObject(in); + id.read(in); + return id;// new CDOIDLongImpl(in.readLong()); + } + + case LEGACY_OBJECT: + { + CDOIDObject id = factory.createCDOIDObject(in); + id.read(in); + CDOModelUtil.readClassRef(in); // Discard classRef from stream + return id; + } + + default: + throw new ImplementationError(); + } + } + + public static void write(ExtendedDataOutput out, CDOID id) throws IOException + { + write(out, id, false); + } + + public static void write(ExtendedDataOutput out, CDOID id, boolean asLegacy) throws IOException + { + if (id == null) + { + id = CDOID.NULL; + } + + Type type = id.getType(); + int ordinal = type.ordinal(); + if (TRACER.isEnabled()) + { + TRACER.format("Writing CDOID of type {0} ({1})", ordinal, type); + } + + out.writeByte(ordinal); + if (asLegacy) + { + switch (type) + { + case NULL: + case TEMP_OBJECT: + case TEMP_META: + case META: + case OBJECT: + throw new IllegalStateException("Missing classRef"); + + case LEGACY_OBJECT: + CDOIDObject legacy = (CDOIDObject)id; + legacy.write(out); + CDOModelUtil.writeClassRef(out, legacy.getClassRef()); + return; + + default: + throw new ImplementationError(); + } + } + + // Not asLegacy + id.write(out); + } + + public static CDOIDMeta createMeta(long value) + { + return new CDOIDMetaImpl(value); + } + + public static CDOIDMetaRange createMetaRange(CDOID lowerBound, int count) + { + return new CDOIDMetaRangeImpl(lowerBound, count); + } + + public static CDOIDMetaRange readMetaRange(ExtendedDataInput in) throws IOException + { + boolean exist = in.readBoolean(); + if (exist) + { + return new CDOIDMetaRangeImpl(read(in, null), in.readInt()); + } + + return null; + } + + public static void writeMetaRange(ExtendedDataOutput out, CDOIDMetaRange idRange) throws IOException + { + if (idRange == null) + { + out.writeBoolean(false); + } + else + { + out.writeBoolean(true); + write(out, idRange.getLowerBound()); + out.writeInt(idRange.size()); + } + } + + public static CDOIDLibraryDescriptor readLibraryDescriptor(ExtendedDataInput in) throws IOException + { + return new CDOIDLibraryDescriptorImpl(in); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClass.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClass.java new file mode 100644 index 0000000000..ec4823b98d --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClass.java @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model; + +/** + * @author Eike Stepper + */ +public interface CDOClass extends CDOModelElement, Comparable<CDOClass> +{ + public int getClassifierID(); + + public boolean isAbstract(); + + public boolean isResource(); + + public boolean isRoot(); + + public int getSuperTypeCount(); + + public CDOClass getSuperType(int index); + + public CDOClass[] getSuperTypes(); + + /** + * @return An array of all super types. The array is not a copy and must not be modified! + */ + public CDOClass[] getAllSuperTypes(); + + public int getFeatureCount(); + + public CDOFeature lookupFeature(int featureID); + + public CDOFeature lookupFeature(String name); + + public CDOFeature[] getFeatures(); + + public int getFeatureID(CDOFeature feature); + + /** + * @return An array of all features. The array is not a copy and must not be modified! + */ + public CDOFeature[] getAllFeatures(); + + public CDOClassRef createClassRef(); + + public CDOPackage getContainingPackage(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassProxy.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassProxy.java new file mode 100644 index 0000000000..5d887735af --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassProxy.java @@ -0,0 +1,100 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model; + +/** + * @author Eike Stepper + */ +public final class CDOClassProxy +{ + private CDOPackageManager packageManager; + + private CDOClassRef classRef; + + private CDOClass cdoClass; + + public CDOClassProxy() + { + } + + public CDOClassProxy(CDOClassRef classRef, CDOPackageManager packageManager) + { + this.classRef = classRef; + this.packageManager = packageManager; + } + + public CDOClassProxy(CDOClass cdoClass) + { + this.cdoClass = cdoClass; + } + + public String getPackageURI() + { + if (cdoClass == null) + { + return classRef.getPackageURI(); + } + + return cdoClass.getContainingPackage().getPackageURI(); + } + + public int getClassifierID() + { + if (cdoClass == null) + { + return classRef.getClassifierID(); + } + + return cdoClass.getClassifierID(); + } + + // TODO Clarify camel case + public CDOClass getCdoClass() + { + if (cdoClass == null) + { + cdoClass = classRef.resolve(packageManager); + if (cdoClass == null) + { + throw new IllegalStateException("Unable to resolve class ref: " + classRef); + } + } + + return cdoClass; + } + + // TODO Clarify camel case + public void setCdoClass(CDOClass cdoClass) + { + this.cdoClass = cdoClass; + } + + public CDOClassRef getClassRef() + { + if (classRef == null) + { + classRef = cdoClass.createClassRef(); + } + + return classRef; + } + + @Override + public String toString() + { + if (cdoClass != null) + { + return cdoClass.toString(); + } + + return classRef.toString(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassRef.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassRef.java new file mode 100644 index 0000000000..832f792862 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassRef.java @@ -0,0 +1,23 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model; + +/** + * @author Eike Stepper + */ +public interface CDOClassRef +{ + public String getPackageURI(); + + public int getClassifierID(); + + public CDOClass resolve(CDOPackageManager packageManager); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOFeature.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOFeature.java new file mode 100644 index 0000000000..4e3f8d6203 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOFeature.java @@ -0,0 +1,37 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model; + +/** + * @author Eike Stepper + */ +public interface CDOFeature extends CDOModelElement +{ + public int getFeatureID(); + + public int getFeatureIndex(); + + public CDOType getType(); + + public boolean isMany(); + + public boolean isReference(); + + public boolean isContainment(); + + public CDOClass getReferenceType(); + + public CDOClassProxy getReferenceTypeProxy(); + + public CDOClass getContainingClass(); + + public CDOPackage getContainingPackage(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelElement.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelElement.java new file mode 100644 index 0000000000..daf5ea6fde --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelElement.java @@ -0,0 +1,25 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model; + +/** + * @author Eike Stepper + */ +public interface CDOModelElement +{ + public CDOPackageManager getPackageManager(); + + public String getName(); + + public Object getClientInfo(); + + public Object getServerInfo(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java new file mode 100644 index 0000000000..ec62a70885 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java @@ -0,0 +1,151 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model; + +import org.eclipse.emf.cdo.common.id.CDOIDMetaRange; +import org.eclipse.emf.cdo.internal.common.model.CDOClassImpl; +import org.eclipse.emf.cdo.internal.common.model.CDOClassRefImpl; +import org.eclipse.emf.cdo.internal.common.model.CDOFeatureImpl; +import org.eclipse.emf.cdo.internal.common.model.CDOPackageImpl; +import org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl; +import org.eclipse.emf.cdo.spi.common.InternalCDOClass; +import org.eclipse.emf.cdo.spi.common.InternalCDOFeature; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public final class CDOModelUtil +{ + private CDOModelUtil() + { + } + + // /////////////////////////////////////////////// + + public static CDOType getType(int typeID) + { + CDOTypeImpl type = CDOTypeImpl.ids.get(typeID); + if (type == null) + { + throw new IllegalStateException("No type for id " + typeID); + } + + return type; + } + + public static CDOType readType(ExtendedDataInput in) throws IOException + { + int typeID = in.readInt(); + return getType(typeID); + } + + public static void writeType(ExtendedDataOutput out, CDOType type) throws IOException + { + ((CDOTypeImpl)type).write(out); + } + + // /////////////////////////////////////////////// + + public static CDOPackage createPackage(CDOPackageManager packageManager, String packageURI, String name, + String ecore, boolean dynamic, CDOIDMetaRange metaIDRange, String parentURI) + { + return new CDOPackageImpl(packageManager, packageURI, name, ecore, dynamic, metaIDRange, parentURI); + } + + public static CDOPackage createProxyPackage(CDOPackageManager packageManager, String packageURI, boolean dynamic, + CDOIDMetaRange metaIDRange, String parentURI) + { + return new CDOPackageImpl(packageManager, packageURI, dynamic, metaIDRange, parentURI); + } + + public static CDOPackage readPackage(CDOPackageManager packageManager, ExtendedDataInput in) throws IOException + { + return new CDOPackageImpl(packageManager, in); + } + + public static void writePackage(ExtendedDataOutput out, CDOPackage cdoPackage) throws IOException + { + ((CDOPackageImpl)cdoPackage).write(out); + } + + // /////////////////////////////////////////////// + + public static CDOClass createClass(CDOPackage containingPackage, int classifierID, String name, boolean isAbstract) + { + return new CDOClassImpl(containingPackage, classifierID, name, isAbstract); + } + + public static CDOClass readClass(CDOPackage containingPackage, ExtendedDataInput in) throws IOException + { + return new CDOClassImpl(containingPackage, in); + } + + public static void writeClass(ExtendedDataOutput out, CDOClass cdoClass) throws IOException + { + ((InternalCDOClass)cdoClass).write(out); + } + + // /////////////////////////////////////////////// + + public static CDOFeature createAttribute(CDOClass containingClass, int featureID, String name, CDOType type, + boolean many) + { + return new CDOFeatureImpl(containingClass, featureID, name, type, many); + } + + public static CDOFeature createReference(CDOClass containingClass, int featureID, String name, + CDOClassProxy referenceType, boolean many, boolean containment) + { + return new CDOFeatureImpl(containingClass, featureID, name, referenceType, many, containment); + } + + public static CDOFeature readFeature(CDOClass containingClass, ExtendedDataInput in) throws IOException + { + return new CDOFeatureImpl(containingClass, in); + } + + public static void writeFeature(ExtendedDataOutput out, CDOFeature cdoFeature) throws IOException + { + ((InternalCDOFeature)cdoFeature).write(out); + } + + // /////////////////////////////////////////////// + + public static CDOClassRef createClassRef(String packageURI, int classifierID) + { + return new CDOClassRefImpl(packageURI, classifierID); + } + + public static CDOClassRef readClassRef(ExtendedDataInput in, String defaultURI) throws IOException + { + return new CDOClassRefImpl(in, defaultURI); + } + + public static CDOClassRef readClassRef(ExtendedDataInput in) throws IOException + { + return readClassRef(in, null); + } + + public static void writeClassRef(ExtendedDataOutput out, CDOClassRef classRef, String defaultURI) throws IOException + { + ((CDOClassRefImpl)classRef).write(out, defaultURI); + } + + public static void writeClassRef(ExtendedDataOutput out, CDOClassRef classRef) throws IOException + { + writeClassRef(out, classRef, null); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackage.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackage.java new file mode 100644 index 0000000000..a2716512c3 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackage.java @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model; + +import org.eclipse.emf.cdo.common.id.CDOIDMetaRange; + +/** + * @author Eike Stepper + */ +public interface CDOPackage extends CDOModelElement, Comparable<CDOPackage> +{ + public CDOPackageManager getPackageManager(); + + public String getPackageURI(); + + public int getClassCount(); + + public CDOClass[] getClasses(); + + public CDOClass[] getConcreteClasses(); + + public CDOClass lookupClass(int classifierID); + + public String getEcore(); + + public boolean isSystem(); + + public boolean isDynamic(); + + public boolean isProxy(); + + public boolean isPersistent(); + + public CDOIDMetaRange getMetaIDRange(); + + public String getParentURI(); + + public CDOPackage getParentPackage(); + + public CDOPackage getTopLevelPackage(); + + public CDOPackage[] getSubPackages(boolean recursive); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageInfo.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageInfo.java new file mode 100644 index 0000000000..b03b2aecba --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageInfo.java @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model; + +import org.eclipse.emf.cdo.common.id.CDOIDMetaRange; + +/** + * TODO Add read(), write(), ... + * + * @author Eike Stepper + */ +public final class CDOPackageInfo +{ + private String packageURI; + + private boolean dynamic; + + private CDOIDMetaRange metaIDRange; + + private String parentURI; + + public CDOPackageInfo(String packageURI, boolean dynamic, CDOIDMetaRange metaIDRange, String parentURI) + { + this.packageURI = packageURI; + this.dynamic = dynamic; + this.metaIDRange = metaIDRange; + this.parentURI = parentURI; + } + + public String getPackageURI() + { + return packageURI; + } + + public boolean isDynamic() + { + return dynamic; + } + + public CDOIDMetaRange getMetaIDRange() + { + return metaIDRange; + } + + public String getParentURI() + { + return parentURI; + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageManager.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageManager.java new file mode 100644 index 0000000000..bd6d7e3a6b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageManager.java @@ -0,0 +1,35 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model; + +import org.eclipse.emf.cdo.common.id.CDOIDObjectFactory; +import org.eclipse.emf.cdo.common.model.core.CDOCorePackage; +import org.eclipse.emf.cdo.common.model.resource.CDOResourcePackage; + +import org.eclipse.net4j.util.container.IContainer; + +/** + * @author Eike Stepper + */ +public interface CDOPackageManager extends IContainer<CDOPackage> +{ + public CDOIDObjectFactory getCDOIDObjectFactory(); + + public int getPackageCount(); + + public CDOPackage[] getPackages(); + + public CDOPackage lookupPackage(String packageURI); + + public CDOCorePackage getCDOCorePackage(); + + public CDOResourcePackage getCDOResourcePackage(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOType.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOType.java new file mode 100644 index 0000000000..558ba8253a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOType.java @@ -0,0 +1,80 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model; + +import org.eclipse.emf.cdo.common.id.CDOIDObjectFactory; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public interface CDOType +{ + public static final CDOType OBJECT = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.OBJECT; + + public static final CDOType BOOLEAN = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.BOOLEAN; + + public static final CDOType BOOLEAN_OBJECT = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.BOOLEAN_OBJECT; + + public static final CDOType BYTE = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.BYTE; + + public static final CDOType BYTE_OBJECT = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.BYTE_OBJECT; + + public static final CDOType CHAR = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.CHAR; + + public static final CDOType CHARACTER_OBJECT = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.CHARACTER_OBJECT; + + public static final CDOType DATE = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.DATE; + + public static final CDOType DOUBLE = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.DOUBLE; + + public static final CDOType DOUBLE_OBJECT = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.DOUBLE_OBJECT; + + public static final CDOType FLOAT = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.FLOAT; + + public static final CDOType FLOAT_OBJECT = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.FLOAT_OBJECT; + + public static final CDOType INT = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.INT; + + public static final CDOType INTEGER_OBJECT = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.INTEGER_OBJECT; + + public static final CDOType LONG = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.LONG; + + public static final CDOType LONG_OBJECT = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.LONG_OBJECT; + + public static final CDOType SHORT = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.SHORT; + + public static final CDOType SHORT_OBJECT = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.SHORT_OBJECT; + + public static final CDOType STRING = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.STRING; + + public static final CDOType BYTE_ARRAY = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.BYTE_ARRAY; + + public static final CDOType CUSTOM = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.CUSTOM; + + public String getName(); + + public int getTypeID(); + + public boolean canBeNull(); + + public Object getDefaultValue(); + + public Object copyValue(Object value); + + public Object readValue(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException; + + public void writeValue(ExtendedDataOutput out, Object value) throws IOException; +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/core/CDOCorePackage.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/core/CDOCorePackage.java new file mode 100644 index 0000000000..908af68f9b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/core/CDOCorePackage.java @@ -0,0 +1,25 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model.core; + +import org.eclipse.emf.cdo.common.model.CDOPackage; + +/** + * @author Eike Stepper + */ +public interface CDOCorePackage extends CDOPackage +{ + public static final String PACKAGE_URI = "http://www.eclipse.org/emf/CDO/core/1.0.0"; + + public static final String NAME = "cdocore"; + + public CDOObjectClass getCDOObjectClass(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/core/CDOObjectClass.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/core/CDOObjectClass.java new file mode 100644 index 0000000000..ffb3f161bc --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/core/CDOObjectClass.java @@ -0,0 +1,23 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model.core; + +import org.eclipse.emf.cdo.common.model.CDOClass; + +/** + * @author Eike Stepper + */ +public interface CDOObjectClass extends CDOClass +{ + public static final int CLASSIFIER_ID = 0; + + public static final String NAME = "CDOObject"; +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/resource/CDOContentsFeature.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/resource/CDOContentsFeature.java new file mode 100644 index 0000000000..d8bfeebdc4 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/resource/CDOContentsFeature.java @@ -0,0 +1,23 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model.resource; + +import org.eclipse.emf.cdo.common.model.CDOFeature; + +/** + * @author Eike Stepper + */ +public interface CDOContentsFeature extends CDOFeature +{ + public static final int FEATURE_ID = 2; + + public static final String NAME = "contents"; +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/resource/CDOPathFeature.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/resource/CDOPathFeature.java new file mode 100644 index 0000000000..1438fb1f57 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/resource/CDOPathFeature.java @@ -0,0 +1,23 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model.resource; + +import org.eclipse.emf.cdo.common.model.CDOFeature; + +/** + * @author Eike Stepper + */ +public interface CDOPathFeature extends CDOFeature +{ + public static final int FEATURE_ID = 9; + + public static final String NAME = "path"; +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/resource/CDOResourceClass.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/resource/CDOResourceClass.java new file mode 100644 index 0000000000..dde37970b2 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/resource/CDOResourceClass.java @@ -0,0 +1,27 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model.resource; + +import org.eclipse.emf.cdo.common.model.CDOClass; + +/** + * @author Eike Stepper + */ +public interface CDOResourceClass extends CDOClass +{ + public static final int CLASSIFIER_ID = 0; + + public static final String NAME = "CDOResource"; + + public CDOPathFeature getCDOPathFeature(); + + public CDOContentsFeature getCDOContentsFeature(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/resource/CDOResourcePackage.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/resource/CDOResourcePackage.java new file mode 100644 index 0000000000..309040391c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/resource/CDOResourcePackage.java @@ -0,0 +1,26 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.model.resource; + +import org.eclipse.emf.cdo.common.model.CDOPackage; + +/** + * @author Eike Stepper + */ +public interface CDOResourcePackage extends CDOPackage +{ + public static final String PACKAGE_URI = "http://www.eclipse.org/emf/CDO/resource/1.0.0"; + + public static final String NAME = "cdoresource"; + + public CDOResourceClass getCDOResourceClass(); + +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOReferenceProxy.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOReferenceProxy.java new file mode 100644 index 0000000000..d7c466de6e --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOReferenceProxy.java @@ -0,0 +1,28 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.model.CDOFeature; + +/** + * @author Eike Stepper + */ +public interface CDOReferenceProxy +{ + public CDORevision getRevision(); + + public CDOFeature getFeature(); + + public int getIndex(); + + public CDOID resolve(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevision.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevision.java new file mode 100644 index 0000000000..a38fabb631 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevision.java @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + * Simon McDuff - delta support + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDProvider; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta; + +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public interface CDORevision +{ + public static final long UNSPECIFIED_DATE = 0; + + public static final int UNCHUNKED = -1; + + public CDORevisionResolver getRevisionResolver(); + + public CDOClass getCDOClass(); + + public CDOID getID(); + + public int getVersion(); + + public long getCreated(); + + public long getRevised(); + + public boolean isCurrent(); + + public boolean isValid(long timeStamp); + + public boolean isTransactional(); + + public boolean isResource(); + + public CDORevisionData getData(); + + public CDORevisionDelta compare(CDORevision origin); + + public void merge(CDORevisionDelta delta); + + public void write(ExtendedDataOutput out, CDOIDProvider idProvider, int referenceChunk) throws IOException; +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionData.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionData.java new file mode 100644 index 0000000000..06bf2b8384 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionData.java @@ -0,0 +1,48 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.model.CDOFeature; + +/** + * @author Eike Stepper + */ +public interface CDORevisionData +{ + public CDORevision getRevision(); + + public CDOID getResourceID(); + + public CDOID getContainerID(); + + public int getContainingFeatureID(); + + public Object get(CDOFeature feature, int index); + + public int size(CDOFeature feature); + + public boolean isEmpty(CDOFeature feature); + + public boolean contains(CDOFeature feature, Object value); + + public int indexOf(CDOFeature feature, Object value); + + public int lastIndexOf(CDOFeature feature, Object value); + + public boolean isSet(CDOFeature feature); + + public <T> T[] toArray(CDOFeature feature, T[] array); + + public Object[] toArray(CDOFeature feature); + + public int hashCode(CDOFeature feature); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionResolver.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionResolver.java new file mode 100644 index 0000000000..76bf815920 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionResolver.java @@ -0,0 +1,64 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDObjectFactory; +import org.eclipse.emf.cdo.common.model.CDOClass; + +import java.util.Collection; +import java.util.List; + +/** + * @author Eike Stepper + */ +public interface CDORevisionResolver +{ + public CDOIDObjectFactory getCDOIDObjectFactory(); + + /** + * @return The type of an object if a revision for that object is in the revision cache, <code>null</code> otherwise. + */ + public CDOClass getObjectType(CDOID id); + + public boolean containsRevision(CDOID id); + + public boolean containsRevisionByTime(CDOID id, long timeStamp); + + public boolean containsRevisionByVersion(CDOID id, int version); + + public CDORevision getRevision(CDOID id, int referenceChunk); + + public CDORevision getRevisionByTime(CDOID id, int referenceChunk, long timeStamp); + + public CDORevision getRevisionByVersion(CDOID id, int referenceChunk, int version); + + public CDORevision getRevisionByVersion(CDOID id, int referenceChunk, int version, boolean loadOnDemand); + + public List<CDORevision> getRevisions(Collection<CDOID> ids, int referenceChunk); + + public List<CDORevision> getRevisionsByTime(Collection<CDOID> ids, int referenceChunk, long timeStamp); + + public CDOID resolveReferenceProxy(CDOReferenceProxy referenceProxy); + + /** + * Analyzing a list of values with respect to consecutive sequences of {@link CDOReferenceProxy} instances. A sequence + * of reference proxies is considered consecutive if and only if the {@link CDOReferenceProxy#getIndex() ids} of each + * proxy is the ids of its predecessor increased by one. + * <p> + * Implementation note: The implementation of this method should try to determine and deliver the longest possible + * consecutive sequences. + * + * @return An integer list of the range <b>sizes</b>. A positive integer denotes a range of non-proxies. A negative + * integer denotes a range of proxies. Ranges of zero size are not possible by definition. + */ + public List<Integer> analyzeReferenceRanges(List<Object> list); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java new file mode 100644 index 0000000000..a7828ed1ed --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java @@ -0,0 +1,71 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOPackageManager; +import org.eclipse.emf.cdo.internal.common.revision.CDORevisionImpl; + +import org.eclipse.net4j.util.io.ExtendedDataInput; + +import java.io.IOException; +import java.util.Map; + +/** + * @author Eike Stepper + */ +public final class CDORevisionUtil +{ + public static final Object UNINITIALIZED = new Uninitialized(); + + private CDORevisionUtil() + { + } + + public static CDORevision create(CDORevisionResolver revisionResolver, CDOClass cdoClass, CDOID id) + { + return new CDORevisionImpl(revisionResolver, cdoClass, id); + } + + public static CDORevision copy(CDORevision source) + { + return new CDORevisionImpl((CDORevisionImpl)source); + } + + public static CDORevision read(ExtendedDataInput in, CDORevisionResolver revisionResolver, + CDOPackageManager packageManager) throws IOException + { + return new CDORevisionImpl(in, revisionResolver, packageManager); + } + + public static Object remapID(Object value, Map<CDOIDTemp, CDOID> idMappings) + { + return CDORevisionImpl.remapID(value, idMappings); + } + + /** + * @author Eike Stepper + */ + private static final class Uninitialized + { + public Uninitialized() + { + } + + @Override + public String toString() + { + return "UNINITIALIZED"; + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOAddFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOAddFeatureDelta.java new file mode 100644 index 0000000000..a3617c70fe --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOAddFeatureDelta.java @@ -0,0 +1,22 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision.delta; + +/** + * @author Simon McDuff + */ +public interface CDOAddFeatureDelta extends CDOFeatureDelta +{ + public int getIndex(); + + public Object getValue(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOClearFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOClearFeatureDelta.java new file mode 100644 index 0000000000..61f22a3d03 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOClearFeatureDelta.java @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision.delta; + +/** + * @author Simon McDuff + */ +public interface CDOClearFeatureDelta extends CDOFeatureDelta +{ +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOContainerFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOContainerFeatureDelta.java new file mode 100644 index 0000000000..bfcecf7a91 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOContainerFeatureDelta.java @@ -0,0 +1,24 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision.delta; + +import org.eclipse.emf.cdo.common.id.CDOID; + +/** + * @author Simon McDuff + */ +public interface CDOContainerFeatureDelta extends CDOFeatureDelta +{ + public CDOID getContainerID(); + + public int getContainerFeatureID(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDelta.java new file mode 100644 index 0000000000..b6abd5cd21 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDelta.java @@ -0,0 +1,37 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision.delta; + +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.revision.CDORevision; + +/** + * @author Simon McDuff + */ +public interface CDOFeatureDelta +{ + public Type getType(); + + public CDOFeature getFeature(); + + public void apply(CDORevision revision); + + public void accept(CDOFeatureDeltaVisitor visitor); + + /** + * @author Simon McDuff + */ + public enum Type + { + ADD, REMOVE, CLEAR, MOVE, SET, UNSET, LIST, CONTAINER + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDeltaHandler.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDeltaHandler.java new file mode 100644 index 0000000000..fe9597452a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDeltaHandler.java @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision.delta; + +/** + * @author Eike Stepper + */ +public interface CDOFeatureDeltaHandler +{ + public void handleFeatureDelta(CDOFeatureDelta featureDelta); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDeltaVisitor.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDeltaVisitor.java new file mode 100644 index 0000000000..17e4b2e980 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDeltaVisitor.java @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision.delta; + +/** + * @author Simon McDuff + */ +public interface CDOFeatureDeltaVisitor +{ + public void visit(CDOMoveFeatureDelta delta); + + public void visit(CDOAddFeatureDelta delta); + + public void visit(CDORemoveFeatureDelta delta); + + public void visit(CDOSetFeatureDelta delta); + + public void visit(CDOUnsetFeatureDelta delta); + + public void visit(CDOListFeatureDelta delta); + + public void visit(CDOClearFeatureDelta delta); + + public void visit(CDOContainerFeatureDelta delta); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOListFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOListFeatureDelta.java new file mode 100644 index 0000000000..8b2eb714d1 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOListFeatureDelta.java @@ -0,0 +1,22 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision.delta; + +import java.util.List; + +/** + * @author Simon McDuff + */ +public interface CDOListFeatureDelta extends CDOFeatureDelta +{ + public List<CDOFeatureDelta> getListChanges(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOMoveFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOMoveFeatureDelta.java new file mode 100644 index 0000000000..0b76002436 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOMoveFeatureDelta.java @@ -0,0 +1,22 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision.delta; + +/** + * @author Simon McDuff + */ +public interface CDOMoveFeatureDelta extends CDOFeatureDelta +{ + public int getOldPosition(); + + public int getNewPosition(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORemoveFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORemoveFeatureDelta.java new file mode 100644 index 0000000000..6458bd5ce6 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORemoveFeatureDelta.java @@ -0,0 +1,20 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision.delta; + +/** + * @author Simon McDuff + */ +public interface CDORemoveFeatureDelta extends CDOFeatureDelta +{ + public int getIndex(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDelta.java new file mode 100644 index 0000000000..cf543f68fd --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDelta.java @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266 + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision.delta; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDProvider; +import org.eclipse.emf.cdo.common.revision.CDORevision; + +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; +import java.util.List; + +/** + * @author Eike Stepper + */ +public interface CDORevisionDelta +{ + public CDOID getID(); + + public int getOriginVersion(); + + public int getDirtyVersion(); + + public List<CDOFeatureDelta> getFeatureDeltas(); + + public void apply(CDORevision revision); + + public void accept(CDOFeatureDeltaVisitor visitor); + + public void write(ExtendedDataOutput out, CDOIDProvider idProvider) throws IOException; +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDeltaUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDeltaUtil.java new file mode 100644 index 0000000000..09b99d01aa --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDeltaUtil.java @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision.delta; + +import org.eclipse.emf.cdo.common.model.CDOPackageManager; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl; + +import org.eclipse.net4j.util.io.ExtendedDataInput; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public final class CDORevisionDeltaUtil +{ + private CDORevisionDeltaUtil() + { + } + + public static CDORevisionDelta create(CDORevision revision) + { + return new CDORevisionDeltaImpl(revision); + } + + public static CDORevisionDelta create(CDORevision originRevision, CDORevision dirtyRevision) + { + return new CDORevisionDeltaImpl(originRevision, dirtyRevision); + } + + public static CDORevisionDelta read(ExtendedDataInput in, CDOPackageManager packageManager) throws IOException + { + return new CDORevisionDeltaImpl(in, packageManager); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOSetFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOSetFeatureDelta.java new file mode 100644 index 0000000000..6d9bff9ca8 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOSetFeatureDelta.java @@ -0,0 +1,22 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision.delta; + +/** + * @author Simon McDuff + */ +public interface CDOSetFeatureDelta extends CDOFeatureDelta +{ + public int getIndex(); + + public Object getValue(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOUnsetFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOUnsetFeatureDelta.java new file mode 100644 index 0000000000..eb095cd9ec --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOUnsetFeatureDelta.java @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.common.revision.delta; + +/** + * @author Simon McDuff + */ +public interface CDOUnsetFeatureDelta extends CDOFeatureDelta +{ +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOException.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOException.java new file mode 100644 index 0000000000..cc62eb638c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOException.java @@ -0,0 +1,38 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.util; + +/** + * @author Eike Stepper + */ +public class CDOException extends RuntimeException +{ + private static final long serialVersionUID = 1L; + + public CDOException() + { + } + + public CDOException(String message) + { + super(message); + } + + public CDOException(Throwable cause) + { + super(cause); + } + + public CDOException(String message, Throwable cause) + { + super(message, cause); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOGZIPStreamWrapperInjector.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOGZIPStreamWrapperInjector.java new file mode 100644 index 0000000000..22f6bad1b0 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOGZIPStreamWrapperInjector.java @@ -0,0 +1,26 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.util; + +import org.eclipse.emf.cdo.common.CDOProtocolConstants; + +import org.eclipse.net4j.signal.wrapping.GZIPStreamWrapperInjector; + +/** + * @author Eike Stepper + */ +public class CDOGZIPStreamWrapperInjector extends GZIPStreamWrapperInjector +{ + public CDOGZIPStreamWrapperInjector() + { + super(CDOProtocolConstants.PROTOCOL_NAME); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOXORStreamWrapperInjector.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOXORStreamWrapperInjector.java new file mode 100644 index 0000000000..b0a7ebe86c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOXORStreamWrapperInjector.java @@ -0,0 +1,28 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.util; + +import org.eclipse.emf.cdo.common.CDOProtocolConstants; + +import org.eclipse.net4j.signal.wrapping.XORStreamWrapperInjector; + +/** + * @author Eike Stepper + */ +public class CDOXORStreamWrapperInjector extends XORStreamWrapperInjector +{ + private static final int[] key = { 0xAA, 0x55, 0xAA, 0x55 }; + + public CDOXORStreamWrapperInjector() + { + super(CDOProtocolConstants.PROTOCOL_NAME, key); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/TransportException.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/TransportException.java new file mode 100644 index 0000000000..9d55f61812 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/TransportException.java @@ -0,0 +1,38 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.common.util; + +/** + * @author Eike Stepper + */ +public class TransportException extends CDOException +{ + private static final long serialVersionUID = 1L; + + public TransportException() + { + } + + public TransportException(String message) + { + super(message); + } + + public TransportException(String message, Throwable cause) + { + super(message, cause); + } + + public TransportException(Throwable cause) + { + super(cause); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/CDOProtocolImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/CDOProtocolImpl.java new file mode 100644 index 0000000000..fb7b6affca --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/CDOProtocolImpl.java @@ -0,0 +1,37 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common; + +import org.eclipse.emf.cdo.common.CDOProtocol; +import org.eclipse.emf.cdo.common.CDOProtocolConstants; +import org.eclipse.emf.cdo.common.CDOProtocolSession; + +import org.eclipse.net4j.signal.SignalProtocol; + +/** + * @author Eike Stepper + */ +public abstract class CDOProtocolImpl extends SignalProtocol implements CDOProtocol +{ + public CDOProtocolImpl() + { + } + + public String getType() + { + return CDOProtocolConstants.PROTOCOL_NAME; + } + + public CDOProtocolSession getSession() + { + return (CDOProtocolSession)getInfraStructure(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/bundle/OM.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/bundle/OM.java new file mode 100644 index 0000000000..7556f5b29f --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/bundle/OM.java @@ -0,0 +1,60 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.bundle; + +import org.eclipse.net4j.util.om.OMBundle; +import org.eclipse.net4j.util.om.OMPlatform; +import org.eclipse.net4j.util.om.OSGiActivator; +import org.eclipse.net4j.util.om.log.OMLogger; +import org.eclipse.net4j.util.om.trace.OMTracer; + +/** + * The <em>Operations & Maintenance</em> class of this bundle. + * + * @author Eike Stepper + */ +public abstract class OM +{ + public static final String BUNDLE_ID = "org.eclipse.emf.cdo.common"; //$NON-NLS-1$ + + public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class); + + public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$ + + public static final OMTracer DEBUG_PROTOCOL = DEBUG.tracer("protocol"); //$NON-NLS-1$ + + public static final OMTracer DEBUG_ID = DEBUG.tracer("id"); //$NON-NLS-1$ + + public static final OMTracer DEBUG_MODEL = DEBUG.tracer("model"); //$NON-NLS-1$ + + public static final OMTracer DEBUG_REVISION = DEBUG.tracer("revision"); //$NON-NLS-1$ + + public static final OMTracer PERF = BUNDLE.tracer("perf"); //$NON-NLS-1$ + + public static final OMTracer PERF_REVISION = PERF.tracer("revision"); //$NON-NLS-1$ + + public static final OMTracer PERF_REVISION_READING = PERF_REVISION.tracer("reading"); //$NON-NLS-1$ + + public static final OMTracer PERF_REVISION_WRITING = PERF_REVISION.tracer("writing"); //$NON-NLS-1$ + + public static final OMLogger LOG = BUNDLE.logger(); + + /** + * @author Eike Stepper + */ + public static final class Activator extends OSGiActivator + { + public Activator() + { + super(BUNDLE); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDMetaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDMetaImpl.java new file mode 100644 index 0000000000..12f7e56ba3 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDMetaImpl.java @@ -0,0 +1,38 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.id; + +import org.eclipse.emf.cdo.common.id.CDOIDMeta; +import org.eclipse.emf.cdo.spi.common.AbstractCDOIDLong; + +/** + * @author Eike Stepper + */ +public class CDOIDMetaImpl extends AbstractCDOIDLong implements CDOIDMeta +{ + private static final long serialVersionUID = 1L; + + public CDOIDMetaImpl(long value) + { + super(value); + } + + public Type getType() + { + return Type.META; + } + + @Override + public String toString() + { + return "MID" + getLongValue(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDMetaRangeImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDMetaRangeImpl.java new file mode 100644 index 0000000000..ea727a67aa --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDMetaRangeImpl.java @@ -0,0 +1,118 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.id; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDMetaRange; +import org.eclipse.emf.cdo.common.id.CDOID.Type; + +import java.text.MessageFormat; + +/** + * @author Eike Stepper + */ +public final class CDOIDMetaRangeImpl implements CDOIDMetaRange +{ + private static final long serialVersionUID = 1L; + + private CDOID lowerBound; + + private int size; + + public CDOIDMetaRangeImpl(CDOID lowerBound, int size) + { + if (size < 0) + { + throw new IllegalArgumentException("size < 0"); + } + + this.lowerBound = lowerBound; + this.size = size; + } + + public CDOID getLowerBound() + { + return lowerBound; + } + + public CDOID getUpperBound() + { + return size > 0 ? get(size - 1) : null; + } + + public CDOID get(int index) + { + if (index < 0 || index >= size) + { + throw new IllegalArgumentException("ids < 0 || ids >= size"); + } + + if (isTemporary()) + { + return new CDOIDTempMetaImpl(((CDOIDTempMetaImpl)lowerBound).getIntValue() + index); + } + + return new CDOIDMetaImpl(((CDOIDMetaImpl)lowerBound).getLongValue() + index); + } + + public int size() + { + return size; + } + + public boolean isEmpty() + { + return size == 0; + } + + public boolean contains(CDOID id) + { + if (isTemporary()) + { + if (id.getType() != Type.TEMP_META) + { + throw new IllegalArgumentException("id.getType() != Type.TEMP_META"); + } + + int index = ((CDOIDTempMetaImpl)id).getIntValue() - ((CDOIDTempMetaImpl)lowerBound).getIntValue(); + return 0 <= index && index < size; + } + + if (id.getType() != Type.META) + { + throw new IllegalArgumentException("id.getType() != Type.META"); + } + + long index = ((CDOIDMetaImpl)id).getLongValue() - ((CDOIDMetaImpl)lowerBound).getLongValue(); + return 0L <= index && index < size; + } + + public CDOIDMetaRange increase() + { + return new CDOIDMetaRangeImpl(lowerBound, size + 1); + } + + public Type getType() + { + return lowerBound.getType(); + } + + public boolean isTemporary() + { + return lowerBound.isTemporary(); + } + + @Override + public String toString() + { + return MessageFormat.format("[{0}:{1}]", lowerBound, getUpperBound()); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDNullImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDNullImpl.java new file mode 100644 index 0000000000..dd959a4baa --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDNullImpl.java @@ -0,0 +1,89 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.id; + +import org.eclipse.emf.cdo.common.id.CDOIDMeta; +import org.eclipse.emf.cdo.common.id.CDOIDObject; +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.common.model.CDOClassRef; +import org.eclipse.emf.cdo.spi.common.AbstractCDOID; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public final class CDOIDNullImpl extends AbstractCDOID implements CDOIDMeta, CDOIDTemp, CDOIDObject +{ + public static final CDOIDNullImpl INSTANCE = new CDOIDNullImpl(); + + private static final long serialVersionUID = 1L; + + private CDOIDNullImpl() + { + } + + public Type getType() + { + return Type.NULL; + } + + public int getIntValue() + { + return 0; + } + + public long getLongValue() + { + return 0L; + } + + public CDOIDObject asLegacy(CDOClassRef classRef) + { + return this; + } + + public CDOClassRef getClassRef() + { + return null; + } + + public void read(ExtendedDataInput in) throws IOException + { + // Do nothing + } + + public void write(ExtendedDataOutput out) throws IOException + { + // Do nothing + } + + @Override + public boolean equals(Object obj) + { + return obj == INSTANCE; + } + + @Override + public int hashCode() + { + return 0; + } + + @Override + public String toString() + { + return "NULL"; + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDTempMetaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDTempMetaImpl.java new file mode 100644 index 0000000000..0d5b94a6fd --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDTempMetaImpl.java @@ -0,0 +1,38 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.id; + +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.spi.common.AbstractCDOIDInteger; + +/** + * @author Eike Stepper + */ +public class CDOIDTempMetaImpl extends AbstractCDOIDInteger implements CDOIDTemp +{ + private static final long serialVersionUID = 1L; + + public CDOIDTempMetaImpl(int value) + { + super(value); + } + + public Type getType() + { + return Type.TEMP_META; + } + + @Override + public String toString() + { + return "mid" + getIntValue(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDTempObjectImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDTempObjectImpl.java new file mode 100644 index 0000000000..09ba5432be --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDTempObjectImpl.java @@ -0,0 +1,38 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.id; + +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.spi.common.AbstractCDOIDInteger; + +/** + * @author Eike Stepper + */ +public class CDOIDTempObjectImpl extends AbstractCDOIDInteger implements CDOIDTemp +{ + private static final long serialVersionUID = 1L; + + public CDOIDTempObjectImpl(int value) + { + super(value); + } + + public Type getType() + { + return Type.TEMP_OBJECT; + } + + @Override + public String toString() + { + return "oid" + getIntValue(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassImpl.java new file mode 100644 index 0000000000..44d3608cfb --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassImpl.java @@ -0,0 +1,455 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.model; + +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOClassProxy; +import org.eclipse.emf.cdo.common.model.CDOClassRef; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.model.CDOModelUtil; +import org.eclipse.emf.cdo.common.model.CDOPackage; +import org.eclipse.emf.cdo.common.model.CDOPackageManager; +import org.eclipse.emf.cdo.internal.common.bundle.OM; +import org.eclipse.emf.cdo.spi.common.InternalCDOClass; +import org.eclipse.emf.cdo.spi.common.InternalCDOFeature; + +import org.eclipse.net4j.util.ObjectUtil; +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; +import org.eclipse.net4j.util.om.trace.ContextTracer; + +import java.io.IOException; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * @author Eike Stepper + */ +public class CDOClassImpl extends CDOModelElementImpl implements InternalCDOClass +{ + private static final ContextTracer MODEL = new ContextTracer(OM.DEBUG_MODEL, CDOClassImpl.class); + + private static final ContextTracer PROTOCOL = new ContextTracer(OM.DEBUG_PROTOCOL, CDOClassImpl.class); + + private CDOPackage containingPackage; + + private int classifierID; + + private boolean isAbstract; + + private List<CDOClassProxy> superTypes = new ArrayList<CDOClassProxy>(0); + + private List<CDOFeature> features = new ArrayList<CDOFeature>(0); + + private transient List<Integer> indices; + + private transient CDOClass[] allSuperTypes; + + private transient CDOFeature[] allFeatures; + + public CDOClassImpl() + { + } + + public CDOClassImpl(CDOPackage containingPackage, int classifierID, String name, boolean isAbstract) + { + super(name); + this.containingPackage = containingPackage; + this.classifierID = classifierID; + this.isAbstract = isAbstract; + if (MODEL.isEnabled()) + { + MODEL.format("Created {0}", this); + } + } + + public CDOClassImpl(CDOPackage containingPackage, ExtendedDataInput in) throws IOException + { + this.containingPackage = containingPackage; + read(in); + } + + @Override + public void read(ExtendedDataInput in) throws IOException + { + super.read(in); + classifierID = in.readInt(); + isAbstract = in.readBoolean(); + readSuperTypes(in); + readFeatures(in); + + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Read class: ID={0}, name={1}, abstract={2}", classifierID, getName(), isAbstract); + } + } + + @Override + public void write(ExtendedDataOutput out) throws IOException + { + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Writing class: ID={0}, name={1}, abstract={2}", classifierID, getName(), isAbstract); + } + + super.write(out); + out.writeInt(classifierID); + out.writeBoolean(isAbstract); + writeSuperTypes(out); + writeFeatures(out); + } + + public int getFeatureID(CDOFeature feature) + { + int index = feature.getFeatureIndex(); + if (index != -1) + { + CDOFeature[] features = getAllFeatures(); + while (index < features.length) + { + if (features[index] == feature) + { + return index; + } + + ++index; + } + } + + return -1; + } + + public CDOPackageManager getPackageManager() + { + return containingPackage.getPackageManager(); + } + + public CDOPackage getContainingPackage() + { + return containingPackage; + } + + public void setContainingPackage(CDOPackage containingPackage) + { + this.containingPackage = containingPackage; + } + + public int getClassifierID() + { + return classifierID; + } + + public void setClassifierID(int classifierID) + { + this.classifierID = classifierID; + } + + public boolean isAbstract() + { + return isAbstract; + } + + public void setAbstract(boolean isAbstract) + { + this.isAbstract = isAbstract; + } + + public boolean isResource() + { + return false; + } + + public boolean isRoot() + { + return false; + } + + public int getSuperTypeCount() + { + return superTypes.size(); + } + + public CDOClass[] getSuperTypes() + { + int size = superTypes.size(); + CDOClass[] result = new CDOClass[size]; + for (int i = 0; i < size; i++) + { + result[i] = getSuperType(i); + } + + return result; + } + + public void setSuperTypes(List<CDOClass> superTypes) + { + this.superTypes = new ArrayList<CDOClassProxy>(superTypes.size()); + for (CDOClass cdoClass : superTypes) + { + this.superTypes.add(new CDOClassProxy(cdoClass)); + } + } + + public CDOClass getSuperType(int index) + { + return superTypes.get(index).getCdoClass(); + } + + public List<CDOClassProxy> getSuperTypeProxies() + { + return Collections.unmodifiableList(superTypes); + } + + public int getFeatureCount() + { + return features.size(); + } + + public CDOFeature[] getFeatures() + { + return features.toArray(new CDOFeature[features.size()]); + } + + public void setFeatures(List<CDOFeature> features) + { + this.features = features; + for (CDOFeature feature : features) + { + ((InternalCDOFeature)feature).setContainingClass(this); + } + } + + public CDOFeature lookupFeature(int featureID) + { + int i = getFeatureIndex(featureID); + return getAllFeatures()[i]; + } + + public CDOFeature lookupFeature(String name) + { + for (CDOFeature feature : getAllFeatures()) + { + if (ObjectUtil.equals(feature.getName(), name)) + { + return feature; + } + } + + return null; + } + + public CDOClassRef createClassRef() + { + return CDOModelUtil.createClassRef(containingPackage.getPackageURI(), classifierID); + } + + public CDOClass[] getAllSuperTypes() + { + if (allSuperTypes == null) + { + List<CDOClass> result = new ArrayList<CDOClass>(0); + for (CDOClass superType : getSuperTypes()) + { + CDOClass[] higherSupers = superType.getAllSuperTypes(); + for (CDOClass higherSuper : higherSupers) + { + addUnique(higherSuper, result); + } + + addUnique(superType, result); + } + + allSuperTypes = result.toArray(new CDOClass[result.size()]); + } + + return allSuperTypes; + } + + public int getFeatureIndex(int featureID) + { + if (indices == null) + { + CDOFeature[] features = getAllFeatures(); + indices = new ArrayList<Integer>(features.length); + int index = 0; + for (CDOFeature feature : features) + { + if (feature.getContainingClass() == this) + { + ((InternalCDOFeature)feature).setFeatureIndex(index); + } + + setIndex(feature.getFeatureID(), index); + index++; + } + } + + return indices.get(featureID); + } + + public CDOFeature[] getAllFeatures() + { + if (allFeatures == null) + { + List<CDOFeature> result = new ArrayList<CDOFeature>(0); + for (CDOClass superType : getSuperTypes()) + { + CDOFeature[] features = superType.getAllFeatures(); + addAllFeatures(features, result); + } + + addAllFeatures(getFeatures(), result); + allFeatures = result.toArray(new CDOFeature[result.size()]); + } + + return allFeatures; + } + + public void addSuperType(CDOClassRef classRef) + { + if (MODEL.isEnabled()) + { + MODEL.format("Adding super type: {0}", classRef); + } + + superTypes.add(new CDOClassProxy(classRef, containingPackage.getPackageManager())); + } + + public void addFeature(CDOFeature cdoFeature) + { + if (MODEL.isEnabled()) + { + MODEL.format("Adding feature: {0}", cdoFeature); + } + + features.add(cdoFeature); + } + + public int compareTo(CDOClass that) + { + return getName().compareTo(that.getName()); + } + + @Override + public String toString() + { + return MessageFormat.format("CDOClass(ID={0}, name={1})", classifierID, getName()); + } + + @Override + protected void onInitialize() + { + for (CDOFeature cdoFeature : features) + { + ((InternalCDOFeature)cdoFeature).initialize(); + } + } + + private void setIndex(int featureID, int index) + { + while (indices.size() <= featureID) + { + indices.add(null); + } + + indices.set(featureID, index); + } + + private void readSuperTypes(ExtendedDataInput in) throws IOException + { + int size = in.readInt(); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Reading {0} super types", size); + } + + for (int i = 0; i < size; i++) + { + CDOClassRef classRef = CDOModelUtil.readClassRef(in, containingPackage.getPackageURI()); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Read super type: classRef={0}", classRef, classifierID); + } + + superTypes.add(new CDOClassProxy(classRef, containingPackage.getPackageManager())); + } + } + + private void readFeatures(ExtendedDataInput in) throws IOException + { + int size = in.readInt(); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Reading {0} features", size); + } + + for (int i = 0; i < size; i++) + { + CDOFeature cdoFeature = CDOModelUtil.readFeature(this, in); + addFeature(cdoFeature); + } + } + + private void writeSuperTypes(ExtendedDataOutput out) throws IOException + { + int size = superTypes.size(); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Writing {0} super types", size); + } + + out.writeInt(size); + for (CDOClassProxy proxy : superTypes) + { + CDOClassRef classRef = proxy.getClassRef(); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Writing super type: classRef={0}", classRef); + } + + CDOModelUtil.writeClassRef(out, classRef, containingPackage.getPackageURI()); + } + } + + private void writeFeatures(ExtendedDataOutput out) throws IOException + { + int size = features.size(); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Writing {0} features", size); + } + + out.writeInt(size); + for (CDOFeature cdoFeature : features) + { + CDOModelUtil.writeFeature(out, cdoFeature); + } + } + + private static void addAllFeatures(CDOFeature[] features, List<CDOFeature> result) + { + for (CDOFeature feature : features) + { + addUnique(feature, result); + } + } + + @SuppressWarnings("unchecked") + private static void addUnique(Object object, List result) + { + if (!result.contains(object)) + { + result.add(object); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassRefImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassRefImpl.java new file mode 100644 index 0000000000..6ce58cbf04 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassRefImpl.java @@ -0,0 +1,86 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.model; + +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOClassRef; +import org.eclipse.emf.cdo.common.model.CDOPackage; +import org.eclipse.emf.cdo.common.model.CDOPackageManager; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; +import java.text.MessageFormat; + +/** + * TODO Optimize transfer of CDOClassRef instances + * + * @author Eike Stepper + */ +public final class CDOClassRefImpl implements CDOClassRef +{ + private String packageURI; + + private int classifierID; + + public CDOClassRefImpl(String packageURI, int classifierID) + { + this.packageURI = packageURI; + this.classifierID = classifierID; + } + + public CDOClassRefImpl(ExtendedDataInput in, String defaultURI) throws IOException + { + // TODO Optimize transfer of URIs + packageURI = in.readString(); + if (packageURI == null) + { + packageURI = defaultURI; + } + + classifierID = in.readInt(); + } + + public void write(ExtendedDataOutput out, String defaultURI) throws IOException + { + // TODO Optimize transfer of URIs + out.writeString(packageURI.equals(defaultURI) ? null : packageURI); + out.writeInt(classifierID); + } + + public String getPackageURI() + { + return packageURI; + } + + public int getClassifierID() + { + return classifierID; + } + + public CDOClass resolve(CDOPackageManager packageManager) + { + CDOPackage cdoPackage = packageManager.lookupPackage(packageURI); + if (cdoPackage != null) + { + return cdoPackage.lookupClass(classifierID); + } + + return null; + } + + @Override + public String toString() + { + return MessageFormat.format("CDOClassRef({0}, {1})", packageURI, classifierID); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOFeatureImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOFeatureImpl.java new file mode 100644 index 0000000000..76b2a8a3dd --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOFeatureImpl.java @@ -0,0 +1,270 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.model; + +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOClassProxy; +import org.eclipse.emf.cdo.common.model.CDOClassRef; +import org.eclipse.emf.cdo.common.model.CDOModelUtil; +import org.eclipse.emf.cdo.common.model.CDOPackage; +import org.eclipse.emf.cdo.common.model.CDOPackageManager; +import org.eclipse.emf.cdo.common.model.CDOType; +import org.eclipse.emf.cdo.internal.common.bundle.OM; +import org.eclipse.emf.cdo.spi.common.InternalCDOClass; +import org.eclipse.emf.cdo.spi.common.InternalCDOFeature; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; +import org.eclipse.net4j.util.om.trace.ContextTracer; + +import java.io.IOException; +import java.text.MessageFormat; + +/** + * @author Eike Stepper + */ +public class CDOFeatureImpl extends CDOModelElementImpl implements InternalCDOFeature +{ + private static final int UNKNOWN_FEATURE_INDEX = Integer.MIN_VALUE; + + private static final ContextTracer MODEL = new ContextTracer(OM.DEBUG_MODEL, CDOFeatureImpl.class); + + private static final ContextTracer PROTOCOL = new ContextTracer(OM.DEBUG_PROTOCOL, CDOFeatureImpl.class); + + private CDOClass containingClass; + + private int featureID; + + private int featureIndex = UNKNOWN_FEATURE_INDEX; + + private CDOType type; + + private boolean many; + + private boolean containment; + + private CDOClassProxy referenceType; + + public CDOFeatureImpl() + { + } + + public CDOFeatureImpl(CDOClass containingClass, int featureID, String name, CDOType type, boolean many) + { + super(name); + if (type == CDOType.OBJECT) + { + throw new IllegalArgumentException("type == OBJECT"); + } + + this.containingClass = containingClass; + this.featureID = featureID; + this.type = type; + this.many = many; + if (MODEL.isEnabled()) + { + MODEL.format("Created {0}", this); + } + } + + public CDOFeatureImpl(CDOClass containingClass, int featureID, String name, CDOClassProxy referenceType, + boolean many, boolean containment) + { + super(name); + if (referenceType == null) + { + throw new IllegalArgumentException("referenceType == null"); + } + + this.containingClass = containingClass; + this.featureID = featureID; + type = CDOType.OBJECT; + this.many = many; + this.containment = containment; + this.referenceType = referenceType; + if (MODEL.isEnabled()) + { + MODEL.format("Created {0}", this); + } + } + + public CDOFeatureImpl(CDOClass containingClass, ExtendedDataInput in) throws IOException + { + this.containingClass = containingClass; + read(in); + } + + @Override + public void read(ExtendedDataInput in) throws IOException + { + super.read(in); + featureID = in.readInt(); + type = CDOModelUtil.readType(in); + many = in.readBoolean(); + containment = in.readBoolean(); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Read feature: ID={0}, name={1}, type={2}, many={3}, containment={4}", featureID, getName(), + type, many, containment); + } + + if (isReference()) + { + String defaultURI = containingClass.getContainingPackage().getPackageURI(); + CDOClassRef classRef = CDOModelUtil.readClassRef(in, defaultURI); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Read reference type: classRef={0}", classRef); + } + + referenceType = new CDOClassProxy(classRef, containingClass.getContainingPackage().getPackageManager()); + } + } + + @Override + public void write(ExtendedDataOutput out) throws IOException + { + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Writing feature: ID={0}, name={1}, type={2}, many={3}, containment={4}", featureID, getName(), + type, many, containment); + } + + super.write(out); + out.writeInt(featureID); + CDOModelUtil.writeType(out, type); + out.writeBoolean(many); + out.writeBoolean(containment); + + if (isReference()) + { + CDOClassRef classRef = referenceType.getClassRef(); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Writing reference type: classRef={0}", classRef); + } + + CDOModelUtil.writeClassRef(out, classRef, getContainingPackage().getPackageURI()); + } + } + + public CDOPackageManager getPackageManager() + { + return getContainingPackage().getPackageManager(); + } + + public CDOPackage getContainingPackage() + { + return containingClass.getContainingPackage(); + } + + public CDOClass getContainingClass() + { + return containingClass; + } + + public void setContainingClass(CDOClass containingClass) + { + this.containingClass = containingClass; + } + + public int getFeatureID() + { + return featureID; + } + + public void setFeatureID(int featureID) + { + this.featureID = featureID; + } + + public int getFeatureIndex() + { + if (featureIndex == UNKNOWN_FEATURE_INDEX) + { + featureIndex = ((InternalCDOClass)containingClass).getFeatureIndex(featureID); + } + + return featureIndex; + } + + public void setFeatureIndex(int featureIndex) + { + this.featureIndex = featureIndex; + } + + public CDOType getType() + { + return type; + } + + public void setType(CDOType type) + { + this.type = type; + } + + public boolean isMany() + { + return many; + } + + public void setMany(boolean many) + { + this.many = many; + } + + public boolean isReference() + { + return type == CDOType.OBJECT; + } + + public boolean isContainment() + { + return containment; + } + + public void setContainment(boolean containment) + { + this.containment = containment; + } + + public CDOClass getReferenceType() + { + if (referenceType == null) + { + return null; + } + + return referenceType.getCdoClass(); + } + + public void setReferenceType(CDOClass cdoClass) + { + referenceType = new CDOClassProxy(cdoClass); + } + + public CDOClassProxy getReferenceTypeProxy() + { + return referenceType; + } + + @Override + public String toString() + { + return MessageFormat.format("CDOFeature(ID={0}, name={1}, type={2}, referenceType={3})", featureID, getName(), + getType(), getReferenceTypeProxy()); + } + + @Override + protected void onInitialize() + { + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOModelElementImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOModelElementImpl.java new file mode 100644 index 0000000000..4eb233e5a2 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOModelElementImpl.java @@ -0,0 +1,114 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.model; + +import org.eclipse.emf.cdo.internal.common.bundle.OM; +import org.eclipse.emf.cdo.spi.common.InternalCDOModelElement; + +import org.eclipse.net4j.util.ImplementationError; +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; +import org.eclipse.net4j.util.om.trace.ContextTracer; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public abstract class CDOModelElementImpl implements InternalCDOModelElement +{ + private static final ContextTracer MODEL = new ContextTracer(OM.DEBUG_MODEL, CDOModelElementImpl.class); + + private String name; + + private Object clientInfo; + + private Object serverInfo; + + private boolean initialized; + + protected CDOModelElementImpl(String name) + { + this.name = name; + } + + protected CDOModelElementImpl() + { + } + + public void read(ExtendedDataInput in) throws IOException + { + name = in.readString(); + } + + public void write(ExtendedDataOutput out) throws IOException + { + out.writeString(name); + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public Object getClientInfo() + { + return clientInfo; + } + + public void setClientInfo(Object clientInfo) + { + if (MODEL.isEnabled()) + { + MODEL.format("Setting client info: {0} --> {1}", this, clientInfo); + } + + this.clientInfo = clientInfo; + } + + public Object getServerInfo() + { + return serverInfo; + } + + public void setServerInfo(Object serverInfo) + { + if (MODEL.isEnabled()) + { + MODEL.format("Setting server info: {0} --> {1}", this, serverInfo); + } + + this.serverInfo = serverInfo; + } + + public boolean isInitialized() + { + return initialized; + } + + public final void initialize() + { + if (initialized) + { + throw new ImplementationError("Duplicate initialization"); + } + + initialized = true; + onInitialize(); + } + + protected abstract void onInitialize(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageImpl.java new file mode 100644 index 0000000000..ad1928e633 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageImpl.java @@ -0,0 +1,395 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.model; + +import org.eclipse.emf.cdo.common.id.CDOIDMetaRange; +import org.eclipse.emf.cdo.common.id.CDOIDUtil; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOModelUtil; +import org.eclipse.emf.cdo.common.model.CDOPackage; +import org.eclipse.emf.cdo.common.model.CDOPackageManager; +import org.eclipse.emf.cdo.internal.common.bundle.OM; +import org.eclipse.emf.cdo.spi.common.InternalCDOClass; +import org.eclipse.emf.cdo.spi.common.InternalCDOPackage; + +import org.eclipse.net4j.util.ObjectUtil; +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; +import org.eclipse.net4j.util.om.trace.ContextTracer; + +import java.io.IOException; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Eike Stepper + */ +public class CDOPackageImpl extends CDOModelElementImpl implements InternalCDOPackage +{ + private static final ContextTracer MODEL = new ContextTracer(OM.DEBUG_MODEL, CDOPackageImpl.class); + + private static final ContextTracer PROTOCOL = new ContextTracer(OM.DEBUG_PROTOCOL, CDOPackageImpl.class); + + private CDOPackageManager packageManager; + + private String packageURI; + + private List<CDOClass> classes; + + private List<CDOClass> index; + + private String ecore; + + private boolean dynamic; + + private CDOIDMetaRange metaIDRange; + + private String parentURI; + + /** + * TODO If this is only needed by the client then put it into server info + */ + private transient boolean persistent = true; + + public CDOPackageImpl() + { + } + + public CDOPackageImpl(CDOPackageManager packageManager, String packageURI, String name, String ecore, + boolean dynamic, CDOIDMetaRange metaIDRange, String parentURI) + { + super(name); + this.packageManager = packageManager; + this.packageURI = packageURI; + this.ecore = ecore; + this.dynamic = dynamic; + this.metaIDRange = metaIDRange; + this.parentURI = parentURI; + if (MODEL.isEnabled()) + { + MODEL.format("Created {0}", this); + } + + createLists(); + } + + public CDOPackageImpl(CDOPackageManager packageManager, ExtendedDataInput in) throws IOException + { + this.packageManager = packageManager; + createLists(); + read(in); + } + + /** + * Creates a proxy CDO package + */ + public CDOPackageImpl(CDOPackageManager packageManager, String packageURI, boolean dynamic, + CDOIDMetaRange metaIDRange, String parentURI) + { + this.packageManager = packageManager; + this.packageURI = packageURI; + this.dynamic = dynamic; + this.metaIDRange = metaIDRange; + this.parentURI = parentURI; + if (MODEL.isEnabled()) + { + MODEL.format("Created proxy package {0}, dynamic={1}, metaIDRange={2}, parentURI={3}", packageURI, dynamic, + metaIDRange, packageURI); + } + } + + @Override + public void read(ExtendedDataInput in) throws IOException + { + super.read(in); + packageURI = in.readString(); + dynamic = in.readBoolean(); + ecore = in.readString(); + metaIDRange = CDOIDUtil.readMetaRange(in); + parentURI = in.readString(); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Read package: URI={0}, name={1}, dynamic={2}, metaIDRange={3}, parentURI={4}", packageURI, + getName(), dynamic, metaIDRange, parentURI); + } + + int size = in.readInt(); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Reading {0} classes", size); + } + + for (int i = 0; i < size; i++) + { + CDOClass cdoClass = CDOModelUtil.readClass(this, in); + addClass(cdoClass); + } + } + + @Override + public void write(ExtendedDataOutput out) throws IOException + { + resolve(); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Writing package: URI={0}, name={1}, dynamic={2}, metaIDRange={3}, parentURI={4}", packageURI, + getName(), dynamic, metaIDRange, parentURI); + } + + super.write(out); + out.writeString(packageURI); + out.writeBoolean(dynamic); + out.writeString(ecore); + CDOIDUtil.writeMetaRange(out, metaIDRange); + out.writeString(parentURI); + + int size = classes.size(); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Writing {0} classes", size); + } + + out.writeInt(size); + for (CDOClass cdoClass : classes) + { + CDOModelUtil.writeClass(out, cdoClass); + } + } + + public void setPackageManager(CDOPackageManager packageManager) + { + this.packageManager = packageManager; + } + + public CDOPackageManager getPackageManager() + { + return packageManager; + } + + public String getParentURI() + { + return parentURI; + } + + public void setParentURI(String parentURI) + { + this.parentURI = parentURI; + } + + public CDOPackage getTopLevelPackage() + { + CDOPackage parentPackage = getParentPackage(); + return parentPackage == null ? this : parentPackage.getTopLevelPackage(); + } + + public CDOPackage getParentPackage() + { + return packageManager.lookupPackage(parentURI); + } + + public CDOPackage[] getSubPackages(boolean recursive) + { + List<CDOPackage> result = new ArrayList<CDOPackage>(); + CDOPackage[] allPackages = packageManager.getPackages(); + getSubPackages(this, allPackages, result, recursive); + return result.toArray(new CDOPackage[result.size()]); + } + + private void getSubPackages(CDOPackage parentPackage, CDOPackage[] allPackages, List<CDOPackage> result, + boolean recursive) + { + for (CDOPackage cdoPackage : allPackages) + { + if (ObjectUtil.equals(cdoPackage.getParentURI(), parentPackage.getPackageURI())) + { + result.add(cdoPackage); + if (recursive) + { + getSubPackages(cdoPackage, allPackages, result, true); + } + } + } + } + + public String getPackageURI() + { + return packageURI; + } + + public void setPackageURI(String packageURI) + { + this.packageURI = packageURI; + } + + public int getClassCount() + { + resolve(); + return classes.size(); + } + + public CDOClass[] getClasses() + { + resolve(); + return classes.toArray(new CDOClass[classes.size()]); + } + + public void setClasses(List<CDOClass> classes) + { + this.classes = classes; + for (CDOClass cdoClass : classes) + { + ((InternalCDOClass)cdoClass).setContainingPackage(this); + setIndex(cdoClass.getClassifierID(), cdoClass); + } + } + + /** + * @return All classes with <code>isAbstract() == false</code> and <code>isSystem() == false</code>. + */ + public CDOClass[] getConcreteClasses() + { + resolve(); + List<CDOClass> result = new ArrayList<CDOClass>(0); + for (CDOClass cdoClass : classes) + { + if (!cdoClass.isAbstract()) + { + result.add(cdoClass); + } + } + + return result.toArray(new CDOClass[result.size()]); + } + + public CDOClass lookupClass(int classifierID) + { + resolve(); + return index.get(classifierID); + } + + public String getEcore() + { + if (ecore == null && packageManager instanceof CDOPackageManagerImpl && parentURI == null) + { + // TODO Can ecore be null? + ecore = ((CDOPackageManagerImpl)packageManager).provideEcore(this); + } + + return ecore; + } + + /** + * TODO Add IStore API to demand read dynamic ecore string + */ + public void setEcore(String ecore) + { + this.ecore = ecore; + } + + public CDOIDMetaRange getMetaIDRange() + { + return metaIDRange; + } + + public void setMetaIDRange(CDOIDMetaRange metaIDRange) + { + this.metaIDRange = metaIDRange; + } + + public boolean isDynamic() + { + return dynamic; + } + + public void setDynamic(boolean dynamic) + { + this.dynamic = dynamic; + } + + public boolean isSystem() + { + return false; + } + + public boolean isProxy() + { + return classes == null; + } + + public boolean isPersistent() + { + return persistent; + } + + public void setPersistent(boolean persistent) + { + this.persistent = persistent; + } + + public void addClass(CDOClass cdoClass) + { + int classifierID = cdoClass.getClassifierID(); + if (MODEL.isEnabled()) + { + MODEL.format("Adding class: {0}", cdoClass); + } + + setIndex(classifierID, cdoClass); + classes.add(cdoClass); + } + + public int compareTo(CDOPackage that) + { + return getPackageURI().compareTo(that.getPackageURI()); + } + + @Override + public String toString() + { + return MessageFormat.format("CDOPackage(URI={0}, name={1}, dynamic={2}, metaIDRange={3}, parentURI={4})", + packageURI, getName(), dynamic, metaIDRange, parentURI); + } + + @Override + protected void onInitialize() + { + for (CDOClass cdoClass : classes) + { + ((InternalCDOClass)cdoClass).initialize(); + } + } + + private void setIndex(int classifierID, CDOClass cdoClass) + { + while (classifierID >= index.size()) + { + index.add(null); + } + + index.set(classifierID, cdoClass); + } + + private void resolve() + { + if (classes == null && packageManager instanceof CDOPackageManagerImpl) + { + createLists(); + ((CDOPackageManagerImpl)packageManager).resolve(this); + } + } + + private void createLists() + { + classes = new ArrayList<CDOClass>(0); + index = new ArrayList<CDOClass>(0); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageManagerImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageManagerImpl.java new file mode 100644 index 0000000000..b8c9c21f93 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageManagerImpl.java @@ -0,0 +1,144 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.model; + +import org.eclipse.emf.cdo.common.model.CDOPackage; +import org.eclipse.emf.cdo.common.model.CDOPackageManager; +import org.eclipse.emf.cdo.common.model.core.CDOCorePackage; +import org.eclipse.emf.cdo.common.model.resource.CDOResourcePackage; +import org.eclipse.emf.cdo.internal.common.bundle.OM; +import org.eclipse.emf.cdo.internal.common.model.core.CDOCorePackageImpl; +import org.eclipse.emf.cdo.internal.common.model.resource.CDOResourcePackageImpl; + +import org.eclipse.net4j.util.container.Container; +import org.eclipse.net4j.util.om.trace.ContextTracer; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +/** + * @author Eike Stepper + */ +public abstract class CDOPackageManagerImpl extends Container<CDOPackage> implements CDOPackageManager +{ + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_MODEL, CDOPackageManagerImpl.class); + + private ConcurrentMap<String, CDOPackage> packages = new ConcurrentHashMap<String, CDOPackage>(); + + private CDOCorePackage cdoCorePackage; + + private CDOResourcePackage cdoResourcePackage; + + public CDOPackageManagerImpl() + { + addPackage(cdoCorePackage = new CDOCorePackageImpl(this)); + addPackage(cdoResourcePackage = new CDOResourcePackageImpl(this)); + } + + public CDOPackage lookupPackage(String uri) + { + if (uri == null) + { + return null; + } + + return packages.get(uri); + } + + public int getPackageCount() + { + return packages.size(); + } + + public CDOPackage[] getPackages() + { + return packages.values().toArray(new CDOPackage[packages.size()]); + } + + public CDOPackage[] getElements() + { + return getPackages(); + } + + @Override + public boolean isEmpty() + { + return packages.isEmpty(); + } + + public CDOCorePackage getCDOCorePackage() + { + return cdoCorePackage; + } + + public CDOResourcePackage getCDOResourcePackage() + { + return cdoResourcePackage; + } + + public List<CDOPackage> getTransientPackages() + { + List<CDOPackage> result = new ArrayList<CDOPackage>(); + for (CDOPackage cdoPackage : packages.values()) + { + if (!cdoPackage.isPersistent()) + { + result.add(cdoPackage); + } + } + + return result; + } + + public void addPackage(CDOPackage cdoPackage) + { + String uri = cdoPackage.getPackageURI(); + if (uri == null) + { + throw new IllegalArgumentException("uri == null"); + } + + CDOPackage existing = packages.putIfAbsent(uri, cdoPackage); + if (existing == null) + { + if (TRACER.isEnabled()) + { + TRACER.format("Added package: {0}", cdoPackage); + } + + fireElementAddedEvent(cdoPackage); + } + else + { + throw new IllegalStateException("Duplicate package: " + cdoPackage); + } + } + + public void removePackage(CDOPackage cdoPackage) + { + packages.remove(cdoPackage.getPackageURI()); + fireElementRemovedEvent(cdoPackage); + } + + /** + * @param cdoPackage + * is a proxy CDO package. The implementer of this method must only use the package URI of the cdoPackage + * passed in. + */ + protected abstract void resolve(CDOPackage cdoPackage); + + /** + * Only called on clients for generated models + */ + protected abstract String provideEcore(CDOPackage cdoPackage); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java new file mode 100644 index 0000000000..a07448bf3a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java @@ -0,0 +1,472 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.model; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDObjectFactory; +import org.eclipse.emf.cdo.common.id.CDOIDUtil; +import org.eclipse.emf.cdo.common.model.CDOType; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Eike Stepper + */ +public abstract class CDOTypeImpl implements CDOType +{ + public static Map<Integer, CDOTypeImpl> ids = new HashMap<Integer, CDOTypeImpl>(); + + private static final byte BOOLEAN_DEFAULT_PRIMITIVE = 0; + + private static final char CHARACTER_DEFAULT_PRIMITIVE = 0; + + private static final short SHORT_DEFAULT_PRIMITIVE = 0; + + public static final Boolean BOOLEAN_DEFAULT = new Boolean(false); + + public static final Byte BYTE_DEFAULT = new Byte(BOOLEAN_DEFAULT_PRIMITIVE); + + public static final Character CHARACTER_DEFAULT = new Character(CHARACTER_DEFAULT_PRIMITIVE); + + public static final Double DOUBLE_DEFAULT = new Double(0.0); + + public static final Float FLOAT_DEFAULT = new Float(0.0); + + public static final Integer INTEGER_DEFAULT = new Integer(0); + + public static final Long LONG_DEFAULT = new Long(0L); + + public static final Short SHORT_DEFAULT = new Short(SHORT_DEFAULT_PRIMITIVE); + + public static final CDOType BOOLEAN = new CDOTypeImpl("BOOLEAN", 22, false, BOOLEAN_DEFAULT) + { + public void writeValue(ExtendedDataOutput out, Object value) throws IOException + { + boolean v = (Boolean)(value == null ? getDefaultValue() : value); + out.writeBoolean(v); + } + + public Object readValue(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException + { + boolean v = in.readBoolean(); + return new Boolean(v); + } + }; + + public static final CDOType BYTE = new CDOTypeImpl("BYTE", 24, false, BYTE_DEFAULT) + { + public void writeValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeByte((Byte)(value == null ? getDefaultValue() : value)); + } + + public Object readValue(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException + { + return new Byte(in.readByte()); + } + }; + + public static final CDOType CHAR = new CDOTypeImpl("CHAR", 27, false, CHARACTER_DEFAULT) + { + public void writeValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeChar(((Character)(value == null ? getDefaultValue() : value)).charValue()); + } + + public Object readValue(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException + { + return new Character(in.readChar()); + } + }; + + public static final CDOType DOUBLE = new CDOTypeImpl("DOUBLE", 31, false, DOUBLE_DEFAULT) + { + public void writeValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeDouble((Double)(value == null ? getDefaultValue() : value)); + } + + public Object readValue(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException + { + return new Double(in.readDouble()); + } + }; + + public static final CDOType FLOAT = new CDOTypeImpl("FLOAT", 37, false, FLOAT_DEFAULT) + { + public void writeValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeFloat((Float)(value == null ? getDefaultValue() : value)); + } + + public Object readValue(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException + { + return new Float(in.readFloat()); + } + }; + + public static final CDOType INT = new CDOTypeImpl("INT", 39, false, INTEGER_DEFAULT) + { + public void writeValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeInt((Integer)(value == null ? getDefaultValue() : value)); + } + + public Object readValue(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException + { + return new Integer(in.readInt()); + } + }; + + public static final CDOType LONG = new CDOTypeImpl("LONG", 43, false, LONG_DEFAULT) + { + public void writeValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeLong((Long)(value == null ? getDefaultValue() : value)); + } + + public Object readValue(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException + { + return new Long(in.readLong()); + } + }; + + public static final CDOType SHORT = new CDOTypeImpl("SHORT", 48, false, SHORT_DEFAULT) + { + public void writeValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeShort((Short)(value == null ? getDefaultValue() : value)); + } + + public Object readValue(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException + { + return new Short(in.readShort()); + } + }; + + public static final CDOType OBJECT = new CDOTypeImpl("OBJECT", 10, true, CDOID.NULL) + { + public void writeValue(ExtendedDataOutput out, Object value) throws IOException + { + CDOIDUtil.write(out, (CDOID)value); + } + + public Object readValue(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException + { + return CDOIDUtil.read(in, factory); + } + }; + + public static final CDOType BOOLEAN_OBJECT = new ObjectType("BOOLEAN_OBJECT", 23) + { + @Override + protected void doWriteValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeBoolean((Boolean)value); + } + + @Override + protected Object doReadValue(ExtendedDataInput in) throws IOException + { + return in.readBoolean(); + } + }; + + public static final CDOType BYTE_OBJECT = new ObjectType("BYTE_OBJECT", 26) + { + @Override + protected void doWriteValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeByte((Byte)value); + } + + @Override + protected Object doReadValue(ExtendedDataInput in) throws IOException + { + return in.readByte(); + } + }; + + public static final CDOType CHARACTER_OBJECT = new ObjectType("CHARACTER_OBJECT", 28) + { + @Override + protected void doWriteValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeChar((Character)value); + } + + @Override + protected Object doReadValue(ExtendedDataInput in) throws IOException + { + return in.readChar(); + } + }; + + public static final CDOType DATE = new ObjectType("DATE", 29) + { + @Override + protected void doWriteValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeLong(((Date)value).getTime()); + } + + @Override + protected Object doReadValue(ExtendedDataInput in) throws IOException + { + return new Date(in.readLong()); + } + }; + + public static final CDOType DOUBLE_OBJECT = new ObjectType("DOUBLE_OBJECT", 32) + { + @Override + protected void doWriteValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeDouble((Double)value); + } + + @Override + protected Object doReadValue(ExtendedDataInput in) throws IOException + { + return in.readDouble(); + } + }; + + public static final CDOType FLOAT_OBJECT = new ObjectType("FLOAT_OBJECT", 38) + { + @Override + protected void doWriteValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeFloat((Float)value); + } + + @Override + protected Object doReadValue(ExtendedDataInput in) throws IOException + { + return in.readFloat(); + } + }; + + public static final CDOType INTEGER_OBJECT = new ObjectType("INTEGER_OBJECT", 40) + { + @Override + protected void doWriteValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeInt((Integer)value); + } + + @Override + protected Object doReadValue(ExtendedDataInput in) throws IOException + { + return in.readInt(); + } + }; + + public static final CDOType LONG_OBJECT = new ObjectType("LONG_OBJECT", 44) + { + @Override + protected void doWriteValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeLong((Long)value); + } + + @Override + protected Object doReadValue(ExtendedDataInput in) throws IOException + { + return in.readLong(); + } + }; + + public static final CDOType SHORT_OBJECT = new ObjectType("SHORT_OBJECT", 49) + { + @Override + protected void doWriteValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeShort((Short)value); + } + + @Override + protected Object doReadValue(ExtendedDataInput in) throws IOException + { + return in.readShort(); + } + }; + + public static final CDOType STRING = new CDOTypeImpl("STRING", 50, true) + { + @SuppressWarnings("cast") + @Override + public Object copyValue(Object value) + { + return (String)value; + } + + public void writeValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeString((String)value); + } + + public Object readValue(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException + { + return in.readString(); + } + }; + + public static final CDOType BYTE_ARRAY = new CDOTypeImpl("BYTE_ARRAY", 25, true) + { + @Override + public Object copyValue(Object value) + { + if (value == null) + { + return null; + } + + byte[] array = (byte[])value; + byte[] result = new byte[array.length]; + System.arraycopy(value, 0, result, 0, array.length); + return result; + } + + public void writeValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeByteArray((byte[])value); + } + + public Object readValue(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException + { + return in.readByteArray(); + } + }; + + public static final CDOType CUSTOM = new CDOTypeImpl("CUSTOM", 999, true) + { + @SuppressWarnings("cast") + @Override + public Object copyValue(Object value) + { + return (String)value; + } + + public void writeValue(ExtendedDataOutput out, Object value) throws IOException + { + out.writeString((String)value); + } + + public Object readValue(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException + { + return in.readString(); + } + }; + + private String name; + + private int typeID; + + private boolean canBeNull; + + private Object defaultValue; + + private CDOTypeImpl(String name, int typeID, boolean canBeNull, Object defaultValue) + { + this.name = name; + this.typeID = typeID; + this.canBeNull = canBeNull; + this.defaultValue = defaultValue; + ids.put(typeID, this); + } + + private CDOTypeImpl(String name, int typeID, boolean canBeNull) + { + this(name, typeID, canBeNull, null); + } + + public String getName() + { + return name; + } + + public int getTypeID() + { + return typeID; + } + + public boolean canBeNull() + { + return canBeNull; + } + + public Object getDefaultValue() + { + return defaultValue; + } + + @Override + public String toString() + { + return name; + } + + public Object copyValue(Object value) + { + return value == null ? getDefaultValue() : value; + } + + public void write(ExtendedDataOutput out) throws IOException + { + out.writeInt(typeID); + } + + /** + * @author Eike Stepper + */ + private static abstract class ObjectType extends CDOTypeImpl + { + public ObjectType(String name, int typeID) + { + super(name, typeID, true); + } + + public final void writeValue(ExtendedDataOutput out, Object value) throws IOException + { + if (value == null) + { + out.writeBoolean(false); + } + else + { + out.writeBoolean(true); + doWriteValue(out, value); + } + } + + protected abstract void doWriteValue(ExtendedDataOutput out, Object value) throws IOException; + + public final Object readValue(ExtendedDataInput in, CDOIDObjectFactory factory) throws IOException + { + boolean notNull = in.readBoolean(); + if (notNull) + { + return doReadValue(in); + } + + return null; + } + + protected abstract Object doReadValue(ExtendedDataInput in) throws IOException; + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/core/CDOCorePackageImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/core/CDOCorePackageImpl.java new file mode 100644 index 0000000000..62c54dd0bf --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/core/CDOCorePackageImpl.java @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.model.core; + +import org.eclipse.emf.cdo.common.model.core.CDOCorePackage; +import org.eclipse.emf.cdo.internal.common.model.CDOPackageImpl; +import org.eclipse.emf.cdo.internal.common.model.CDOPackageManagerImpl; + +/** + * @author Eike Stepper + */ +public final class CDOCorePackageImpl extends CDOPackageImpl implements CDOCorePackage +{ + private CDOObjectClassImpl cdoObjectClass; + + public CDOCorePackageImpl(CDOPackageManagerImpl packageManager) + { + super(packageManager, PACKAGE_URI, NAME, null, false, null, null); + addClass(cdoObjectClass = new CDOObjectClassImpl(this)); + } + + public CDOObjectClassImpl getCDOObjectClass() + { + return cdoObjectClass; + } + + @Override + public String getEcore() + { + return null; + } + + @Override + public boolean isSystem() + { + return true; + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/core/CDOObjectClassImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/core/CDOObjectClassImpl.java new file mode 100644 index 0000000000..812a9f48f8 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/core/CDOObjectClassImpl.java @@ -0,0 +1,32 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.model.core; + +import org.eclipse.emf.cdo.common.model.CDOPackage; +import org.eclipse.emf.cdo.common.model.core.CDOObjectClass; +import org.eclipse.emf.cdo.internal.common.model.CDOClassImpl; + +/** + * @author Eike Stepper + */ +public class CDOObjectClassImpl extends CDOClassImpl implements CDOObjectClass +{ + public CDOObjectClassImpl(CDOPackage containingPackage) + { + super(containingPackage, CLASSIFIER_ID, NAME, false); + } + + @Override + public boolean isRoot() + { + return true; + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/resource/CDOContentsFeatureImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/resource/CDOContentsFeatureImpl.java new file mode 100644 index 0000000000..f8eed25188 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/resource/CDOContentsFeatureImpl.java @@ -0,0 +1,29 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.model.resource; + +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOClassProxy; +import org.eclipse.emf.cdo.common.model.CDOPackageManager; +import org.eclipse.emf.cdo.common.model.resource.CDOContentsFeature; +import org.eclipse.emf.cdo.internal.common.model.CDOFeatureImpl; + +/** + * @author Eike Stepper + */ +public class CDOContentsFeatureImpl extends CDOFeatureImpl implements CDOContentsFeature +{ + public CDOContentsFeatureImpl(CDOClass containingClass, CDOPackageManager packageManager) + { + super(containingClass, FEATURE_ID, NAME, new CDOClassProxy(packageManager.getCDOCorePackage().getCDOObjectClass()), + true, true); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/resource/CDOPathFeatureImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/resource/CDOPathFeatureImpl.java new file mode 100644 index 0000000000..f42709edb5 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/resource/CDOPathFeatureImpl.java @@ -0,0 +1,27 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.model.resource; + +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.resource.CDOPathFeature; +import org.eclipse.emf.cdo.internal.common.model.CDOFeatureImpl; +import org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl; + +/** + * @author Eike Stepper + */ +public class CDOPathFeatureImpl extends CDOFeatureImpl implements CDOPathFeature +{ + public CDOPathFeatureImpl(CDOClass containingClass) + { + super(containingClass, FEATURE_ID, NAME, CDOTypeImpl.STRING, false); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/resource/CDOResourceClassImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/resource/CDOResourceClassImpl.java new file mode 100644 index 0000000000..ec747c5195 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/resource/CDOResourceClassImpl.java @@ -0,0 +1,49 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.model.resource; + +import org.eclipse.emf.cdo.common.model.CDOPackage; +import org.eclipse.emf.cdo.common.model.CDOPackageManager; +import org.eclipse.emf.cdo.common.model.resource.CDOResourceClass; +import org.eclipse.emf.cdo.internal.common.model.CDOClassImpl; + +/** + * @author Eike Stepper + */ +public class CDOResourceClassImpl extends CDOClassImpl implements CDOResourceClass +{ + private CDOPathFeatureImpl cdoPathFeature; + + private CDOContentsFeatureImpl cdoContentsFeature; + + public CDOResourceClassImpl(CDOPackage containingPackage, CDOPackageManager packageManager) + { + super(containingPackage, CLASSIFIER_ID, NAME, false); + addFeature(cdoPathFeature = new CDOPathFeatureImpl(this)); + addFeature(cdoContentsFeature = new CDOContentsFeatureImpl(this, packageManager)); + } + + @Override + public boolean isResource() + { + return true; + } + + public CDOPathFeatureImpl getCDOPathFeature() + { + return cdoPathFeature; + } + + public CDOContentsFeatureImpl getCDOContentsFeature() + { + return cdoContentsFeature; + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/resource/CDOResourcePackageImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/resource/CDOResourcePackageImpl.java new file mode 100644 index 0000000000..f1ac7bf14c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/resource/CDOResourcePackageImpl.java @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.model.resource; + +import org.eclipse.emf.cdo.common.model.resource.CDOResourcePackage; +import org.eclipse.emf.cdo.internal.common.model.CDOPackageImpl; +import org.eclipse.emf.cdo.internal.common.model.CDOPackageManagerImpl; + +/** + * @author Eike Stepper + */ +public final class CDOResourcePackageImpl extends CDOPackageImpl implements CDOResourcePackage +{ + private CDOResourceClassImpl cdoResourceClass; + + public CDOResourcePackageImpl(CDOPackageManagerImpl packageManager) + { + super(packageManager, PACKAGE_URI, NAME, null, false, null, null); + addClass(cdoResourceClass = new CDOResourceClassImpl(this, packageManager)); + } + + public CDOResourceClassImpl getCDOResourceClass() + { + return cdoResourceClass; + } + + @Override + public String getEcore() + { + return null; + } + + @Override + public boolean isSystem() + { + return true; + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDOReferenceProxyImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDOReferenceProxyImpl.java new file mode 100644 index 0000000000..88a3b96de4 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDOReferenceProxyImpl.java @@ -0,0 +1,65 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.revision.CDOReferenceProxy; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.common.revision.CDORevisionResolver; + +import java.text.MessageFormat; + +/** + * @author Eike Stepper + */ +public class CDOReferenceProxyImpl implements CDOReferenceProxy +{ + private CDORevision revision; + + private CDOFeature feature; + + private int index; + + public CDOReferenceProxyImpl(CDORevision revision, CDOFeature feature, int index) + { + this.revision = revision; + this.feature = feature; + this.index = index; + } + + public CDORevision getRevision() + { + return revision; + } + + public CDOFeature getFeature() + { + return feature; + } + + public int getIndex() + { + return index; + } + + public CDOID resolve() + { + CDORevisionResolver revisionResolver = revision.getRevisionResolver(); + return revisionResolver.resolveReferenceProxy(this); + } + + @Override + public String toString() + { + return MessageFormat.format("CDOReferenceProxy[{0}, {1}, {2}", revision, feature, index); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionImpl.java new file mode 100644 index 0000000000..736b16755d --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionImpl.java @@ -0,0 +1,814 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266 + * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=212958 + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDProvider; +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.common.id.CDOIDUtil; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOClassRef; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.model.CDOModelUtil; +import org.eclipse.emf.cdo.common.model.CDOPackageManager; +import org.eclipse.emf.cdo.common.model.CDOType; +import org.eclipse.emf.cdo.common.revision.CDOReferenceProxy; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.common.revision.CDORevisionData; +import org.eclipse.emf.cdo.common.revision.CDORevisionResolver; +import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDeltaUtil; +import org.eclipse.emf.cdo.internal.common.bundle.OM; +import org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionMerger; +import org.eclipse.emf.cdo.spi.common.InternalCDORevision; +import org.eclipse.emf.cdo.spi.common.InternalCDORevisionDelta; + +import org.eclipse.net4j.util.ImplementationError; +import org.eclipse.net4j.util.collection.MoveableArrayList; +import org.eclipse.net4j.util.collection.MoveableList; +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; +import org.eclipse.net4j.util.om.trace.ContextTracer; +import org.eclipse.net4j.util.om.trace.PerfTracer; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * @author Eike Stepper + */ +public class CDORevisionImpl implements InternalCDORevision +{ + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_REVISION, CDORevisionImpl.class); + + private static final PerfTracer READING = new PerfTracer(OM.PERF_REVISION_READING, CDORevisionImpl.class); + + private static final PerfTracer WRITING = new PerfTracer(OM.PERF_REVISION_WRITING, CDORevisionImpl.class); + + private CDORevisionResolver revisionResolver; + + private CDOClass cdoClass; + + private CDOID id; + + private int version; + + private long created; + + private long revised; + + private CDOID resourceID; + + private CDOID containerID; + + private int containingFeatureID; + + private Object[] values; + + public CDORevisionImpl(CDORevisionResolver revisionResolver, CDOClass cdoClass, CDOID id) + { + this.revisionResolver = revisionResolver; + this.cdoClass = cdoClass; + this.id = id; + version = 0; + created = UNSPECIFIED_DATE; + revised = UNSPECIFIED_DATE; + resourceID = CDOID.NULL; + containerID = CDOID.NULL; + containingFeatureID = 0; + values = new Object[cdoClass.getAllFeatures().length]; + } + + public CDORevisionImpl(CDORevisionImpl source) + { + revisionResolver = source.revisionResolver; + cdoClass = source.cdoClass; + id = source.id; + version = source.version; + created = source.created; + revised = source.revised; // == UNSPECIFIED + resourceID = source.resourceID; + containerID = source.containerID; + containingFeatureID = source.containingFeatureID; + copyValues(source.values); + } + + public CDORevisionImpl(ExtendedDataInput in, CDORevisionResolver revisionResolver, CDOPackageManager packageManager) + throws IOException + { + this.revisionResolver = revisionResolver; + + READING.start(this); + CDOClassRef classRef = CDOModelUtil.readClassRef(in); + cdoClass = classRef.resolve(packageManager); + if (cdoClass == null) + { + throw new IllegalStateException("ClassRef unresolveable: " + classRef); + } + + id = CDOIDUtil.read(in, revisionResolver.getCDOIDObjectFactory()); + version = in.readInt(); + created = in.readLong(); + revised = in.readLong(); + resourceID = CDOIDUtil.read(in, revisionResolver.getCDOIDObjectFactory()); + containerID = CDOIDUtil.read(in, revisionResolver.getCDOIDObjectFactory()); + containingFeatureID = in.readInt(); + if (TRACER.isEnabled()) + { + TRACER + .format( + "Reading revision: ID={0}, classRef={1}, className={2}, version={3}, created={4}, revised={5}, resource={6}, container={7}, feature={8}", + id, classRef, cdoClass.getName(), version, created, revised, resourceID, containerID, containingFeatureID); + } + + readValues(in); + READING.stop(this); + } + + public void write(ExtendedDataOutput out, CDOIDProvider idProvider, int referenceChunk) throws IOException + { + CDOClassRef classRef = cdoClass.createClassRef(); + if (TRACER.isEnabled()) + { + TRACER + .format( + "Writing revision: ID={0}, classRef={1}, className={2}, version={3}, created={4}, revised={5}, resource={6}, container={7}, feature={8}", + id, classRef, cdoClass.getName(), getVersion(), created, revised, resourceID, containerID, + containingFeatureID); + } + + WRITING.start(this); + CDOModelUtil.writeClassRef(out, classRef); + CDOIDUtil.write(out, id); + out.writeInt(getVersion()); + out.writeLong(created); + out.writeLong(revised); + CDOIDUtil.write(out, resourceID); + CDOIDUtil.write(out, containerID); + out.writeInt(containingFeatureID); + writeValues(out, idProvider, referenceChunk); + WRITING.stop(this); + } + + public CDORevisionResolver getRevisionResolver() + { + return revisionResolver; + } + + public CDOClass getCDOClass() + { + return cdoClass; + } + + public CDOID getID() + { + return id; + } + + public void setID(CDOID id) + { + if (TRACER.isEnabled()) + { + TRACER.format("Setting ID: {0}", id); + } + + this.id = id; + } + + public int getVersion() + { + return version < 0 ? -version : version; + } + + public void setVersion(int version) + { + if (TRACER.isEnabled()) + { + TRACER.format("Setting version for {0}: v{1}", this, version); + } + + this.version = version; + } + + public boolean isTransactional() + { + return version < 0; + } + + public int setTransactional() + { + if (TRACER.isEnabled()) + { + TRACER.format("Setting transactional {0}: v{1}", this, -(version + 1)); + } + + version = -(version + 1); + return version; + } + + public void setUntransactional() + { + if (TRACER.isEnabled()) + { + TRACER.format("Setting untransactional {0}: v{1}", this, Math.abs(version)); + } + + version = Math.abs(version); + } + + public long getCreated() + { + return created; + } + + public void setCreated(long created) + { + if (TRACER.isEnabled()) + { + TRACER.format("Setting created {0}: {1,date} {1,time}", this, created); + } + + this.created = created; + } + + public long getRevised() + { + return revised; + } + + public void setRevised(long revised) + { + if (TRACER.isEnabled()) + { + TRACER.format("Setting revised {0}: {1,date} {1,time}", this, revised); + } + + this.revised = revised; + } + + public boolean isCurrent() + { + return revised == UNSPECIFIED_DATE; + } + + public boolean isValid(long timeStamp) + { + return (revised == UNSPECIFIED_DATE || revised >= timeStamp) && timeStamp >= created; + } + + public boolean isResource() + { + return cdoClass.isResource(); + } + + public CDORevisionData getData() + { + return this; + } + + public CDORevision getRevision() + { + return this; + } + + public InternalCDORevisionDelta compare(CDORevision origin) + { + return (InternalCDORevisionDelta)CDORevisionDeltaUtil.create(origin, this); + } + + public void merge(CDORevisionDelta delta) + { + CDORevisionMerger applier = new CDORevisionMerger(); + applier.merge(this, delta); + } + + public CDOID getResourceID() + { + return resourceID; + } + + public void setResourceID(CDOID resourceID) + { + if (TRACER.isEnabled()) + { + TRACER.format("Setting resourceID {0}: {1}", this, resourceID); + } + + this.resourceID = resourceID; + } + + public CDOID getContainerID() + { + return containerID; + } + + public void setContainerID(CDOID containerID) + { + if (TRACER.isEnabled()) + { + TRACER.format("Setting containerID {0}: {1}", this, containerID); + } + + this.containerID = containerID; + } + + public int getContainingFeatureID() + { + return containingFeatureID; + } + + public void setContainingFeatureID(int containingFeatureID) + { + if (TRACER.isEnabled()) + { + TRACER.format("Setting containingFeatureID {0}: {1}", this, containingFeatureID); + } + + this.containingFeatureID = containingFeatureID; + } + + public int hashCode(CDOFeature feature) + { + return getValue(feature).hashCode(); + } + + public Object get(CDOFeature feature, int index) + { + if (feature.isMany()) + { + return getList(feature).get(index); + } + + return getValue(feature); + } + + public boolean contains(CDOFeature feature, Object value) + { + return getList(feature).contains(value); + } + + public int indexOf(CDOFeature feature, Object value) + { + return getList(feature).indexOf(value); + } + + public boolean isEmpty(CDOFeature feature) + { + return getList(feature).isEmpty(); + } + + public boolean isSet(CDOFeature feature) + { + return getValue(feature) != null; + } + + public int lastIndexOf(CDOFeature feature, Object value) + { + return getList(feature).lastIndexOf(value); + } + + public int size(CDOFeature feature) + { + return getList(feature).size(); + } + + public Object[] toArray(CDOFeature feature) + { + if (!feature.isMany()) + { + throw new IllegalStateException("!feature.isMany()"); + } + + return getList(feature).toArray(); + } + + public <T> T[] toArray(CDOFeature feature, T[] array) + { + if (!feature.isMany()) + { + throw new IllegalStateException("!feature.isMany()"); + } + + return getList(feature).toArray(array); + } + + public void add(CDOFeature feature, int index, Object value) + { + getList(feature).add(index, value); + } + + public void clear(CDOFeature feature) + { + setValue(feature, null); + } + + public Object move(CDOFeature feature, int targetIndex, int sourceIndex) + { + return getList(feature).move(targetIndex, sourceIndex); + } + + public Object remove(CDOFeature feature, int index) + { + return getList(feature).remove(index); + } + + public Object set(CDOFeature feature, int index, Object value) + { + if (feature.isMany()) + { + return getList(feature).set(index, value); + } + + return setValue(feature, value); + } + + public void unset(CDOFeature feature) + { + setValue(feature, null); + } + + public void adjustReferences(Map<CDOIDTemp, CDOID> idMappings) + { + if (TRACER.isEnabled()) + { + TRACER.format("Adjusting references for revision {0}", this); + } + + resourceID = (CDOID)remapID(resourceID, idMappings); + containerID = (CDOID)remapID(containerID, idMappings); + + CDOFeature[] features = cdoClass.getAllFeatures(); + for (int i = 0; i < features.length; i++) + { + CDOFeature feature = features[i]; + if (feature.isReference()) + { + if (feature.isMany()) + { + List<Object> list = getValueAsList(i); + int size = list == null ? 0 : list.size(); + for (int j = 0; j < size; j++) + { + Object oldID = list.get(j); + Object newID = remapID(oldID, idMappings); + if (newID != oldID) + { + list.set(j, newID); + } + } + } + else + { + values[i] = remapID(values[i], idMappings); + } + } + } + } + + @SuppressWarnings("unchecked") + private List<Object> getValueAsList(int i) + { + return (List<Object>)values[i]; + } + + @Override + public String toString() + { + return cdoClass.getName() + "@" + id + "v" + version; + } + + public Object getValue(CDOFeature feature) + { + int i = cdoClass.getFeatureID(feature); + return values[i]; + } + + public Object setValue(CDOFeature feature, Object value) + { + int i = cdoClass.getFeatureID(feature); + Object old = values[i]; + values[i] = value; + return old; + } + + public MoveableList<Object> getList(CDOFeature feature) + { + return getList(feature, 0); + } + + @SuppressWarnings("unchecked") + public MoveableList<Object> getList(CDOFeature feature, int size) + { + int i = cdoClass.getFeatureID(feature); + MoveableList<Object> list = (MoveableList<Object>)values[i]; + if (list == null) + { + list = new MoveableArrayList<Object>(size); + values[i] = list; + } + + return list; + } + + public void setListSize(CDOFeature feature, int size) + { + MoveableList<Object> list = getList(feature, size); + for (int j = list.size(); j < size; j++) + { + list.add(InternalCDORevision.UNINITIALIZED); + } + } + + @SuppressWarnings("unchecked") + private void copyValues(Object[] sourceValues) + { + CDOFeature[] features = cdoClass.getAllFeatures(); + values = new Object[features.length]; + for (int i = 0; i < features.length; i++) + { + CDOFeature feature = features[i]; + CDOType type = feature.getType(); + if (feature.isMany()) + { + MoveableList<Object> sourceList = (MoveableList<Object>)sourceValues[i]; + if (sourceList != null) + { + int size = sourceList.size(); + MoveableList<Object> list = new MoveableArrayList<Object>(size); + for (int j = 0; j < size; j++) + { + Object value = sourceList.get(j); + if (value instanceof CDOReferenceProxy) + { + list.add(new CDOReferenceProxyImpl(this, feature, ((CDOReferenceProxy)value).getIndex())); + } + else + { + list.add(type.copyValue(value)); + } + } + + values[i] = list; + } + } + else + { + values[i] = type.copyValue(sourceValues[i]); + } + } + } + + private void readValues(ExtendedDataInput in) throws IOException + { + CDOFeature[] features = cdoClass.getAllFeatures(); + values = new Object[features.length]; + for (int i = 0; i < features.length; i++) + { + CDOFeature feature = features[i]; + CDOType type = feature.getType(); + if (feature.isMany()) + { + int referenceChunk; + int size = in.readInt(); + if (size < 0) + { + size = -size; + referenceChunk = in.readInt(); + if (TRACER.isEnabled()) + { + TRACER.format("Read feature {0}: size={1}, referenceChunk={2}", feature, size, referenceChunk); + } + } + else + { + referenceChunk = size; + if (TRACER.isEnabled()) + { + TRACER.format("Read feature {0}: size={1}", feature, size); + } + } + + if (size != 0) + { + CDORevisionImpl baseRevision = null; + MoveableList<Object> list = new MoveableArrayList<Object>(size); + values[i] = list; + int ranges = in.readInt(); + if (ranges != 0) + { + // This happens only on server side + while (ranges-- > 0) + { + int range = in.readInt(); + if (range > 0) + { + while (range-- > 0) + { + Object value = type.readValue(in, revisionResolver.getCDOIDObjectFactory()); + list.add(value); + if (TRACER.isEnabled()) + { + TRACER.trace(" " + value); + } + } + } + else + { + if (baseRevision == null) + { + baseRevision = (CDORevisionImpl)revisionResolver.getRevisionByVersion(id, CDORevision.UNCHUNKED, + getVersion() - 1); + } + + MoveableList<Object> baseList = baseRevision.getList(feature); + int index = in.readInt(); + while (range++ < 0) + { + Object value = baseList.get(index++); + list.add(value); + if (TRACER.isEnabled()) + { + TRACER.trace(" " + value); + } + } + } + } + } + else + { + for (int j = 0; j < referenceChunk; j++) + { + Object value = type.readValue(in, revisionResolver.getCDOIDObjectFactory()); + list.add(value); + if (TRACER.isEnabled()) + { + TRACER.trace(" " + value); + } + } + + for (int j = referenceChunk; j < size; j++) + { + list.add(new CDOReferenceProxyImpl(this, feature, j)); + } + } + } + } + else + { + values[i] = type.readValue(in, revisionResolver.getCDOIDObjectFactory()); + if (TRACER.isEnabled()) + { + TRACER.format("Read feature {0}: {1}", feature, values[i]); + } + } + } + } + + private void writeValues(ExtendedDataOutput out, CDOIDProvider idProvider, int referenceChunk) throws IOException + { + CDOFeature[] features = cdoClass.getAllFeatures(); + for (int i = 0; i < features.length; i++) + { + CDOFeature feature = features[i]; + if (feature.isMany()) + { + List<Object> list = getValueAsList(i); + int size = list == null ? 0 : list.size(); + if (referenceChunk != CDORevision.UNCHUNKED && referenceChunk < size) + { + // This happens only on server-side + if (TRACER.isEnabled()) + { + TRACER.format("Writing feature {0}: size={1}, referenceChunk={2}", feature, size, referenceChunk); + } + + out.writeInt(-size); + out.writeInt(referenceChunk); + size = referenceChunk; + } + else + { + if (TRACER.isEnabled()) + { + TRACER.format("Writing feature {0}: size={1}", feature, size); + } + + out.writeInt(size); + } + + if (size != 0) + { + List<Integer> ranges = revisionResolver.analyzeReferenceRanges(list); + if (ranges != null) + { + // This happens only on client-side + out.writeInt(ranges.size()); + int j = 0; + for (int range : ranges) + { + out.writeInt(range); + if (range > 0) + { + // This is an id range + while (range-- > 0) + { + Object value = list.get(j); + if (value != null && feature.isReference()) + { + value = idProvider.provideCDOID(value); + list.set(j, value); + } + + if (TRACER.isEnabled()) + { + TRACER.trace(" " + value); + } + + feature.getType().writeValue(out, value); + ++j; + } + } + else + { + // This is a proxy range + CDOReferenceProxy proxy = (CDOReferenceProxy)list.get(j); + out.writeInt(proxy.getIndex()); + j -= range; // Increase j to next range start + } + } + } + else + { + out.writeInt(0); // No ranges -> no ref proxies + for (int j = 0; j < size; j++) + { + Object value = list.get(j); + if (value != null && feature.isReference()) + { + value = idProvider.provideCDOID(value); + list.set(j, value); + } + + if (TRACER.isEnabled()) + { + TRACER.trace(" " + value); + } + + feature.getType().writeValue(out, value); + } + } + } + } + else + { + if (values[i] != null && feature.isReference()) + { + values[i] = idProvider.provideCDOID(values[i]); + } + + if (TRACER.isEnabled()) + { + TRACER.format("Writing feature {0}: {1}", feature, values[i]); + } + + feature.getType().writeValue(out, values[i]); + } + } + } + + public static Object remapID(Object value, Map<CDOIDTemp, CDOID> idMappings) + { + if (value instanceof CDOIDTemp) + { + CDOIDTemp oldID = (CDOIDTemp)value; + if (!oldID.isNull()) + { + CDOID newID = idMappings.get(oldID); + if (newID == null) + { + throw new ImplementationError("Missing ID mapping for " + oldID); + } + + if (TRACER.isEnabled()) + { + TRACER.format("Adjusting ID: {0} --> {1}", oldID, newID); + } + + return newID; + } + } + + return value; + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionResolverImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionResolverImpl.java new file mode 100644 index 0000000000..63b3f3d708 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionResolverImpl.java @@ -0,0 +1,528 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266 + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.common.revision.CDORevisionResolver; +import org.eclipse.emf.cdo.internal.common.bundle.OM; +import org.eclipse.emf.cdo.spi.common.InternalCDORevision; + +import org.eclipse.net4j.util.lifecycle.Lifecycle; +import org.eclipse.net4j.util.om.trace.ContextTracer; + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * @author Eike Stepper + */ +public abstract class CDORevisionResolverImpl extends Lifecycle implements CDORevisionResolver +{ + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_REVISION, CDORevisionResolverImpl.class); + + private Map<CDOID, RevisionHolder> revisions = new HashMap<CDOID, RevisionHolder>(); + + // { + // private static final long serialVersionUID = 1L; + // + // @Override + // public String toString() + // { + // List<Entry<CDOID, RevisionHolder>> entries = new ArrayList<Entry<CDOID, RevisionHolder>>(entrySet()); + // Collections.sort(entries, new Comparator<Entry<CDOID, RevisionHolder>>() + // { + // public int compare(Entry<CDOID, RevisionHolder> o1, Entry<CDOID, RevisionHolder> o2) + // { + // return o1.getKey().compareTo(o2.getKey()); + // } + // }); + // + // StringBuilder builder = new StringBuilder(); + // for (Entry<CDOID, RevisionHolder> entry : entries) + // { + // builder.append(entry.getKey()); + // builder.append(" -->"); + // RevisionHolder holder = entry.getValue(); + // while (holder != null) + // { + // builder.append(" "); + // builder.append(holder.getRevision(false)); + // holder = holder.getNext(); + // } + // + // builder.append("\n"); + // } + // + // return builder.toString(); + // } + // }; + + private int currentLRUCapacity; + + private int revisedLRUCapacity; + + private LRU currentLRU; + + private LRU revisedLRU; + + public CDORevisionResolverImpl() + { + } + + public int getCurrentLRUCapacity() + { + return currentLRUCapacity; + } + + public void setCurrentLRUCapacity(int capacity) + { + currentLRUCapacity = capacity; + if (currentLRU != null) + { + currentLRU.capacity(capacity); + } + } + + public int getRevisedLRUCapacity() + { + return revisedLRUCapacity; + } + + public void setRevisedLRUCapacity(int capacity) + { + revisedLRUCapacity = capacity; + if (revisedLRU != null) + { + revisedLRU.capacity(capacity); + } + } + + public CDOClass getObjectType(CDOID id) + { + RevisionHolder holder = revisions.get(id); + if (holder == null) + { + return null; + } + + InternalCDORevision revision = (InternalCDORevision)holder.getRevision(true); + return revision.getCDOClass(); + } + + public boolean containsRevision(CDOID id) + { + return revisions.containsKey(id); + } + + public boolean containsRevisionByTime(CDOID id, long timeStamp) + { + return getRevisionByTime(id, 0, timeStamp, false) != null; + } + + public boolean containsRevisionByVersion(CDOID id, int version) + { + return getRevisionByVersion(id, 0, version, false) != null; + } + + public InternalCDORevision getRevision(CDOID id, int referenceChunk) + { + return getRevision(id, referenceChunk, true); + } + + public List<CDORevision> getRevisions(Collection<CDOID> ids, int referenceChunk) + { + List<CDOID> missingIDs = new ArrayList<CDOID>(0); + List<CDORevision> revisions = new ArrayList<CDORevision>(ids.size()); + for (CDOID id : ids) + { + InternalCDORevision revision = getRevision(id, referenceChunk, false); + revisions.add(revision); + if (revision == null) + { + missingIDs.add(id); + } + } + + if (!missingIDs.isEmpty()) + { + List<InternalCDORevision> missingRevisions = loadRevisions(missingIDs, referenceChunk); + handleMissingRevisions(revisions, missingRevisions); + } + + return revisions; + } + + public InternalCDORevision getRevisionByTime(CDOID id, int referenceChunk, long timeStamp) + { + return getRevisionByTime(id, referenceChunk, timeStamp, true); + } + + public List<CDORevision> getRevisionsByTime(Collection<CDOID> ids, int referenceChunk, long timeStamp) + { + List<CDOID> missingIDs = new ArrayList<CDOID>(0); + List<CDORevision> revisions = new ArrayList<CDORevision>(ids.size()); + for (CDOID id : ids) + { + InternalCDORevision revision = getRevisionByTime(id, referenceChunk, timeStamp, false); + revisions.add(revision); + if (revision == null) + { + missingIDs.add(id); + } + } + + if (!missingIDs.isEmpty()) + { + List<InternalCDORevision> missingRevisions = loadRevisions(missingIDs, referenceChunk); + handleMissingRevisions(revisions, missingRevisions); + } + + return revisions; + } + + public synchronized InternalCDORevision getRevisionByVersion(CDOID id, int referenceChunk, int version) + { + return getRevisionByVersion(id, referenceChunk, version, true); + } + + public synchronized InternalCDORevision getRevisionByVersion(CDOID id, int referenceChunk, int version, + boolean loadOnDemand) + { + RevisionHolder holder = revisions.get(id); + while (holder != null) + { + int holderVersion = holder.getVersion(); + if (holderVersion > version) + { + holder = holder.getNext(); + } + else if (holderVersion == version) + { + return (InternalCDORevision)holder.getRevision(true); + } + else + { + break; + } + } + + if (loadOnDemand) + { + InternalCDORevision revision = loadRevisionByVersion(id, referenceChunk, version); + if (revision != null) + { + addRevision(revision); + return revision; + } + } + + return null; + } + + public boolean addRevision(InternalCDORevision revision) + { + if (TRACER.isEnabled()) + { + TRACER.format("Adding revision: {0}, created={1,date} {1,time}, revised={2,date} {2,time}, current={3}", + revision, revision.getCreated(), revision.getRevised(), revision.isCurrent()); + } + + RevisionHolder newHolder = createHolder(revision); + LRU list = revision.isCurrent() ? currentLRU : revisedLRU; + list.add((DLRevisionHolder)newHolder); + + int version = revision.getVersion(); + RevisionHolder lastHolder = null; + RevisionHolder holder = revisions.get(revision.getID()); + while (holder != null) + { + int holderVersion = holder.getVersion(); + if (holderVersion > version) + { + lastHolder = holder; + holder = holder.getNext(); + } + else if (holderVersion == version) + { + return false; + } + else + { + break; + } + } + + adjustHolder(revision, newHolder, lastHolder, holder); + return true; + } + + protected InternalCDORevision getRevision(CDOID id, int referenceChunk, boolean loadOnDemand) + { + RevisionHolder holder = revisions.get(id); + InternalCDORevision revision = holder == null ? null : (InternalCDORevision)holder.getRevision(true); + if (revision == null || !revision.isCurrent()) + { + if (loadOnDemand) + { + revision = loadRevision(id, referenceChunk); + if (revision == null) + { + throw new IllegalStateException("Could not load revision for " + id); + } + + addRevision(revision); + } + else + { + revision = null; + } + } + else + { + InternalCDORevision oldRevision = revision; + revision = verifyRevision(oldRevision, referenceChunk); + if (revision != oldRevision) + { + addRevision(revision); + } + } + + return revision; + } + + protected synchronized InternalCDORevision getRevisionByTime(CDOID id, int referenceChunk, long timeStamp, + boolean loadOnDemand) + { + RevisionHolder holder = revisions.get(id); + while (holder != null) + { + int indicator = holder.compareTo(timeStamp); + if (indicator == 1) + { + // timeStamp is after holder timeSpan + holder = holder.getNext(); + } + else if (indicator == 0) + { + // timeStamp is within holder timeSpan + InternalCDORevision oldRevision = (InternalCDORevision)holder.getRevision(true); + InternalCDORevision revision = verifyRevision(oldRevision, referenceChunk); + if (revision != oldRevision) + { + addRevision(revision); + } + + return revision; + } + else + { + // timeStamp is before holder timeSpan + break; + } + } + + if (loadOnDemand) + { + InternalCDORevision revision = loadRevisionByTime(id, referenceChunk, timeStamp); + if (revision != null) + { + addRevision(revision); + return revision; + } + } + + return null; + } + + protected abstract InternalCDORevision loadRevision(CDOID id, int referenceChunk); + + protected abstract InternalCDORevision loadRevisionByTime(CDOID id, int referenceChunk, long timeStamp); + + protected abstract InternalCDORevision loadRevisionByVersion(CDOID id, int referenceChunk, int version); + + protected abstract List<InternalCDORevision> loadRevisions(Collection<CDOID> ids, int referenceChunk); + + protected abstract List<InternalCDORevision> loadRevisionsByTime(Collection<CDOID> ids, int referenceChunk, + long timeStamp); + + protected void handleMissingRevisions(List<CDORevision> revisions, List<InternalCDORevision> missingRevisions) + { + Iterator<InternalCDORevision> it = missingRevisions.iterator(); + for (int i = 0; i < revisions.size(); i++) + { + CDORevision revision = revisions.get(i); + if (revision == null) + { + InternalCDORevision missingRevision = it.next(); + revisions.set(i, missingRevision); + addRevision(missingRevision); + } + } + } + + protected synchronized void removeRevision(CDOID id, int version) + { + RevisionHolder holder = revisions.get(id); + while (holder != null) + { + int holderVersion = holder.getVersion(); + if (holderVersion > version) + { + holder = holder.getNext(); + } + else + { + if (holderVersion == version) + { + removeHolder(holder); + } + + holder = null; + } + } + } + + protected InternalCDORevision verifyRevision(InternalCDORevision revision, int referenceChunk) + { + return revision; + } + + @Override + protected void doActivate() throws Exception + { + super.doActivate(); + currentLRU = new LRU(currentLRUCapacity); + revisedLRU = new LRU(revisedLRUCapacity); + } + + @Override + protected void doDeactivate() throws Exception + { + currentLRU = null; + revisedLRU = null; + super.doDeactivate(); + } + + private void adjustHolder(InternalCDORevision revision, RevisionHolder holder, RevisionHolder prevHolder, + RevisionHolder nextHolder) + { + if (prevHolder != null) + { + if (nextHolder == null) + { + nextHolder = prevHolder.getNext(); + } + + holder.setPrev(prevHolder); + holder.setNext(nextHolder); + prevHolder.setNext(holder); + } + else + { + holder.setNext(nextHolder); + revisions.put(revision.getID(), holder); + } + + reviseHolder(holder, nextHolder); + } + + private void reviseHolder(RevisionHolder holder, RevisionHolder nextHolder) + { + if (nextHolder != null) + { + nextHolder.setPrev(holder); + if (holder.isCurrent() && nextHolder.isCurrent()) + { + currentLRU.remove((DLRevisionHolder)nextHolder); + revisedLRU.add((DLRevisionHolder)nextHolder); + + InternalCDORevision oldRevision = (InternalCDORevision)nextHolder.getRevision(false); + if (oldRevision != null) + { + oldRevision.setRevised(holder.getCreated() - 1); + } + } + } + } + + private synchronized void removeHolder(RevisionHolder holder) + { + CDOID id = holder.getID(); + RevisionHolder prev = holder.getPrev(); + RevisionHolder next = holder.getNext(); + if (next != null) + { + next.setPrev(prev); + } + + if (prev != null) + { + prev.setNext(next); + } + else + { + if (next != null) + { + revisions.put(id, next); + } + else + { + revisions.remove(id); + } + } + + holder.setPrev(null); + holder.setNext(null); + } + + private RevisionHolder createHolder(InternalCDORevision revision) + { + LRURevisionList list = revision.isCurrent() ? currentLRU : revisedLRU; + return new LRURevisionHolder(list, revision); + } + + /** + * @author Eike Stepper + */ + private final class LRU extends LRURevisionList + { + public LRU(int capacity) + { + super(capacity); + } + + @Override + public String toString() + { + return MessageFormat.format("LRU[size={0}, capacity={1}]", size(), capacity()); + } + + @Override + protected void evict(LRURevisionHolder holder) + { + if (TRACER.isEnabled()) + { + TRACER.format("Evicting revision {0}v{1}", holder.getID(), holder.getVersion()); + } + + super.evict(holder); + removeHolder(holder); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/DLRevisionHolder.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/DLRevisionHolder.java new file mode 100644 index 0000000000..86f94cb422 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/DLRevisionHolder.java @@ -0,0 +1,56 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision; + +import org.eclipse.emf.cdo.common.revision.CDORevision; + +/** + * @author Eike Stepper + */ +public class DLRevisionHolder extends RevisionHolder +{ + private DLRevisionList dlList; + + private DLRevisionHolder dlPrev; + + private DLRevisionHolder dlNext; + + public DLRevisionHolder(DLRevisionList list, CDORevision revision) + { + super(revision); + dlList = list; + } + + public DLRevisionList getDLList() + { + return dlList; + } + + public DLRevisionHolder getDLPrev() + { + return dlPrev; + } + + public void setDLPrev(DLRevisionHolder prev) + { + dlPrev = prev; + } + + public DLRevisionHolder getDLNext() + { + return dlNext; + } + + public void setDLNext(DLRevisionHolder next) + { + dlNext = next; + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/DLRevisionList.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/DLRevisionList.java new file mode 100644 index 0000000000..f8ba7b7432 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/DLRevisionList.java @@ -0,0 +1,222 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.spi.common.InternalCDORevision; + +import java.text.MessageFormat; + +/** + * @author Eike Stepper + */ +public class DLRevisionList extends DLRevisionHolder +{ + private int size; + + public DLRevisionList() + { + super(null, null); + setDLHead(this); + setDLTail(this); + } + + public int size() + { + return size; + } + + public DLRevisionHolder getDLHead() + { + return getDLNext(); + } + + public void setDLHead(DLRevisionHolder head) + { + setDLNext(head); + } + + public DLRevisionHolder getDLTail() + { + return getDLPrev(); + } + + public void setDLTail(DLRevisionHolder tail) + { + setDLPrev(tail); + } + + public DLRevisionHolder get(int index) + { + if (index < 0 || index >= size) + { + throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size); + } + + DLRevisionHolder holder = this; + if (index < size >> 1) + { + for (int i = 0; i <= index; i++) + { + holder = holder.getDLNext(); + } + } + else + { + for (int i = size; i > index; i--) + { + holder = holder.getDLPrev(); + } + } + + return holder; + } + + public void add(DLRevisionHolder holder) + { + addTail(holder); + } + + public synchronized void addHead(DLRevisionHolder holder) + { + ++size; + DLRevisionHolder head = getDLHead(); + head.setDLPrev(holder); + holder.setDLNext(head); + holder.setDLPrev(this); + setDLHead(holder); + } + + public synchronized void addTail(DLRevisionHolder holder) + { + ++size; + DLRevisionHolder tail = getDLTail(); + tail.setDLNext(holder); + holder.setDLPrev(tail); + holder.setDLNext(this); + setDLTail(holder); + } + + public synchronized void remove(DLRevisionHolder holder) + { + --size; + DLRevisionHolder prev = holder.getDLPrev(); + DLRevisionHolder next = holder.getDLNext(); + + prev.setDLNext(next); + holder.setDLPrev(null); + holder.setDLNext(null); + next.setDLPrev(prev); + } + + @Override + public String toString() + { + return MessageFormat.format("DLRevisionList[size={0}]", size); + } + + @Override + public int compareTo(long timeStamp) + { + throw new UnsupportedOperationException(); + } + + @Override + public long getCreated() + { + throw new UnsupportedOperationException(); + } + + @Override + public DLRevisionList getDLList() + { + throw new UnsupportedOperationException(); + } + + @Override + public CDOID getID() + { + throw new UnsupportedOperationException(); + } + + @Override + public RevisionHolder getNext() + { + throw new UnsupportedOperationException(); + } + + @Override + public RevisionHolder getPrev() + { + throw new UnsupportedOperationException(); + } + + @Override + public long getRevised() + { + throw new UnsupportedOperationException(); + } + + @Override + public CDORevision getRevision(boolean loadOnDemand) + { + throw new UnsupportedOperationException(); + } + + @Override + public int getVersion() + { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isCurrent() + { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isLoaded() + { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isValid(long timeStamp) + { + throw new UnsupportedOperationException(); + } + + @Override + protected InternalCDORevision loadRevision() + { + throw new UnsupportedOperationException(); + } + + @Override + public void setNext(RevisionHolder next) + { + throw new UnsupportedOperationException(); + } + + @Override + public void setPrev(RevisionHolder prev) + { + throw new UnsupportedOperationException(); + } + + @Override + public void setRevision(CDORevision revision) + { + // Ignore + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/LRURevisionHolder.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/LRURevisionHolder.java new file mode 100644 index 0000000000..4eb20d9a25 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/LRURevisionHolder.java @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision; + +import org.eclipse.emf.cdo.common.revision.CDORevision; + +/** + * @author Eike Stepper + */ +public class LRURevisionHolder extends DLRevisionHolder +{ + private long usedStamp; + + public LRURevisionHolder(LRURevisionList list, CDORevision revision) + { + super(list, revision); + usedStamp = System.currentTimeMillis(); + } + + @Override + public LRURevisionList getDLList() + { + return (LRURevisionList)super.getDLList(); + } + + public long getUsedStamp() + { + return usedStamp; + } + + @Override + public CDORevision getRevision(boolean loadOnDemand) + { + if (loadOnDemand) + { + stamp(); + } + + return super.getRevision(loadOnDemand); + } + + protected void stamp() + { + usedStamp = System.currentTimeMillis(); + LRURevisionList list = getDLList(); + if (list != null) + { + synchronized (list) + { + list.remove(this); + list.addHead(this); + } + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/LRURevisionList.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/LRURevisionList.java new file mode 100644 index 0000000000..26525a7ac9 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/LRURevisionList.java @@ -0,0 +1,66 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision; + +import java.text.MessageFormat; + +/** + * @author Eike Stepper + */ +public class LRURevisionList extends DLRevisionList +{ + private int capacity; + + public LRURevisionList(int capacity) + { + this.capacity = capacity; + } + + public int capacity() + { + return capacity; + } + + public synchronized void capacity(int capacity) + { + this.capacity = capacity; + eviction(); + } + + @Override + public synchronized void add(DLRevisionHolder holder) + { + addHead(holder); + eviction(); + } + + @Override + public String toString() + { + return MessageFormat.format("LRURevisionList[size={0}, capacity={1}]", size(), capacity); + } + + protected void eviction() + { + if (capacity != 0) + { + while (size() > capacity) + { + evict((LRURevisionHolder)getDLTail()); + } + } + } + + protected void evict(LRURevisionHolder holder) + { + remove(holder); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/RevisionHolder.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/RevisionHolder.java new file mode 100644 index 0000000000..c58a1a3009 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/RevisionHolder.java @@ -0,0 +1,142 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.spi.common.InternalCDORevision; + +import java.text.MessageFormat; + +/** + * @author Eike Stepper + */ +public class RevisionHolder +{ + // private CDOID id; + // + // private int version; + // + // private long created; + // + // private long revised; + + private RevisionHolder prev; + + private RevisionHolder next; + + private CDORevision revision; + + public RevisionHolder(CDORevision revision) + { + setRevision(revision); + } + + public CDOID getID() + { + return revision.getID(); + } + + public int getVersion() + { + return revision.getVersion(); + } + + public long getCreated() + { + return revision.getCreated(); + } + + public long getRevised() + { + return revision.getRevised(); + } + + public boolean isCurrent() + { + return getRevised() == CDORevision.UNSPECIFIED_DATE; + } + + public boolean isValid(long timeStamp) + { + return (getRevised() == CDORevision.UNSPECIFIED_DATE || getRevised() >= timeStamp) && timeStamp >= getCreated(); + } + + public int compareTo(long timeStamp) + { + if (timeStamp < getCreated()) + { + return -1; + } + + if (getRevised() != CDORevision.UNSPECIFIED_DATE && timeStamp > getRevised()) + { + return 1; + } + + return 0; + } + + public RevisionHolder getPrev() + { + return prev; + } + + public void setPrev(RevisionHolder prev) + { + this.prev = prev; + } + + public RevisionHolder getNext() + { + return next; + } + + public void setNext(RevisionHolder next) + { + this.next = next; + } + + public boolean isLoaded() + { + return revision != null; + } + + public CDORevision getRevision(boolean loadOnDemand) + { + if (revision == null && loadOnDemand) + { + revision = loadRevision(); + } + + return revision; + } + + public void setRevision(CDORevision revision) + { + this.revision = revision; + // id = revision.getID(); + // version = revision.getVersion(); + // created = revision.getCreated(); + // revised = revision.getRevised(); + } + + @Override + public String toString() + { + return MessageFormat.format("RevisionHolder[{0}]", revision); + } + + protected InternalCDORevision loadRevision() + { + throw new UnsupportedOperationException(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOAddFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOAddFeatureDeltaImpl.java new file mode 100644 index 0000000000..c7de939da6 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOAddFeatureDeltaImpl.java @@ -0,0 +1,72 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.common.revision.delta.CDOAddFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDeltaVisitor; +import org.eclipse.emf.cdo.spi.common.InternalCDORevision; + +import org.eclipse.net4j.util.io.ExtendedDataInput; + +import java.io.IOException; + +/** + * @author Simon McDuff + */ +public class CDOAddFeatureDeltaImpl extends CDOSingleValueFeatureDeltaImpl implements CDOAddFeatureDelta, + IListIndexAffecting, IListTargetAdding +{ + public CDOAddFeatureDeltaImpl(CDOFeature feature, int index, Object value) + { + super(feature, index, value); + } + + public CDOAddFeatureDeltaImpl(ExtendedDataInput in, CDOClass cdoClass) throws IOException + { + super(in, cdoClass); + } + + public Type getType() + { + return Type.ADD; + } + + public void apply(CDORevision revision) + { + ((InternalCDORevision)revision).getList(getFeature()).add(getIndex(), getValue()); + } + + public void accept(CDOFeatureDeltaVisitor visitor) + { + visitor.visit(this); + } + + public void affectIndices(int[] indices) + { + int index = getIndex(); + if (index == NO_INDEX) + { + return; + } + + for (int i = 1; i <= indices[0]; i++) + { + if (indices[i] >= index) + { + ++indices[i]; + } + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOClearFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOClearFeatureDeltaImpl.java new file mode 100644 index 0000000000..ba98c6e565 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOClearFeatureDeltaImpl.java @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.common.revision.delta.CDOClearFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDeltaVisitor; +import org.eclipse.emf.cdo.spi.common.InternalCDORevision; + +import org.eclipse.net4j.util.io.ExtendedDataInput; + +import java.io.IOException; +import java.util.Map; + +/** + * @author Simon McDuff + */ +public class CDOClearFeatureDeltaImpl extends CDOFeatureDeltaImpl implements CDOClearFeatureDelta +{ + public CDOClearFeatureDeltaImpl(CDOFeature feature) + { + super(feature); + } + + public CDOClearFeatureDeltaImpl(ExtendedDataInput in, CDOClass cdoClass) throws IOException + { + super(in, cdoClass); + } + + public Type getType() + { + return Type.CLEAR; + } + + public void apply(CDORevision revision) + { + ((InternalCDORevision)revision).clear(getFeature()); + } + + public void accept(CDOFeatureDeltaVisitor visitor) + { + visitor.visit(this); + } + + @Override + public void adjustReferences(Map<CDOIDTemp, CDOID> idMappings) + { + // Do nothing + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOContainerFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOContainerFeatureDeltaImpl.java new file mode 100644 index 0000000000..6763434c40 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOContainerFeatureDeltaImpl.java @@ -0,0 +1,197 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDProvider; +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.common.id.CDOIDUtil; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOClassProxy; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.model.CDOPackage; +import org.eclipse.emf.cdo.common.model.CDOPackageManager; +import org.eclipse.emf.cdo.common.model.CDOType; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.common.revision.CDORevisionUtil; +import org.eclipse.emf.cdo.common.revision.delta.CDOContainerFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDeltaVisitor; +import org.eclipse.emf.cdo.spi.common.InternalCDORevision; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; +import java.util.Map; + +/** + * @author Simon McDuff + */ +public class CDOContainerFeatureDeltaImpl extends CDOFeatureDeltaImpl implements CDOContainerFeatureDelta +{ + /** + * TODO Move to CDOObjectContainerFeature + */ + private static CDOFeature CONTAINER_FEATURE = new ContainerFeature(); + + private CDOID newContainerID; + + private int newContainerFeatureID; + + public CDOContainerFeatureDeltaImpl(CDOID newContainerID, int newContainerFeatureID) + { + super(CONTAINER_FEATURE); + this.newContainerID = newContainerID; + this.newContainerFeatureID = newContainerFeatureID; + } + + public CDOContainerFeatureDeltaImpl(ExtendedDataInput in, CDOClass cdoClass) throws IOException + { + super(CONTAINER_FEATURE); + newContainerFeatureID = in.readInt(); + newContainerID = CDOIDUtil.read(in, cdoClass.getPackageManager().getCDOIDObjectFactory()); + } + + public int getContainerFeatureID() + { + return newContainerFeatureID; + } + + public CDOID getContainerID() + { + return newContainerID; + } + + public Type getType() + { + return Type.CONTAINER; + } + + public void apply(CDORevision revision) + { + ((InternalCDORevision)revision).setContainerID(newContainerID); + ((InternalCDORevision)revision).setContainingFeatureID(newContainerFeatureID); + } + + @Override + public void adjustReferences(Map<CDOIDTemp, CDOID> idMappings) + { + newContainerID = (CDOID)CDORevisionUtil.remapID(newContainerID, idMappings); + } + + @Override + public void write(ExtendedDataOutput out, CDOClass cdoClass, CDOIDProvider idProvider) throws IOException + { + out.writeInt(getType().ordinal()); + out.writeInt(newContainerFeatureID); + CDOIDUtil.write(out, newContainerID); + } + + public void accept(CDOFeatureDeltaVisitor visitor) + { + visitor.visit(this); + } + + /** + * @author Simon McDuff + */ + private static final class ContainerFeature implements CDOFeature + { + public CDOClass getContainingClass() + { + return null; + } + + public void setContainingClass(CDOClass cdoClass) + { + } + + public CDOPackage getContainingPackage() + { + return null; + } + + public int getFeatureID() + { + return 0; + } + + public int getFeatureIndex() + { + return 0; + } + + public CDOClass getReferenceType() + { + return null; + } + + public CDOClassProxy getReferenceTypeProxy() + { + return null; + } + + public CDOType getType() + { + return null; + } + + public boolean isContainment() + { + return false; + } + + public boolean isMany() + { + return false; + } + + public boolean isReference() + { + return false; + } + + public Object getClientInfo() + { + return null; + } + + public String getName() + { + return null; + } + + public CDOPackageManager getPackageManager() + { + return null; + } + + public Object getServerInfo() + { + return null; + } + + public void setClientInfo(Object clientInfo) + { + } + + public void setServerInfo(Object serverInfo) + { + } + + @Override + public String toString() + { + return "CONTAINER_FEATURE"; + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaImpl.java new file mode 100644 index 0000000000..cf02d045b9 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaImpl.java @@ -0,0 +1,87 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDProvider; +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; +import java.util.Map; + +/** + * @author Simon McDuff + */ +public abstract class CDOFeatureDeltaImpl implements CDOFeatureDelta +{ + public static final int NO_INDEX = -1; + + private CDOFeature feature; + + protected CDOFeatureDeltaImpl(CDOFeature feature) + { + this.feature = feature; + } + + public CDOFeatureDeltaImpl(ExtendedDataInput in, CDOClass cdoClass) throws IOException + { + int featureID = in.readInt(); + feature = cdoClass.getAllFeatures()[featureID]; + } + + public CDOFeature getFeature() + { + return feature; + } + + public abstract void adjustReferences(Map<CDOIDTemp, CDOID> idMappings); + + public void write(ExtendedDataOutput out, CDOClass cdoClass, CDOIDProvider idProvider) throws IOException + { + out.writeInt(getType().ordinal()); + out.writeInt(cdoClass.getFeatureID(feature)); + } + + public static CDOFeatureDeltaImpl read(ExtendedDataInput in, CDOClass cdoClass) throws IOException + { + int typeOrdinal = in.readInt(); + Type type = Type.values()[typeOrdinal]; + switch (type) + { + case ADD: + return new CDOAddFeatureDeltaImpl(in, cdoClass); + case SET: + return new CDOSetFeatureDeltaImpl(in, cdoClass); + case LIST: + return new CDOListFeatureDeltaImpl(in, cdoClass); + case MOVE: + return new CDOMoveFeatureDeltaImpl(in, cdoClass); + case CLEAR: + return new CDOClearFeatureDeltaImpl(in, cdoClass); + case REMOVE: + return new CDORemoveFeatureDeltaImpl(in, cdoClass); + case CONTAINER: + return new CDOContainerFeatureDeltaImpl(in, cdoClass); + case UNSET: + return new CDOUnsetFeatureDeltaImpl(in, cdoClass); + default: + // TODO Find better exception for signalling errors + throw new UnsupportedOperationException("Invalid type " + typeOrdinal); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaVisitorImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaVisitorImpl.java new file mode 100644 index 0000000000..3317bad23b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaVisitorImpl.java @@ -0,0 +1,69 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +import org.eclipse.emf.cdo.common.revision.delta.CDOAddFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOClearFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOContainerFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDeltaVisitor; +import org.eclipse.emf.cdo.common.revision.delta.CDOListFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOMoveFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDORemoveFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOSetFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOUnsetFeatureDelta; + +/** + * @author Simon McDuff + */ +public class CDOFeatureDeltaVisitorImpl implements CDOFeatureDeltaVisitor +{ + public CDOFeatureDeltaVisitorImpl() + { + } + + public void visit(CDOAddFeatureDelta delta) + { + } + + public void visit(CDOClearFeatureDelta delta) + { + } + + public void visit(CDOContainerFeatureDelta delta) + { + } + + public void visit(CDOListFeatureDelta deltas) + { + for (CDOFeatureDelta delta : deltas.getListChanges()) + { + delta.accept(this); + } + } + + public void visit(CDOMoveFeatureDelta delta) + { + } + + public void visit(CDORemoveFeatureDelta delta) + { + } + + public void visit(CDOSetFeatureDelta delta) + { + } + + public void visit(CDOUnsetFeatureDelta delta) + { + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOListFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOListFeatureDeltaImpl.java new file mode 100644 index 0000000000..35cedd3690 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOListFeatureDeltaImpl.java @@ -0,0 +1,126 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDProvider; +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDeltaVisitor; +import org.eclipse.emf.cdo.common.revision.delta.CDOListFeatureDelta; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @author Simon McDuff + */ +public class CDOListFeatureDeltaImpl extends CDOFeatureDeltaImpl implements CDOListFeatureDelta +{ + private List<CDOFeatureDelta> featureDeltas = new ArrayList<CDOFeatureDelta>(); + + public CDOListFeatureDeltaImpl(CDOFeature feature) + { + super(feature); + } + + public CDOListFeatureDeltaImpl(ExtendedDataInput in, CDOClass cdoClass) throws IOException + { + super(in, cdoClass); + int size = in.readInt(); + for (int i = 0; i < size; i++) + { + featureDeltas.add(CDOFeatureDeltaImpl.read(in, cdoClass)); + } + } + + public Type getType() + { + return Type.LIST; + } + + public List<CDOFeatureDelta> getListChanges() + { + return featureDeltas; + } + + @Override + public void write(final ExtendedDataOutput out, CDOClass cdoClass, final CDOIDProvider idProvider) throws IOException + { + super.write(out, cdoClass, idProvider); + out.writeInt(featureDeltas.size()); + for (CDOFeatureDelta featureDelta : featureDeltas) + { + ((CDOFeatureDeltaImpl)featureDelta).write(out, cdoClass, idProvider); + } + } + + /** + * Returns the number of indices as the first element of the array. + * + * @return never <code>null</code>. + */ + public int[] reconstructAddedIndices() + { + int[] indices = new int[1 + featureDeltas.size()]; + for (CDOFeatureDelta featureDelta : featureDeltas) + { + if (featureDelta instanceof IListIndexAffecting) + { + IListIndexAffecting affecting = (IListIndexAffecting)featureDelta; + affecting.affectIndices(indices); + } + + if (featureDelta instanceof IListTargetAdding) + { + indices[++indices[0]] = ((IListTargetAdding)featureDelta).getIndex(); + } + } + + return indices; + } + + public void add(CDOFeatureDelta featureDelta) + { + featureDeltas.add(featureDelta); + } + + public void apply(CDORevision revision) + { + for (CDOFeatureDelta featureDelta : featureDeltas) + { + ((CDOFeatureDeltaImpl)featureDelta).apply(revision); + } + } + + @Override + public void adjustReferences(Map<CDOIDTemp, CDOID> idMappings) + { + for (CDOFeatureDelta featureDelta : featureDeltas) + { + ((CDOFeatureDeltaImpl)featureDelta).adjustReferences(idMappings); + } + } + + public void accept(CDOFeatureDeltaVisitor visitor) + { + visitor.visit(this); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOMoveFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOMoveFeatureDeltaImpl.java new file mode 100644 index 0000000000..850249b32c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOMoveFeatureDeltaImpl.java @@ -0,0 +1,123 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDProvider; +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDeltaVisitor; +import org.eclipse.emf.cdo.common.revision.delta.CDOMoveFeatureDelta; +import org.eclipse.emf.cdo.spi.common.InternalCDORevision; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; +import java.util.Map; + +/** + * @author Simon McDuff + */ +public class CDOMoveFeatureDeltaImpl extends CDOFeatureDeltaImpl implements CDOMoveFeatureDelta, IListIndexAffecting +{ + private int oldPosition; + + private int newPosition; + + public CDOMoveFeatureDeltaImpl(CDOFeature feature, int newPosition, int oldPosition) + { + super(feature); + this.newPosition = newPosition; + this.oldPosition = oldPosition; + } + + public CDOMoveFeatureDeltaImpl(ExtendedDataInput in, CDOClass cdoClass) throws IOException + { + super(in, cdoClass); + newPosition = in.readInt(); + oldPosition = in.readInt(); + } + + public int getNewPosition() + { + return newPosition; + } + + public int getOldPosition() + { + return oldPosition; + } + + public Type getType() + { + return Type.MOVE; + } + + public void apply(CDORevision revision) + { + ((InternalCDORevision)revision).getList(getFeature()).move(newPosition, oldPosition); + } + + @Override + public void write(ExtendedDataOutput out, CDOClass cdoClass, CDOIDProvider idProvider) throws IOException + { + super.write(out, cdoClass, idProvider); + out.writeInt(newPosition); + out.writeInt(oldPosition); + } + + public void affectIndices(int[] indices) + { + if (oldPosition < newPosition) + { + for (int i = 1; i <= indices[0]; i++) + { + if (oldPosition < indices[i] && indices[i] <= newPosition) + { + --indices[i]; + } + else if (indices[i] == oldPosition) + { + indices[i] = newPosition; + } + } + } + else if (newPosition < oldPosition) + { + for (int i = 1; i <= indices[0]; i++) + { + if (newPosition <= indices[i] && indices[i] < oldPosition) + { + ++indices[i]; + } + else if (indices[i] == oldPosition) + { + indices[i] = newPosition; + } + } + } + } + + public void accept(CDOFeatureDeltaVisitor visitor) + { + visitor.visit(this); + } + + @Override + public void adjustReferences(Map<CDOIDTemp, CDOID> idMappings) + { + // Do nothing + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORemoveFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORemoveFeatureDeltaImpl.java new file mode 100644 index 0000000000..4e6babfe2c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORemoveFeatureDeltaImpl.java @@ -0,0 +1,103 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDProvider; +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDeltaVisitor; +import org.eclipse.emf.cdo.common.revision.delta.CDORemoveFeatureDelta; +import org.eclipse.emf.cdo.spi.common.InternalCDORevision; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; +import java.util.Map; + +/** + * @author Simon McDuff + */ +public class CDORemoveFeatureDeltaImpl extends CDOFeatureDeltaImpl implements CDORemoveFeatureDelta, + IListIndexAffecting +{ + private int index; + + public CDORemoveFeatureDeltaImpl(CDOFeature feature, int index) + { + super(feature); + this.index = index; + } + + public CDORemoveFeatureDeltaImpl(ExtendedDataInput in, CDOClass cdoClass) throws IOException + { + super(in, cdoClass); + index = in.readInt(); + } + + public int getIndex() + { + return index; + } + + public Type getType() + { + return Type.REMOVE; + } + + public void apply(CDORevision revision) + { + ((InternalCDORevision)revision).getList(getFeature()).remove(index); + } + + public void accept(CDOFeatureDeltaVisitor visitor) + { + visitor.visit(this); + } + + @Override + public void write(ExtendedDataOutput out, CDOClass cdoClass, CDOIDProvider idProvider) throws IOException + { + super.write(out, cdoClass, idProvider); + out.writeInt(index); + } + + public void affectIndices(int[] indices) + { + int index = getIndex(); + for (int i = 1; i <= indices[0]; i++) + { + if (indices[i] > index) + { + --indices[i]; + } + else if (indices[i] == index) + { + int rest = indices[0]-- - i; + if (rest > 0) + { + System.arraycopy(indices, i + 1, indices, i, rest); + --i; + } + } + } + } + + @Override + public void adjustReferences(Map<CDOIDTemp, CDOID> idMappings) + { + // do Nothing + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionDeltaImpl.java new file mode 100644 index 0000000000..6eb47605a4 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionDeltaImpl.java @@ -0,0 +1,261 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + * Simon McDuff - https://bugs.eclipse.org/bugs/show_bug.cgi?id=201266 + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDProvider; +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.common.id.CDOIDUtil; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOClassRef; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.model.CDOModelUtil; +import org.eclipse.emf.cdo.common.model.CDOPackageManager; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.common.revision.CDORevisionData; +import org.eclipse.emf.cdo.common.revision.delta.CDOClearFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDeltaVisitor; +import org.eclipse.emf.cdo.spi.common.InternalCDORevision; +import org.eclipse.emf.cdo.spi.common.InternalCDORevisionDelta; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author Eike Stepper + */ +public class CDORevisionDeltaImpl implements InternalCDORevisionDelta +{ + private CDOID cdoID; + + private CDOClass cdoClass; + + private int dirtyVersion; + + private int originVersion; + + private Map<CDOFeature, CDOFeatureDelta> featureDeltas = new HashMap<CDOFeature, CDOFeatureDelta>(); + + public CDORevisionDeltaImpl(CDORevision revision) + { + cdoID = revision.getID(); + cdoClass = revision.getCDOClass(); + dirtyVersion = revision.getVersion(); + originVersion = dirtyVersion - 1; + } + + public CDORevisionDeltaImpl(CDORevision originRevision, CDORevision dirtyRevision) + { + if (originRevision.getCDOClass() != dirtyRevision.getCDOClass()) + { + throw new IllegalArgumentException(); + } + + cdoID = originRevision.getID(); + cdoClass = originRevision.getCDOClass(); + dirtyVersion = dirtyRevision.getVersion(); + originVersion = originRevision.getVersion(); + + compare(originRevision, dirtyRevision); + + CDORevisionData originData = originRevision.getData(); + CDORevisionData dirtyData = dirtyRevision.getData(); + if (!compare(originData.getContainerID(), dirtyData.getContainerID()) + || !compare(originData.getContainingFeatureID(), dirtyData.getContainingFeatureID())) + { + addFeatureDelta(new CDOContainerFeatureDeltaImpl(dirtyData.getContainerID(), dirtyData.getContainingFeatureID())); + } + + } + + public CDORevisionDeltaImpl(ExtendedDataInput in, CDOPackageManager packageManager) throws IOException + { + CDOClassRef classRef = CDOModelUtil.readClassRef(in); + cdoClass = classRef.resolve(packageManager); + cdoID = CDOIDUtil.read(in, packageManager.getCDOIDObjectFactory()); + originVersion = in.readInt(); + dirtyVersion = in.readInt(); + int size = in.readInt(); + for (int i = 0; i < size; i++) + { + CDOFeatureDelta featureDelta = CDOFeatureDeltaImpl.read(in, cdoClass); + featureDeltas.put(featureDelta.getFeature(), featureDelta); + } + } + + public void write(ExtendedDataOutput out, CDOIDProvider idProvider) throws IOException + { + CDOClassRef classRef = cdoClass.createClassRef(); + CDOModelUtil.writeClassRef(out, classRef); + CDOIDUtil.write(out, cdoID); + out.writeInt(originVersion); + out.writeInt(dirtyVersion); + out.writeInt(featureDeltas.size()); + for (CDOFeatureDelta featureDelta : featureDeltas.values()) + { + ((CDOFeatureDeltaImpl)featureDelta).write(out, cdoClass, idProvider); + } + } + + public CDOID getID() + { + return cdoID; + } + + public int getOriginVersion() + { + return originVersion; + } + + public int getDirtyVersion() + { + return dirtyVersion; + } + + public List<CDOFeatureDelta> getFeatureDeltas() + { + return new ArrayList<CDOFeatureDelta>(featureDeltas.values()); + } + + public void apply(CDORevision revision) + { + ((InternalCDORevision)revision).setVersion(dirtyVersion); + for (CDOFeatureDelta featureDelta : featureDeltas.values()) + { + ((CDOFeatureDeltaImpl)featureDelta).apply(revision); + } + } + + public void addFeatureDelta(CDOFeatureDelta delta) + { + CDOFeature feature = delta.getFeature(); + if (feature.isMany()) + { + CDOListFeatureDeltaImpl lookupDelta = (CDOListFeatureDeltaImpl)featureDeltas.get(feature); + if (lookupDelta == null) + { + lookupDelta = new CDOListFeatureDeltaImpl(feature); + featureDeltas.put(lookupDelta.getFeature(), lookupDelta); + } + + // Remove all previous changes + if (delta instanceof CDOClearFeatureDelta) + { + lookupDelta.getListChanges().clear(); + } + lookupDelta.add(delta); + } + else + { + featureDeltas.put(feature, delta); + } + } + + public void adjustReferences(Map<CDOIDTemp, CDOID> idMappings) + { + for (CDOFeatureDelta featureDelta : featureDeltas.values()) + { + ((CDOFeatureDeltaImpl)featureDelta).adjustReferences(idMappings); + } + } + + public void accept(CDOFeatureDeltaVisitor visitor) + { + for (CDOFeatureDelta featureDelta : featureDeltas.values()) + { + ((CDOFeatureDeltaImpl)featureDelta).accept(visitor); + } + } + + private void compare(CDORevision originRevision, CDORevision dirtyRevision) + { + CDOFeature features[] = cdoClass.getAllFeatures(); + int count = cdoClass.getFeatureCount(); + for (int i = 0; i < count; i++) + { + CDOFeature feature = features[i]; + if (feature.isMany()) + { + int originSize = originRevision.getData().size(feature); + int dirtySize = dirtyRevision.getData().size(feature); + if (dirtySize == 0 && originSize > 0) + { + addFeatureDelta(new CDOClearFeatureDeltaImpl(feature)); + } + else + { + int originIndex = 0; + int dirtyIndex = 0; + if (originSize == dirtySize) + { + for (; originIndex < originSize && dirtyIndex < dirtySize; dirtyIndex++, originIndex++) + { + Object originValue = originRevision.getData().get(feature, originIndex); + Object dirtyValue = dirtyRevision.getData().get(feature, dirtyIndex); + + if (!compare(originValue, dirtyValue)) + { + dirtyIndex = 0; + break; + } + } + } + + if (originIndex != originSize || dirtyIndex != dirtySize) + { + // Not identical + // Be very stupid and do the simplest thing. + // Clear and add all value; + if (originSize > 0) + { + addFeatureDelta(new CDOClearFeatureDeltaImpl(feature)); + } + + for (int k = 0; k < dirtySize; k++) + { + Object dirtyValue = dirtyRevision.getData().get(feature, k); + addFeatureDelta(new CDOAddFeatureDeltaImpl(feature, k, dirtyValue)); + } + } + } + } + else + { + Object originValue = originRevision.getData().get(feature, 0); + Object dirtyValue = dirtyRevision.getData().get(feature, 0); + if (!compare(originValue, dirtyValue)) + { + if (dirtyValue == null) + { + addFeatureDelta(new CDOUnsetFeatureDeltaImpl(feature)); + } + else + { + addFeatureDelta(new CDOSetFeatureDeltaImpl(feature, 0, dirtyValue)); + } + } + } + } + } + + private boolean compare(Object originValue, Object dirtyValue) + { + return originValue == dirtyValue || originValue != null && dirtyValue != null && originValue.equals(dirtyValue); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionMerger.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionMerger.java new file mode 100644 index 0000000000..d1300ae653 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionMerger.java @@ -0,0 +1,84 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +import org.eclipse.emf.cdo.common.revision.delta.CDOAddFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOClearFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOContainerFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOMoveFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDORemoveFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOSetFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDOUnsetFeatureDelta; +import org.eclipse.emf.cdo.spi.common.InternalCDORevision; + +/** + * @author Simon McDuff + */ +public class CDORevisionMerger extends CDOFeatureDeltaVisitorImpl +{ + private InternalCDORevision revision; + + public CDORevisionMerger() + { + } + + public void merge(InternalCDORevision revision, CDORevisionDelta delta) + { + this.revision = revision; + delta.accept(this); + revision = null; + } + + @Override + public void visit(CDOMoveFeatureDelta delta) + { + revision.move(delta.getFeature(), delta.getOldPosition(), delta.getNewPosition()); + } + + @Override + public void visit(CDOAddFeatureDelta delta) + { + revision.add(delta.getFeature(), delta.getIndex(), delta.getValue()); + } + + @Override + public void visit(CDORemoveFeatureDelta delta) + { + revision.remove(delta.getFeature(), delta.getIndex()); + } + + @Override + public void visit(CDOSetFeatureDelta delta) + { + revision.set(delta.getFeature(), delta.getIndex(), delta.getValue()); + } + + @Override + public void visit(CDOUnsetFeatureDelta delta) + { + revision.unset(delta.getFeature()); + } + + @Override + public void visit(CDOClearFeatureDelta delta) + { + revision.clear(delta.getFeature()); + } + + @Override + public void visit(CDOContainerFeatureDelta delta) + { + revision.setContainerID(delta.getContainerID()); + revision.setContainingFeatureID(delta.getContainerFeatureID()); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSetFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSetFeatureDeltaImpl.java new file mode 100644 index 0000000000..44fdfe6b9c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSetFeatureDeltaImpl.java @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDeltaVisitor; +import org.eclipse.emf.cdo.common.revision.delta.CDOSetFeatureDelta; +import org.eclipse.emf.cdo.spi.common.InternalCDORevision; + +import org.eclipse.net4j.util.io.ExtendedDataInput; + +import java.io.IOException; + +/** + * @author Simon McDuff + */ +public class CDOSetFeatureDeltaImpl extends CDOSingleValueFeatureDeltaImpl implements CDOSetFeatureDelta, + IListTargetAdding +{ + public CDOSetFeatureDeltaImpl(CDOFeature feature, int index, Object value) + { + super(feature, index, value); + } + + public CDOSetFeatureDeltaImpl(ExtendedDataInput in, CDOClass cdoClass) throws IOException + { + super(in, cdoClass); + } + + public Type getType() + { + return Type.SET; + } + + public void apply(CDORevision revision) + { + ((InternalCDORevision)revision).set(getFeature(), getIndex(), getValue()); + } + + public void accept(CDOFeatureDeltaVisitor visitor) + { + visitor.visit(this); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java new file mode 100644 index 0000000000..741d76b8e6 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java @@ -0,0 +1,82 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDProvider; +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.revision.CDORevisionUtil; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; +import java.util.Map; + +/** + * @author Simon McDuff + */ +public abstract class CDOSingleValueFeatureDeltaImpl extends CDOFeatureDeltaImpl implements CDOFeatureDelta +{ + private int index; + + private Object newValue; + + public CDOSingleValueFeatureDeltaImpl(CDOFeature feature, int index, Object value) + { + super(feature); + this.index = index; + newValue = value; + } + + public CDOSingleValueFeatureDeltaImpl(ExtendedDataInput in, CDOClass cdoClass) throws IOException + { + super(in, cdoClass); + index = in.readInt(); + newValue = getFeature().getType().readValue(in, cdoClass.getPackageManager().getCDOIDObjectFactory()); + } + + public int getIndex() + { + return index; + } + + public Object getValue() + { + return newValue; + } + + @Override + public void write(ExtendedDataOutput out, CDOClass cdoClass, CDOIDProvider idProvider) throws IOException + { + super.write(out, cdoClass, idProvider); + out.writeInt(index); + if (newValue != null && getFeature().isReference()) + { + newValue = idProvider.provideCDOID(newValue); + } + + getFeature().getType().writeValue(out, newValue); + } + + @Override + public void adjustReferences(Map<CDOIDTemp, CDOID> idMappings) + { + if (newValue instanceof CDOID) + { + newValue = CDORevisionUtil.remapID(newValue, idMappings); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOUnsetFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOUnsetFeatureDeltaImpl.java new file mode 100644 index 0000000000..235c999c96 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOUnsetFeatureDeltaImpl.java @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Simon McDuff - initial API and implementation + * Eike Stepper - maintenance + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDeltaVisitor; +import org.eclipse.emf.cdo.common.revision.delta.CDOUnsetFeatureDelta; +import org.eclipse.emf.cdo.spi.common.InternalCDORevision; + +import org.eclipse.net4j.util.io.ExtendedDataInput; + +import java.io.IOException; +import java.util.Map; + +/** + * @author Simon McDuff + */ +public class CDOUnsetFeatureDeltaImpl extends CDOFeatureDeltaImpl implements CDOUnsetFeatureDelta +{ + public CDOUnsetFeatureDeltaImpl(CDOFeature feature) + { + super(feature); + } + + public CDOUnsetFeatureDeltaImpl(ExtendedDataInput in, CDOClass cdoClass) throws IOException + { + super(in, cdoClass); + } + + public Type getType() + { + return Type.UNSET; + } + + public void apply(CDORevision revision) + { + ((InternalCDORevision)revision).unset(getFeature()); + } + + public void accept(CDOFeatureDeltaVisitor visitor) + { + visitor.visit(this); + } + + @Override + public void adjustReferences(Map<CDOIDTemp, CDOID> idMappings) + { + // Do nothing + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/IListIndexAffecting.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/IListIndexAffecting.java new file mode 100644 index 0000000000..9ccaeeeb41 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/IListIndexAffecting.java @@ -0,0 +1,22 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +/** + * @author Eike Stepper + */ +public interface IListIndexAffecting +{ + /** + * Expects the number of indices in the first element of the indices array. + */ + public void affectIndices(int[] indices); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/IListTargetAdding.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/IListTargetAdding.java new file mode 100644 index 0000000000..7fa52d0cd5 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/IListTargetAdding.java @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.common.revision.delta; + +/** + * @author Eike Stepper + */ +public interface IListTargetAdding +{ + public int getIndex(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/AbstractCDOID.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/AbstractCDOID.java new file mode 100644 index 0000000000..b4d9a5594e --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/AbstractCDOID.java @@ -0,0 +1,94 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.spi.common; + +import org.eclipse.emf.cdo.common.id.CDOID; + +/** + * @author Eike Stepper + */ +public abstract class AbstractCDOID implements CDOID +{ + private static final long serialVersionUID = 1L; + + public AbstractCDOID() + { + } + + public boolean isNull() + { + switch (getType()) + { + case NULL: + return true; + default: + return false; + } + } + + public boolean isObject() + { + switch (getType()) + { + case OBJECT: + case LEGACY_OBJECT: + case TEMP_OBJECT: + return true; + default: + return false; + } + } + + public boolean isLegacy() + { + switch (getType()) + { + case LEGACY_OBJECT: + return true; + default: + return false; + } + } + + public boolean isMeta() + { + switch (getType()) + { + case META: + case TEMP_META: + return true; + default: + return false; + } + } + + public boolean isTemporary() + { + switch (getType()) + { + case TEMP_OBJECT: + case TEMP_META: + return true; + default: + return false; + } + } + + // public CDOClassRef getClassRef() + // { + // return null; + // } + // + // public CDOID asLegacy(CDOClassRef classRef) + // { + // throw new UnsupportedOperationException(); + // } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/AbstractCDOIDInteger.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/AbstractCDOIDInteger.java new file mode 100644 index 0000000000..e06304e8d2 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/AbstractCDOIDInteger.java @@ -0,0 +1,99 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.spi.common; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public abstract class AbstractCDOIDInteger extends AbstractCDOID implements Comparable<AbstractCDOIDInteger> +{ + private static final long serialVersionUID = 1L; + + private int value; + + public AbstractCDOIDInteger() + { + } + + public AbstractCDOIDInteger(int value) + { + if (value == 0) + { + throw new IllegalArgumentException("value == 0"); + } + + this.value = value; + } + + public int getIntValue() + { + return value; + } + + public void read(ExtendedDataInput in) throws IOException + { + value = in.readInt(); + } + + public void write(ExtendedDataOutput out) throws IOException + { + out.writeInt(value); + } + + public int compareTo(AbstractCDOIDInteger that) + { + if (value < that.value) + { + return -1; + } + + if (value > that.value) + { + return 1; + } + + return 0; + } + + @Override + public boolean equals(Object obj) + { + if (obj == this) + { + return true; + } + + if (obj != null && obj.getClass() == getClass()) + { + AbstractCDOIDInteger that = (AbstractCDOIDInteger)obj; + return value == that.value; + } + + return false; + } + + @Override + public int hashCode() + { + return getClass().hashCode() ^ value; + } + + @Override + public String toString() + { + return String.valueOf(value); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/AbstractCDOIDLong.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/AbstractCDOIDLong.java new file mode 100644 index 0000000000..1b452fbef4 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/AbstractCDOIDLong.java @@ -0,0 +1,100 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.spi.common; + +import org.eclipse.net4j.util.ObjectUtil; +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public abstract class AbstractCDOIDLong extends AbstractCDOID implements Comparable<AbstractCDOIDLong> +{ + private static final long serialVersionUID = 1L; + + private long value; + + public AbstractCDOIDLong() + { + } + + public AbstractCDOIDLong(long value) + { + if (value == 0L) + { + throw new IllegalArgumentException("value == 0L"); + } + + this.value = value; + } + + public long getLongValue() + { + return value; + } + + public void read(ExtendedDataInput in) throws IOException + { + value = in.readLong(); + } + + public void write(ExtendedDataOutput out) throws IOException + { + out.writeLong(value); + } + + public int compareTo(AbstractCDOIDLong that) + { + if (value < that.value) + { + return -1; + } + + if (value > that.value) + { + return 1; + } + + return 0; + } + + @Override + public boolean equals(Object obj) + { + if (obj == this) + { + return true; + } + + if (obj != null && obj.getClass() == getClass()) + { + AbstractCDOIDLong that = (AbstractCDOIDLong)obj; + return value == that.value; + } + + return false; + } + + @Override + public int hashCode() + { + return getClass().hashCode() ^ ObjectUtil.hashCode(value); + } + + @Override + public String toString() + { + return String.valueOf(value); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOIDLibraryDescriptorImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOIDLibraryDescriptorImpl.java new file mode 100644 index 0000000000..7c73f792b9 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOIDLibraryDescriptorImpl.java @@ -0,0 +1,123 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.spi.common; + +import org.eclipse.emf.cdo.common.id.CDOIDLibraryDescriptor; +import org.eclipse.emf.cdo.internal.common.bundle.OM; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; +import org.eclipse.net4j.util.om.trace.ContextTracer; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public class CDOIDLibraryDescriptorImpl implements CDOIDLibraryDescriptor +{ + private static final ContextTracer PROTOCOL = new ContextTracer(OM.DEBUG_PROTOCOL, CDOIDLibraryDescriptorImpl.class); + + private String factoryName; + + private String[] libraryNames; + + public CDOIDLibraryDescriptorImpl(String factoryName, String[] libraryNames) + { + this.factoryName = factoryName; + this.libraryNames = libraryNames == null ? new String[0] : libraryNames; + } + + public CDOIDLibraryDescriptorImpl(ExtendedDataInput in) throws IOException + { + factoryName = in.readString(); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Read factory name: {0}", factoryName); + } + + int size = in.readInt(); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Reading {0} library names", size); + } + + libraryNames = new String[size]; + for (int i = 0; i < size; i++) + { + libraryNames[i] = in.readString(); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Read library name: {0}", libraryNames[i]); + } + } + } + + public String getFactoryName() + { + return factoryName; + } + + public String[] getLibraryNames() + { + return libraryNames; + } + + public void write(ExtendedDataOutput out) throws IOException + { + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Writing factory name: {0}", factoryName); + } + + out.writeString(factoryName); + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Writing {0} library names", libraryNames.length); + } + + out.writeInt(libraryNames.length); + for (String libraryName : libraryNames) + { + if (PROTOCOL.isEnabled()) + { + PROTOCOL.format("Writing library name: {0}", libraryName); + } + + out.writeString(libraryName); + } + } + + @Override + public String toString() + { + StringBuilder builder = new StringBuilder(); + builder.append(getClass().getSimpleName()); + builder.append("["); + builder.append(factoryName); + if (libraryNames.length != 0) + { + builder.append(" -> "); + for (int i = 0; i < libraryNames.length; i++) + { + if (i != 0) + { + builder.append(", "); + } + + builder.append(libraryNames[i]); + } + } + + builder.append("]"); + return builder.toString(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOIDLibraryProviderImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOIDLibraryProviderImpl.java new file mode 100644 index 0000000000..1e5ac72318 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOIDLibraryProviderImpl.java @@ -0,0 +1,95 @@ +package org.eclipse.emf.cdo.spi.common; + +import org.eclipse.emf.cdo.common.id.CDOIDLibraryDescriptor; +import org.eclipse.emf.cdo.common.id.CDOIDLibraryProvider; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.IOUtil; +import org.eclipse.net4j.util.om.OMBundle; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +/** + * @author Eike Stepper + */ +public class CDOIDLibraryProviderImpl implements CDOIDLibraryProvider +{ + private Map<String, OMBundle> bundles = new HashMap<String, OMBundle>(); + + public CDOIDLibraryProviderImpl() + { + } + + public void addLibrary(String libraryName, OMBundle bundle) + { + bundles.put(libraryName, bundle); + } + + public String[] getLibraryNames() + { + Set<String> libraryNames = bundles.keySet(); + return libraryNames.toArray(new String[libraryNames.size()]); + } + + public CDOIDLibraryDescriptor createDescriptor(String factoryName) + { + return new Descriptor(factoryName); + } + + public InputStream getContents(String libraryName) throws IOException + { + File library = getLibrary(libraryName); + return IOUtil.openInputStream(library); + } + + public int getSize(String libraryName) + { + File library = getLibrary(libraryName); + return (int)library.length(); + } + + private File getLibrary(String libraryName) + { + OMBundle bundle = bundles.get(libraryName); + if (bundle == null) + { + throw new IllegalStateException("Unknown library: " + libraryName); + } + + URL url = bundle.getBaseURL(); + File file = new File(url.getFile()); + if (file.exists() && file.isDirectory()) + { + file = new File(file, libraryName); + } + + if (file.exists() && file.isFile() && file.getName().endsWith(".jar")) + { + return file; + } + + throw new IllegalStateException("Not a JAR: " + file.getAbsolutePath()); + } + + /** + * @author Eike Stepper + */ + private final class Descriptor extends CDOIDLibraryDescriptorImpl + { + public Descriptor(String factoryName) + { + super(factoryName, CDOIDLibraryProviderImpl.this.getLibraryNames()); + } + + public Descriptor(ExtendedDataInput in) throws IOException + { + super(in); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOIDLongFactoryImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOIDLongFactoryImpl.java new file mode 100644 index 0000000000..216bba9c59 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOIDLongFactoryImpl.java @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.spi.common; + +import org.eclipse.emf.cdo.common.id.CDOIDLibraryProvider; +import org.eclipse.emf.cdo.common.id.CDOIDObject; +import org.eclipse.emf.cdo.common.id.CDOIDObjectFactory; + +import org.eclipse.net4j.util.io.ExtendedDataInput; + +import java.io.IOException; +import java.io.InputStream; + +/** + * @author Eike Stepper + */ +public class CDOIDLongFactoryImpl implements CDOIDObjectFactory +{ + private LibraryHandler LIBRARY_HANDLER = new LibraryHandler(); + + public CDOIDLongFactoryImpl() + { + } + + public CDOIDObject createCDOIDObject(ExtendedDataInput in) + { + return new CDOIDLongImpl(); + } + + public LibraryHandler getLibraryHandler() + { + return LIBRARY_HANDLER; + } + + /** + * @author Eike Stepper + */ + public static final class LibraryHandler extends CDOIDLibraryDescriptorImpl implements CDOIDLibraryProvider + { + private LibraryHandler() + { + super(CDOIDLongFactoryImpl.class.getName(), null); + } + + public int getSize(String libraryName) + { + throw new UnsupportedOperationException(); + } + + public InputStream getContents(String libraryName) throws IOException + { + throw new UnsupportedOperationException(); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOIDLongImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOIDLongImpl.java new file mode 100644 index 0000000000..f8bd460685 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOIDLongImpl.java @@ -0,0 +1,106 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.spi.common; + +import org.eclipse.emf.cdo.common.id.CDOIDObject; +import org.eclipse.emf.cdo.common.model.CDOClassRef; + +/** + * @author Eike Stepper + */ +public class CDOIDLongImpl extends AbstractCDOIDLong implements CDOIDObject +{ + private static final long serialVersionUID = 1L; + + public CDOIDLongImpl() + { + } + + public CDOIDLongImpl(long value) + { + super(value); + } + + public Type getType() + { + return Type.OBJECT; + } + + public CDOClassRef getClassRef() + { + return null; + } + + public Legacy asLegacy(CDOClassRef classRef) + { + return new Legacy(getLongValue(), classRef); + } + + @Override + public String toString() + { + return "OID" + getLongValue(); + } + + /** + * @author Eike Stepper + */ + public static final class Legacy extends CDOIDLongImpl + { + private static final long serialVersionUID = 1L; + + private CDOClassRef classRef; + + public Legacy() + { + } + + public Legacy(long value, CDOClassRef classRef) + { + super(value); + if (classRef == null) + { + throw new IllegalArgumentException("classRef == null"); + } + + this.classRef = classRef; + } + + @Override + public Type getType() + { + return Type.LEGACY_OBJECT; + } + + @Override + public CDOClassRef getClassRef() + { + return classRef; + } + + public void setClassRef(CDOClassRef classRef) + { + this.classRef = classRef; + } + + @Override + public Legacy asLegacy(CDOClassRef classRef) + { + return this; + } + + @Override + public String toString() + { + return super.toString() + "(" + classRef + ")"; + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOClass.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOClass.java new file mode 100644 index 0000000000..b564a5262d --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOClass.java @@ -0,0 +1,35 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.spi.common; + +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOClassProxy; +import org.eclipse.emf.cdo.common.model.CDOClassRef; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.model.CDOPackage; + +import java.util.List; + +/** + * @author Eike Stepper + */ +public interface InternalCDOClass extends CDOClass, InternalCDOModelElement +{ + public void setContainingPackage(CDOPackage containingPackage); + + public void addSuperType(CDOClassRef classRef); + + public void addFeature(CDOFeature cdoFeature); + + public int getFeatureIndex(int featureID); + + public List<CDOClassProxy> getSuperTypeProxies(); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOFeature.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOFeature.java new file mode 100644 index 0000000000..d37bdfad9c --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOFeature.java @@ -0,0 +1,26 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.spi.common; + +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOFeature; + +/** + * @author Eike Stepper + */ +public interface InternalCDOFeature extends CDOFeature, InternalCDOModelElement +{ + public void setContainingClass(CDOClass containingClass); + + public void setFeatureIndex(int featureIndex); + + public void setReferenceType(CDOClass cdoClass); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOModelElement.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOModelElement.java new file mode 100644 index 0000000000..3e2ddced61 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOModelElement.java @@ -0,0 +1,36 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.spi.common; + +import org.eclipse.emf.cdo.common.model.CDOModelElement; + +import org.eclipse.net4j.util.io.ExtendedDataInput; +import org.eclipse.net4j.util.io.ExtendedDataOutput; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public interface InternalCDOModelElement extends CDOModelElement +{ + public void setName(String name); + + public void setClientInfo(Object clientInfo); + + public void setServerInfo(Object serverInfo); + + public void initialize(); + + public void read(ExtendedDataInput in) throws IOException; + + public void write(ExtendedDataOutput out) throws IOException; +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOPackage.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOPackage.java new file mode 100644 index 0000000000..d7b8402f67 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOPackage.java @@ -0,0 +1,36 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.spi.common; + +import org.eclipse.emf.cdo.common.id.CDOIDMetaRange; +import org.eclipse.emf.cdo.common.model.CDOClass; +import org.eclipse.emf.cdo.common.model.CDOPackage; +import org.eclipse.emf.cdo.common.model.CDOPackageManager; + +import java.util.List; + +/** + * @author Eike Stepper + */ +public interface InternalCDOPackage extends CDOPackage, InternalCDOModelElement +{ + public void setPackageManager(CDOPackageManager packageManager); + + public void setPersistent(boolean persistent); + + public void setMetaIDRange(CDOIDMetaRange metaIDRange); + + public void setEcore(String ecore); + + public void addClass(CDOClass cdoClass); + + public void setClasses(List<CDOClass> classes); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDORevision.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDORevision.java new file mode 100644 index 0000000000..0c128acee1 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDORevision.java @@ -0,0 +1,72 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.spi.common; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.common.model.CDOFeature; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.common.revision.CDORevisionData; +import org.eclipse.emf.cdo.common.revision.CDORevisionUtil; + +import org.eclipse.net4j.util.collection.MoveableList; + +import java.util.Map; + +/** + * @author Eike Stepper + */ +public interface InternalCDORevision extends CDORevision, CDORevisionData +{ + public static final Object UNINITIALIZED = CDORevisionUtil.UNINITIALIZED; + + public void setID(CDOID id); + + public void setVersion(int version); + + public int setTransactional(); + + public void setUntransactional(); + + public void setCreated(long created); + + public void setRevised(long revised); + + public void setResourceID(CDOID resourceID); + + public void setContainerID(CDOID containerID); + + public void setContainingFeatureID(int containingFeatureID); + + public void add(CDOFeature feature, int index, Object value); + + public void clear(CDOFeature feature); + + public Object move(CDOFeature feature, int targetIndex, int sourceIndex); + + public Object remove(CDOFeature feature, int index); + + public Object set(CDOFeature feature, int index, Object value); + + public void unset(CDOFeature feature); + + public void adjustReferences(Map<CDOIDTemp, CDOID> idMappings); + + public Object getValue(CDOFeature feature); + + public Object setValue(CDOFeature feature, Object value); + + public MoveableList<Object> getList(CDOFeature feature); + + public MoveableList<Object> getList(CDOFeature feature, int size); + + public void setListSize(CDOFeature feature, int size); +} diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDORevisionDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDORevisionDelta.java new file mode 100644 index 0000000000..85081674a1 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDORevisionDelta.java @@ -0,0 +1,28 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.spi.common; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.id.CDOIDTemp; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta; +import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta; + +import java.util.Map; + +/** + * @author Eike Stepper + */ +public interface InternalCDORevisionDelta extends CDORevisionDelta +{ + public void addFeatureDelta(CDOFeatureDelta delta); + + public void adjustReferences(Map<CDOIDTemp, CDOID> idMappings); +} diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/.classpath b/plugins/org.eclipse.net4j.buddies.chat.ui/.classpath new file mode 100644 index 0000000000..64c5e31b7a --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/.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/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/.cvsignore b/plugins/org.eclipse.net4j.buddies.chat.ui/.cvsignore new file mode 100644 index 0000000000..693869726d --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/.cvsignore @@ -0,0 +1,2 @@ +bin +doc diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/.options b/plugins/org.eclipse.net4j.buddies.chat.ui/.options new file mode 100644 index 0000000000..497a5c463f --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/.options @@ -0,0 +1,3 @@ +# Debugging and tracing options + +org.eclipse.net4j.buddies.chat.ui/debug = true diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/.project b/plugins/org.eclipse.net4j.buddies.chat.ui/.project new file mode 100644 index 0000000000..6ce07fc42e --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.net4j.buddies.chat.ui</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/org.eclipse.net4j.buddies.chat.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.net4j.buddies.chat.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..7d705df472 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,271 @@ +#Sat Feb 23 10:51:56 CET 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 +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_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_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_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.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +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=next_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true +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=120 +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.format_guardian_clause_on_one_line=false +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=2 +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_member=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_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=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=do not 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_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_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_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_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_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_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_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.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=true +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +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=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=2 +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.net4j.buddies.chat.ui/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..b25700f665 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,65 @@ +#Sat Feb 23 10:51:56 CET 2008 +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_serial_version_id=true +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_to_enhanced_for_loop=false +cleanup.correct_indentation=true +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +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=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=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_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=true +cleanup.use_this_for_non_static_field_access=true +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=true +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_EMFT +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_EMFT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=ex +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +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\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment"/><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"/><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">/***************************************************************************\r\n * Copyright (c) 2004 - 2008 Eike Stepper, Germany.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * Eike Stepper - initial API and implementation\r\n **************************************************************************/</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author Eike Stepper\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><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"/><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"/><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}\r\n${package_declaration}\r\n\r\n${typecomment}\r\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">\r\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">\r\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">\r\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">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" 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}</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/org.eclipse.net4j.buddies.chat.ui/.settings/org.eclipse.mylyn.tasks.ui.prefs b/plugins/org.eclipse.net4j.buddies.chat.ui/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 0000000000..7f1832044c --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +#Sun Mar 09 19:15:26 CET 2008 +eclipse.preferences.version=1 +project.repository.kind=bugzilla +project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/.settings/org.eclipse.mylyn.team.ui.prefs b/plugins/org.eclipse.net4j.buddies.chat.ui/.settings/org.eclipse.mylyn.team.ui.prefs new file mode 100644 index 0000000000..e72b02b02f --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/.settings/org.eclipse.mylyn.team.ui.prefs @@ -0,0 +1,3 @@ +#Sun Mar 09 19:15:26 CET 2008 +commit.comment.template=[${task.id}] ${task.description} \r\n${task.url} +eclipse.preferences.version=1 diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.buddies.chat.ui/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..debe89fb21 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.net4j.buddies.chat.ui;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.eclipse.net4j.buddies.chat.internal.ui.bundle.OM$Activator +Bundle-Vendor: %providerName +Bundle-ClassPath: . +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)", + org.eclipse.net4j.buddies.ui;bundle-version="[1.0.0,2.0.0)";visibility:=reexport, + org.eclipse.net4j.buddies.chat;bundle-version="[1.0.0,2.0.0)";visibility:=reexport +Export-Package: org.eclipse.net4j.buddies.chat.internal.ui;version="1.0.0" +Bundle-ActivationPolicy: lazy diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/about.html b/plugins/org.eclipse.net4j.buddies.chat.ui/about.html new file mode 100644 index 0000000000..d35d5aed64 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/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>June 5, 2007</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> diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/build.properties b/plugins/org.eclipse.net4j.buddies.chat.ui/build.properties new file mode 100644 index 0000000000..8cd171e60e --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/build.properties @@ -0,0 +1,22 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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: +# Eike Stepper - initial API and implementation + +# NLS_MESSAGEFORMAT_VAR + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + plugin.properties,\ + icons/,\ + .options,\ + about.html,\ + copyright.txt,\ + license.html diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/copyright.txt b/plugins/org.eclipse.net4j.buddies.chat.ui/copyright.txt new file mode 100644 index 0000000000..529118d99e --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/copyright.txt @@ -0,0 +1,8 @@ +Copyright (c) 2004 - 2008 Eike Stepper, Germany. +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: + Eike Stepper - initial API and implementation
\ No newline at end of file diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/epl-v10.html b/plugins/org.eclipse.net4j.buddies.chat.ui/epl-v10.html new file mode 100644 index 0000000000..d7b88e9416 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/epl-v10.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/.cvsignore b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/.cvsignore new file mode 100644 index 0000000000..085e8baf0c --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/.cvsignore @@ -0,0 +1 @@ +Thumbs.db diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/.cvsignore b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/.cvsignore new file mode 100644 index 0000000000..085e8baf0c --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/.cvsignore @@ -0,0 +1 @@ +Thumbs.db diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/dtool16/.cvsignore b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/dtool16/.cvsignore new file mode 100644 index 0000000000..085e8baf0c --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/dtool16/.cvsignore @@ -0,0 +1 @@ +Thumbs.db diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/.cvsignore b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/.cvsignore new file mode 100644 index 0000000000..085e8baf0c --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/.cvsignore @@ -0,0 +1 @@ +Thumbs.db diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/add.gif b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/add.gif Binary files differnew file mode 100644 index 0000000000..252d7ebcb8 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/add.gif diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/add_chat.gif b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/add_chat.gif Binary files differnew file mode 100644 index 0000000000..0840bc6094 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/add_chat.gif diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/add_contact.gif b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/add_contact.gif Binary files differnew file mode 100644 index 0000000000..d3323e64fc --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/add_contact.gif diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/add_group.gif b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/add_group.gif Binary files differnew file mode 100644 index 0000000000..7492f8ac10 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/add_group.gif diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/communications.gif b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/communications.gif Binary files differnew file mode 100644 index 0000000000..21a902fd1a --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/communications.gif diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/delete.gif b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/delete.gif Binary files differnew file mode 100644 index 0000000000..b6922ac11c --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/delete.gif diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/horizontal_layout.gif b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/horizontal_layout.gif Binary files differnew file mode 100644 index 0000000000..86bfc482dd --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/horizontal_layout.gif diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/identity.gif b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/identity.gif Binary files differnew file mode 100644 index 0000000000..cf78a9d75b --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/identity.gif diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/messages.gif b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/messages.gif Binary files differnew file mode 100644 index 0000000000..27d15cc3cc --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/messages.gif diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/terminate_co.gif b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/terminate_co.gif Binary files differnew file mode 100644 index 0000000000..dc47edf069 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/terminate_co.gif diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/vertical_layout.gif b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/vertical_layout.gif Binary files differnew file mode 100644 index 0000000000..493c2fbd5f --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/etool16/vertical_layout.gif diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/obj16/.cvsignore b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/obj16/.cvsignore new file mode 100644 index 0000000000..085e8baf0c --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/obj16/.cvsignore @@ -0,0 +1 @@ +Thumbs.db diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/obj16/chat.gif b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/obj16/chat.gif Binary files differnew file mode 100644 index 0000000000..62c9921751 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/obj16/chat.gif diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/obj16/message.gif b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/obj16/message.gif Binary files differnew file mode 100644 index 0000000000..b949ac948a --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/obj16/message.gif diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/obj16/messages.gif b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/obj16/messages.gif Binary files differnew file mode 100644 index 0000000000..27d15cc3cc --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/icons/full/obj16/messages.gif diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/license.html b/plugins/org.eclipse.net4j.buddies.chat.ui/license.html new file mode 100644 index 0000000000..d7b88e9416 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/license.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/plugin.properties b/plugins/org.eclipse.net4j.buddies.chat.ui/plugin.properties new file mode 100644 index 0000000000..f7cb72ef9b --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/plugin.properties @@ -0,0 +1,25 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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: +# Eike Stepper - initial API and implementation + +# NLS_MESSAGEFORMAT_VAR + +# ============================================================================== +# Do not change the properties between this line and the last line containing: +# %%% END OF TRANSLATED PROPERTIES %%% +# Instead, either redefine an existing property, or create a new property, +# append it to the end of the file, and change the code to use the new name. +# ============================================================================== + +pluginName = Net4j Chat UI +providerName = Eclipse.org + +# ============================================================================== +# %%% END OF TRANSLATED PROPERTIES %%% +# The above properties have been shipped for translation. +# ============================================================================== diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/plugin.xml b/plugins/org.eclipse.net4j.buddies.chat.ui/plugin.xml new file mode 100644 index 0000000000..87215e2c71 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/plugin.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.3"?> +<!-- + <copyright> + + Copyright (c) 2004 - 2008 Eike Stepper, Germany. + 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: + Eike Stepper - Initial API and implementation + + </copyright> +--> + +<plugin> + + <extension + point="org.eclipse.net4j.buddies.ui.facilityPaneCreators"> + <facilityPaneCreator + class="org.eclipse.net4j.buddies.chat.internal.ui.ChatPaneCreator" + icon="icons/full/obj16/chat.gif" + type="chat"/> + </extension> + +</plugin> diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/ChatPane.java b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/ChatPane.java new file mode 100644 index 0000000000..d2d4b6d237 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/ChatPane.java @@ -0,0 +1,119 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.chat.internal.ui; + +import org.eclipse.net4j.buddies.chat.IChat; +import org.eclipse.net4j.buddies.chat.IComment; +import org.eclipse.net4j.buddies.internal.chat.CommentEvent; +import org.eclipse.net4j.buddies.internal.ui.views.CollaborationsPane; +import org.eclipse.net4j.buddies.internal.ui.views.FacilityPane; +import org.eclipse.net4j.util.StringUtil; +import org.eclipse.net4j.util.event.IEvent; +import org.eclipse.net4j.util.ui.actions.SafeAction; +import org.eclipse.net4j.util.ui.widgets.SashComposite; + +import org.eclipse.jface.action.IContributionManager; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.KeyAdapter; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Text; + +/** + * @author Eike Stepper + */ +public class ChatPane extends FacilityPane +{ + private SashComposite sashComposite; + + private Text input; + + private Text output; + + public ChatPane(CollaborationsPane collaborationsPane, int style) + { + super(collaborationsPane, style); + } + + @Override + protected void handleEvent(IEvent event) throws Exception + { + if (event instanceof CommentEvent) + { + CommentEvent e = (CommentEvent)event; + IComment comment = e.getComment(); + String text = comment.getText(); + output.append(comment.getSenderID() + ": " + text + StringUtil.NL); + } + } + + @Override + protected Control createUI(Composite parent) + { + sashComposite = new SashComposite(parent, SWT.NONE, 16, 80, false) + { + @Override + protected Control createControl1(Composite parent) + { + output = new Text(parent, SWT.MULTI); + return output; + } + + @Override + protected Control createControl2(Composite parent) + { + input = new Text(parent, SWT.MULTI); + input.addKeyListener(new KeyAdapter() + { + @Override + public void keyPressed(KeyEvent e) + { + if ((e.character == SWT.CR || e.character == SWT.LF) && e.stateMask == 0) + { + ((IChat)getFacility()).sendComment(input.getText()); + input.setText(""); + e.doit = false; + } + } + }); + + return input; + } + }; + + return sashComposite; + } + + @Override + protected void fillCoolBar(IContributionManager manager) + { + manager.add(new SafeAction("Vertical Layout", "Vertical Layout", SharedIcons + .getDescriptor(SharedIcons.ETOOL_VERTICAL)) + { + @Override + protected void safeRun() throws Exception + { + sashComposite.setVertical(false); + } + }); + + manager.add(new SafeAction("Horizontal Layout", "Horizontal Layout", SharedIcons + .getDescriptor(SharedIcons.ETOOL_HORIZONTAL)) + { + @Override + protected void safeRun() throws Exception + { + sashComposite.setVertical(true); + } + }); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/ChatPaneCreator.java b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/ChatPaneCreator.java new file mode 100644 index 0000000000..e8750be910 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/ChatPaneCreator.java @@ -0,0 +1,43 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.chat.internal.ui; + +import org.eclipse.net4j.buddies.chat.IChat; +import org.eclipse.net4j.buddies.internal.ui.views.CollaborationsPane; +import org.eclipse.net4j.buddies.internal.ui.views.FacilityPane; +import org.eclipse.net4j.buddies.ui.IFacilityPaneCreator; + +import org.eclipse.jface.resource.ImageDescriptor; + +/** + * @author Eike Stepper + */ +public class ChatPaneCreator implements IFacilityPaneCreator +{ + public ChatPaneCreator() + { + } + + public String getType() + { + return IChat.TYPE; + } + + public ImageDescriptor getImageDescriptor() + { + return SharedIcons.getDescriptor(SharedIcons.OBJ_CHAT); + } + + public FacilityPane createPane(CollaborationsPane collaborationsPane, int style) + { + return new ChatPane(collaborationsPane, style); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/SharedIcons.java b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/SharedIcons.java new file mode 100644 index 0000000000..38e288aa4c --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/SharedIcons.java @@ -0,0 +1,100 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.chat.internal.ui; + +import org.eclipse.net4j.buddies.chat.internal.ui.bundle.OM; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +/** + * @author Eike Stepper + */ +public class SharedIcons +{ + private static final ImageRegistry REGISTRY = new ImageRegistry(getDisplay()); + + private static final String ETOOL = "etool16/"; + + private static final String OBJ = "obj16/"; + + @SuppressWarnings("unused") + private static final String VIEW = "view16/"; + + @SuppressWarnings("unused") + private static final String WIZBAN = "wizban/"; + + public static final String OBJ_CHAT = OBJ + "chat"; + + public static final String ETOOL_HORIZONTAL = ETOOL + "horizontal_layout"; + + public static final String ETOOL_VERTICAL = ETOOL + "vertical_layout"; + + public static Image getImage(String key) + { + key = mangleKey(key); + Image image = REGISTRY.get(key); + if (image == null) + { + createDescriptor(key); + image = REGISTRY.get(key); + } + + return image; + } + + public static ImageDescriptor getDescriptor(String key) + { + key = mangleKey(key); + ImageDescriptor descriptor = REGISTRY.getDescriptor(key); + if (descriptor == null) + { + descriptor = createDescriptor(key); + } + + return descriptor; + } + + private static ImageDescriptor createDescriptor(String key) + { + ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(OM.BUNDLE_ID, key); + if (descriptor != null) + { + REGISTRY.put(key, descriptor); + } + + return descriptor; + } + + private static Display getDisplay() + { + Display display = Display.getCurrent(); + if (display == null) + { + display = Display.getDefault(); + } + + if (display == null) + { + throw new IllegalStateException("display == null"); + } + + return display; + } + + private static String mangleKey(String key) + { + return "icons/full/" + key + ".gif"; + } +} diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/bundle/OM.java b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/bundle/OM.java new file mode 100644 index 0000000000..973c24f9e6 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/bundle/OM.java @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.chat.internal.ui.bundle; + +import org.eclipse.net4j.util.om.OMBundle; +import org.eclipse.net4j.util.om.OMPlatform; +import org.eclipse.net4j.util.om.log.OMLogger; +import org.eclipse.net4j.util.om.trace.OMTracer; +import org.eclipse.net4j.util.ui.UIActivator; + +/** + * The <em>Operations & Maintenance</em> class of this bundle. + * + * @author Eike Stepper + */ +public abstract class OM +{ + public static final String BUNDLE_ID = "org.eclipse.net4j.buddies.chat.ui"; //$NON-NLS-1$ + + public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class); + + public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$ + + public static final OMLogger LOG = BUNDLE.logger(); + + /** + * @author Eike Stepper + */ + public static final class Activator extends UIActivator + { + public static Activator INSTANCE; + + public Activator() + { + super(BUNDLE); + INSTANCE = this; + } + } +} diff --git a/plugins/org.eclipse.net4j.buddies.chat/.classpath b/plugins/org.eclipse.net4j.buddies.chat/.classpath new file mode 100644 index 0000000000..64c5e31b7a --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/.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/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/org.eclipse.net4j.buddies.chat/.cvsignore b/plugins/org.eclipse.net4j.buddies.chat/.cvsignore new file mode 100644 index 0000000000..5298e8d079 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/.cvsignore @@ -0,0 +1,4 @@ +bin +mixin-bin +doc +text diff --git a/plugins/org.eclipse.net4j.buddies.chat/.options b/plugins/org.eclipse.net4j.buddies.chat/.options new file mode 100644 index 0000000000..1b6c9cb649 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/.options @@ -0,0 +1,3 @@ +# Debugging and tracing options + +org.eclipse.net4j.buddies.chat/debug = true diff --git a/plugins/org.eclipse.net4j.buddies.chat/.project b/plugins/org.eclipse.net4j.buddies.chat/.project new file mode 100644 index 0000000000..5fbaef36b3 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.net4j.buddies.chat</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/org.eclipse.net4j.buddies.chat/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.net4j.buddies.chat/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..bfb58bc3dd --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,272 @@ +#Sat Feb 23 10:52:07 CET 2008 +eclipse.preferences.version=1 +instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 +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_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_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_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.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +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=next_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true +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=120 +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.format_guardian_clause_on_one_line=false +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=2 +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_member=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_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=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=do not 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_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_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_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_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_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_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_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.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=true +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +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=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=2 +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true diff --git a/plugins/org.eclipse.net4j.buddies.chat/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.net4j.buddies.chat/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..ed6e42b381 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,65 @@ +#Sat Feb 23 10:52:07 CET 2008 +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_serial_version_id=true +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_to_enhanced_for_loop=false +cleanup.correct_indentation=true +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +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=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=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_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=true +cleanup.use_this_for_non_static_field_access=true +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=true +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_EMFT +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_EMFT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=ex +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +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\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment"/><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"/><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">/***************************************************************************\r\n * Copyright (c) 2004 - 2008 Eike Stepper, Germany.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * Eike Stepper - initial API and implementation\r\n **************************************************************************/</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author Eike Stepper\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><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"/><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"/><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}\r\n${package_declaration}\r\n\r\n${typecomment}\r\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">\r\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">\r\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">\r\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">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" 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}</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/org.eclipse.net4j.buddies.chat/.settings/org.eclipse.mylyn.tasks.ui.prefs b/plugins/org.eclipse.net4j.buddies.chat/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 0000000000..7f1832044c --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +#Sun Mar 09 19:15:26 CET 2008 +eclipse.preferences.version=1 +project.repository.kind=bugzilla +project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/plugins/org.eclipse.net4j.buddies.chat/.settings/org.eclipse.mylyn.team.ui.prefs b/plugins/org.eclipse.net4j.buddies.chat/.settings/org.eclipse.mylyn.team.ui.prefs new file mode 100644 index 0000000000..e72b02b02f --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/.settings/org.eclipse.mylyn.team.ui.prefs @@ -0,0 +1,3 @@ +#Sun Mar 09 19:15:26 CET 2008 +commit.comment.template=[${task.id}] ${task.description} \r\n${task.url} +eclipse.preferences.version=1 diff --git a/plugins/org.eclipse.net4j.buddies.chat/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.buddies.chat/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..bef732ebde --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.net4j.buddies.chat;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-Activator: org.eclipse.net4j.buddies.internal.chat.bundle.OM$Activator +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)", + org.eclipse.net4j.buddies.common;bundle-version="[1.0.0,2.0.0)";visibility:=reexport +Export-Package: org.eclipse.net4j.buddies.chat;version="1.0.0", + org.eclipse.net4j.buddies.internal.chat;version="1.0.0" +Bundle-ActivationPolicy: lazy diff --git a/plugins/org.eclipse.net4j.buddies.chat/about.html b/plugins/org.eclipse.net4j.buddies.chat/about.html new file mode 100644 index 0000000000..d35d5aed64 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/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>June 5, 2007</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> diff --git a/plugins/org.eclipse.net4j.buddies.chat/about.ini b/plugins/org.eclipse.net4j.buddies.chat/about.ini new file mode 100644 index 0000000000..b7e87ca285 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/about.ini @@ -0,0 +1,15 @@ +# about.ini +# contains information about a feature +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# "%key" are externalized strings defined in about.properties +# This file does not need to be translated. + +# Property "aboutText" contains blurb for "About" dialog (translated) +aboutText=%featureText + +# Property "featureImage" contains path to feature image (32x32) +featureImage=modeling32.png + +# Property "appName" contains name of the application (translated) +appName=%featureName + diff --git a/plugins/org.eclipse.net4j.buddies.chat/about.mappings b/plugins/org.eclipse.net4j.buddies.chat/about.mappings new file mode 100644 index 0000000000..720ca870fa --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/about.mappings @@ -0,0 +1,6 @@ +# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
+0=@build@
\ No newline at end of file diff --git a/plugins/org.eclipse.net4j.buddies.chat/about.properties b/plugins/org.eclipse.net4j.buddies.chat/about.properties new file mode 100644 index 0000000000..97c97a9dc9 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/about.properties @@ -0,0 +1,31 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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: +# Eike Stepper - initial API and implementation + +# NLS_MESSAGEFORMAT_VAR + +# ============================================================================== +# Do not change the properties between this line and the last line containing: +# %%% END OF TRANSLATED PROPERTIES %%% +# Instead, either redefine an existing property, or create a new property, +# append it to the end of the file, and change the code to use the new name. +# ============================================================================== + +featureName = Net4j Chat +featureText = Net4j Chat \n\ +Version: {featureVersion}\n\ +Build id: {0}\n\ +\n\ +Copyright (c) 2004 - 2008 Eike Stepper, Germany. All rights reserved.\n\ +\n\ +Visit http://wiki.eclipse.org/Net4j + +# ============================================================================== +# %%% END OF TRANSLATED PROPERTIES %%% +# The above properties have been shipped for translation. +# ============================================================================== diff --git a/plugins/org.eclipse.net4j.buddies.chat/build.properties b/plugins/org.eclipse.net4j.buddies.chat/build.properties new file mode 100644 index 0000000000..9309926198 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/build.properties @@ -0,0 +1,27 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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: +# Eike Stepper - initial API and implementation + +# NLS_MESSAGEFORMAT_VAR + +bin.includes = .,\ + META-INF/,\ + plugin.properties,\ + .options,\ + about.html,\ + copyright.txt,\ + epl-v10.html,\ + license.html,\ + plugin.xml,\ + about.ini,\ + about.mappings,\ + about.properties,\ + modeling32.png +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/plugins/org.eclipse.net4j.buddies.chat/copyright.txt b/plugins/org.eclipse.net4j.buddies.chat/copyright.txt new file mode 100644 index 0000000000..529118d99e --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/copyright.txt @@ -0,0 +1,8 @@ +Copyright (c) 2004 - 2008 Eike Stepper, Germany. +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: + Eike Stepper - initial API and implementation
\ No newline at end of file diff --git a/plugins/org.eclipse.net4j.buddies.chat/epl-v10.html b/plugins/org.eclipse.net4j.buddies.chat/epl-v10.html new file mode 100644 index 0000000000..d7b88e9416 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/epl-v10.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.net4j.buddies.chat/license.html b/plugins/org.eclipse.net4j.buddies.chat/license.html new file mode 100644 index 0000000000..d7b88e9416 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/license.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.net4j.buddies.chat/modeling32.png b/plugins/org.eclipse.net4j.buddies.chat/modeling32.png Binary files differnew file mode 100644 index 0000000000..6b08de2ada --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/modeling32.png diff --git a/plugins/org.eclipse.net4j.buddies.chat/plugin.properties b/plugins/org.eclipse.net4j.buddies.chat/plugin.properties new file mode 100644 index 0000000000..7e8c12c9ce --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/plugin.properties @@ -0,0 +1,25 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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: +# Eike Stepper - initial API and implementation + +# NLS_MESSAGEFORMAT_VAR + +# ============================================================================== +# Do not change the properties between this line and the last line containing: +# %%% END OF TRANSLATED PROPERTIES %%% +# Instead, either redefine an existing property, or create a new property, +# append it to the end of the file, and change the code to use the new name. +# ============================================================================== + +pluginName = Net4j Chat +providerName = Eclipse.org + +# ============================================================================== +# %%% END OF TRANSLATED PROPERTIES %%% +# The above properties have been shipped for translation. +# ============================================================================== diff --git a/plugins/org.eclipse.net4j.buddies.chat/plugin.xml b/plugins/org.eclipse.net4j.buddies.chat/plugin.xml new file mode 100644 index 0000000000..4953c4a81f --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/plugin.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.3"?> +<!-- + <copyright> + + Copyright (c) 2004 - 2008 Eike Stepper, Germany. + 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: + Eike Stepper - Initial API and implementation + + </copyright> +--> + +<plugin> + + <extension + point="org.eclipse.net4j.util.factories"> + <factory + class="org.eclipse.net4j.buddies.internal.chat.ChatFactory" + productGroup="org.eclipse.net4j.buddies.clientFacilities" + type="chat"/> + <factory + class="org.eclipse.net4j.buddies.internal.chat.ChatRoomFactory" + productGroup="org.eclipse.net4j.buddies.serverFacilities" + type="chat"/> + </extension> + +</plugin> diff --git a/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/chat/IChat.java b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/chat/IChat.java new file mode 100644 index 0000000000..6bb24bbd28 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/chat/IChat.java @@ -0,0 +1,25 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.chat; + +import org.eclipse.net4j.buddies.common.IFacility; + +/** + * @author Eike Stepper + */ +public interface IChat extends IFacility +{ + public static final String TYPE = "chat"; + + public IComment[] getComments(); + + public void sendComment(String text); +} diff --git a/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/chat/IChatRoom.java b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/chat/IChatRoom.java new file mode 100644 index 0000000000..eba71f0975 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/chat/IChatRoom.java @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.chat; + +/** + * @author Eike Stepper + */ +public interface IChatRoom extends IChat +{ + +} diff --git a/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/chat/IComment.java b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/chat/IComment.java new file mode 100644 index 0000000000..4f97b2c5d7 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/chat/IComment.java @@ -0,0 +1,23 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.chat; + +/** + * @author Eike Stepper + */ +public interface IComment +{ + public long getReceiveTime(); + + public String getSenderID(); + + public String getText(); +} diff --git a/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/chat/ICommentEvent.java b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/chat/ICommentEvent.java new file mode 100644 index 0000000000..58116c4af2 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/chat/ICommentEvent.java @@ -0,0 +1,23 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.chat; + +import org.eclipse.net4j.util.event.IEvent; + +/** + * @author Eike Stepper + */ +public interface ICommentEvent extends IEvent +{ + public IChat getChat(); + + public IComment getComment(); +} diff --git a/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/Chat.java b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/Chat.java new file mode 100644 index 0000000000..27aeb4c17c --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/Chat.java @@ -0,0 +1,67 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.chat; + +import org.eclipse.net4j.buddies.chat.IChat; +import org.eclipse.net4j.buddies.chat.IComment; +import org.eclipse.net4j.buddies.common.IMessage; +import org.eclipse.net4j.buddies.spi.common.Facility; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Eike Stepper + */ +public class Chat extends Facility implements IChat +{ + private List<IComment> comments = new ArrayList<IComment>(); + + public Chat() + { + super(TYPE); + } + + public IComment[] getComments() + { + synchronized (comments) + { + return comments.toArray(new IComment[comments.size()]); + } + } + + public void sendComment(String text) + { + TextMessage message = new TextMessage(text); + sendMessage(message); + addComment(message.getSenderID(), text); + } + + @Override + public void handleMessage(IMessage message) + { + if (message instanceof TextMessage) + { + addComment(message.getSenderID(), ((TextMessage)message).getText()); + } + } + + protected void addComment(String senderID, String text) + { + Comment comment = new Comment(System.currentTimeMillis(), senderID, text); + synchronized (comments) + { + comments.add(comment); + } + + fireEvent(new CommentEvent(this, comment)); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/ChatFactory.java b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/ChatFactory.java new file mode 100644 index 0000000000..d17b4271a2 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/ChatFactory.java @@ -0,0 +1,31 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.chat; + +import org.eclipse.net4j.buddies.chat.IChat; +import org.eclipse.net4j.buddies.spi.common.ClientFacilityFactory; +import org.eclipse.net4j.util.factory.ProductCreationException; + +/** + * @author Eike Stepper + */ +public class ChatFactory extends ClientFacilityFactory +{ + public ChatFactory() + { + super(IChat.TYPE); + } + + public Chat create(String description) throws ProductCreationException + { + return new Chat(); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/ChatRoom.java b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/ChatRoom.java new file mode 100644 index 0000000000..6f803093eb --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/ChatRoom.java @@ -0,0 +1,36 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.chat; + +import org.eclipse.net4j.buddies.chat.IChatRoom; +import org.eclipse.net4j.buddies.common.IMessage; + +/** + * @author Eike Stepper + */ +public class ChatRoom extends Chat implements IChatRoom +{ + public ChatRoom() + { + } + + @Override + public void sendComment(String text) + { + throw new UnsupportedOperationException(); + } + + @Override + public void handleMessage(IMessage message) + { + sendMessage(message); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/ChatRoomFactory.java b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/ChatRoomFactory.java new file mode 100644 index 0000000000..7cb7c60e60 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/ChatRoomFactory.java @@ -0,0 +1,32 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.chat; + +import org.eclipse.net4j.buddies.spi.common.ServerFacilityFactory; +import org.eclipse.net4j.util.factory.ProductCreationException; + +/** + * @author Eike Stepper + */ +public class ChatRoomFactory extends ServerFacilityFactory +{ + public static final String TYPE = "chat"; + + public ChatRoomFactory() + { + super(TYPE); + } + + public ChatRoom create(String description) throws ProductCreationException + { + return new ChatRoom(); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/Comment.java b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/Comment.java new file mode 100644 index 0000000000..072be7a4e0 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/Comment.java @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.chat; + +import org.eclipse.net4j.buddies.chat.IComment; + +import java.io.Serializable; + +/** + * @author Eike Stepper + */ +public class Comment implements IComment, Serializable +{ + private static final long serialVersionUID = 1L; + + private long receiveTime; + + private String senderID; + + private String text; + + public Comment(long receiveTime, String senderID, String text) + { + this.receiveTime = receiveTime; + this.senderID = senderID; + this.text = text; + } + + public long getReceiveTime() + { + return receiveTime; + } + + public String getSenderID() + { + return senderID; + } + + public String getText() + { + return text; + } +} diff --git a/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/CommentEvent.java b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/CommentEvent.java new file mode 100644 index 0000000000..5b98e55e1a --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/CommentEvent.java @@ -0,0 +1,42 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.chat; + +import org.eclipse.net4j.buddies.chat.IChat; +import org.eclipse.net4j.buddies.chat.IComment; +import org.eclipse.net4j.buddies.chat.ICommentEvent; +import org.eclipse.net4j.util.event.Event; + +/** + * @author Eike Stepper + */ +public class CommentEvent extends Event implements ICommentEvent +{ + private static final long serialVersionUID = 1L; + + private IComment comment; + + public CommentEvent(IChat chat, IComment comment) + { + super(chat); + this.comment = comment; + } + + public IChat getChat() + { + return (IChat)getSource(); + } + + public IComment getComment() + { + return comment; + } +} diff --git a/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/TextMessage.java b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/TextMessage.java new file mode 100644 index 0000000000..1727932f31 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/TextMessage.java @@ -0,0 +1,37 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.chat; + +import org.eclipse.net4j.buddies.spi.common.Message; + +/** + * @author Eike Stepper + */ +public class TextMessage extends Message +{ + private static final long serialVersionUID = 1L; + + private String text; + + public TextMessage(String text) + { + this.text = encode(text); + } + + protected TextMessage() + { + } + + public String getText() + { + return decode(text); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/bundle/OM.java b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/bundle/OM.java new file mode 100644 index 0000000000..188a5b11b3 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.chat/src/org/eclipse/net4j/buddies/internal/chat/bundle/OM.java @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.chat.bundle; + +import org.eclipse.net4j.util.om.OMBundle; +import org.eclipse.net4j.util.om.OMPlatform; +import org.eclipse.net4j.util.om.OSGiActivator; +import org.eclipse.net4j.util.om.log.OMLogger; +import org.eclipse.net4j.util.om.trace.OMTracer; + +/** + * The <em>Operations & Maintenance</em> class of this bundle. + * + * @author Eike Stepper + */ +public abstract class OM +{ + public static final String BUNDLE_ID = "org.eclipse.net4j.buddies.chat"; //$NON-NLS-1$ + + public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class); + + public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$ + + public static final OMLogger LOG = BUNDLE.logger(); + + /** + * @author Eike Stepper + */ + public static final class Activator extends OSGiActivator + { + public Activator() + { + super(BUNDLE); + } + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/.classpath b/plugins/org.eclipse.net4j.buddies.common/.classpath new file mode 100644 index 0000000000..64c5e31b7a --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/.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/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/org.eclipse.net4j.buddies.common/.cvsignore b/plugins/org.eclipse.net4j.buddies.common/.cvsignore new file mode 100644 index 0000000000..693869726d --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/.cvsignore @@ -0,0 +1,2 @@ +bin +doc diff --git a/plugins/org.eclipse.net4j.buddies.common/.options b/plugins/org.eclipse.net4j.buddies.common/.options new file mode 100644 index 0000000000..d5862c214b --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/.options @@ -0,0 +1,3 @@ +# Debugging and tracing options + +org.eclipse.net4j.buddies.common/debug = true diff --git a/plugins/org.eclipse.net4j.buddies.common/.project b/plugins/org.eclipse.net4j.buddies.common/.project new file mode 100644 index 0000000000..0e5d12fb87 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.net4j.buddies.common</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/org.eclipse.net4j.buddies.common/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.net4j.buddies.common/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..89d1443c32 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,271 @@ +#Sat Feb 23 10:52:39 CET 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 +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_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_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_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.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +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=next_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true +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=120 +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.format_guardian_clause_on_one_line=false +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=2 +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_member=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_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=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=do not 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_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_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_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_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_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_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_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.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=true +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +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=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=2 +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true diff --git a/plugins/org.eclipse.net4j.buddies.common/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.net4j.buddies.common/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..36ce091cf8 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,65 @@ +#Sat Feb 23 10:52:39 CET 2008 +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_serial_version_id=true +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_to_enhanced_for_loop=false +cleanup.correct_indentation=true +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +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=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=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_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=true +cleanup.use_this_for_non_static_field_access=true +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=true +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_EMFT +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_EMFT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=ex +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +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\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment"/><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"/><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">/***************************************************************************\r\n * Copyright (c) 2004 - 2008 Eike Stepper, Germany.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * Eike Stepper - initial API and implementation\r\n **************************************************************************/</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author Eike Stepper\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><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"/><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"/><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}\r\n${package_declaration}\r\n\r\n${typecomment}\r\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">\r\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">\r\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">\r\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">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" 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}</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/org.eclipse.net4j.buddies.common/.settings/org.eclipse.mylyn.tasks.ui.prefs b/plugins/org.eclipse.net4j.buddies.common/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 0000000000..7f1832044c --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +#Sun Mar 09 19:15:26 CET 2008 +eclipse.preferences.version=1 +project.repository.kind=bugzilla +project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/plugins/org.eclipse.net4j.buddies.common/.settings/org.eclipse.mylyn.team.ui.prefs b/plugins/org.eclipse.net4j.buddies.common/.settings/org.eclipse.mylyn.team.ui.prefs new file mode 100644 index 0000000000..e72b02b02f --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/.settings/org.eclipse.mylyn.team.ui.prefs @@ -0,0 +1,3 @@ +#Sun Mar 09 19:15:26 CET 2008 +commit.comment.template=[${task.id}] ${task.description} \r\n${task.url} +eclipse.preferences.version=1 diff --git a/plugins/org.eclipse.net4j.buddies.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.buddies.common/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..f0a664c316 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/META-INF/MANIFEST.MF @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.net4j.buddies.common +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: %providerName +Bundle-Activator: org.eclipse.net4j.buddies.internal.common.bundle.OM$Activator +Bundle-ClassPath: . +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)", + org.eclipse.net4j;bundle-version="[1.0.0,2.0.0)";visibility:=reexport +Import-Package: org.osgi.framework;version="1.3.0";resolution:=optional +Export-Package: org.eclipse.net4j.buddies.common;version="1.0.0", + org.eclipse.net4j.buddies.internal.common;version="1.0.0";x-friends:="org.eclipse.net4j.buddies,org.eclipse.net4j.buddies.server,org.eclipse.net4j.buddies.ui", + org.eclipse.net4j.buddies.internal.common.bundle;version="1.0.0";x-internal:=true, + org.eclipse.net4j.buddies.internal.common.protocol;version="1.0.0";x-friends:="org.eclipse.net4j.buddies,org.eclipse.net4j.buddies.server", + org.eclipse.net4j.buddies.spi.common;version="1.0.0" +Bundle-ActivationPolicy: lazy diff --git a/plugins/org.eclipse.net4j.buddies.common/about.html b/plugins/org.eclipse.net4j.buddies.common/about.html new file mode 100644 index 0000000000..d35d5aed64 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/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>June 5, 2007</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> diff --git a/plugins/org.eclipse.net4j.buddies.common/build.properties b/plugins/org.eclipse.net4j.buddies.common/build.properties new file mode 100644 index 0000000000..eb76b6604c --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/build.properties @@ -0,0 +1,21 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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: +# Eike Stepper - initial API and implementation + +# NLS_MESSAGEFORMAT_VAR + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + copyright.txt,\ + epl-v10.html,\ + license.html,\ + plugin.properties,\ + .options diff --git a/plugins/org.eclipse.net4j.buddies.common/copyright.txt b/plugins/org.eclipse.net4j.buddies.common/copyright.txt new file mode 100644 index 0000000000..529118d99e --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/copyright.txt @@ -0,0 +1,8 @@ +Copyright (c) 2004 - 2008 Eike Stepper, Germany. +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: + Eike Stepper - initial API and implementation
\ No newline at end of file diff --git a/plugins/org.eclipse.net4j.buddies.common/epl-v10.html b/plugins/org.eclipse.net4j.buddies.common/epl-v10.html new file mode 100644 index 0000000000..d7b88e9416 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/epl-v10.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.net4j.buddies.common/license.html b/plugins/org.eclipse.net4j.buddies.common/license.html new file mode 100644 index 0000000000..d7b88e9416 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/license.html @@ -0,0 +1,319 @@ +<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta name="ProgId" content="Word.Document"> +<meta name="Generator" content="Microsoft Word 9"> +<meta name="Originator" content="Microsoft Word 9"> +<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml> + <o:DocumentProperties> + <o:Revision>2</o:Revision> + <o:TotalTime>3</o:TotalTime> + <o:Created>2004-03-05T23:03:00Z</o:Created> + <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved> + <o:Pages>4</o:Pages> + <o:Words>1626</o:Words> + <o:Characters>9270</o:Characters> + <o:Lines>77</o:Lines> + <o:Paragraphs>18</o:Paragraphs> + <o:CharactersWithSpaces>11384</o:CharactersWithSpaces> + <o:Version>9.4402</o:Version> + </o:DocumentProperties> +</xml><![endif]--><!--[if gte mso 9]><xml> + <w:WordDocument> + <w:TrackRevisions/> + </w:WordDocument> +</xml><![endif]--> + + +<style> +<!-- + /* Font Definitions */ +@font-face + {font-family:Tahoma; + panose-1:2 11 6 4 3 5 4 4 2 4; + mso-font-charset:0; + mso-generic-font-family:swiss; + mso-font-pitch:variable; + mso-font-signature:553679495 -2147483648 8 0 66047 0;} + /* Style Definitions */ +p.MsoNormal, li.MsoNormal, div.MsoNormal + {mso-style-parent:""; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p + {margin-right:0in; + mso-margin-top-alt:auto; + mso-margin-bottom-alt:auto; + margin-left:0in; + mso-pagination:widow-orphan; + font-size:12.0pt; + font-family:"Times New Roman"; + mso-fareast-font-family:"Times New Roman";} +p.BalloonText, li.BalloonText, div.BalloonText + {mso-style-name:"Balloon Text"; + margin:0in; + margin-bottom:.0001pt; + mso-pagination:widow-orphan; + font-size:8.0pt; + font-family:Tahoma; + mso-fareast-font-family:"Times New Roman";} +@page Section1 + {size:8.5in 11.0in; + margin:1.0in 1.25in 1.0in 1.25in; + mso-header-margin:.5in; + mso-footer-margin:.5in; + mso-paper-source:0;} +div.Section1 + {page:Section1;} +--> +</style></head> + +<body style="" lang="EN-US"> + +<div class="Section1"> + +<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b> +</p> + +<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.</span> </p> + +<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p> + +<p><span style="font-size: 10pt;">"Contribution" means:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and<br clear="left"> +b) in the case of each subsequent Contributor:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +changes to the Program, and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +additions to the Program;</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program. </span></p> + +<p><span style="font-size: 10pt;">"Contributor" means any person or +entity that distributes the Program.</span> </p> + +<p><span style="font-size: 10pt;">"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program. </span></p> + +<p><span style="font-size: 10pt;">"Program" means the Contributions +distributed in accordance with this Agreement.</span> </p> + +<p><span style="font-size: 10pt;">"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.</span> </p> + +<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder. </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. </span></p> + +<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p> + +<p><span style="font-size: 10pt;">A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that:</span> +</p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it complies with the terms and conditions of this Agreement; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) +its license agreement:</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits; </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and</span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.<span style="color: blue;"> </span></span></p> + +<p><span style="font-size: 10pt;">When the Program is made available in source +code form:</span> </p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a) +it must be made available under this Agreement; and </span></p> + +<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a +copy of this Agreement must be included with each copy of the Program. </span></p> + +<p><span style="font-size: 10pt;">Contributors may not remove or alter any +copyright notices contained within the Program. </span></p> + +<p><span style="font-size: 10pt;">Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. </span></p> + +<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p> + +<p><span style="font-size: 10pt;">Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.</span> </p> + +<p><span style="font-size: 10pt;">For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.</span> </p> + +<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations. </span></p> + +<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p> + +<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.</span> </p> + +<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p> + +<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.</span> </p> + +<p><span style="font-size: 10pt;">If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed. </span></p> + +<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive. </span></p> + +<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.</span> </p> + +<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.</span> </p> + +<p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> + +</div> + +</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.net4j.buddies.common/plugin.properties b/plugins/org.eclipse.net4j.buddies.common/plugin.properties new file mode 100644 index 0000000000..acb1f5c254 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/plugin.properties @@ -0,0 +1,25 @@ +# Copyright (c) 2004 - 2008 Eike Stepper, Germany. +# 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: +# Eike Stepper - initial API and implementation + +# NLS_MESSAGEFORMAT_VAR + +# ============================================================================== +# Do not change the properties between this line and the last line containing: +# %%% END OF TRANSLATED PROPERTIES %%% +# Instead, either redefine an existing property, or create a new property, +# append it to the end of the file, and change the code to use the new name. +# ============================================================================== + +pluginName = Net4j Buddies Protocol +providerName = Eclipse.org + +# ============================================================================== +# %%% END OF TRANSLATED PROPERTIES %%% +# The above properties have been shipped for translation. +# ============================================================================== diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IAccount.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IAccount.java new file mode 100644 index 0000000000..c276a28041 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IAccount.java @@ -0,0 +1,31 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +import java.util.Map; + +/** + * @author Eike Stepper + */ +public interface IAccount +{ + public String getUserID(); + + public void setPassword(String password); + + public boolean authenticate(String password); + + public Map<String, String> getProperties(); + + public void touch(); + + public long getTimeStamp(); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IBuddy.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IBuddy.java new file mode 100644 index 0000000000..63a29dcf68 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IBuddy.java @@ -0,0 +1,50 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +import org.eclipse.core.runtime.IAdaptable; + +import java.util.Collection; +import java.util.Set; + +/** + * @author Eike Stepper + */ +public interface IBuddy extends IMembershipContainer, ICollaborationProvider, IAdaptable +{ + public String getUserID(); + + public State getState(); + + public IAccount getAccount(); + + public ISession getSession(); + + public Set<String> getFacilityTypes(); + + public IMembership initiate(); + + public IMembership initiate(IBuddy buddy); + + public IMembership[] initiate(Collection<IBuddy> buddies); + + public IMembership join(long collaborationID); + + public IMembership join(Object invitationToken); + + /** + * @author Eike Stepper + */ + public enum State + { + AVAILABLE, LONESOME, AWAY, DO_NOT_DISTURB + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IBuddyContainer.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IBuddyContainer.java new file mode 100644 index 0000000000..6a4a9210e7 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IBuddyContainer.java @@ -0,0 +1,20 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +import org.eclipse.net4j.util.container.IContainer; + +/** + * @author Eike Stepper + */ +public interface IBuddyContainer extends IBuddyProvider, IContainer<IBuddy> +{ +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IBuddyProvider.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IBuddyProvider.java new file mode 100644 index 0000000000..44468151f8 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IBuddyProvider.java @@ -0,0 +1,21 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +/** + * @author Eike Stepper + */ +public interface IBuddyProvider +{ + public IBuddy[] getBuddies(); + + public IBuddy getBuddy(String userID); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IBuddyStateEvent.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IBuddyStateEvent.java new file mode 100644 index 0000000000..684ffc8197 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IBuddyStateEvent.java @@ -0,0 +1,25 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +import org.eclipse.net4j.util.event.IEvent; + +/** + * @author Eike Stepper + */ +public interface IBuddyStateEvent extends IEvent +{ + public IBuddy getBuddy(); + + public IBuddy.State getOldState(); + + public IBuddy.State getNewState(); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ICollaboration.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ICollaboration.java new file mode 100644 index 0000000000..e545d74358 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ICollaboration.java @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +import org.eclipse.core.runtime.IAdaptable; + +/** + * @author Eike Stepper + */ +public interface ICollaboration extends IMembershipContainer, IBuddyProvider, IAdaptable +{ + public long getID(); + + public String getTitle(); + + public String getDescription(); + + public Visibility getVisibility(); + + public boolean isPublic(); + + public void setPublic(String title, String description); + + public void setPrivate(); + + public String[] getFacilityTypes(); + + public IFacility[] getFacilities(); + + public IFacility getFacility(String type); + + public enum Visibility + { + PRIVATE, PUBLIC + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ICollaborationContainer.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ICollaborationContainer.java new file mode 100644 index 0000000000..f9056bf04d --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ICollaborationContainer.java @@ -0,0 +1,20 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +import org.eclipse.net4j.util.container.IContainer; + +/** + * @author Eike Stepper + */ +public interface ICollaborationContainer extends ICollaborationProvider, IContainer<ICollaboration> +{ +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ICollaborationProvider.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ICollaborationProvider.java new file mode 100644 index 0000000000..897cddd7a7 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ICollaborationProvider.java @@ -0,0 +1,21 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +/** + * @author Eike Stepper + */ +public interface ICollaborationProvider +{ + public ICollaboration[] getCollaborations(); + + public ICollaboration getCollaboration(long id); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IFacility.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IFacility.java new file mode 100644 index 0000000000..7c5731d6ef --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IFacility.java @@ -0,0 +1,29 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +import org.eclipse.net4j.util.event.INotifier; + +import org.eclipse.core.runtime.IAdaptable; + +/** + * @author Eike Stepper + */ +public interface IFacility extends INotifier, IAdaptable +{ + public String getType(); + + public ICollaboration getCollaboration(); + + public void setCollaboration(ICollaboration collaboration); + + public void sendMessage(IMessage message); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IFacilityInstalledEvent.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IFacilityInstalledEvent.java new file mode 100644 index 0000000000..2ca2d3d16a --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IFacilityInstalledEvent.java @@ -0,0 +1,25 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +import org.eclipse.net4j.util.event.IEvent; + +/** + * @author Eike Stepper + */ +public interface IFacilityInstalledEvent extends IEvent +{ + public ICollaboration getCollaboration(); + + public IFacility getFacility(); + + public boolean fromRemote(); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMembership.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMembership.java new file mode 100644 index 0000000000..c6748d5719 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMembership.java @@ -0,0 +1,23 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +import org.eclipse.net4j.util.container.IContainer; + +import org.eclipse.core.runtime.IAdaptable; + +/** + * @author Eike Stepper + */ +public interface IMembership extends IMembershipKey, IContainer<Object>, IAdaptable +{ + public long getStartTime(); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMembershipContainer.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMembershipContainer.java new file mode 100644 index 0000000000..8a9ff1f581 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMembershipContainer.java @@ -0,0 +1,20 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +import org.eclipse.net4j.util.container.IContainer; + +/** + * @author Eike Stepper + */ +public interface IMembershipContainer extends IMembershipProvider, IContainer<IMembership> +{ +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMembershipKey.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMembershipKey.java new file mode 100644 index 0000000000..c7da597065 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMembershipKey.java @@ -0,0 +1,21 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +/** + * @author Eike Stepper + */ +public interface IMembershipKey +{ + public IBuddy getBuddy(); + + public ICollaboration getCollaboration(); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMembershipProvider.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMembershipProvider.java new file mode 100644 index 0000000000..3c20dcedc6 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMembershipProvider.java @@ -0,0 +1,21 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +/** + * @author Eike Stepper + */ +public interface IMembershipProvider +{ + public IMembership[] getMemberships(); + + public IMembership getMembership(IBuddy buddy, ICollaboration collaboration); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMessage.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMessage.java new file mode 100644 index 0000000000..7b45c06378 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMessage.java @@ -0,0 +1,21 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +import org.eclipse.core.runtime.IAdaptable; + +/** + * @author Eike Stepper + */ +public interface IMessage extends IAdaptable +{ + public String getSenderID(); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMessageEvent.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMessageEvent.java new file mode 100644 index 0000000000..d488bb5aa1 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/IMessageEvent.java @@ -0,0 +1,21 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +import org.eclipse.net4j.util.event.IEvent; + +/** + * @author Eike Stepper + */ +public interface IMessageEvent extends IEvent +{ + public IMessage getMessage(); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ISession.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ISession.java new file mode 100644 index 0000000000..05673f3a95 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ISession.java @@ -0,0 +1,28 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +import org.eclipse.net4j.channel.IChannel; +import org.eclipse.net4j.util.event.INotifier; + +import org.eclipse.core.runtime.IAdaptable; + +/** + * @author Eike Stepper + */ +public interface ISession extends INotifier, IAdaptable +{ + public IChannel getChannel(); + + public IBuddy getSelf(); + + public void close(); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ISessionProvider.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ISessionProvider.java new file mode 100644 index 0000000000..310771465f --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ISessionProvider.java @@ -0,0 +1,23 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.common; + +/** + * @author Eike Stepper + */ +public interface ISessionProvider +{ + public ISession[] getSessions(); + + public ISession getSession(String userID); + + public ISession getSession(IBuddy buddy); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Account.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Account.java new file mode 100644 index 0000000000..78588c9dee --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Account.java @@ -0,0 +1,79 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common; + +import org.eclipse.net4j.buddies.common.IAccount; +import org.eclipse.net4j.util.ObjectUtil; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Eike Stepper + */ +public class Account implements IAccount, Serializable +{ + private static final long serialVersionUID = 1L; + + private String userID; + + private transient String password; + + private Map<String, String> properties = new HashMap<String, String>(); + + private long timeStamp; + + protected Account() + { + } + + public Account(String userID, String password) + { + this.userID = userID; + this.password = password; + } + + public String getUserID() + { + return userID; + } + + public String getPassword() + { + return password; + } + + public void setPassword(String password) + { + this.password = password; + } + + public boolean authenticate(String password) + { + return ObjectUtil.equals(password, this.password); + } + + public Map<String, String> getProperties() + { + return properties; + } + + public void touch() + { + timeStamp = System.currentTimeMillis(); + } + + public long getTimeStamp() + { + return timeStamp; + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Buddy.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Buddy.java new file mode 100644 index 0000000000..95f6b09b5a --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Buddy.java @@ -0,0 +1,220 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common; + +import org.eclipse.net4j.buddies.common.IBuddy; +import org.eclipse.net4j.buddies.common.IBuddyStateEvent; +import org.eclipse.net4j.buddies.common.ICollaboration; +import org.eclipse.net4j.buddies.common.IMembership; +import org.eclipse.net4j.buddies.common.ISession; +import org.eclipse.net4j.util.ObjectUtil; +import org.eclipse.net4j.util.event.Event; +import org.eclipse.net4j.util.event.IEvent; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.PlatformObject; + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * @author Eike Stepper + */ +public abstract class Buddy extends MembershipContainer implements IBuddy +{ + private ISession session; + + private State state = State.AVAILABLE; + + private Set<String> facilityTypes; + + public Buddy(ISession session, Set<String> facilityTypes) + { + this.session = session; + this.facilityTypes = facilityTypes == null ? null : Collections.unmodifiableSet(facilityTypes); + } + + public ISession getSession() + { + return session; + } + + public void setSession(ISession session) + { + this.session = session; + } + + public State getState() + { + return state; + } + + public void setState(State state) + { + if (this.state != state) + { + IEvent event = new BuddyStateEvent(this.state, state); + this.state = state; + fireEvent(event); + } + } + + public Set<String> getFacilityTypes() + { + if (facilityTypes == null) + { + facilityTypes = Collections.unmodifiableSet(loadFacilityTypes()); + } + + return facilityTypes; + } + + public IMembership getMembership(Collaboration collaboration) + { + return getMembership(this, collaboration); + } + + public IMembership removeMembership(Collaboration collaboration) + { + return removeMembership(this, collaboration); + } + + public ICollaboration getCollaboration(long collaborationID) + { + for (IMembership membership : getMemberships()) + { + ICollaboration collaboration = membership.getCollaboration(); + if (collaboration.getID() == collaborationID) + { + return collaboration; + } + } + + return null; + } + + public ICollaboration[] getCollaborations() + { + List<ICollaboration> collaborations = new ArrayList<ICollaboration>(); + for (IMembership membership : getMemberships()) + { + ICollaboration collaboration = membership.getCollaboration(); + collaborations.add(collaboration); + } + + return collaborations.toArray(new ICollaboration[collaborations.size()]); + } + + public IMembership initiate() + { + return initiate((IBuddy)null); + } + + public IMembership initiate(IBuddy buddy) + { + HashSet<IBuddy> buddies = new HashSet<IBuddy>(); + if (buddy != null) + { + buddies.add(buddy); + } + + IMembership[] memberships = initiate(buddies); + return memberships.length == 0 ? null : memberships[0]; + } + + /** + * @see PlatformObject#getAdapter(Class) + */ + @SuppressWarnings("unchecked") + public Object getAdapter(Class adapter) + { + return Platform.getAdapterManager().getAdapter(this, adapter); + } + + @Override + public boolean equals(Object obj) + { + if (obj == this) + { + return true; + } + + if (obj instanceof IBuddy) + { + IBuddy buddy = (IBuddy)obj; + return ObjectUtil.equals(getUserID(), buddy.getUserID()); + } + + return false; + } + + @Override + public int hashCode() + { + return ObjectUtil.hashCode(getUserID()); + } + + @Override + public String toString() + { + return MessageFormat.format("{0}[{1}]", getClass().getSimpleName(), getUserID()); + } + + protected Set<String> loadFacilityTypes() + { + throw new UnsupportedOperationException(); + } + + /** + * @author Eike Stepper + */ + private final class BuddyStateEvent extends Event implements IBuddyStateEvent + { + private static final long serialVersionUID = 1L; + + private State oldState; + + private State newState; + + public BuddyStateEvent(State oldState, State newState) + { + super(Buddy.this); + this.oldState = oldState; + this.newState = newState; + } + + public IBuddy getBuddy() + { + return Buddy.this; + } + + public State getOldState() + { + return oldState; + } + + public State getNewState() + { + return newState; + } + + @Override + public String toString() + { + return MessageFormat.format("BuddyStateEvent[source={0}, oldState={1}, newState={2}]", getSource(), + getOldState(), getNewState()); + } + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/BuddyContainer.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/BuddyContainer.java new file mode 100644 index 0000000000..9c550ba0f1 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/BuddyContainer.java @@ -0,0 +1,143 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common; + +import org.eclipse.net4j.buddies.common.IBuddy; +import org.eclipse.net4j.buddies.common.IBuddyContainer; +import org.eclipse.net4j.util.container.IContainerDelta; +import org.eclipse.net4j.util.container.SingleDeltaContainerEvent; +import org.eclipse.net4j.util.event.IEvent; +import org.eclipse.net4j.util.event.IListener; +import org.eclipse.net4j.util.lifecycle.ILifecycleEvent; +import org.eclipse.net4j.util.lifecycle.Lifecycle; +import org.eclipse.net4j.util.lifecycle.LifecycleEvent; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Eike Stepper + */ +public class BuddyContainer extends Lifecycle implements IBuddyContainer, IListener +{ + private Map<String, IBuddy> buddies = new HashMap<String, IBuddy>(); + + public BuddyContainer(Collection<IBuddy> buddies) + { + if (buddies != null) + { + for (IBuddy buddy : buddies) + { + this.buddies.put(buddy.getUserID(), buddy); + buddy.addListener(this); + } + } + } + + public BuddyContainer() + { + } + + public boolean addBuddy(IBuddy buddy) + { + String userID = buddy.getUserID(); + synchronized (buddies) + { + if (!buddies.containsKey(userID)) + { + buddies.put(userID, buddy); + fireEvent(new SingleDeltaContainerEvent<IBuddy>(this, buddy, IContainerDelta.Kind.ADDED)); + buddy.addListener(this); + return true; + } + } + + return false; + } + + public IBuddy removeBuddy(String userID) + { + IBuddy buddy; + synchronized (buddies) + { + buddy = buddies.remove(userID); + } + + if (buddy != null) + { + buddy.removeListener(this); + fireEvent(new SingleDeltaContainerEvent<IBuddy>(this, buddy, IContainerDelta.Kind.REMOVED)); + } + + return buddy; + } + + public IBuddy[] getBuddies() + { + synchronized (buddies) + { + return buddies.values().toArray(new IBuddy[buddies.size()]); + } + } + + public IBuddy getBuddy(String userID) + { + synchronized (buddies) + { + return buddies.get(userID); + } + } + + public IBuddy[] getElements() + { + return getBuddies(); + } + + public boolean isEmpty() + { + synchronized (buddies) + { + return buddies.isEmpty(); + } + } + + public void notifyEvent(IEvent event) + { + if (event.getSource() instanceof IBuddy) + { + notifyBuddyEvent(event); + if (event instanceof LifecycleEvent) + { + LifecycleEvent e = (LifecycleEvent)event; + if (e.getKind() == ILifecycleEvent.Kind.DEACTIVATED) + { + removeBuddy(((IBuddy)e.getSource()).getUserID()); + } + } + } + } + + protected void notifyBuddyEvent(IEvent event) + { + } + + @Override + protected void doDeactivate() throws Exception + { + for (IBuddy buddy : getBuddies()) + { + buddy.removeListener(this); + } + + super.doDeactivate(); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Collaboration.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Collaboration.java new file mode 100644 index 0000000000..4f53e4516e --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Collaboration.java @@ -0,0 +1,288 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common; + +import org.eclipse.net4j.buddies.common.IBuddy; +import org.eclipse.net4j.buddies.common.ICollaboration; +import org.eclipse.net4j.buddies.common.IFacility; +import org.eclipse.net4j.buddies.common.IFacilityInstalledEvent; +import org.eclipse.net4j.buddies.common.IMembership; +import org.eclipse.net4j.buddies.common.IMessage; +import org.eclipse.net4j.buddies.internal.common.bundle.OM; +import org.eclipse.net4j.buddies.internal.common.protocol.MessageNotification; +import org.eclipse.net4j.util.ObjectUtil; +import org.eclipse.net4j.util.event.Event; +import org.eclipse.net4j.util.event.IEvent; +import org.eclipse.net4j.util.lifecycle.LifecycleUtil; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.PlatformObject; + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +/** + * @author Eike Stepper + */ +public class Collaboration extends MembershipContainer implements ICollaboration +{ + private long id; + + private String title; + + private String description; + + private Visibility visibility = Visibility.PRIVATE; + + private ConcurrentMap<String, IFacility> facilities = new ConcurrentHashMap<String, IFacility>(); + + public Collaboration(long id) + { + this.id = id; + } + + public long getID() + { + return id; + } + + public String getTitle() + { + return title == null ? String.valueOf(id) : title; + } + + public String getDescription() + { + return description; + } + + public Visibility getVisibility() + { + return visibility; + } + + public boolean isPublic() + { + return visibility == Visibility.PUBLIC; + } + + public void setPublic(String title, String description) + { + visibility = Visibility.PUBLIC; + this.title = title; + this.description = description; + } + + public void setPrivate() + { + visibility = Visibility.PRIVATE; + title = null; + description = null; + } + + public IMembership getMembership(IBuddy buddy) + { + return getMembership(buddy, this); + } + + public IMembership removeMembership(IBuddy buddy) + { + return removeMembership(buddy, this); + } + + public IBuddy getBuddy(String userID) + { + for (IMembership membership : getMemberships()) + { + IBuddy buddy = membership.getBuddy(); + if (ObjectUtil.equals(buddy.getUserID(), userID)) + { + return buddy; + } + } + + return null; + } + + public IBuddy[] getBuddies() + { + List<IBuddy> buddies = new ArrayList<IBuddy>(); + for (IMembership membership : getMemberships()) + { + IBuddy buddy = membership.getBuddy(); + buddies.add(buddy); + } + + return buddies.toArray(new IBuddy[buddies.size()]); + } + + public String[] getFacilityTypes() + { + return facilities.keySet().toArray(new String[facilities.size()]); + } + + public IFacility[] getFacilities() + { + return facilities.values().toArray(new IFacility[facilities.size()]); + } + + public IFacility getFacility(String type) + { + return facilities.get(type); + } + + public boolean addFacility(IFacility facility, boolean remote) + { + String type = facility.getType(); + if (!facilities.containsKey(type)) + { + facilities.put(type, facility); + fireEvent(new FacilityInstalledEvent(facility, remote)); + facility.addListener(this); + return true; + } + + return false; + } + + public void sendMessage(long collaborationID, String facilityType, IMessage message) + { + IMembership[] elements = getElements(); + for (IMembership membership : elements) + { + IBuddy receiver = membership.getBuddy(); + if (!ObjectUtil.equals(receiver.getUserID(), message.getSenderID())) + { + try + { + new MessageNotification(receiver.getSession().getChannel(), collaborationID, facilityType, message).send(); + } + catch (Exception ex) + { + OM.LOG.error(ex); + } + } + } + } + + /** + * @see PlatformObject#getAdapter(Class) + */ + @SuppressWarnings("unchecked") + public Object getAdapter(Class adapter) + { + return Platform.getAdapterManager().getAdapter(this, adapter); + } + + @Override + public boolean equals(Object obj) + { + if (obj == this) + { + return true; + } + + if (obj instanceof ICollaboration) + { + ICollaboration collaboration = (ICollaboration)obj; + return getID() == collaboration.getID(); + } + + return false; + } + + @Override + public int hashCode() + { + return ObjectUtil.hashCode(id); + } + + @Override + public String toString() + { + return MessageFormat.format("{0}[{1}]", getClass().getSimpleName(), getTitle()); + } + + @Override + public void notifyEvent(IEvent event) + { + super.notifyEvent(event); + if (event.getSource() instanceof IFacility) + { + notifyFacilityEvent(event); + } + } + + protected void notifyFacilityEvent(IEvent event) + { + } + + @Override + protected void doDeactivate() throws Exception + { + for (IFacility facility : getFacilities()) + { + facility.removeListener(this); + LifecycleUtil.deactivate(facility); + } + + for (IMembership membership : getMemberships()) + { + LifecycleUtil.deactivate(membership); + } + + super.doDeactivate(); + } + + /** + * @author Eike Stepper + */ + private final class FacilityInstalledEvent extends Event implements IFacilityInstalledEvent + { + private static final long serialVersionUID = 1L; + + private IFacility facility; + + private boolean remote; + + public FacilityInstalledEvent(IFacility facility, boolean remote) + { + super(Collaboration.this); + this.facility = facility; + this.remote = remote; + } + + public ICollaboration getCollaboration() + { + return Collaboration.this; + } + + public IFacility getFacility() + { + return facility; + } + + public boolean fromRemote() + { + return remote; + } + + @Override + public String toString() + { + return MessageFormat.format("FacilityInstalledEvent[source={0}, facility={1}, remote={2}]", getSource(), + facility, remote); + } + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/CollaborationContainer.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/CollaborationContainer.java new file mode 100644 index 0000000000..c78fe059da --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/CollaborationContainer.java @@ -0,0 +1,141 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common; + +import org.eclipse.net4j.buddies.common.ICollaboration; +import org.eclipse.net4j.buddies.common.ICollaborationContainer; +import org.eclipse.net4j.util.container.IContainerDelta; +import org.eclipse.net4j.util.container.SingleDeltaContainerEvent; +import org.eclipse.net4j.util.event.IEvent; +import org.eclipse.net4j.util.event.IListener; +import org.eclipse.net4j.util.lifecycle.ILifecycleEvent; +import org.eclipse.net4j.util.lifecycle.Lifecycle; +import org.eclipse.net4j.util.lifecycle.LifecycleEvent; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Eike Stepper + */ +public class CollaborationContainer extends Lifecycle implements ICollaborationContainer, IListener +{ + private Map<Long, ICollaboration> collaborations = new HashMap<Long, ICollaboration>(); + + public CollaborationContainer(Collection<ICollaboration> collaborations) + { + if (collaborations != null) + { + for (ICollaboration collaboration : collaborations) + { + this.collaborations.put(collaboration.getID(), collaboration); + collaboration.addListener(this); + } + } + } + + public CollaborationContainer() + { + } + + public void addCollaboration(ICollaboration collaboration) + { + long id = collaboration.getID(); + synchronized (collaborations) + { + if (!collaborations.containsKey(id)) + { + collaborations.put(id, collaboration); + } + } + + fireEvent(new SingleDeltaContainerEvent<ICollaboration>(this, collaboration, IContainerDelta.Kind.ADDED)); + collaboration.addListener(this); + } + + public ICollaboration removeCollaboration(long id) + { + ICollaboration collaboration; + synchronized (collaborations) + { + collaboration = collaborations.remove(id); + } + + if (collaboration != null) + { + collaboration.removeListener(this); + fireEvent(new SingleDeltaContainerEvent<ICollaboration>(this, collaboration, IContainerDelta.Kind.REMOVED)); + } + + return collaboration; + } + + public ICollaboration[] getCollaborations() + { + synchronized (collaborations) + { + return collaborations.values().toArray(new ICollaboration[collaborations.size()]); + } + } + + public ICollaboration getCollaboration(long id) + { + synchronized (collaborations) + { + return collaborations.get(id); + } + } + + public ICollaboration[] getElements() + { + return getCollaborations(); + } + + public boolean isEmpty() + { + synchronized (collaborations) + { + return collaborations.isEmpty(); + } + } + + public void notifyEvent(IEvent event) + { + if (event.getSource() instanceof ICollaboration) + { + notifyCollaborationEvent(event); + if (event instanceof LifecycleEvent) + { + LifecycleEvent e = (LifecycleEvent)event; + if (e.getKind() == ILifecycleEvent.Kind.DEACTIVATED) + { + removeCollaboration(((ICollaboration)e.getSource()).getID()); + } + } + } + } + + protected void notifyCollaborationEvent(IEvent event) + { + } + + @Override + protected void doDeactivate() throws Exception + { + for (ICollaboration collaboration : getCollaborations()) + { + collaboration.removeListener(this); + } + + super.doDeactivate(); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Membership.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Membership.java new file mode 100644 index 0000000000..6addbc2f4b --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Membership.java @@ -0,0 +1,118 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common; + +import org.eclipse.net4j.buddies.common.IBuddy; +import org.eclipse.net4j.buddies.common.ICollaboration; +import org.eclipse.net4j.buddies.common.IMembership; +import org.eclipse.net4j.buddies.common.IMembershipKey; +import org.eclipse.net4j.util.ObjectUtil; +import org.eclipse.net4j.util.lifecycle.Lifecycle; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.PlatformObject; + +/** + * @author Eike Stepper + */ +public class Membership extends Lifecycle implements IMembership +{ + private MembershipKey key; + + private long startTime; + + private transient Object[] elements; + + private Membership(IBuddy buddy, ICollaboration collaboration) + { + key = new MembershipKey(buddy, collaboration); + elements = new Object[] { buddy, collaboration }; + startTime = System.currentTimeMillis(); + activate(); + } + + public IBuddy getBuddy() + { + return key.getBuddy(); + } + + public ICollaboration getCollaboration() + { + return key.getCollaboration(); + } + + public long getStartTime() + { + return startTime; + } + + public Object[] getElements() + { + return elements; + } + + public boolean isEmpty() + { + return false; + } + + public MembershipKey getKey() + { + return key; + } + + /** + * @see PlatformObject#getAdapter(Class) + */ + @SuppressWarnings("unchecked") + public Object getAdapter(Class adapter) + { + return Platform.getAdapterManager().getAdapter(this, adapter); + } + + @Override + public boolean equals(Object obj) + { + if (obj == this) + { + return true; + } + + if (obj instanceof IMembershipKey) + { + IMembershipKey key = (IMembershipKey)obj; + return ObjectUtil.equals(getBuddy(), key.getBuddy()) + && ObjectUtil.equals(getCollaboration(), key.getCollaboration()); + } + + return false; + } + + @Override + public int hashCode() + { + return key.hashCode(); + } + + @Override + public String toString() + { + return key.toString(); + } + + public static IMembership create(IBuddy buddy, ICollaboration collaboration) + { + Membership membership = new Membership(buddy, collaboration); + ((Buddy)buddy).addMembership(membership); + ((Collaboration)collaboration).addMembership(membership); + return membership; + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/MembershipContainer.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/MembershipContainer.java new file mode 100644 index 0000000000..88ce8da4c3 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/MembershipContainer.java @@ -0,0 +1,121 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common; + +import org.eclipse.net4j.buddies.common.IBuddy; +import org.eclipse.net4j.buddies.common.ICollaboration; +import org.eclipse.net4j.buddies.common.IMembership; +import org.eclipse.net4j.buddies.common.IMembershipContainer; +import org.eclipse.net4j.buddies.common.IMembershipKey; +import org.eclipse.net4j.util.container.IContainerDelta; +import org.eclipse.net4j.util.container.SingleDeltaContainerEvent; +import org.eclipse.net4j.util.event.IEvent; +import org.eclipse.net4j.util.event.IListener; +import org.eclipse.net4j.util.lifecycle.ILifecycleEvent; +import org.eclipse.net4j.util.lifecycle.Lifecycle; + +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +/** + * @author Eike Stepper + */ +public class MembershipContainer extends Lifecycle implements IMembershipContainer, IListener +{ + private ConcurrentMap<IMembershipKey, IMembership> memberships = new ConcurrentHashMap<IMembershipKey, IMembership>(); + + public MembershipContainer() + { + } + + public void addMembership(IMembership membership) + { + if (memberships.putIfAbsent(membership, membership) == null) + { + fireEvent(new SingleDeltaContainerEvent<IMembership>(this, membership, IContainerDelta.Kind.ADDED)); + membership.addListener(this); + } + } + + public IMembership removeMembership(IBuddy buddy, ICollaboration collaboration) + { + return removeMembership(new MembershipKey(buddy, collaboration)); + } + + public IMembership removeMembership(IMembershipKey key) + { + // for (IMembership membership : memberships.values()) + // { + // + // } + // + IMembership membership = memberships.remove(key); + if (membership != null) + { + membership.removeListener(this); + fireEvent(new SingleDeltaContainerEvent<IMembership>(this, membership, IContainerDelta.Kind.REMOVED)); + } + + return membership; + } + + public IMembership[] getMemberships() + { + return memberships.values().toArray(new IMembership[memberships.size()]); + } + + public IMembership getMembership(IBuddy buddy, ICollaboration collaboration) + { + return memberships.get(new MembershipKey(buddy, collaboration)); + } + + public IMembership[] getElements() + { + return getMemberships(); + } + + public boolean isEmpty() + { + return memberships.isEmpty(); + } + + public void notifyEvent(IEvent event) + { + if (event.getSource() instanceof IMembership) + { + IMembership membership = (IMembership)event.getSource(); + notifyMembershipEvent(event); + if (event instanceof ILifecycleEvent) + { + ILifecycleEvent e = (ILifecycleEvent)event; + if (e.getKind() == ILifecycleEvent.Kind.DEACTIVATED) + { + removeMembership(membership); + } + } + } + } + + protected void notifyMembershipEvent(IEvent event) + { + } + + @Override + protected void doDeactivate() throws Exception + { + for (IMembership membership : getMemberships()) + { + membership.removeListener(this); + } + + super.doDeactivate(); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/MembershipKey.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/MembershipKey.java new file mode 100644 index 0000000000..ce228dc125 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/MembershipKey.java @@ -0,0 +1,72 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common; + +import org.eclipse.net4j.buddies.common.IBuddy; +import org.eclipse.net4j.buddies.common.ICollaboration; +import org.eclipse.net4j.buddies.common.IMembershipKey; +import org.eclipse.net4j.util.ObjectUtil; + +/** + * @author Eike Stepper + */ +public class MembershipKey implements IMembershipKey +{ + private IBuddy buddy; + + private ICollaboration collaboration; + + public MembershipKey(IBuddy buddy, ICollaboration collaboration) + { + this.buddy = buddy; + this.collaboration = collaboration; + } + + public IBuddy getBuddy() + { + return buddy; + } + + public ICollaboration getCollaboration() + { + return collaboration; + } + + @Override + public boolean equals(Object obj) + { + if (obj == this) + { + return true; + } + + if (obj instanceof IMembershipKey) + { + IMembershipKey key = (IMembershipKey)obj; + return ObjectUtil.equals(getBuddy(), key.getBuddy()) + && ObjectUtil.equals(getCollaboration(), key.getCollaboration()); + } + + return false; + } + + @Override + public int hashCode() + { + return ObjectUtil.hashCode(buddy) ^ ObjectUtil.hashCode(collaboration); + } + + @Override + public String toString() + { + return buddy + "(" + collaboration + ")"; + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/MessageEvent.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/MessageEvent.java new file mode 100644 index 0000000000..f3aaa66aec --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/MessageEvent.java @@ -0,0 +1,37 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common; + +import org.eclipse.net4j.buddies.common.IMessage; +import org.eclipse.net4j.buddies.common.IMessageEvent; +import org.eclipse.net4j.util.event.Event; +import org.eclipse.net4j.util.event.INotifier; + +/** + * @author Eike Stepper + */ +public final class MessageEvent extends Event implements IMessageEvent +{ + private static final long serialVersionUID = 1L; + + private IMessage message; + + public MessageEvent(INotifier notifier, IMessage message) + { + super(notifier); + this.message = message; + } + + public IMessage getMessage() + { + return message; + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/bundle/OM.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/bundle/OM.java new file mode 100644 index 0000000000..6b59c6c183 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/bundle/OM.java @@ -0,0 +1,50 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common.bundle; + +import org.eclipse.net4j.util.om.OMBundle; +import org.eclipse.net4j.util.om.OMPlatform; +import org.eclipse.net4j.util.om.OSGiActivator; +import org.eclipse.net4j.util.om.log.OMLogger; +import org.eclipse.net4j.util.om.trace.OMTracer; + +/** + * The <em>Operations & Maintenance</em> class of this bundle. + * + * @author Eike Stepper + */ +public abstract class OM +{ + public static final String BUNDLE_ID = "org.eclipse.net4j.buddies.common"; //$NON-NLS-1$ + + public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class); + + public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$ + + public static final OMTracer DEBUG_PROTOCOL = DEBUG.tracer("protocol"); //$NON-NLS-1$ + + public static final OMTracer DEBUG_MODEL = DEBUG.tracer("model"); //$NON-NLS-1$ + + public static final OMTracer DEBUG_REVISION = DEBUG.tracer("revision"); //$NON-NLS-1$ + + public static final OMLogger LOG = BUNDLE.logger(); + + /** + * @author Eike Stepper + */ + public static final class Activator extends OSGiActivator + { + public Activator() + { + super(BUNDLE); + } + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateIndication.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateIndication.java new file mode 100644 index 0000000000..30cf3eaf8f --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateIndication.java @@ -0,0 +1,43 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common.protocol; + +import org.eclipse.net4j.buddies.common.IBuddy.State; +import org.eclipse.net4j.signal.Indication; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public abstract class BuddyStateIndication extends Indication +{ + public BuddyStateIndication() + { + } + + @Override + protected short getSignalID() + { + return ProtocolConstants.SIGNAL_BUDDY_STATE; + } + + @Override + protected void indicating(ExtendedDataInputStream in) throws IOException + { + String userID = in.readString(); + State state = ProtocolUtil.readState(in); + stateChanged(userID, state); + } + + protected abstract void stateChanged(String userID, State state); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateNotification.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateNotification.java new file mode 100644 index 0000000000..2d755ae66b --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateNotification.java @@ -0,0 +1,48 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common.protocol; + +import org.eclipse.net4j.buddies.common.IBuddy.State; +import org.eclipse.net4j.channel.IChannel; +import org.eclipse.net4j.signal.Request; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public class BuddyStateNotification extends Request +{ + private String userID; + + private State state; + + public BuddyStateNotification(IChannel channel, String userID, State state) + { + super(channel); + this.userID = userID; + this.state = state; + } + + @Override + protected short getSignalID() + { + return ProtocolConstants.SIGNAL_BUDDY_STATE; + } + + @Override + protected void requesting(ExtendedDataOutputStream out) throws IOException + { + out.writeString(userID); + ProtocolUtil.writeState(out, state); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftIndication.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftIndication.java new file mode 100644 index 0000000000..36c22d707b --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftIndication.java @@ -0,0 +1,75 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common.protocol; + +import org.eclipse.net4j.buddies.common.IBuddyProvider; +import org.eclipse.net4j.buddies.common.ICollaborationProvider; +import org.eclipse.net4j.buddies.internal.common.Buddy; +import org.eclipse.net4j.buddies.internal.common.Collaboration; +import org.eclipse.net4j.signal.Indication; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public class CollaborationLeftIndication extends Indication +{ + private IBuddyProvider buddyProvider; + + private ICollaborationProvider collaborationProvider; + + public CollaborationLeftIndication(IBuddyProvider buddyProvider, ICollaborationProvider collaborationProvider) + { + this.buddyProvider = buddyProvider; + this.collaborationProvider = collaborationProvider; + } + + @Override + protected short getSignalID() + { + return ProtocolConstants.SIGNAL_COLLABORATION_LEFT; + } + + @Override + protected void indicating(ExtendedDataInputStream in) throws IOException + { + long collaborationID = in.readLong(); + String userID = in.readString(); + + Collaboration collaboration = getCollaboration(collaborationID); + if (collaboration != null) + { + Buddy buddy = getBuddy(userID); + if (buddy != null) + { + collaborationLeft(buddy, collaboration); + } + } + } + + protected void collaborationLeft(Buddy buddy, Collaboration collaboration) + { + collaboration.removeMembership(buddy); + buddy.removeMembership(collaboration); + } + + protected Collaboration getCollaboration(long collaborationID) + { + return (Collaboration)collaborationProvider.getCollaboration(collaborationID); + } + + protected Buddy getBuddy(String userID) + { + return (Buddy)buddyProvider.getBuddy(userID); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftNotification.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftNotification.java new file mode 100644 index 0000000000..5a70267057 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftNotification.java @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common.protocol; + +import org.eclipse.net4j.channel.IChannel; +import org.eclipse.net4j.signal.Request; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public class CollaborationLeftNotification extends Request +{ + private long collaborationID; + + private String userID; + + public CollaborationLeftNotification(IChannel channel, long collaborationID, String userID) + { + super(channel); + this.collaborationID = collaborationID; + this.userID = userID; + } + + @Override + protected short getSignalID() + { + return ProtocolConstants.SIGNAL_COLLABORATION_LEFT; + } + + @Override + protected void requesting(ExtendedDataOutputStream out) throws IOException + { + out.writeLong(collaborationID); + out.writeString(userID); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageIndication.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageIndication.java new file mode 100644 index 0000000000..70cbb13ba1 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageIndication.java @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common.protocol; + +import org.eclipse.net4j.buddies.common.ICollaboration; +import org.eclipse.net4j.buddies.common.ICollaborationProvider; +import org.eclipse.net4j.buddies.common.IMessage; +import org.eclipse.net4j.buddies.spi.common.Facility; +import org.eclipse.net4j.signal.Indication; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public class MessageIndication extends Indication +{ + private ICollaborationProvider collaborationProvider; + + public MessageIndication(ICollaborationProvider collaborationProvider) + { + this.collaborationProvider = collaborationProvider; + } + + @Override + protected short getSignalID() + { + return ProtocolConstants.SIGNAL_MESSAGE; + } + + @Override + protected void indicating(ExtendedDataInputStream in) throws IOException + { + long collaborationID = in.readLong(); + String facilityType = in.readString(); + Facility facility = getFacility(collaborationID, facilityType); + if (facility != null) + { + IMessage message = ProtocolUtil.readMessage(in, facility.getClass().getClassLoader()); + facility.handleMessage(message); + } + } + + private Facility getFacility(long collaborationID, String facilityType) + { + ICollaboration collaboration = collaborationProvider.getCollaboration(collaborationID); + if (collaboration == null) + { + return null; + } + + return (Facility)collaboration.getFacility(facilityType); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageNotification.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageNotification.java new file mode 100644 index 0000000000..7de369b755 --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageNotification.java @@ -0,0 +1,52 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common.protocol; + +import org.eclipse.net4j.buddies.common.IMessage; +import org.eclipse.net4j.channel.IChannel; +import org.eclipse.net4j.signal.Request; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +import java.io.IOException; + +/** + * @author Eike Stepper + */ +public class MessageNotification extends Request +{ + private long collaborationID; + + private String facilityType; + + private IMessage message; + + public MessageNotification(IChannel channel, long collaborationID, String facilityType, IMessage message) + { + super(channel); + this.collaborationID = collaborationID; + this.facilityType = facilityType; + this.message = message; + } + + @Override + protected short getSignalID() + { + return ProtocolConstants.SIGNAL_MESSAGE; + } + + @Override + protected void requesting(ExtendedDataOutputStream out) throws IOException + { + out.writeLong(collaborationID); + out.writeString(facilityType); + ProtocolUtil.writeMessage(out, message); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/ProtocolConstants.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/ProtocolConstants.java new file mode 100644 index 0000000000..54bc1e835d --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/ProtocolConstants.java @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common.protocol; + +/** + * @author Eike Stepper + */ +public interface ProtocolConstants +{ + public static final String PROTOCOL_NAME = "buddies"; + + public static final short SIGNAL_OPEN_SESSION = 1; + + public static final short SIGNAL_LOAD_ACCOUNT = 2; + + public static final short SIGNAL_BUDDY_ADDED = 3; + + public static final short SIGNAL_BUDDY_REMOVED = 4; + + public static final short SIGNAL_BUDDY_STATE = 5; + + public static final short SIGNAL_INITIATE_COLLABORATION = 6; + + public static final short SIGNAL_COLLABORATION_INITIATED = 7; + + public static final short SIGNAL_COLLABORATION_LEFT = 8; + + public static final short SIGNAL_INVITE_BUDDIES = 9; + + public static final short SIGNAL_BUDDIES_INVITED = 10; + + public static final short SIGNAL_INSTALL_FACILITY = 11; + + public static final short SIGNAL_FACILITY_INSTALLED = 12; + + public static final short SIGNAL_MESSAGE = 13; + + public static final long TIMEOUT = 5000L; + + public static final byte STATE_AVAILABLE = 1; + + public static final byte STATE_LONESOME = 2; + + public static final byte STATE_AWAY = 3; + + public static final byte STATE_DO_NOT_DISTURB = 4; +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/ProtocolUtil.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/ProtocolUtil.java new file mode 100644 index 0000000000..674bfc6b0c --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/ProtocolUtil.java @@ -0,0 +1,225 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.internal.common.protocol; + +import org.eclipse.net4j.buddies.common.IAccount; +import org.eclipse.net4j.buddies.common.IBuddy; +import org.eclipse.net4j.buddies.common.IBuddyContainer; +import org.eclipse.net4j.buddies.common.IMessage; +import org.eclipse.net4j.util.WrappedException; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectStreamClass; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +/** + * @author Eike Stepper + */ +public final class ProtocolUtil +{ + private ProtocolUtil() + { + } + + public static void writeBuddies(ExtendedDataOutputStream out, Collection<IBuddy> buddies) throws IOException + { + if (buddies == null) + { + out.writeInt(0); + } + else + { + out.writeInt(buddies.size()); + for (IBuddy buddy : buddies) + { + out.writeString(buddy.getUserID()); + } + } + } + + public static Set<IBuddy> readBuddies(ExtendedDataInputStream in, IBuddyContainer buddyContainer) throws IOException + { + int size = in.readInt(); + Set<IBuddy> buddies = new HashSet<IBuddy>(); + for (int i = 0; i < size; i++) + { + String userID = in.readString(); + IBuddy buddy = buddyContainer.getBuddy(userID); + if (buddy != null) + { + buddies.add(buddy); + } + } + return buddies; + } + + public static String[] readUserIDs(ExtendedDataInputStream in) throws IOException + { + int size = in.readInt(); + String[] userIDs = new String[size]; + for (int i = 0; i < size; i++) + { + userIDs[i] = in.readString(); + } + + return userIDs; + } + + public static void writeAccount(ExtendedDataOutputStream out, IAccount account) throws IOException + { + if (account != null) + { + out.writeBoolean(true); + ObjectOutputStream oos = new ObjectOutputStream(out); + oos.writeObject(account); + } + else + { + out.writeBoolean(false); + } + } + + public static IAccount readAccount(ExtendedDataInputStream in) throws IOException + { + boolean exists = in.readBoolean(); + if (!exists) + { + return null; + } + + try + { + ObjectInputStream ois = new ObjectInputStream(in); + return (IAccount)ois.readObject(); + } + catch (IOException ex) + { + throw ex; + } + catch (Exception ex) + { + throw WrappedException.wrap(ex); + } + } + + public static void writeState(ExtendedDataOutputStream out, IBuddy.State state) throws IOException + { + switch (state) + { + case AVAILABLE: + out.writeByte(ProtocolConstants.STATE_AVAILABLE); + break; + + case LONESOME: + out.writeByte(ProtocolConstants.STATE_LONESOME); + break; + + case AWAY: + out.writeByte(ProtocolConstants.STATE_AWAY); + break; + + case DO_NOT_DISTURB: + out.writeByte(ProtocolConstants.STATE_DO_NOT_DISTURB); + break; + + default: + throw new IllegalArgumentException("Illegal state: " + state); + } + } + + public static IBuddy.State readState(ExtendedDataInputStream in) throws IOException + { + byte state = in.readByte(); + switch (state) + { + case ProtocolConstants.STATE_AVAILABLE: + return IBuddy.State.AVAILABLE; + + case ProtocolConstants.STATE_LONESOME: + return IBuddy.State.LONESOME; + + case ProtocolConstants.STATE_AWAY: + return IBuddy.State.AWAY; + + case ProtocolConstants.STATE_DO_NOT_DISTURB: + return IBuddy.State.DO_NOT_DISTURB; + + default: + throw new IllegalArgumentException("Illegal state: " + state); + } + } + + public static void writeFacilityTypes(ExtendedDataOutputStream out, String[] facilityTypes) throws IOException + { + if (facilityTypes == null) + { + out.writeInt(0); + } + else + { + out.writeInt(facilityTypes.length); + for (String facilityType : facilityTypes) + { + out.writeString(facilityType); + } + } + } + + public static String[] readFacilityTypes(ExtendedDataInputStream in) throws IOException + { + int size = in.readInt(); + String[] facilityTypes = new String[size]; + for (int i = 0; i < size; i++) + { + facilityTypes[i] = in.readString(); + } + + return facilityTypes; + } + + public static void writeMessage(ExtendedDataOutputStream out, IMessage message) throws IOException + { + ObjectOutputStream oos = new ObjectOutputStream(out); + oos.writeObject(message); + } + + public static IMessage readMessage(ExtendedDataInputStream in, final ClassLoader classLoader) throws IOException + { + try + { + ObjectInputStream ois = new ObjectInputStream(in) + { + @Override + protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException + { + String className = desc.getName(); + return classLoader.loadClass(className); + } + }; + + return (IMessage)ois.readObject(); + } + catch (IOException ex) + { + throw ex; + } + catch (Exception ex) + { + throw WrappedException.wrap(ex); + } + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/spi/common/ClientFacilityFactory.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/spi/common/ClientFacilityFactory.java new file mode 100644 index 0000000000..46c2aaf28f --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/spi/common/ClientFacilityFactory.java @@ -0,0 +1,26 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.spi.common; + +import org.eclipse.net4j.util.factory.Factory; + +/** + * @author Eike Stepper + */ +public abstract class ClientFacilityFactory extends Factory +{ + public static final String PRODUCT_GROUP = "org.eclipse.net4j.buddies.clientFacilities"; + + public ClientFacilityFactory(String type) + { + super(PRODUCT_GROUP, type); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/spi/common/Facility.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/spi/common/Facility.java new file mode 100644 index 0000000000..0b3ac8b72c --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/spi/common/Facility.java @@ -0,0 +1,66 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.spi.common; + +import org.eclipse.net4j.buddies.common.ICollaboration; +import org.eclipse.net4j.buddies.common.IFacility; +import org.eclipse.net4j.buddies.common.IMessage; +import org.eclipse.net4j.buddies.internal.common.Collaboration; +import org.eclipse.net4j.util.lifecycle.Lifecycle; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.PlatformObject; + +/** + * @author Eike Stepper + */ +public abstract class Facility extends Lifecycle implements IFacility +{ + private String type; + + private Collaboration collaboration; + + public Facility(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + + public Collaboration getCollaboration() + { + return collaboration; + } + + public void setCollaboration(ICollaboration collaboration) + { + this.collaboration = (Collaboration)collaboration; + } + + /** + * @see PlatformObject#getAdapter(Class) + */ + @SuppressWarnings("unchecked") + public Object getAdapter(Class adapter) + { + return Platform.getAdapterManager().getAdapter(this, adapter); + } + + public void sendMessage(IMessage message) + { + collaboration.sendMessage(collaboration.getID(), type, message); + } + + public abstract void handleMessage(IMessage message); +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/spi/common/Message.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/spi/common/Message.java new file mode 100644 index 0000000000..4a1879955e --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/spi/common/Message.java @@ -0,0 +1,52 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.spi.common; + +import org.eclipse.net4j.buddies.common.IMessage; +import org.eclipse.net4j.util.StringUtil; + +import org.eclipse.core.runtime.PlatformObject; + +import java.io.Serializable; + +/** + * @author Eike Stepper + */ +public abstract class Message extends PlatformObject implements IMessage, Serializable +{ + private static final long serialVersionUID = 1L; + + private String senderID; + + protected Message() + { + } + + public String getSenderID() + { + return senderID; + } + + public void setSenderID(String senderID) + { + this.senderID = senderID; + } + + protected String encode(String text) + { + return text.replaceAll(StringUtil.NL, "\n"); + } + + protected String decode(String text) + { + return text.replaceAll("\n", StringUtil.NL); + } +} diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/spi/common/ServerFacilityFactory.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/spi/common/ServerFacilityFactory.java new file mode 100644 index 0000000000..8bbca8a70e --- /dev/null +++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/spi/common/ServerFacilityFactory.java @@ -0,0 +1,26 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * 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: + * Eike Stepper - initial API and implementation + **************************************************************************/ +package org.eclipse.net4j.buddies.spi.common; + +import org.eclipse.net4j.util.factory.Factory; + +/** + * @author Eike Stepper + */ +public abstract class ServerFacilityFactory extends Factory +{ + public static final String PRODUCT_GROUP = "org.eclipse.net4j.buddies.serverFacilities"; + + public ServerFacilityFactory(String type) + { + super(PRODUCT_GROUP, type); + } +} |