diff options
Diffstat (limited to 'plugins/org.eclipse.jem.beaninfo.common')
40 files changed, 0 insertions, 4575 deletions
diff --git a/plugins/org.eclipse.jem.beaninfo.common/.classpath b/plugins/org.eclipse.jem.beaninfo.common/.classpath deleted file mode 100644 index efbd865d4..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/.classpath +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="beaninfoCommon"/> - <classpathentry kind="src" output="bin_vm_beaninfovm" path="vm_beaninfovm"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/plugins/org.eclipse.jem.beaninfo.common/.cvsignore b/plugins/org.eclipse.jem.beaninfo.common/.cvsignore deleted file mode 100644 index 9b8171d4d..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -bin -build.xml -bin_beaninfocommon -bin_vm_beaninfovm diff --git a/plugins/org.eclipse.jem.beaninfo.common/.options b/plugins/org.eclipse.jem.beaninfo.common/.options deleted file mode 100644 index 5b246520d..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/.options +++ /dev/null @@ -1,3 +0,0 @@ -org.eclipse.jem.beaninfo/debug/logtrace=default -org.eclipse.jem.beaninfo/debug/logtracefile=default -org.eclipse.jem.beaninfo/debug/loglevel=default diff --git a/plugins/org.eclipse.jem.beaninfo.common/.project b/plugins/org.eclipse.jem.beaninfo.common/.project deleted file mode 100644 index 2d66fd663..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/.project +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.jem.beaninfo.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> - <buildCommand> - <name>com.ibm.rtp.tools.rose.builder</name> - <arguments> - <dictionary> - <key>rose</key> - <value></value> - </dictionary> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - <nature>com.ibm.rtp.tools.rose.toolnature</nature> - </natures> -</projectDescription> diff --git a/plugins/org.eclipse.jem.beaninfo.common/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.jem.beaninfo.common/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 1e7f49867..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,294 +0,0 @@ -#Tue Mar 13 10:35:59 EDT 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 -org.eclipse.jdt.core.compiler.compliance=1.4 -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=error -org.eclipse.jdt.core.compiler.problem.unusedLocal=error -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.3 -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=1 -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_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false -org.eclipse.jdt.core.formatter.comment.format_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_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=150 -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=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=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=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_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=do not 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_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=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=150 -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=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false diff --git a/plugins/org.eclipse.jem.beaninfo.common/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.jem.beaninfo.common/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 855e13665..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Tue Feb 21 10:09:18 EST 2006 -eclipse.preferences.version=1 -formatter_profile=_jve -formatter_settings_version=10 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;org.eclipse.wtp;org.eclipse.jem;org.eclipse.ve.internal.cdm;org.eclipse.ve.internal.cde;org.eclipse.ve.internal.jcm;org.eclipse.ve.internal.java;org.eclipse.ve;com; -org.eclipse.jdt.ui.ondemandthreshold=3 -org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/> diff --git a/plugins/org.eclipse.jem.beaninfo.common/.settings/org.eclipse.pde.core.prefs b/plugins/org.eclipse.jem.beaninfo.common/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index 59dc1688c..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Thu Jun 16 11:09:08 EDT 2005 -eclipse.preferences.version=1 -selfhosting.binExcludes=/org.eclipse.jem.beaninfo/bin_vm_beaninfovm diff --git a/plugins/org.eclipse.jem.beaninfo.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.jem.beaninfo.common/META-INF/MANIFEST.MF deleted file mode 100644 index 196053c96..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.jem.beaninfo.common;singleton:=true -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.eclipse.jem.internal.beaninfo.common.BeaninfoCommonPlugin -Bundle-Vendor: %providerName -Bundle-Localization: plugin -Export-Package: org.eclipse.jem.beaninfo.common, - org.eclipse.jem.beaninfo.vm, - org.eclipse.jem.internal.beaninfo.common, - org.eclipse.jem.internal.beaninfo.vm -Require-Bundle: org.eclipse.jem.proxy;bundle-version="[2.0.0,3.0.0)", - org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)" -Eclipse-LazyStart: true -Bundle-RequiredExecutionEnvironment: J2SE-1.4 diff --git a/plugins/org.eclipse.jem.beaninfo.common/about.html b/plugins/org.eclipse.jem.beaninfo.common/about.html deleted file mode 100644 index afceed0cc..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/about.html +++ /dev/null @@ -1,25 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> -<html><head><title>About</title> - - - -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"></head><body lang="EN-US"> -<h2>About This Content</h2> - -<p>May 2, 2006</p> -<h3>License</h3> - -<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. -For purposes of the EPL, "Program" will mean the Content.</p> - -<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> - -</body></html>
\ No newline at end of file diff --git a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/beaninfo/common/IBaseBeanInfoConstants.java b/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/beaninfo/common/IBaseBeanInfoConstants.java deleted file mode 100644 index 3b63c764f..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/beaninfo/common/IBaseBeanInfoConstants.java +++ /dev/null @@ -1,155 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - - - */ -package org.eclipse.jem.beaninfo.common; - - - -/** - * Constants for the BaseBeanInfo for arguments. This class is common between - * the IDE and the remote vm so that these constants can be used on both sides. - * <p> - * These are constants used in FeatureAttributes as keys. The other special - * constants that are not keys in FeatureAttributes are left in BaseBeanInfo - * since they are not needed on both sides. - * - * @since 1.2.0 - */ -public interface IBaseBeanInfoConstants { - - /** - * Indicator used to describe a factory instantiation pattern. - * <p> - * This will be on the attributes of the BeanDescriptor for the factory class. It will be complete, in that if this - * factory is inherited from another factory, it must copy in the superclass's factory attribute. They won't be - * automatically merged. - * <p> - * The format is an Object[][]. The first dimension at index zero is for toolkit wide information and then indexes one and beyond are one for each creation method name. The second dimension is for one entry - * of classwide data and the rest are the data for - * each creation method. - * <p> - * The first entry at Object[0] will be <code>{initString, isShared, onFreeform}</code> where: - * <dl> - * <dt>initString - * <dd>The init string that should be used to create an instance of the toolkit if it needs one, or <code>null</code> if it doesn't - * need one (i.e. all static) or if the default constructor should be used. - * This is used when a component is dropped from the palette that is for a toolkit component. - * <dt>isShared - * <dd><code>false</code> if each call to the creation method should have a new instance of the toolkit. This means that the toolkit manages only - * one instance. This is more like a controller than a toolkit in this case. <code>true</code> if it should - * try to reuse the toolkit of the parent if it has one, or any other found toolkit of the same type, (i.e. a subtype will be acceptable). - * This is used when a component is dropped from the palette that is for a toolkit component. - * <dt>onFreeform - * <dd><code>true</code> if the toolkit is created that it should appear on the freeform surface to be selectable. This would be of use - * if the toolkit had properties that need to be set. If the toolkit had no properties then it doesn't need to be selectable and should - * not be on the freeform. Use <code>false</code> in that case. - * </dl> - * <p> - * The second and other entries of the array are of the format: - * <code>{methodName, returnedClassname, isStatic, Object[], ...}</code> where: - * <dl> - * <dt>methodName - * <dd>The name of the creation method this entry is for (String). - * <dt>returnedClassname - * <dd>The name of the class that is created and returned from the method (String). - * <dt>isStatic - * <dd><code>Boolean.TRUE</code> if the method is a static method, <code>Boolean.FALSE</code> if not. - * This is used when a component is dropped from the palette that is for a toolkit component. - * <dt>Object[] - * <dd>Zero or more arrays. The array contains the name of the properties for each method signature that each - * respective argument is for, or <code>null</code> if that arg is not a property. There can be more than one array if there - * is more than one factory method of the same name, and returns the same type, but what is different is only the number of arguments. - * If there is a - * factory method that has no properties as arguments or has no arguments, don't include an array for it. For example if there was only one factory method and it had no - * arguments then there would not be any arrays. - * Currently cannot handle where more than one method has the same number of arguments but different types for the arguments. - * </dl> - * <p> - * A example is: - * <pre><code> - * new Object[][] { - * {"new a.b.c.Toolkit(\"ABC\")", Boolean.TRUE, Boolean.FALSE}, - * {"createButton", "a.b.c.Button", Boolean.FALSE, new Object[] {"parent", "text"}, new Object[] {"parent"}} - * } - * </code> - * </pre> - * <p> - * This example says that this class is toolkit (factory). To construct an instead use <code>"new a.b.c.Toolkit(\"ABC\")"</code> and it is shared - * with other objects created from this factory instance. Also, the factory method is "createButton", returns an "a.b.c.Button", and it is - * not a static call (i.e. use a toolkit instance to create it). It has two forms of factory methods. One is two arguments where the first - * arg is the parent property and the second arg is the text property. The other form has only one argument, the parent property. - * <p> - * The way this is used in a palette entry to drop a new object that a toolkit can create is to have an expression of the form - * <code>{toolkit:classname}.factorymethod(args)</code>. So for the above example it would be <code>{toolkit:a.b.c.Toolkit}.createButton(parent)</code>. - * The classname <b>must</b> be fully-qualified and if an inner class it must use the "$" instead of "." for the name, i.e. a.b.c.Toolkit.InnerFactory - * would be a.b.c.Toolkit$InnerFactory. - * <p> - * <b>NOTE:</b> This is an EXPERIMENTAL API and can change in the future until committed. - * - * @since 1.2.0 - */ - public static final String FACTORY_CREATION = "FACTORY_CREATION";//$NON-NLS-1$ - - /** - * Category indicator for apply property arguments. Category is a pre-defined attribute name too. That is where the category is stored in a - * descriptor. - * - * @since 1.1.0 - */ - public static final String CATEGORY = "category"; //$NON-NLS-1$ - - /** - * Enumeration values indicator for apply property arguments. Enumeration values is a pre-defined attribute name too. That is where the - * enumeration values are stored. - * - * @since 1.1.0 - */ - public static final String ENUMERATIONVALUES = "enumerationValues";//$NON-NLS-1$ - - // The keys for icon file names, NOT THE java.awt.icon key. - public static final String ICONCOLOR16X16URL = "ICON_COLOR_16x16_URL"; //$NON-NLS-1$ - public static final String ICONCOLOR32X32URL = "ICON_COLOR_32x32_URL"; //$NON-NLS-1$ // Not used - public static final String ICONMONO16X16URL = "ICON_MONO_16x16_URL"; //$NON-NLS-1$ // Not used - public static final String ICONMONO32X32URL = "ICON_MONO_32x32_URL"; //$NON-NLS-1$ // Not used - - - /** - * FeatureAttribute key for explicit property changes. The value is a Boolean. <code>true</code> - * indicates that the Customize Bean customizer supplied by the BeanInfo will indicate which - * properties it has changed through firing {@link java.beans.PropertyChangeEvent} instead of the - * Visual Editor automatically trying to determine the set of changed properties. - * <p> - * The default if not set is <code>false</code>. - * - * @since 1.1.0.1 - */ - public static final String EXPLICIT_PROPERTY_CHANGE = "EXPLICIT_PROPERTY_CHANGE"; //$NON-NLS-1$ - - /** - * Used by Visual Editor as feature attribute key/value to indicate that it must create an implicit setting of a property(s). - * For example {@link javax.swing.JFrame#getContentPane()}. There must be a content pane - * set in the VE model so that users can drop the components on it. Setting this here - * means that the default content pane from the JFrame will show up in the editor to use. - * <p> - * This should be used with care in that not all properties are required to always show up. - * They can be queried when needed. - * <p> - * The value can be either a {@link String} for one property. Or it can be a {@link String[]} for more - * than one property. - * - * @since 1.2.0 - */ - public static final String REQUIRED_IMPLICIT_PROPERTIES = "requiredImplicitProperties"; //$NON-NLS-1$ - -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/BeanRecord.java b/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/BeanRecord.java deleted file mode 100644 index 724b0d811..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/BeanRecord.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - - - */ -package org.eclipse.jem.internal.beaninfo.common; - - -/** - * This is the data structure for sending the BeanDescriptor info from - * the BeanInfo vm to the IDE vm. It is serializable so that it can - * be serialized for transmission. - * <p> - * It contains the properties of the BeanDescriptor. - * @since 1.1.0 - */ -public class BeanRecord extends FeatureRecord { - - private static final long serialVersionUID = 1105979920664L; - - public String customizerClassName; - public boolean mergeInheritedProperties; - public boolean mergeInheritedOperations; - public boolean mergeInheritedEvents; - /** - * Names of properties that are to not be inherited in getAllProperties(). It is set only - * if the list is not the full list of inherited properties. - * If all inherited or mergeInheritedProperties is false, then the field will be <code>null</code>. Save space that way. - */ - public String[] notInheritedPropertyNames; - /** - * Names of operations that are to not be inherited in getEAllOperations(). It is set only - * if the list is not the full list of inherited operations. - * If all are inherited or if mergeInheritedOperations is false, then the field will be <code>null</code>. Save space that way. - */ - public String[] notInheritedOperationNames; - /** - * Names of events that are to not be inherited in getAllEvents(). It is set only - * if the list is not the full list of inherited events. - * If all are inherited or if mergeInheritedEvents is false, then the field will be <code>null</code>. Save space that way. - */ - public String[] notInheritedEventNames; - -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/BeaninfoCommonPlugin.java b/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/BeaninfoCommonPlugin.java deleted file mode 100644 index 492828b17..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/BeaninfoCommonPlugin.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jem.internal.beaninfo.common; -/* - - - */ - - -import org.eclipse.core.runtime.Plugin; - - -/** - * The plugin class for the org.eclipse.jem.internal.proxy.core plugin. - */ - -public class BeaninfoCommonPlugin extends Plugin { - public static final String PI_BEANINFO_PLUGINID = "org.eclipse.jem.beaninfo.common"; // Plugin ID, used for QualifiedName. //$NON-NLS-1$ - - private static BeaninfoCommonPlugin BEANINFO_PLUGIN = null; - - public BeaninfoCommonPlugin() { - BEANINFO_PLUGIN = this; - } - - /** - * Accessor method to get the singleton plugin. - */ - public static BeaninfoCommonPlugin getPlugin() { - return BEANINFO_PLUGIN; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/EventSetRecord.java b/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/EventSetRecord.java deleted file mode 100644 index b235382cc..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/EventSetRecord.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - - - */ -package org.eclipse.jem.internal.beaninfo.common; - - -/** - * This is the data structure for sending the EventSetDescriptor info from - * the BeanInfo vm to the IDE vm. It is serializable so that it can - * be serialized for transmission. - * <p> - * It contains the properties of the EventSetDescriptor. - * @since 1.1.0 - */ -public class EventSetRecord extends FeatureRecord { - - private static final long serialVersionUID = 1105980773420L; - - public ReflectMethodRecord addListenerMethod; - public String eventAdapterClassName; - public MethodRecord[] listenerMethodDescriptors; - public String listenerTypeName; - public ReflectMethodRecord removeListenerMethod; - public boolean inDefaultEventSet; - public boolean unicast; -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/FeatureAttributeValue.java b/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/FeatureAttributeValue.java deleted file mode 100644 index 5fd3cd54a..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/FeatureAttributeValue.java +++ /dev/null @@ -1,785 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - - - */ -package org.eclipse.jem.internal.beaninfo.common; - -import java.io.*; -import java.lang.reflect.*; -import java.util.Arrays; -import java.util.logging.Level; -import java.util.regex.Pattern; - -import org.eclipse.jem.internal.proxy.common.MapTypes; - - - -/** - * This is the value for a FeatureAttribute. It wrappers the true java object. - * Use the getObject method to get the java value. - * <p> - * We can only represent Strings, primitives, and arrays. (Primitives will converted - * to their wrapper class (e.g. Long), and byte, short, and int will move up to Long, - * and float will move up to Double). And any kind of valid array on the java BeanInfo side - * will be converted to an Object array on the IDE side. We don't have the capability to allow more complex objects - * because the IDE may not have the necessary classes available to it that - * the BeanInfo may of had available to it. Invalid objects will be represented - * by the singleton instance of {@link org.eclipse.jem.internal.beaninfo.common.InvalidObject}. - * <p> - * <b>Note:</b> - * Class objects that are values of Feature attributes on the java BeanInfo side will be - * converted to simple strings containing the classname when moved to the client (IDE) side. - * That is because the classes probably will not be available on the IDE side, but can be - * used to reconstruct the class when used back on the java vm side. - * @since 1.1.0 - */ -public class FeatureAttributeValue implements Serializable { - - private transient Object value; - private transient Object internalValue; - private boolean implicitValue; - private static final long serialVersionUID = 1105717634844L; - - /** - * Create the value with the given init string. - * <p> - * This is not meant to be used by clients. - * @param initString - * - * @since 1.1.0 - */ - public FeatureAttributeValue(String initString) { - // Use the init string to create the value. This is our - // own short-hand for this. - if (initString.startsWith(IMPLICIT)) { - setImplicitValue(true); - initString = initString.substring(IMPLICIT.length()); - } - value = parseString(initString); - } - - /** - * This is used when customer wants to fluff one up. - * - * - * @since 1.1.0 - */ - public FeatureAttributeValue() { - - } - - /** - * @return Returns the value. - * - * @since 1.1.0 - */ - public Object getValue() { - return value; - } - - /** - * Set a value. - * @param value The value to set. - * @since 1.1.0 - */ - public void setValue(Object value) { - this.value = value; - this.setInternalValue(null); - } - - /** - * Set the internal value. - * @param internalValue The internalValue to set. - * - * @since 1.1.0 - */ - public void setInternalValue(Object internalValue) { - this.internalValue = internalValue; - } - - /** - * This is the internal value. It is the <code>value</code> massaged into an easier to use form - * in the IDE. It will not be serialized out. It will not be reconstructed from an init string. - * <p> - * It does not need to be used. It will be cleared if - * a new value is set. For example, if the value is a complicated array (because you can't have - * special classes in the attribute value on the BeanInfo side) the first usage of this value can - * be translated into an easier form to use, such as a map. - * - * @return Returns the internalValue. - * - * @since 1.1.0 - */ - public Object getInternalValue() { - return internalValue; - } - - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - public String toString() { - if (value == null) - return super.toString(); - StringBuffer out = new StringBuffer(100); - if (isImplicitValue()) - out.append(IMPLICIT); - makeString(value, out); - return out.toString(); - } - - - /** - * Helper method to take the object and turn it into the - * string form that is required for EMF serialization. - * <p> - * This is used internally. It can be used for development - * purposes by clients, but they would not have any real - * runtime need for this. - * <p> - * Output format would be (there won't be any newlines in the actual string) - * <pre> - * String: "zxvzxv" - * Number: number - * Boolean: true or false - * Character: 'c' - * null: null - * - * Array: (all arrays will be turned into Object[]) - * [dim]{e1, e2} - * [dim1][dim2]{[dim1a]{e1, e2}, [dim2a]{e3, e4}} - * where en are objects that follow the pattern for single output above. - * - * Any invalid object (i.e. not one of the ones we handle) will be: - * INV - * - * Arrays of invalid types (not Object, String, Number, Boolean, Character, - * or primitives) will be marked as INV. - * </pre> - * @param value - * @return serialized form as a string. - * - * @since 1.1.0 - */ - public static String makeString(Object value) { - StringBuffer out = new StringBuffer(100); - makeString(value, out); - return out.toString(); - } - - private static final Pattern QUOTE = Pattern.compile("\""); // Pattern for searching for double-quote. Make it static so don't waste time compiling each time. //$NON-NLS-1$ - private static final String NULL = "null"; // Output string for null //$NON-NLS-1$ - private static final String INVALID = "INV"; // Invalid object flag. //$NON-NLS-1$ - private static final String IMPLICIT = "implicit,"; // Implicit flag. //$NON-NLS-1$ - - /* - * Used for recursive building of the string. - */ - private static void makeString(Object value, StringBuffer out) { - if (value == null) - out.append(NULL); - else if (value instanceof String || value instanceof Class) { - // String: "string" or "string\"stringend" if str included a double-quote. - out.append('"'); - // If class, turn value into the classname. - String str = value instanceof String ? (String) value : ((Class) value).getName(); - if (str.indexOf('"') != -1) { - // Replace double-quote with escape double-quote so we can distinquish it from the terminating double-quote. - out.append(QUOTE.matcher(str).replaceAll("\\\\\"")); // Don't know why we need the back-slash to be doubled for replaceall, but it doesn't work otherwise. //$NON-NLS-1$ - } else - out.append(str); - out.append('\"'); - } else if (value instanceof Number) { - // Will go out as either a integer number or a floating point number. - // When read back in it will be either a Long or a Double. - out.append(value); - } else if (value instanceof Boolean) { - // It will go out as either true or false. - out.append(value); - } else if (value instanceof Character) { - // Character: 'c' or '\'' if char was a quote. - out.append('\''); - Character c = (Character) value; - if (c.charValue() != '\'') - out.append(c.charValue()); - else - out.append("\\'"); //$NON-NLS-1$ - out.append('\''); - } else if (value.getClass().isArray()) { - // Handle array format. - Class type = value.getClass(); - // See if final type is a valid type. - Class ft = type.getComponentType(); - int dims = 1; - while (ft.isArray()) { - dims++; - ft = ft.getComponentType(); - } - if (ft == Object.class || ft == String.class || ft == Boolean.class || ft == Character.class || ft.isPrimitive() || Number.class.isAssignableFrom(ft)) { - // [length][][] {....} - out.append('['); - int length = Array.getLength(value); - out.append(length); - out.append(']'); - while(--dims > 0) { - out.append("[]"); //$NON-NLS-1$ - } - out.append('{'); - for (int i=0; i < length; i++) { - if (i != 0) - out.append(','); - makeString(Array.get(value, i), out); - } - out.append('}'); - } else - out.append(INVALID); // Any other kind of array is invalid. - } else { - out.append(INVALID); - } - } - - - /** - * Helper method to take the string input from EMF serialization and turn it - * into an Object. - * <p> - * This is used internally. It can be used for development - * purposes by clients, but they would not have any real - * runtime need for this. - * <p> - * The object will be an object, null, or an Object array. Any value - * that is invalid will be set to the {@link InvalidObject#INSTANCE} static - * instance. - * - * @param input - * @return object decoded from the input. - * - * @see #makeString(Object) - * @since 1.1.0 - */ - public static Object parseString(String input) { - return parseString(new StringParser(input)); - } - - private static class StringParser { - private int next=0; - private int length; - private String input; - - public StringParser(String input) { - this.input = input; - this.length = input.length(); - } - - public String toString() { - return "StringParser: \""+input+'"'; //$NON-NLS-1$ - } - - public void skipWhitespace() { - while(next < length) { - if (!Character.isWhitespace(input.charAt(next++))) { - next--; // Put it back as not yet read since it is not whitespace. - break; - } - } - } - - /** - * Return the next index - * @return - * - * @since 1.1.0 - */ - public int nextIndex() { - return next; - } - - /** - * Get the length of the input - * @return input length - * - * @since 1.1.0 - */ - public int getLength() { - return length; - } - - - /** - * Read the current character and go to next. - * @return current character - * - * @since 1.1.0 - */ - public char read() { - return next<length ? input.charAt(next++) : 0; - } - - /** - * Backup the parser one character. - * - * - * @since 1.1.0 - */ - public void backup() { - if (--next < 0) - next = 0; - } - - /** - * Peek at the char at the next index, but don't increment afterwards. - * @return - * - * @since 1.1.0 - */ - public char peek() { - return next<length ? input.charAt(next) : 0; - } - - /** - * Have we read the last char. - * @return <code>true</code> if read last char. - * - * @since 1.1.0 - */ - public boolean atEnd() { - return next>=length; - } - - /** - * Reset to the given next index. - * @param nextIndex the next index to do a read at. - * - * @since 1.1.0 - */ - public void reset(int nextIndex) { - if (nextIndex<=length) - next = nextIndex; - else - next = length; - } - - /** - * Skip the next number of chars. - * @param skip number of chars to skip. - * - * @since 1.1.0 - */ - public void skip(int skip) { - if ((next+=skip) > length) - next = length; - } - - /** - * Return the string input. - * @return the string input - * - * @since 1.1.0 - */ - public String getInput() { - return input; - } - - } - - /* - * Starting a parse for an object at the given index. - * Return the parsed object or InvalidObject if no - * object or if there was an error parsing. - */ - private static Object parseString(StringParser parser) { - parser.skipWhitespace(); - if (!parser.atEnd()) { - char c = parser.read(); - switch (c) { - case '"': - // Start of a quoted string. Scan for closing quote, ignoring escaped quotes. - int start = parser.nextIndex(); // Index of first char after '"' - char[] dequoted = null; // Used if there is an escaped quote. That is the only thing we support escape on, quotes. - int dequoteIndex = 0; - while (!parser.atEnd()) { - char cc = parser.read(); - if (cc == '"') { - // If we didn't dequote, then just do substring. - if (dequoted == null) - return parser.getInput().substring(start, parser.nextIndex()-1); // next is char after '"', so end of string index is index of '"' - else { - // We have a dequoted string. So turn into a string. - // Gather the last group - int endNdx = parser.nextIndex()-1; - parser.getInput().getChars(start, endNdx, dequoted, dequoteIndex); - dequoteIndex+= (endNdx-start); - return new String(dequoted, 0, dequoteIndex); - } - } else if (cc == '\\') { - // We had an escape, see if next is a quote. If it is we need to strip out the '\'. - if (parser.peek() == '"') { - if (dequoted == null) { - dequoted = new char[parser.getLength()]; - } - int endNdx = parser.nextIndex()-1; - parser.getInput().getChars(start, endNdx, dequoted, dequoteIndex); // Get up to, but not including '\' - dequoteIndex+= (endNdx-start); - // Now also add in the escaped quote. - dequoted[dequoteIndex++] = parser.read(); - start = parser.nextIndex(); // Next group is from next index. - } - } - } - break; // If we got here, it is invalid. - - case '-': - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - // Possible number. - // Scan to next non-digit, or not part of valid number. - boolean numberComplete = false; - boolean floatType = false; - boolean foundE = false; - boolean foundESign = false; - start = parser.nextIndex()-1; // We want to include the sign or first digit in the number. - while (!parser.atEnd() && !numberComplete) { - char cc = parser.read(); - switch (cc) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - break; // This is good, go on. - case '.': - if (floatType) - return InvalidObject.INSTANCE; // We already found a '.', two are invalid. - floatType = true; - break; - case 'e': - case 'E': - if (foundE) - return InvalidObject.INSTANCE; // We already found a 'e', two are invalid. - foundE = true; - floatType = true; // An 'e' makes it a float, if not already. - break; - case '+': - case '-': - if (!foundE || foundESign) - return InvalidObject.INSTANCE; // A +/- with no 'e' first is invalid. Or more than one sign. - foundESign = true; - break; - default: - // Anything else is end of number. - parser.backup(); // Back it up so that next parse will start with this char. - numberComplete = true; // So we stop scanning - break; - } - } - try { - if (!floatType) - return Long.valueOf(parser.getInput().substring(start, parser.nextIndex())); - else - return Double.valueOf(parser.getInput().substring(start, parser.nextIndex())); - } catch (NumberFormatException e) { - } - break; // If we got here, it is invalid. - - case 't': - case 'T': - case 'f': - case 'F': - // Possible boolean. - if (parser.getInput().regionMatches(true, parser.nextIndex()-1, "true", 0, 4)) { //$NON-NLS-1$ - parser.skip(3); // Skip over rest of string. - return Boolean.TRUE; - } else if (parser.getInput().regionMatches(true, parser.nextIndex()-1, "false", 0, 5)) { //$NON-NLS-1$ - parser.skip(4); // Skip over rest of string. - return Boolean.FALSE; - } - break; // If we got here, it is invalid. - - case '\'': - // Possible character - char cc = parser.read(); - // We really only support '\\' and '\'' anything else will be treated as ignore '\' because we don't know handle full escapes. - if (cc == '\\') - cc = parser.read(); // Get what's after it. - else if (cc == '\'') - break; // '' is invalid. - if (parser.peek() == '\'') { - // So next char after "character" is is a quote. This is good. - parser.read(); // Now consume the quote - return new Character(cc); - } - break; // If we got here, it is invalid. - - case 'n': - // Possible null. - if (parser.getInput().regionMatches(parser.nextIndex()-1, "null", 0, 4)) { //$NON-NLS-1$ - parser.skip(3); // Skip over rest of string. - return null; - } - break; // If we got here, it is invalid. - - case 'I': - // Possible invalid value. - if (parser.getInput().regionMatches(parser.nextIndex()-1, INVALID, 0, INVALID.length())) { - parser.skip(INVALID.length()-1); // Skip over rest of string. - return InvalidObject.INSTANCE; - } - break; // If we got here, it is invalid. - - case '[': - // Possible array. - // The next field should be a number, so we'll use parseString to get the number. - Object size = parseString(parser); - if (size instanceof Long) { - parser.skipWhitespace(); - cc = parser.read(); // Se if next is ']' - if (cc == ']') { - // Good, well-formed first dimension - int dim = 1; - boolean valid = true; - // See if there are more of just "[]". the number of them is the dim. - while (true) { - parser.skipWhitespace(); - cc = parser.read(); - if (cc == '[') { - parser.skipWhitespace(); - cc = parser.read(); - if (cc == ']') - dim++; - else { - // This is invalid. - valid = false; - parser.backup(); - break; // No more dims. - } - } else { - parser.backup(); - break; // No more dims. - } - } - if (valid) { - parser.skipWhitespace(); - cc = parser.read(); - if (cc == '{') { - // Good, we're at the start of the initialization code. - int[] dims = new int[dim]; - int len = ((Long) size).intValue(); - dims[0] = len; - Object array = Array.newInstance(Object.class, dims); - Arrays.fill((Object[]) array, null); // Because newInstance used above fills the array created with empty arrays when a dim>1. - - // Now we start filling it in. - Object invSetting = null; // What we will use for the invalid setting. If this is a multidim, this needs to be an array. Will not create it until needed. - Object entry = parseString(parser); // Get the first entry - Class compType = array.getClass().getComponentType(); - int i = -1; - while (true) { - if (++i < len) { - if (compType.isInstance(entry)) { - // Good, it can be assigned. - Array.set(array, i, entry); - } else { - // Bad. Need to set invalid. - if (invSetting == null) { - // We haven't created it yet. - if (dim == 1) - invSetting = InvalidObject.INSTANCE; // Great, one dimensional, we can use invalid directly - else { - // Multi-dim. Need to create a valid array that we can set. - int[] invDims = new int[dim - 1]; - Arrays.fill(invDims, 1); // Length one all of the way so that the final component can be invalid object - invSetting = Array.newInstance(Object.class, invDims); - Object finalEntry = invSetting; // Final array (with component type of just Object). Start with the full array and work down. - for (int j = invDims.length - 1; j > 0; j--) { - finalEntry = Array.get(finalEntry, 0); - } - Array.set(finalEntry, 0, InvalidObject.INSTANCE); - } - } - Array.set(array, i, invSetting); - } - } - - parser.skipWhitespace(); - cc = parser.read(); - if (cc == ',') { - // Good, get next - entry = parseString(parser); - } else if (cc == '}') { - // Good, reached the end. - break; - } else { - if (!parser.atEnd()) { - parser.backup(); - entry = parseString(parser); // Technically this should be invalid, but we'll let a whitespace also denote next entry. - } else { - // It's really screwed up. The string just ended. Log it. - Exception e = new IllegalStateException(parser.toString()); - try { - // See if Beaninfo plugin is available (we are running under eclipse). If so, use it, else just print to error. - // We may be in the remote vm and so it won't be available. - Class biPluginClass = Class.forName("org.eclipse.jem.internal.beaninfo.core.BeaninfoPlugin"); //$NON-NLS-1$ - Method getPlugin = biPluginClass.getMethod("getPlugin", null); //$NON-NLS-1$ - Method getLogger = biPluginClass.getMethod("getLogger", null); //$NON-NLS-1$ - Method log = getLogger.getReturnType().getMethod("log", new Class[] {Throwable.class, Level.class}); //$NON-NLS-1$ - Object biPlugin = getPlugin.invoke(null, null); - Object logger = getLogger.invoke(biPlugin, null); - log.invoke(logger, new Object[] {e, Level.WARNING}); - return InvalidObject.INSTANCE; - } catch (SecurityException e1) { - } catch (IllegalArgumentException e1) { - } catch (ClassNotFoundException e1) { - } catch (NoSuchMethodException e1) { - } catch (IllegalAccessException e1) { - } catch (InvocationTargetException e1) { - } catch (NullPointerException e1) { - } - e.printStackTrace(); // Not in eclipse, so just print stack trace. - return InvalidObject.INSTANCE; - } - } - } - - return array; - } - } - } - } - break; // If we got here, it is invalid. - } - } - return InvalidObject.INSTANCE; - } - - private void writeObject(ObjectOutputStream out) throws IOException { - // Write out any hidden stuff - out.defaultWriteObject(); - writeObject(value, out); - } - - private void writeObject(Object value, ObjectOutputStream out) throws IOException { - if (value == null) - out.writeObject(value); - else { - if (value instanceof Class) - out.writeObject(((Class) value).getName()); - else if (!value.getClass().isArray()) { - if (value instanceof String || value instanceof Number || value instanceof Boolean || value instanceof Character) - out.writeObject(value); - else - out.writeObject(InvalidObject.INSTANCE); - } else { - // Array is tricky. See if it is one we can handle, if not then invalid. - // To indicate array, we will first write out the Class of the Component type of the array (it will - // be converted to be Object or Object[]...). - // This will be the clue that an array is coming. Class values will never - // be returned, so that is how we can tell it is an array. - // Note: The reason we are using the component type (converted to Object) is because to reconstruct on the other side we need - // to use the component type plus length of the array's first dimension. - // - // We can not just serialize the array in the normal way because it may contain invalid values, and we need to - // handle that. Also, if it wasn't an Object array, we need to turn it into an object array. We need consistency - // in that it should always be an Object array. - // So output format will be: - // Class(component type) - // int(size of first dimension) - // Object(value of first entry) - Actually use out writeObject() format to allow nesting of arrays. - // Object(value of second entry) - // ... up to size of dimension. - Class type = value.getClass(); - // See if final type is a valid type. - Class ft = type.getComponentType(); - int dims = 1; - while (ft.isArray()) { - dims++; - ft = ft.getComponentType(); - } - if (ft == Object.class || ft == String.class || ft == Boolean.class || ft == Character.class || ft.isPrimitive() || ft == Class.class || Number.class.isAssignableFrom(ft)) { - String jniType = dims == 1 ? "java.lang.Object" : MapTypes.getJNITypeName("java.lang.Object", dims-1); //$NON-NLS-1$ //$NON-NLS-2$ - try { - Class componentType = Class.forName(jniType); - out.writeObject(componentType); - int length = Array.getLength(value); - out.writeInt(length); - for (int i = 0; i < length; i++) { - writeObject(Array.get(value, i), out); - } - } catch (ClassNotFoundException e) { - // This should never happen. Object arrays are always available. - } - } else - out.writeObject(InvalidObject.INSTANCE); - } - } - } - - - private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - // Read in any hidden stuff - in.defaultReadObject(); - - value = readActualObject(in); - } - - private Object readActualObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - Object val = in.readObject(); - if (val instanceof Class) { - // It must be an array. Only Class objects that come in are Arrays of Object. - int length = in.readInt(); - Object array = Array.newInstance((Class) val, length); - for (int i = 0; i < length; i++) { - Array.set(array, i, readActualObject(in)); - } - return array; - } else - return val; // It is the value itself. - } - - - /** - * Is this FeatureAttributeValue an implicit value, i.e. one that came from - * BeanInfo Introspection and not from an override file. - * - * @return Returns the implicitValue. - * - * @since 1.2.0 - */ - public boolean isImplicitValue() { - return implicitValue; - } - - - /** - * Set the implicit value flag. - * @param implicitValue The implicitValue to set. - * - * @see #isImplicitValue() - * @since 1.2.0 - */ - public void setImplicitValue(boolean implicitValue) { - this.implicitValue = implicitValue; - } - -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/FeatureRecord.java b/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/FeatureRecord.java deleted file mode 100644 index 9d392fca3..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/FeatureRecord.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - - - */ -package org.eclipse.jem.internal.beaninfo.common; - -import java.io.Serializable; - - -/** - * This is the data structure for sending the FeatureDescriptor info from - * the BeanInfo vm to the IDE vm. It is serializable so that it can - * be serialized for transmission. - * <p> - * It contains the properties of the FeatureDescriptor. - * @since 1.1.0 - */ -public class FeatureRecord implements Serializable { - - private static final long serialVersionUID = 1105979276648L; - - public String name; // Some decorators use this and others don't. Each decorator type will decide whether this is of importance. - public String displayName; - public String shortDescription; - public String category; - public boolean expert; - public boolean hidden; - public boolean preferred; - public String[] attributeNames; - public FeatureAttributeValue[] attributeValues; -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/IBeanInfoIntrospectionConstants.java b/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/IBeanInfoIntrospectionConstants.java deleted file mode 100644 index e067449fa..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/IBeanInfoIntrospectionConstants.java +++ /dev/null @@ -1,129 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - - - */ -package org.eclipse.jem.internal.beaninfo.common; - - -/** - * These are constants needed for transferring BeanInfo results from the BeanInfo VM. - * @since 1.1.0 - */ -public interface IBeanInfoIntrospectionConstants { - - /** - * Introspection bit flag indicating do the BeanDecorator. Sent to ModelingBeanInfo.introspect method. - * @since 1.1.0 - */ - public static final int DO_BEAN_DECOR = 0x1; - - /** - * Introspection bit flag indicating do the Properties. Sent to ModelingBeanInfo.introspect method. - * @since 1.1.0 - */ - public static final int DO_PROPERTIES = 0x2; - - /** - * Introspection bit flag indicating do the Methods. Sent to ModelingBeanInfo.introspect method. - * @since 1.1.0 - */ - public static final int DO_METHODS = 0x4; - - /** - * Introspection bit flag indicating do the Events. Sent to ModelingBeanInfo.introspect method. - * @since 1.1.0 - */ - public static final int DO_EVENTS = 0x8; - - /** - * BeanDecorator was sent command id. - * <p> - * This will be sent to callBack(int id, InputStream is). The InputStream will be Objects (use ObjectInputStream). - * The stream will be broken into sections. - * Each section will be headed by the command id of that section (e.g. BEAN_DECORATOR_SENT or PROPERTY_DECORATORS_SENT). - * Following the command id will be the type of input specific data. - * <p> - * The data following the command id will be a BeanRecord from the ObjectInputStream. - * - * @see BeanRecord - * @see org.eclipse.jem.internal.proxy.core.ICallback#calledBackStream(int, InputStream) - * @since 1.1.0 - */ - public static final int BEAN_DECORATOR_SENT = 1; - - /** - * PropertyDecorators send command id. - * <p> - * This will be sent to callBack(int id, InputStream is). The InputStream will be Objects (use ObjectInputStream). - * The stream will be broken into sections. - * Each section will be headed by the command id of that section (e.g. BEAN_DECORATOR_SENT or PROPERTY_DECORATORS_SENT). - * Following the command id will be the type of input specific data. - * <p> - * The first object will be an int and will be the number of properties and each object after that - * will be a PropertyRecord/IndexedPropertyRecord. - * - * @see org.eclipse.jem.internal.proxy.core.ICallback#calledBackStream(int, InputStream) - * @see PropertyRecord - * @see IndexedPropertyRecord - */ - public static final int PROPERTY_DECORATORS_SENT = 2; - - /** - * MethodDecorators send command id. - * <p> - * This will be sent to callBack(int id, InputStream is). The InputStream will be Objects (use ObjectInputStream). - * The stream will be broken into sections. - * Each section will be headed by the command id of that section (e.g. BEAN_DECORATOR_SENT or PROPERTY_DECORATORS_SENT). - * Following the command id will be the type of input specific data. - * <p> - * The InputStream will be Objects (use ObjectInputStream). - * The first object will be an int and will be the number of methods and each object after that - * will be a MethodRecord. - * - * @see org.eclipse.jem.internal.proxy.core.ICallback#calledBackStream(int, InputStream) - * @see MethodRecord - */ - public static final int METHOD_DECORATORS_SENT = 3; - - /** - * EventSetDecorators send command id. - * <p> - * This will be sent to callBack(int id, InputStream is). The InputStream will be Objects (use ObjectInputStream). - * The stream will be broken into sections. - * Each section will be headed by the command id of that section (e.g. BEAN_DECORATOR_SENT or PROPERTY_DECORATORS_SENT). - * Following the command id will be the type of input specific data. - * <p> - * The first object will be an int and will be the number of events and each object after that - * will be a EventSetRecord. - * - * @see org.eclipse.jem.internal.proxy.core.ICallback#calledBackStream(int, InputStream) - * @see MethodRecord - */ - public static final int EVENT_DECORATORS_SENT = 4; - - /** - * Done send command id. - * <p> - * This will be sent to callBack(int id, InputStream is). The InputStream will be Objects (use ObjectInputStream). - * The stream will be broken into sections. - * Each section will be headed by the command id of that section (e.g. BEAN_DECORATOR_SENT or PROPERTY_DECORATORS_SENT). - * Following the command id will be the type of input specific data. - * <p> - * This command id means there is no more data and it should return. - * - * @see org.eclipse.jem.internal.proxy.core.ICallback#calledBackStream(int, InputStream) - * @see MethodRecord - */ - public static final int DONE = 5; - -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/IndexedPropertyRecord.java b/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/IndexedPropertyRecord.java deleted file mode 100644 index 88d291615..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/IndexedPropertyRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - - - */ -package org.eclipse.jem.internal.beaninfo.common; - - -/** - * This is the data structure for sending the IndexedPropertyDescriptor info from - * the BeanInfo vm to the IDE vm. It is serializable so that it can - * be serialized for transmission. - * <p> - * It contains the properties of the IndexedPropertyDescriptor. - * @since 1.1.0 - */ -public class IndexedPropertyRecord extends PropertyRecord { - private static final long serialVersionUID = 1105983227990L; - - public ReflectMethodRecord indexedReadMethod; - public ReflectMethodRecord indexedWriteMethod; - public String indexedPropertyTypeName; -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/InvalidObject.java b/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/InvalidObject.java deleted file mode 100644 index 7e731ceba..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/InvalidObject.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - - - */ -package org.eclipse.jem.internal.beaninfo.common; - -import java.io.ObjectStreamException; -import java.io.Serializable; - - -/** - * An indicator object for invalid object type. This is used with feature attribute - * values from the BeanInfo classes. We can only handle certain types when we - * bring them over from the BeanInfo VM. That is because the classes instantiated - * in the BeanInfo class may not be available in the IDE. So any invalid value - * will be replaced by this class instance. - * <p> - * This is a singleton class. - * There will be one instance (InvalidObject.INSTANCE) in the system. That way - * "==" can be used to test for it. - * - * @since 1.1.0 - */ -public class InvalidObject implements Serializable { - - /** - * Singleton instance of InvalidObject. - * @since 1.1.0 - */ - public static final InvalidObject INSTANCE = new InvalidObject(); - - private static final long serialVersionUID = 1105643804370L; - - /* - * Nobody else should create one of these. - */ - private InvalidObject() { - } - - private Object readResolve() throws ObjectStreamException { - return INSTANCE; - } -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/MethodRecord.java b/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/MethodRecord.java deleted file mode 100644 index 4b37be9ed..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/MethodRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - - - */ -package org.eclipse.jem.internal.beaninfo.common; - - -/** - * This is the data structure for sending the MethodDescriptor info from - * the BeanInfo vm to the IDE vm. It is serializable so that it can - * be serialized for transmission. - * <p> - * It contains the properties of the MethodDescriptor. - * @since 1.1.0 - */ -public class MethodRecord extends FeatureRecord { - - private static final long serialVersionUID = 1105982213110L; - - /** - * Method signature for the method this record describes. - */ - public ReflectMethodRecord methodForDescriptor; - /** - * Parameter records array. It may be <code>null</code> if there aren't any. - */ - public ParameterRecord[] parameters; -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/ParameterRecord.java b/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/ParameterRecord.java deleted file mode 100644 index 5b2f370bb..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/ParameterRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - - - */ -package org.eclipse.jem.internal.beaninfo.common; - - -/** - * This is the data structure for sending the ParameterDescriptor info from - * the BeanInfo vm to the IDE vm. It is serializable so that it can - * be serialized for transmission. - * <p> - * It contains the properties of the ParameterDescriptor. - * <p> - * The only field of importance is the name, and that comes from FeatureRecord. - * @since 1.1.0 - */ -public class ParameterRecord extends FeatureRecord { - - private static final long serialVersionUID = 1105982438955L; - -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/PropertyRecord.java b/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/PropertyRecord.java deleted file mode 100644 index 3e032412d..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/PropertyRecord.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - - - */ -package org.eclipse.jem.internal.beaninfo.common; - - -/** - * This is the data structure for sending the PropertyDescriptor info from - * the BeanInfo vm to the IDE vm. It is serializable so that it can - * be serialized for transmission. - * <p> - * It contains the properties of the PropertyDescriptor. - * @since 1.1.0 - */ -public class PropertyRecord extends FeatureRecord { - private static final long serialVersionUID = 1105979276648L; - - public String propertyEditorClassName; - public String propertyTypeName; - public ReflectMethodRecord readMethod; - public ReflectMethodRecord writeMethod; - public ReflectFieldRecord field; - public boolean bound; - public boolean constrained; - public Boolean designTime; -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/ReflectFieldRecord.java b/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/ReflectFieldRecord.java deleted file mode 100644 index 98298394a..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/ReflectFieldRecord.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - - - */ -package org.eclipse.jem.internal.beaninfo.common; - -import java.io.Serializable; - - -/** - * This is the data structure for sending the java.lang.reflect.Field info from - * the BeanInfo vm to the IDE vm. It is serializable so that it can - * be serialized for transmission. - * <p> - * It contains the properties of the java.lang.reflect.Field. - * @since 1.1.0 - */ -public class ReflectFieldRecord implements Serializable { - - private static final long serialVersionUID = 1105981512453L; - - public String className; - public String fieldName; - public boolean readOnly; -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/ReflectMethodRecord.java b/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/ReflectMethodRecord.java deleted file mode 100644 index 9f112910d..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/beaninfoCommon/org/eclipse/jem/internal/beaninfo/common/ReflectMethodRecord.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - - - */ -package org.eclipse.jem.internal.beaninfo.common; - -import java.io.Serializable; - - -/** - * This is the data structure for sending the java.lang.reflect.Method info from - * the BeanInfo vm to the IDE vm. It is serializable so that it can - * be serialized for transmission. - * <p> - * It contains the properties of the java.lang.reflect.Method. - * @since 1.1.0 - */ -public class ReflectMethodRecord implements Serializable { - - private static final long serialVersionUID = 1105981512773L; - - public String className; - public String methodName; - public String[] parameterTypeNames; // Maybe null if no parameters. -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/build.properties b/plugins/org.eclipse.jem.beaninfo.common/build.properties deleted file mode 100644 index 2796a2af3..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/build.properties +++ /dev/null @@ -1,27 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2006 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -src.excludes = **/.cvsignore -bin.includes = plugin.xml,\ - plugin.properties,\ - about.html,\ - .options,\ - META-INF/,\ - vm/beaninfovm.jar,\ - . -jars.compile.order = .,\ - vm/beaninfovm.jar -src.includes = about.html,\ - proxy.jars -source.. = beaninfoCommon/ -source.vm/beaninfovm.jar = vm_beaninfovm/ -output.vm/beaninfovm.jar = bin_vm_beaninfovm/ -output.. = bin/ - diff --git a/plugins/org.eclipse.jem.beaninfo.common/plugin.properties b/plugins/org.eclipse.jem.beaninfo.common/plugin.properties deleted file mode 100644 index 307f67af7..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/plugin.properties +++ /dev/null @@ -1,18 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2005 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -# -# $Source: /cvsroot/webtools/jeetools.move/webtools.javaee.git/plugins/org.eclipse.jem.beaninfo.common/Attic/plugin.properties,v $ -# $Revision: 1.1 $ $Date: 2007/03/14 03:13:03 $ -# - - -pluginName=Java EMF Model BeanInfo (Introspection) Common Support -providerName = Eclipse.org diff --git a/plugins/org.eclipse.jem.beaninfo.common/plugin.xml b/plugins/org.eclipse.jem.beaninfo.common/plugin.xml deleted file mode 100644 index 7943bf249..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/plugin.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.0"?> -<plugin> - - - -</plugin> diff --git a/plugins/org.eclipse.jem.beaninfo.common/proxy.jars b/plugins/org.eclipse.jem.beaninfo.common/proxy.jars deleted file mode 100644 index 23309123e..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/proxy.jars +++ /dev/null @@ -1,2 +0,0 @@ -vm/beaninfovm.jar=/org.eclipse.jem.beaninfo/bin_vm_beaninfovm/
-beaninfocommon.jar=/org.eclipse.jem.beaninfo/bin_beaninfocommon/
\ No newline at end of file diff --git a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/beaninfo/vm/BaseBeanInfo.java b/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/beaninfo/vm/BaseBeanInfo.java deleted file mode 100644 index 4f8a589d2..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/beaninfo/vm/BaseBeanInfo.java +++ /dev/null @@ -1,850 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jem.beaninfo.vm; - -/* - - - */ - -import java.awt.Image; -import java.beans.*; -import java.lang.reflect.*; - -import org.eclipse.jem.beaninfo.common.IBaseBeanInfoConstants; - - -/** - * A BaseBeanInfo that provides common support for BeanInfos within the JEM environment. - * - * @since 1.1.0 - */ -public abstract class BaseBeanInfo extends SimpleBeanInfo implements IBaseBeanInfoConstants { - - // Constants to use to create all descriptors etc. - protected static java.util.ResourceBundle RESBUNDLE = java.util.ResourceBundle.getBundle("org.eclipse.jem.beaninfo.vm.beaninfo"); //$NON-NLS-1$ - - /** - * Bound indicator for apply property arguments. - * - * @since 1.1.0 - */ - public static final String BOUND = "bound";//$NON-NLS-1$ - - /** - * Constrained indicator for apply property arguments. - * - * @since 1.1.0 - */ - public static final String CONSTRAINED = "constrained";//$NON-NLS-1$ - - /** - * Property editor class indicator for apply property arguments. - * - * @since 1.1.0 - */ - public static final String PROPERTYEDITORCLASS = "propertyEditorClass";//$NON-NLS-1$ - - /** - * Read Method indicator for apply property arguments. - * - * @since 1.1.0 - */ - public static final String READMETHOD = "readMethod";//$NON-NLS-1$ - - /** - * Write method indicator for apply property arguments. - * - * @since 1.1.0 - */ - public static final String WRITEMETHOD = "writeMethod";//$NON-NLS-1$ - - /** - * Displayname indicator for apply property arguments. - * - * @since 1.1.0 - */ - public static final String DISPLAYNAME = "displayName";//$NON-NLS-1$ - - /** - * Expert indicator for apply property arguments. - * - * @since 1.1.0 - */ - public static final String EXPERT = "expert";//$NON-NLS-1$ - - /** - * Hidden indicator for apply property arguments. - * - * @since 1.1.0 - */ - public static final String HIDDEN = "hidden";//$NON-NLS-1$ - - /** - * Preferred indicator for apply property arguments. - * - * @since 1.1.0 - */ - public static final String PREFERRED = "preferred";//$NON-NLS-1$ - - /** - * Short description indicator for apply property arguments. - * - * @since 1.1.0 - */ - public static final String SHORTDESCRIPTION = "shortDescription";//$NON-NLS-1$ - - /** - * Customizer class indicator for apply property arguments. - * - * @since 1.1.0 - */ - public static final String CUSTOMIZERCLASS = "customizerClass";//$NON-NLS-1$ - - /** - * In Default eventset indicator for apply property arguments. - * - * @since 1.1.0 - */ - public static final String INDEFAULTEVENTSET = "inDefaultEventSet";//$NON-NLS-1$ - - /** - * This is a Feature Attribute Key. When this key exists, the value is a java.lang.reflect.Field. It means this property - * is a field and not a getter/setter. The getter/setter will be ignored and the property type will be the type of the field. - * <p> - * At this time, do not use field on an indexed property. This is currently an undefined situation. - * - * @since 1.1.0 - */ - public static final String FIELDPROPERTY = "field"; //$NON-NLS-1$ - - /** - * Obscure indicator for apply property arguments. Obsure is a pre-defined attribute name too. That is where the obscure setting is stored. - * <p> - * Obsure means most users don't need it. In the future such features won't even be cached so as to reduce the in-memory costs. Currently this - * flag is ignored. - * - * @since 1.1.0 - */ - public static final String OBSCURE = "ivjObscure";//$NON-NLS-1$ - - /** - * Design time indicator for apply property arguments. Design time is a pre-defined attribute name too. That is where the design time setting is - * stored. - * <p> - * Design time means: - * <ul> - * <li>Not set: Will be a property that can be connected to, and shows on property sheet (if not hidden). - * <li><code>true</code>: Special property (it will show on property sheet if not hidden), but it can't be connected to. Usually this is a - * property that is fluffed up for the IDE purposes but doesn't have a get/set method. This means it is a property for design time and not for - * runtime. - * <li><code>false</code>: This property will not show up on property sheet but it can be connected to. - * </ul> - * - * @since 1.1.0 - */ - public static final String DESIGNTIMEPROPERTY = "ivjDesignTimeProperty"; //$NON-NLS-1$ - - /** - * EventAdapterClass indicator for apply property arguments. Event adapter class is a pre-defined attribute name too. That is where the event - * adapter is stored. - * <p> - * Adapter class for eventSetDescriptors that provide default no-op implementation of the interface methods. For example - * <code>java.awt.event.WindowListener</code> has an adapter of <code>java.awt.event.WindowAdapter</code>. What is stored is actually the - * class name, not the class itself. - * - * @since 1.1.0 - */ - public static final String EVENTADAPTERCLASS = "eventAdapterClass"; //$NON-NLS-1$ - - - public static final boolean JVM_1_3 = System.getProperty("java.version", "").startsWith("1.3"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - - /** - * Empty args list for those descriptors that don't have arguments. - * @since 1.1.0 - */ - public static final Object[] EMPTY_ARGS = new Object[0]; - - /** - * Capitalize the string. This uppercases only the first character. So if you have property name of "abc" it will become "Abc". - * - * @param s - * @return string with first letter capitalized. - * - * @since 1.1.0 - */ - public static String capitalize(String s) { - if (s.length() == 0) { return s; } - char chars[] = s.toCharArray(); - chars[0] = Character.toUpperCase(chars[0]); - return new String(chars); - } - - /** - * Create a BeanDescriptor object given an array of keyword/value arguments. Use the keywords defined in this class, e.g. BOUND, EXPERT, etc. - * - * @param cls - * bean for which the bean descriptor is being created. - * @param args - * arg pairs, [0] keyword, [1] value, [2] keyword, [3] value, etc. or null if no args - * @return new bean descriptor - * - * @since 1.1.0 - */ - public static BeanDescriptor createBeanDescriptor(Class cls, Object[] args) { - Class customizerClass = null; - - if (args != null) { - /* Find the specified customizerClass */ - for (int i = 0; i < args.length; i += 2) { - if (CUSTOMIZERCLASS.equals(args[i])) { - customizerClass = (Class) args[i + 1]; - break; - } - } - } - - BeanDescriptor bd = new BeanDescriptor(cls, customizerClass); - - if (args != null) { - for (int i = 0; i < args.length; i += 2) { - String key = (String) args[i]; - Object value = args[i + 1]; - setFeatureDescriptorValue(bd, key, value); - } - } - return bd; - } - - /** - * Create a beans EventSetDescriptor given the following: - * - * @param cls - * The bean class - * @param name - * Name of event set - * @param args - * arg pairs, [0] keyword, [1] value, [2] keyword, [3] value, etc. or null if no args. - * @param lmds - * array of MethodDescriptors defining the listener methods - * @param listenerType - * type of listener - * @param addListenerName - * add listener method name - * @param removeListenerNameremove - * listener method name - * @return new event set descriptor - * @since 1.1.0 - */ - public static EventSetDescriptor createEventSetDescriptor(Class cls, String name, Object[] args, MethodDescriptor[] lmds, Class listenerType, - String addListenerName, String removeListenerName) { - EventSetDescriptor esd = null; - Class[] paramTypes = { listenerType}; - try { - java.lang.reflect.Method addMethod = null; - java.lang.reflect.Method removeMethod = null; - try { - /* get addListenerMethod with parameter types. */ - addMethod = cls.getMethod(addListenerName, paramTypes); - } catch (Exception ie) { - throwError(ie, java.text.MessageFormat.format(RESBUNDLE.getString("Cannot_get_the_meth1_EXC_"), //$NON-NLS-1$ - new Object[] { addListenerName})); - } - ; - try { - /* get removeListenerMethod with parameter types. */ - removeMethod = cls.getMethod(removeListenerName, paramTypes); - } catch (Exception ie) { - throwError(ie, java.text.MessageFormat.format(RESBUNDLE.getString("Cannot_get_the_meth1_EXC_"), //$NON-NLS-1$ - new Object[] { removeListenerName})); - } - ; - - esd = new EventSetDescriptor(name, listenerType, lmds, addMethod, removeMethod); - } catch (Exception ie) { - throwError(ie, java.text.MessageFormat.format(RESBUNDLE.getString("Cannot_create_the_E1_EXC_"), //$NON-NLS-1$ - new Object[] { name})); - } - ; - if (args != null) { - // set the event set descriptor properties - for (int i = 0; i < args.length; i += 2) { - String key = (String) args[i]; - Object value = args[i + 1]; - if (INDEFAULTEVENTSET.equals(key)) { - esd.setInDefaultEventSet(((Boolean) value).booleanValue()); - } else - setFeatureDescriptorValue(esd, key, value); - } - } - return esd; - } - - /** - * Create a bean's MethodDescriptor. - * - * @param cls - * class of the method. - * @param name - * name of the method. - * @param args - * arg pairs, [0] keyword, [1] value, [2] keyword, [3] value, etc. or null if no args - * @param params - * parameter descriptors or <code>null</code> if no parameter descriptors. - * @param paramTypes - * parameter types - * @return new method descriptor - * - * @since 1.1.0 - */ - public static MethodDescriptor createMethodDescriptor(Class cls, String name, Object[] args, ParameterDescriptor[] params, Class[] paramTypes) { - MethodDescriptor md = null; - try { - java.lang.reflect.Method aMethod = null; - try { - /* getMethod with parameter types. */ - aMethod = cls.getMethod(name, paramTypes); - } catch (Exception ie) { - throwError(ie, java.text.MessageFormat.format(RESBUNDLE.getString("Cannot_get_the_meth1_EXC_"), //$NON-NLS-1$ - new Object[] { name})); - } - ; - if (params != null && params.length > 0) - md = new MethodDescriptor(aMethod, params); - else - md = new MethodDescriptor(aMethod); - } catch (Exception ie) { - throwError(ie, java.text.MessageFormat.format(RESBUNDLE.getString("Cannot_create_Method_EXC_"), //$NON-NLS-1$ - new Object[] { name})); - } - ; - if (args != null) { - // set the method properties - for (int i = 0; i < args.length; i += 2) { - String key = (String) args[i]; - Object value = args[i + 1]; - setFeatureDescriptorValue(md, key, value); - } - } - return md; - } - - private static PropertyDescriptor createOtherPropertyDescriptor(String name, Class cls) throws IntrospectionException { - Method readMethod = null; - Method writeMethod = null; - String base = capitalize(name); - Class[] parameters = new Class[0]; - - // First we try boolean accessor pattern - try { - readMethod = cls.getMethod("is" + base, parameters);//$NON-NLS-1$ - } catch (Exception ex1) { - } - if (readMethod == null) { - try { - // Else we try the get accessor pattern. - readMethod = cls.getMethod("get" + base, parameters);//$NON-NLS-1$ - } catch (Exception ex2) { - // Find by matching methods of the class - readMethod = findMethod(cls, "get" + base, 0);//$NON-NLS-1$ - } - } - - if (readMethod == null) { - // For write-only properties, find the write method - writeMethod = findMethod(cls, "set" + base, 1);//$NON-NLS-1$ - } else { - // In Sun's code, reflection fails if there are two - // setters with the same name and the first setter located - // does not have the same return type of the getter. - // This fixes that. - parameters = new Class[1]; - parameters[0] = readMethod.getReturnType(); - try { - writeMethod = cls.getMethod("set" + base, parameters);//$NON-NLS-1$ - } catch (Exception ex3) { - } - } - // create the property descriptor - if ((readMethod != null) || (writeMethod != null)) { - return new PropertyDescriptor(name, readMethod, writeMethod); - } else { - throw new IntrospectionException(java.text.MessageFormat.format(RESBUNDLE.getString("Cannot_find_the_acc1_EXC_"), //$NON-NLS-1$ - new Object[] { name})); - } - } - - /** - * Create a beans parameter descriptor. - * - * @param name - * name of parameter - * @param args - * arg pairs, [0] keyword, [1] value, [2] keyword, [3] value, etc. or null if no args - * @return new parameter descriptor - * - * @since 1.1.0 - */ - public static ParameterDescriptor createParameterDescriptor(String name, Object[] args) { - ParameterDescriptor pd = null; - try { - pd = new ParameterDescriptor(); - } catch (Exception ie) { - throwError(ie, java.text.MessageFormat.format(RESBUNDLE.getString("Cannot_create_Param1_EXC_"), //$NON-NLS-1$ - new Object[] { name})); - } - ; - // set the name - pd.setName(name); - if (args != null) { - // set the method properties - for (int i = 0; i < args.length; i += 2) { - String key = (String) args[i]; - Object value = args[i + 1]; - setFeatureDescriptorValue(pd, key, value); - } - } - return pd; - } - - private static Method GETCLASS; - - static { - try { - GETCLASS = Object.class.getMethod("getClass", null); //$NON-NLS-1$ - } catch (SecurityException e) { - } catch (NoSuchMethodException e) { - } - } - /** - * Create a property descriptor describing a field property. - * <p> - * Note: This is non-standard. The VE knows how to handle this, but any one else using BeanInfo will see this as a property with - * no getter or setter. - * @param name - * @param field - * @param args arg pairs, [0] keyword, [1] value, [2] keyword, [3] value, etc. or null if no args - * @return - * - * @since 1.1.0 - */ - public static PropertyDescriptor createFieldPropertyDescriptor(String name, Field field, Object[] args) { - try { - PropertyDescriptor pd = new PropertyDescriptor(name, null, null); - pd.setValue(FIELDPROPERTY, field); // Set the field property so we know it is a field. - applyFieldArguments(pd, args); - // Need to set in a phony read method because Introspector will throw it away otherwise. We just use Object.getClass for this. - // We will ignore the property type for fields. If used outside of VE then it will look like a class property. - pd.setReadMethod(GETCLASS); - return pd; - } catch (IntrospectionException e) { - throwError(e, java.text.MessageFormat.format(RESBUNDLE.getString("Cannot_create_the_P1_EXC_"), //$NON-NLS-1$ - new Object[] { name})); - return null; - } - } - - /** - * Create a bean's property descriptor. - * - * @param cls - * class of who owns the property (usually the bean). It is used to look up get/set methods for the property. - * @param name - * name of the property. It will use get{Name} and set{Name} to find get/set methods. - * @param args - * arg pairs, [0] keyword, [1] value, [2] keyword, [3] value, etc. - * @return new property descriptor - * - * @since 1.1.0 - */ - public static PropertyDescriptor createPropertyDescriptor(Class cls, String name, Object[] args) { - PropertyDescriptor pd = null; - try { - // Create assuming that the getter/setter follows reflection patterns - pd = new PropertyDescriptor(name, cls); - } catch (IntrospectionException e) { - // Try creating a property descriptor for read-only, write-only - // or if Sun's reflection fails - try { - pd = createOtherPropertyDescriptor(name, cls); - } catch (IntrospectionException ie) { - throwError(ie, java.text.MessageFormat.format(RESBUNDLE.getString("Cannot_create_the_P1_EXC_"), //$NON-NLS-1$ - new Object[] { name})); - } - } - - applyPropertyArguments(pd, args, cls); - - return pd; - } - - - /** - * Create a new PropertyDescriptor based upon the PD sent in. It will clone the sent in one, and apply the args to override any specific setting. - * Class cls is used for finding read/write methods, if any. - * - * This is used when wanting to override only a few specific settings from a property descriptor from the super class. - * - * @param fromPDS - * The PropertyDescriptor array to find the entry to clone. It will be changed in place in the array. - * @param name - * The name of the property to find and clone and override. - * @param cls - * The class to use to find read/write methods in args. If no read/write methods specified, then this may be null. - * @param args - * The arguments to override from fromPD. arg pairs, [0] keyword, [1] value, [2] keyword, [3] value, etc. or null if none to override - */ - public void replacePropertyDescriptor(PropertyDescriptor[] pds, String name, Class cls, Object[] args) { - PropertyDescriptor pd = null; - int iPD = findPropertyDescriptor(pds, name); - if (iPD == -1) - return; - PropertyDescriptor fromPD = pds[iPD]; - try { - - pd = pds[iPD] = new PropertyDescriptor(fromPD.getName(), null, null); - } catch (IntrospectionException e) { - throwError(e, java.text.MessageFormat.format(RESBUNDLE.getString("Cannot_create_the_P1_EXC_"), //$NON-NLS-1$ - new Object[] { fromPD.getName()})); - } - - // Now copy over the contents of fromPD. - clonePropertySettings(fromPD, pd); - - // Now apply the overrides - applyPropertyArguments(pd, args, cls); - return; - } - - private void clonePropertySettings(PropertyDescriptor fromPD, PropertyDescriptor pd) { - try { - pd.setReadMethod(fromPD.getReadMethod()); - pd.setWriteMethod(fromPD.getWriteMethod()); - pd.setPropertyEditorClass(fromPD.getPropertyEditorClass()); - pd.setBound(fromPD.isBound()); - pd.setConstrained(fromPD.isConstrained()); - cloneFeatureSettings(fromPD, pd); - } catch (IntrospectionException e) { - throwError(e, java.text.MessageFormat.format(RESBUNDLE.getString("Cannot_create_the_P1_EXC_"), //$NON-NLS-1$ - new Object[] { fromPD.getName()})); - } - } - - private void cloneFeatureSettings(FeatureDescriptor fromFD, FeatureDescriptor fd) { - fd.setExpert(fromFD.isExpert()); - fd.setHidden(fromFD.isHidden()); - fd.setPreferred(fromFD.isPreferred()); - fd.setShortDescription(fromFD.getShortDescription()); - fd.setDisplayName(fromFD.getDisplayName()); - - java.util.Enumeration keys = fromFD.attributeNames(); - while (keys.hasMoreElements()) { - String key = (String) keys.nextElement(); - Object value = fromFD.getValue(key); - fd.setValue(key, value); - } - } - - /* - * The common property arguments between field and standard properties. - */ - private static boolean applyCommonPropertyArguments(PropertyDescriptor pd, String key, Object value) { - if (BOUND.equals(key)) { - pd.setBound(((Boolean) value).booleanValue()); - } else if (CONSTRAINED.equals(key)) { - pd.setConstrained(((Boolean) value).booleanValue()); - } else if (PROPERTYEDITORCLASS.equals(key)) { - pd.setPropertyEditorClass((Class) value); - } else if (FIELDPROPERTY.equals(key)) - return true; // This should not be applied except through createFieldProperty. - else - return false; - return true; - - } - - private static void applyPropertyArguments(PropertyDescriptor pd, Object[] args, Class cls) { - if (args != null) { - for (int i = 0; i < args.length; i += 2) { - String key = (String) args[i]; - Object value = args[i + 1]; - - if (!applyCommonPropertyArguments(pd, key, value)) { - if (READMETHOD.equals(key)) { - String methodName = (String) value; - Method method; - try { - method = cls.getMethod(methodName, new Class[0]); - pd.setReadMethod(method); - } catch (Exception e) { - throwError(e, java.text.MessageFormat.format(RESBUNDLE.getString("{0}_no_read_method_EXC_"), //$NON-NLS-1$ - new Object[] { cls, methodName})); - } - } else if (WRITEMETHOD.equals(key)) { - String methodName = (String) value; - try { - if (methodName == null) { - pd.setWriteMethod(null); - } else { - Method method; - Class type = pd.getPropertyType(); - method = cls.getMethod(methodName, new Class[] { type}); - pd.setWriteMethod(method); - } - } catch (Exception e) { - throwError(e, java.text.MessageFormat.format(RESBUNDLE.getString("{0}_no_write_method_EXC_"), //$NON-NLS-1$ - new Object[] { cls, methodName})); - } - } else { - // arbitrary value - setFeatureDescriptorValue(pd, key, value); - } - } - } - } - } - - private static void applyFieldArguments(PropertyDescriptor pd, Object[] args) { - if (args != null) { - for (int i = 0; i < args.length; i += 2) { - String key = (String) args[i]; - Object value = args[i + 1]; - - if (!applyCommonPropertyArguments(pd, key, value)) { - if (READMETHOD.equals(key)) { - // ignored for field. - } else if (WRITEMETHOD.equals(key)) { - // ignored for field. - } else { - // arbitrary value - setFeatureDescriptorValue(pd, key, value); - } - } - } - } - } - - /** - * Find the method by comparing (name & parameter size) against the methods in the class. This is an expensive call and should be used only if - * getMethod with specific parameter types can't find method. - * - * @return java.lang.reflect.Method - * @param aClass - * java.lang.Class - * @param methodName - * java.lang.String - * @param parameterCount - * int - */ - public static java.lang.reflect.Method findMethod(java.lang.Class aClass, java.lang.String methodName, int parameterCount) { - try { - /* - * Since this method attempts to find a method by getting all methods from the class, this method should only be called if getMethod - * cannot find the method. - */ - java.lang.reflect.Method methods[] = aClass.getMethods(); - for (int index = 0; index < methods.length; index++) { - java.lang.reflect.Method method = methods[index]; - if ((method.getParameterTypes().length == parameterCount) && (method.getName().equals(methodName))) { return method; } - ; - } - ; - } catch (java.lang.Throwable exception) { - return null; - } - ; - return null; - } - - /** - * Find a property descriptor of a given name in the list. - * - * @param pds - * The array of property descriptors to search, may be null. - * @param name - * The name to search for. - * @return The found property descriptor index, or -1 if not found. - */ - public static int findPropertyDescriptor(PropertyDescriptor[] pds, String name) { - for (int i = 0; i < pds.length; i++) { - if (name.equals(pds[i].getName())) - return i; - } - return -1; - } - - /* - * (non-Javadoc) - * - * @see java.beans.BeanInfo#getDefaultEventIndex() - */ - public int getDefaultEventIndex() { - return -1; - } - - /* - * (non-Javadoc) - * - * @see java.beans.BeanInfo#getDefaultPropertyIndex() - */ - public int getDefaultPropertyIndex() { - return -1; - } - - - /* (non-Javadoc) - * @see java.beans.SimpleBeanInfo#getBeanDescriptor() - */ - public BeanDescriptor getBeanDescriptor() { - // Default is to create an empty one. - return createBeanDescriptor(getBeanClass(), EMPTY_ARGS); - } - - /** - * Implementation for BeanInfo. This implementation will return the BeanInfo of the superclass. - * - * @see BeanInfo#getAdditionalBeanInfo() - * @since 1.1.0 - */ - public BeanInfo[] getAdditionalBeanInfo() { - try { - BeanInfo[] result = new BeanInfo[] { Introspector.getBeanInfo(getBeanClass().getSuperclass())}; - PropertyDescriptor[] oPDs = result[0].getPropertyDescriptors(); - PropertyDescriptor[] nPDs = overridePropertyDescriptors(oPDs); - if (oPDs != nPDs) - result[0] = new OverridePDBeanInfo(result[0], nPDs); - return result; - } catch (IntrospectionException e) { - return new BeanInfo[0]; - } - } - - private static class OverridePDBeanInfo implements BeanInfo { - - private BeanInfo originalBeanInfo; - - private PropertyDescriptor[] overridePDs; - - public OverridePDBeanInfo(BeanInfo bi, PropertyDescriptor[] pds) { - originalBeanInfo = bi; - overridePDs = pds; - } - - public BeanInfo[] getAdditionalBeanInfo() { - return originalBeanInfo.getAdditionalBeanInfo(); - } - - public BeanDescriptor getBeanDescriptor() { - return originalBeanInfo.getBeanDescriptor(); - } - - public int getDefaultEventIndex() { - return originalBeanInfo.getDefaultEventIndex(); - } - - public int getDefaultPropertyIndex() { - return originalBeanInfo.getDefaultPropertyIndex(); - } - - public EventSetDescriptor[] getEventSetDescriptors() { - return originalBeanInfo.getEventSetDescriptors(); - } - - public Image getIcon(int iconKind) { - return originalBeanInfo.getIcon(iconKind); - } - - public MethodDescriptor[] getMethodDescriptors() { - return originalBeanInfo.getMethodDescriptors(); - } - - public PropertyDescriptor[] getPropertyDescriptors() { - return overridePDs; - } - } - - /** - * Allow overrides to parent beaninfo. Subclasses should override this method if they wish to override and change any inherited properties. This - * allows removal of inherited properties or changes of specific properties (such as change from hidden to not hidden). - * - * Note: If there any changes, this must return a DIFFERENT array. If it returns the same array, then the changes will not be accepted. If just - * overriding, should use pds.clone() to get the new array and then change the specific entries. - * - * @param pds - * @return The new changed array or the same array if no changes. - * @since 1.1.0 - */ - protected PropertyDescriptor[] overridePropertyDescriptors(PropertyDescriptor[] pds) { - return pds; - } - - /** - * Get the bean class this beaninfo is for. Used by subclasses to quickly get the bean class without having to code it over and over. - * - * @return bean class for this beaninfo. - * - * @since 1.1.0 - */ - public abstract Class getBeanClass(); - - /** - * Called whenever the bean information class throws an exception. By default it prints a message and then a stacktrace to sys err. - * - * @param exception - * java.lang.Throwable - * @since 1.1.0 - */ - public void handleException(Throwable exception) { - System.err.println(RESBUNDLE.getString("UNCAUGHT_EXC_")); //$NON-NLS-1$ - exception.printStackTrace(); - } - - private static void setFeatureDescriptorValue(FeatureDescriptor fd, String key, Object value) { - if (DISPLAYNAME.equals(key)) { - fd.setDisplayName((String) value); - } else if (EXPERT.equals(key)) { - fd.setExpert(((Boolean) value).booleanValue()); - } else if (HIDDEN.equals(key)) { - fd.setHidden(((Boolean) value).booleanValue()); - } else if (PREFERRED.equals(key)) { - fd.setPreferred(((Boolean) value).booleanValue()); - if (JVM_1_3) { - // Bug in 1.3 doesn't preserve the preferred flag, so we will put it into the attributes too. - fd.setValue(PREFERRED, value); - } - } else if (SHORTDESCRIPTION.equals(key)) { - fd.setShortDescription((String) value); - } - // Otherwise assume an arbitrary-named value - // Assume that the FeatureDescriptor private hashTable\ - // contains only arbitrary-named attributes - else { - fd.setValue(key, value); - } - } - - /** - * Fatal errors are handled by calling this method. By default it throws an Error exception. - * - * @param e - * exception exception message placed into the new Error thrown. - * @param s - * message added to exception message. <code>null</code> if nothing to add. - * - * @throws Error - * turns exception into an Error. - * @since 1.1.0 - */ - protected static void throwError(Exception e, String s) { - throw new Error(e.toString() + " " + s);//$NON-NLS-1$ - } -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/beaninfo/vm/basebeaninfonls.properties b/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/beaninfo/vm/basebeaninfonls.properties deleted file mode 100644 index 820de973a..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/beaninfo/vm/basebeaninfonls.properties +++ /dev/null @@ -1,31 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2005 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -# -# $Source: /cvsroot/webtools/jeetools.move/webtools.javaee.git/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/beaninfo/vm/Attic/basebeaninfonls.properties,v $ -# $Revision: 1.1 $ $Date: 2007/03/14 03:13:03 $ -# - - -# -# Properties for the IvjBeanInfo -# - -# -# IvjBeanInfo Strings -# -Cannot_get_the_meth1_EXC_ = IWAV0011E Cannot get the method {0}. -Cannot_create_the_E1_EXC_ = IWAV0012E Cannot create the EventSetDescriptor for {0}. -Cannot_create_Method_EXC_ = IWAV0013E Cannot create the MethodDescriptor for {0}. -Cannot_find_the_acc1_EXC_ = IWAV0014E Cannot find at least the write or read accessor for property {0}. -Cannot_create_Param1_EXC_ = IWAV0015E Cannot create the ParameterDescriptor for {0}. -Cannot_create_the_P1 = Cannot create the PropertyDescriptor for {0}. -{0}_no_read_method_EXC_ = IWAV0016E Class {0} doesn''t have the requested read accessor {1}. -{0}_no_write_method_EXC_ = IWAV0017E Class {0} doesn''t have the requested write accessor {1}. diff --git a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/beaninfo/vm/beaninfo.properties b/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/beaninfo/vm/beaninfo.properties deleted file mode 100644 index d6eb1285d..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/beaninfo/vm/beaninfo.properties +++ /dev/null @@ -1,32 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2005 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -# -# $Source: /cvsroot/webtools/jeetools.move/webtools.javaee.git/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/beaninfo/vm/Attic/beaninfo.properties,v $ -# $Revision: 1.1 $ $Date: 2007/03/14 03:13:03 $ -# - - -# -# Properties for the VCE Beaninfo -# - -# -# IvjBeanInfo Strings -# -Cannot_get_the_meth1_EXC_ = IWAV0007E Cannot get the method {0}. -Cannot_create_the_E1_EXC_ = IWAV0008E Cannot create the EventSetDescriptor for {0}. -Cannot_create_Method_EXC_ = IWAV0009E Cannot create the MethodDescriptor for {0}. -Cannot_find_the_acc1_EXC_ = IWAV0010E Cannot find at least the write or read accessor for property {0}. -Cannot_create_Param1_EXC_ = IWAV0146E Cannot create the ParameterDescriptor for {0}. -Cannot_create_the_P1_EXC_ = IWAV0147E Cannot create the PropertyDescriptor for {0}. -{0}_no_read_method_EXC_ = IWAV0148E Class {0} doesn''t have the requested read accessor {1}. -{0}_no_write_method_EXC_ = IWAV0149E Class {0} doesn''t have the requested write accessor {1}. -UNCAUGHT_EXC_ = IWAV0123E --------- UNCAUGHT EXCEPTION --------- diff --git a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/BeanDescriptorEquality.java b/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/BeanDescriptorEquality.java deleted file mode 100644 index 3c99de2db..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/BeanDescriptorEquality.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jem.internal.beaninfo.vm; -/* - - - */ - -import java.beans.*; -/** - * Equality tester for BeanDescriptors - */ -public class BeanDescriptorEquality extends FeatureDescriptorEquality { - static void INIT() { - try { - MAP_EQUALITY.put(BeanDescriptor.class, (BeanDescriptorEquality.class).getConstructor(new Class[] {BeanDescriptor.class})); - } catch (NoSuchMethodException e) { - } - } - - /** - * Constructor for BeanDescriptorEquality. - */ - public BeanDescriptorEquality() { - super(); - } - - - public BeanDescriptorEquality(BeanDescriptor descr) { - super(descr); - } - - /** - * Calculate the hashcode for the current feature, add this - * to the hashcode received from super.calculateHashCode - * and return the new value. - * - * NOTE: for subclasses, it is MANDITORY that the first line be: - * int hashcode = super.calculateHashCode(); - * and the last line be: - * return hashcode*31 + (your calculated hashcode for just this subclass); - */ - protected int calculateHashCode() { - int hashcode = super.calculateHashCode(); - BeanDescriptor bd = (BeanDescriptor) fFeature; - int hc = bd.getBeanClass().hashCode(); - if (bd.getCustomizerClass() != null) - hc += bd.getCustomizerClass().hashCode(); - - return hashcode*31 + hc; - } - - public boolean equals(Object obj) { - if (identityTest(obj)) - return true; - if (!super.equals(obj)) - return false; - - BeanDescriptor ob = (BeanDescriptor) ((FeatureDescriptorEquality) obj).fFeature; - BeanDescriptor fb = (BeanDescriptor) fFeature; - - if (ob.getBeanClass() != fb.getBeanClass()) - return false; - if (ob.getCustomizerClass() != fb.getCustomizerClass()) - return false; - - return true; - } -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/EventSetDescriptorEquality.java b/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/EventSetDescriptorEquality.java deleted file mode 100644 index b53aa8a72..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/EventSetDescriptorEquality.java +++ /dev/null @@ -1,145 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jem.internal.beaninfo.vm; -/* - - - */ - -import java.beans.*; -import java.util.*; -import java.lang.reflect.Method; -/** - * Equality tester for EventSetDescriptors - */ -public class EventSetDescriptorEquality extends FeatureDescriptorEquality { - - static void INIT() { - try { - MAP_EQUALITY.put(EventSetDescriptor.class, (EventSetDescriptorEquality.class).getConstructor(new Class[] {EventSetDescriptor.class})); - } catch (NoSuchMethodException e) { - } - } - - private ArrayList fListenerMethodDescriptors; // Array of MethodDescriptorEquality's. - - /** - * Constructor for EventSetDescriptorEquality. - */ - public EventSetDescriptorEquality() { - super(); - } - - - public EventSetDescriptorEquality(EventSetDescriptor descr) { - super(descr); - } - - /** - * A new feature is being set into this object, - * clear any cache members so that they can be reconstructed. - * - * NOTE: Subclasses - remember to call super.clearFeature(); - */ - protected void clearFeature() { - super.clearFeature(); - fListenerMethodDescriptors = null; - } - - protected ArrayList listenerMethodDescriptors() { - if (fListenerMethodDescriptors == null) { - MethodDescriptor[] mds = ((EventSetDescriptor) fFeature).getListenerMethodDescriptors(); - fListenerMethodDescriptors = new ArrayList(mds.length); - for (int i=0; i<mds.length; i++) - fListenerMethodDescriptors.add(new MethodDescriptorEquality(mds[i])); - } - return fListenerMethodDescriptors; - } - - /** - * Calculate the hashcode for the current feature, add this - * to the hashcode received from super.calculateHashCode - * and return the new value. - * - * NOTE: for subclasses, it is MANDITORY that the first line be: - * int hashcode = super.calculateHashCode(); - * and the last line be: - * return hashcode*31 + (your calculated hashcode for just this subclass); - */ - protected int calculateHashCode() { - int hashcode = super.calculateHashCode(); - EventSetDescriptor bd = (EventSetDescriptor) fFeature; - int hc = bd.getAddListenerMethod().hashCode(); - Method[] methods = bd.getListenerMethods(); - int mhc = 0; - for (int i=0; i<methods.length; i++) - mhc = mhc*31 + methods[i].hashCode(); - hc += mhc; - hc += listenerMethodDescriptors().hashCode(); - hc += bd.getListenerType().hashCode(); - hc += bd.getRemoveListenerMethod().hashCode(); - hc += (bd.isInDefaultEventSet() ? Boolean.TRUE : Boolean.FALSE).hashCode(); - hc += (bd.isUnicast() ? Boolean.TRUE : Boolean.FALSE).hashCode(); - - return hashcode*31 + hc; - } - - - public boolean equals(Object obj) { - if (identityTest(obj)) - return true; - - if (!super.equals(obj)) - return false; - - EventSetDescriptor oe = (EventSetDescriptor) ((FeatureDescriptorEquality) obj).fFeature; - EventSetDescriptor fe = (EventSetDescriptor) fFeature; - - EventSetDescriptorEquality oee = (EventSetDescriptorEquality) obj; - - if (!oe.getAddListenerMethod().equals(fe.getAddListenerMethod())) - return false; - if (!java.util.Arrays.equals(oe.getListenerMethods(), fe.getListenerMethods())) - return false; - if (oe.getListenerType() != fe.getListenerType()) - return false; - if (oe.getRemoveListenerMethod() != fe.getRemoveListenerMethod()) - return false; - if (oe.isInDefaultEventSet() != fe.isInDefaultEventSet()) - return false; - if (oe.isUnicast() != oe.isUnicast()) - return false; - - if (fListenerMethodDescriptors != null || oee.fListenerMethodDescriptors != null) { - // We are in a Map lookup situation, so one side has listener method equalities, so we will compare that way. - if (!oee.listenerMethodDescriptors().equals(listenerMethodDescriptors())) - return false; - } else { - // We are in the building the list phases, don't waste space building entire list. - MethodDescriptor[] ours = fe.getListenerMethodDescriptors(); - MethodDescriptor[] theirs = oe.getListenerMethodDescriptors(); - if (ours.length != theirs.length) - return false; - if (ours.length > 0) { - MethodDescriptorEquality workingOurs = new MethodDescriptorEquality(); - MethodDescriptorEquality workingThiers = new MethodDescriptorEquality(); - for (int i = 0; i < ours.length; i++) { - workingOurs.setFeature(ours[i]); - workingThiers.setFeature(theirs[i]); - if (!workingOurs.equals(workingThiers)) - return false; - } - } - } - - return true; - } -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/FeatureDescriptorEquality.java b/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/FeatureDescriptorEquality.java deleted file mode 100644 index 9888393fd..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/FeatureDescriptorEquality.java +++ /dev/null @@ -1,201 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jem.internal.beaninfo.vm; -/* - - - */ - -import java.beans.*; -import java.util.*; -import java.lang.reflect.*; -/** - * This object is used to test for semantic equality (equals()) - * between feature objects. It is needed because Feature's don't - * provide a semantic equality, only an identity equality. Need - * semantic equality so that keys in map can be found equal - * semantically. - */ - -public class FeatureDescriptorEquality { - protected FeatureDescriptor fFeature; - - private HashMap fValues; // The key/values for this feature. We grab them out - // so that we don't have to keep re-getting them for equality - // compares. This is done the first time needed in the equals - // statement. - - private int fHashCode = 0; // Hashcode of this equality object. The hashcode for the feature is expensive - // so we will calculate it once (the assumption is that - // features once created aren't changed, which for our - // purposes here in beaninfo land is good). - - protected static HashMap MAP_EQUALITY = new HashMap(10); // Map from descriptor to equality type. - static { - try { - MAP_EQUALITY.put(FeatureDescriptor.class, (FeatureDescriptorEquality.class).getConstructor(new Class[] {FeatureDescriptor.class})); - } catch (NoSuchMethodException e) { - } - // Need to set up the others. - BeanDescriptorEquality.INIT(); - EventSetDescriptorEquality.INIT(); - IndexedPropertyDescriptorEquality.INIT(); - MethodDescriptorEquality.INIT(); - ParameterDescriptorEquality.INIT(); - } - - /** - * Create the appropriate descriptor equality for this object. - */ - public static FeatureDescriptorEquality createEquality(FeatureDescriptor descr) { - try { - return (FeatureDescriptorEquality) ((Constructor) MAP_EQUALITY.get(descr.getClass())).newInstance(new Object[] {descr}); - } catch (IllegalAccessException e) { - } catch (InstantiationException e) { - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - return null; - } - - public FeatureDescriptorEquality() { - } - - /** - * NOTE: Every subclass needs to implement an override for the methods: - * calculateHashCode - * equals - * clearFeature - if it has any cache values - */ - - public FeatureDescriptorEquality(FeatureDescriptor feature) { - setFeature(feature); - } - - public final void setFeature(FeatureDescriptor feature) { - clearFeature(); - fFeature = feature; - } - - /** - * A new feature is being set into this object, - * clear any cache members so that they can be reconstructed. - * - * NOTE: Subclasses - remember to call super.clearFeature(); - */ - protected void clearFeature() { - fValues = null; - fHashCode = 0; - } - - public final int hashCode() { - if (fHashCode == 0) - fHashCode = calculateHashCode(); - return fHashCode; - } - - protected final HashMap values() { - if (fValues == null) { - fValues = new HashMap(5); - - Enumeration keys = fFeature.attributeNames(); - while (keys.hasMoreElements()) { - String key = (String) keys.nextElement(); - fValues.put(key, fFeature.getValue(key)); - } - } - return fValues; - } - - /** - * Calculate the hashcode for the current feature, add this - * to the hashcode received from super.calculateHashCode - * and return the new value. - * - * NOTE: for subclasses, it is MANDITORY that the first line be: - * int hashcode = super.calculateHashCode(); - * and the last line be: - * return hashcode*31 + (your calculated hashcode for just this subclass); - */ - protected int calculateHashCode() { - int hashcode = 0; - if (fFeature.getName() != null) - hashcode += fFeature.getName().hashCode(); - - if (fFeature.getDisplayName() != fFeature.getName()) - hashcode += fFeature.getDisplayName().hashCode(); - if (fFeature.getShortDescription() != fFeature.getDisplayName()) - hashcode += fFeature.getShortDescription().hashCode(); - - hashcode += (fFeature.isExpert() ? Boolean.TRUE : Boolean.FALSE).hashCode(); - hashcode += (fFeature.isHidden() ? Boolean.TRUE : Boolean.FALSE).hashCode(); - hashcode += (fFeature.isPreferred() ? Boolean.TRUE : Boolean.FALSE).hashCode(); - - hashcode += values().hashCode(); - return hashcode; - } - - /** - * equals: See if this is equal semantically. - * - * NOTE: Every subclass needs to implement this and - * the first few lines should be: - * if (identityTest()) - * return true; - * if (!super.equals(obj)) - * return false; - */ - - public boolean equals(Object obj) { - if (identityTest(obj)) - return true; - if (!(obj instanceof FeatureDescriptorEquality)) - return false; - - FeatureDescriptorEquality ofe = (FeatureDescriptorEquality) obj; - FeatureDescriptor of = ofe.fFeature; - - if (fFeature.getClass() != of.getClass()) - return false; - - if (!fFeature.getName().equals(of.getName())) - return false; - if (!fFeature.getDisplayName().equals(of.getDisplayName())) - return false; - if (!fFeature.getShortDescription().equals(of.getShortDescription())) - return false; - if (fFeature.isExpert() != of.isExpert() || - fFeature.isHidden() != of.isHidden() || - fFeature.isPreferred() != of.isPreferred()) - return false; - - if (!values().equals(ofe.values())) - return false; - return true; - } - - /* - * Identity test: Tests for quick identity of - * descriptors. If this returns true, then - * no other tests required. - */ - protected boolean identityTest(Object obj) { - if (!(obj instanceof FeatureDescriptorEquality)) - return false; - if (this == obj) - return true; - - if (((FeatureDescriptorEquality) obj).fFeature == fFeature) - return true; - - return false; - } -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/IndexedPropertyDescriptorEquality.java b/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/IndexedPropertyDescriptorEquality.java deleted file mode 100644 index 42100e47d..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/IndexedPropertyDescriptorEquality.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jem.internal.beaninfo.vm; -/* - - - */ - -import java.beans.*; -/** - * IndexedPropertyDescriptor equality tester - */ -public class IndexedPropertyDescriptorEquality extends PropertyDescriptorEquality { - - static void INIT() { - try { - MAP_EQUALITY.put(IndexedPropertyDescriptor.class, (IndexedPropertyDescriptorEquality.class).getConstructor(new Class[] {PropertyDescriptor.class})); - MAP_EQUALITY.put(PropertyDescriptor.class, (IndexedPropertyDescriptorEquality.class).getConstructor(new Class[] {PropertyDescriptor.class})); - } catch (NoSuchMethodException e) { - } - } - - public IndexedPropertyDescriptorEquality() { - } - - public IndexedPropertyDescriptorEquality(PropertyDescriptor descr) { - super(descr); - } - /** - * Calculate the hashcode for the current feature, add this - * to the hashcode received from super.calculateHashCode - * and return the new value. - * - * NOTE: for subclasses, it is MANDITORY that the first line be: - * int hashcode = super.calculateHashCode(); - * and the last line be: - * return hashcode*31 + (your calculated hashcode for just this subclass); - */ - protected int calculateHashCode() { - int hashcode = super.calculateHashCode(); - if (fFeature instanceof IndexedPropertyDescriptor) { - IndexedPropertyDescriptor pd = (IndexedPropertyDescriptor) fFeature; - - int hc = pd.getIndexedPropertyType().hashCode(); - - if (pd.getIndexedReadMethod() != null) - hc += pd.getIndexedReadMethod().hashCode(); - if (pd.getIndexedWriteMethod() != null) - hc += pd.getIndexedWriteMethod().hashCode(); - return hashcode*31 + hc; - } else - return hashcode; - } - - public boolean equals(Object obj) { - if (!(obj instanceof FeatureDescriptorEquality)) - return false; - if (identityTest(obj)) - return true; - if (fFeature.getClass() != ((FeatureDescriptorEquality) obj).fFeature.getClass()) - return false; // If they aren't both PropertyDesciptors or IndexedPropertyDescriptors, then they don't match. - if (!super.equals(obj)) - return false; - - if (fFeature instanceof IndexedPropertyDescriptor) { - IndexedPropertyDescriptor op = (IndexedPropertyDescriptor) ((FeatureDescriptorEquality) obj).fFeature; - IndexedPropertyDescriptor fp = (IndexedPropertyDescriptor) fFeature; - - if (op.getIndexedPropertyType() != fp.getIndexedPropertyType()) - return false; - if (op.getIndexedReadMethod() != fp.getIndexedReadMethod()) - return false; - if (op.getIndexedWriteMethod() != fp.getIndexedWriteMethod()) - return false; - } - - return true; - } - - - - -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/MethodDescriptorEquality.java b/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/MethodDescriptorEquality.java deleted file mode 100644 index a56159c1e..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/MethodDescriptorEquality.java +++ /dev/null @@ -1,135 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jem.internal.beaninfo.vm; -/* - - - */ - -import java.beans.*; -import java.util.*; -/** - * Equality tester for MethodDescriptors - */ -public class MethodDescriptorEquality extends FeatureDescriptorEquality { - - static void INIT() { - try { - MAP_EQUALITY.put(MethodDescriptor.class, (MethodDescriptorEquality.class).getConstructor(new Class[] {MethodDescriptor.class})); - } catch (NoSuchMethodException e) { - } - } - - private ArrayList fParameterDescriptors; // Array of ParameterDescriptorEquality's. - - public MethodDescriptorEquality() { - } - - public MethodDescriptorEquality(MethodDescriptor descr) { - super(descr); - } - - /** - * A new feature is being set into this object, - * clear any cache members so that they can be reconstructed. - * - * NOTE: Subclasses - remember to call super.clearFeature(); - */ - protected void clearFeature() { - super.clearFeature(); - fParameterDescriptors = null; - } - - protected ArrayList parameterDescriptors() { - if (fParameterDescriptors == null) { - ParameterDescriptor[] pds = ((MethodDescriptor) fFeature).getParameterDescriptors(); - if (pds != null) { - fParameterDescriptors = new ArrayList(pds.length); - for (int i=0; i<pds.length; i++) - fParameterDescriptors.add(new ParameterDescriptorEquality(pds[i])); - } - } - return fParameterDescriptors; - } - /** - * Calculate the hashcode for the current feature, add this - * to the hashcode received from super.calculateHashCode - * and return the new value. - * - * NOTE: for subclasses, it is MANDITORY that the first line be: - * int hashcode = super.calculateHashCode(); - * and the last line be: - * return hashcode*31 + (your calculated hashcode for just this subclass); - */ - protected int calculateHashCode() { - int hashcode = super.calculateHashCode(); - MethodDescriptor bd = (MethodDescriptor) fFeature; - int hc = bd.getMethod().hashCode(); - if (parameterDescriptors() != null) - hc += parameterDescriptors().hashCode(); - - return hashcode*31 + hc; - } - - public boolean equals(Object obj) { - if (identityTest(obj)) - return true; - - if (!super.equals(obj)) - return false; - - MethodDescriptorEquality oem = (MethodDescriptorEquality) obj; - MethodDescriptor om = (MethodDescriptor) oem.fFeature; - MethodDescriptor fm = (MethodDescriptor) fFeature; - - if (fm.getMethod() != om.getMethod()) - return false; - - if (fParameterDescriptors != null || oem.fParameterDescriptors != null) { - // We are in a Map lookup situation, so one side has listener method equalities, so we will compare that way. - if (parameterDescriptors() == null) - if (((MethodDescriptorEquality) obj).parameterDescriptors() != null) - return false; - else ; - else - if (!parameterDescriptors().equals(((MethodDescriptorEquality) obj).parameterDescriptors())) - return false; - } else { - // We are in the building the list phases, don't waste space building entire list. - ParameterDescriptor[] ours = fm.getParameterDescriptors(); - ParameterDescriptor[] theirs = om.getParameterDescriptors(); - if (ours == theirs) - return true; - else if (ours == null) - if (theirs != null) - return false; - else - ; - else if (theirs == null) - return false; - else if (ours.length != theirs.length) - return false; - else if (ours.length > 0) { - ParameterDescriptorEquality workingOurs = new ParameterDescriptorEquality(); - ParameterDescriptorEquality workingThiers = new ParameterDescriptorEquality(); - for (int i = 0; i < ours.length; i++) { - workingOurs.setFeature(ours[i]); - workingThiers.setFeature(theirs[i]); - if (!workingOurs.equals(workingThiers)) - return false; - } - } - } - - - return true; - } -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/ModelingBeanInfo.java b/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/ModelingBeanInfo.java deleted file mode 100644 index 1344589c0..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/ModelingBeanInfo.java +++ /dev/null @@ -1,863 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jem.internal.beaninfo.vm; - -/* - - - */ - -import java.beans.*; -import java.io.IOException; -import java.io.ObjectOutputStream; -import java.lang.reflect.*; -import java.util.*; - -import org.eclipse.jem.beaninfo.common.IBaseBeanInfoConstants; -import org.eclipse.jem.beaninfo.vm.BaseBeanInfo; -import org.eclipse.jem.internal.beaninfo.common.*; -import org.eclipse.jem.internal.proxy.common.*; - -/** - * This class is the beaninfo class that is created when beaninfo modeling introspects a bean. Its purpose is to gather together and analyze the - * beaninfo. For example, it checks with the supertype beaninfo to see if all of the supertype's descriptors are included in this list. If they are, - * then it knows that it does a straight inheritance of the supertype's descriptors, and those descriptors can be removed from the list. This makes it - * easier on the model side so that there isn't a great proliferation of descriptors all describing the same properties. In that case they can be - * merged from the supertype model. If some are not found, then that means this beaninfo is trying to hide some of them, and in that case this is the - * definitive list and inheritance shouldn't be used on the model side. However, for those features which are essentially the inherited feature (i.e. - * the BeanInfo simply filtered out some inherited but not all), they will be returnable (by name). The IDE side will take these that are "inherited" - * and will return the actual structured feature from the inherited class. - * - * The test for seeing if the super feature is included in the beaninfo is first to see if the the feature is in the beaninfo by name, if it is then - * it is marked as included. Then a check is made on equality, if they are equal, then the feature is removed from the beaninfo list, but the merge - * flag is still left on, and removed inherited feature is added to the list of inherited features. If all inherited features are found, this list is - * cleared and flag is set which simply says merge all inherited. This allows merging to occur but it also allows overrides to occur. - * - * Note: Test for identity is different between JDK 1.5 and above and below. 1.5 and above, we can use actual equals() because the same descriptor is - * returned from inherited features. In 1.3, clones were always returned and equals() would answer false, so we need to create a special equality - * descriptor which turns the equals() into one that can test clones for semantic equality. See Java Bug ID#4996673 The problem was supposed to be - * fixed in 1.4 but it was not fixed. Originally a new clone was created each time a beaninfo was requested. That is no longer done in 1.4, but the - * processing to create the original beaninfo does a clone accidently under the covers. Looking at 1.5 it looks this was fixed, but it hasn't been - * tested here yet. - */ - -public abstract class ModelingBeanInfo implements ICallback { - - private static boolean PRE15; - static { - String version = System.getProperty("java.version", ""); //$NON-NLS-1$ //$NON-NLS-2$ - PRE15 = version.startsWith("1."); //$NON-NLS-1$ - if (PRE15) { - // Continue to check, get the revision. - int revision = 0; - if (version.length() > 2) { - int revEnd = version.indexOf('.', 2); - revision = version.length() > 2 ? Integer.parseInt(revEnd != -1 ? version.substring(2, revEnd) : version.substring(2)) : 0; - PRE15 = revision < 5; - } - } - } - - static class FeatureEqualitySet extends HashSet { - - /** - * Comment for <code>serialVersionUID</code> - * - * @since 1.1.0 - */ - private static final long serialVersionUID = -3744776740604328324L; - private FeatureDescriptorEquality workingKey; - - public FeatureEqualitySet(List features) { - super(features.size()); - // Get first feature to fiqure out type of working key. This will not be reentrant. - workingKey = FeatureDescriptorEquality.createEquality((FeatureDescriptor) features.get(0)); - this.addAll(features); - } - - /** - * @see java.util.Collection#add(Object) - */ - public boolean add(Object o) { - return super.add(FeatureDescriptorEquality.createEquality((FeatureDescriptor) o)); - } - - /** - * @see java.util.Collection#contains(Object) - */ - public boolean contains(Object o) { - workingKey.setFeature((FeatureDescriptor) o); - return super.contains(workingKey); - } - - } - - // The following fields indicate if the super info should be merged - // in on the model side. no merge means there were no inherited methods at all. So the - // beaninfo presented is definitive. If merge, then get...Descriptors will return just - // the ones for this level, and getSuper...Descriptors will return the inherited ones. - // Though in this case, if the returned super list is null, then that means use ALL of - // the inherited ones. - // The super list returns simply the names, don't need to have the full descriptors in that case. - protected boolean fMergeInheritedEvents = false, fMergeInheritedMethods = false, fMergeInheritedProperties = false; - - protected final BeanInfo fTargetBeanInfo; // The beaninfo being modeled. - - // Local descriptors - protected EventSetDescriptor[] fEventSets; - - protected MethodDescriptor[] fMethods; - - protected PropertyDescriptor[] fProperties; - - // Not inherited descriptor names, will be null if no merge or if merge all. This is list of names to NOT merge. It is usually shorter than the list to merge from super. - - // Methods are special. You can have duplicates, so name is not sufficient. - // So for methods, - // will use an array of Strings where: - // For each one the full signature - // will be in the list, e.g. "name:methodName(argtype,..." where argtype is the fullyqualified - // classname (using "." notation for inner classes), and using format "java.lang.String[]" for - // arrays. - // - // This is because even if there are no duplicates, it will take less time/space to simply create the entries - // then it would to create a set to see if there are duplicates and then create the final array. - protected String[] fNotInheritedEventSets; - - protected String[] fNotInheritedMethods; - - protected String[] fNotInheritedProperties; - - protected int doFlags; - - /** - * Method used to do introspection and create the appropriate ModelingBeanInfo - * - * This will always introspect. - */ - public static ModelingBeanInfo introspect(Class introspectClass, int doFlags) throws IntrospectionException { - return introspect(introspectClass, true, doFlags); - } - - /** - * Method used to do introspection and create the appropriate ModelingBeanInfo - * - * introspectIfNoBeanInfo: If this is true, then if no explicit beaninfo was found for this class, then introspection will be done anyway. The - * Introspector will use reflection for local methods/events/properties of this class and then add in the results of the superclass introspection. - * If this parameter is false, then if the explicit beaninfo is not found, then no introspection will be done and null will be returned. - */ - public static ModelingBeanInfo introspect(Class introspectClass, boolean introspectIfNoBeanInfo, int doFlags) throws IntrospectionException { - if (!Beans.isDesignTime()) - Beans.setDesignTime(true); // Since this a jem beaninfo specific vm, we should also be considered design time. - if (!introspectIfNoBeanInfo) { - // Need to check if the beaninfo is explicitly supplied. - // If not, then we return null. - // The checks will be the same that Introspector will use. - - boolean found = false; - // 1. Is there a BeanInfo class in the same package - if (!classExists(introspectClass.getName() + "BeanInfo", introspectClass)) { //$NON-NLS-1$ - // 2. Is this class a BeanInfo class for itself. - if (!(BeanInfo.class).isAssignableFrom(introspectClass)) { - // 3. Can this class be found in the Beaninfo searchpath. - String[] searchPath = Introspector.getBeanInfoSearchPath(); - int startClassname = introspectClass.getName().lastIndexOf(".") + 1; //$NON-NLS-1$ - String biName = "." + introspectClass.getName().substring(startClassname) + "BeanInfo"; //$NON-NLS-1$ //$NON-NLS-2$ - for (int i = 0; i < searchPath.length; i++) { - if (classExists(searchPath[i] + biName, introspectClass)) { - found = true; - break; - } - } - } else - found = true; - } else - found = true; - - if (!found) - return null; - } - - BeanInfo bInfo = Introspector.getBeanInfo(introspectClass); - Class superClass = introspectClass.getSuperclass(); - - if (superClass == null) - return PRE15 ? (ModelingBeanInfo) new ModelingBeanInfoPre15(bInfo, doFlags) : new ModelingBeanInfo15(bInfo, doFlags); - else - return PRE15 ? (ModelingBeanInfo) new ModelingBeanInfoPre15(bInfo, Introspector.getBeanInfo(superClass), doFlags) : new ModelingBeanInfo15(bInfo, - Introspector.getBeanInfo(superClass), doFlags); - } - - /** - * See if this class exists, first in the class loader of the sent class, then in the system loader, then the bootstrap loader, and finally the - * current thread context class loader. - */ - protected static boolean classExists(String className, Class fromClass) { - if (fromClass.getClassLoader() != null) - try { - fromClass.getClassLoader().loadClass(className); - return true; - } catch (ClassNotFoundException e) { - } - if (ClassLoader.getSystemClassLoader() != null) - try { - ClassLoader.getSystemClassLoader().loadClass(className); - return true; - } catch (ClassNotFoundException e) { - } - try { - Class.forName(className); - return true; - } catch (ClassNotFoundException e) { - } - - try { - // Use the classloader from the current Thread. - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - cl.loadClass(className); - return true; - } catch (ClassNotFoundException e) { - } - - return false; - - } - - /** - * Used only for Object since that is the only bean that doesn't have a superclass. Superclass beaninfo required for all other classes. If this is - * constructed then this means no merge and the list is definitive. - */ - protected ModelingBeanInfo(BeanInfo beanInfo, int doFlags) { - fTargetBeanInfo = beanInfo; - this.doFlags = doFlags; - } - - protected ModelingBeanInfo(BeanInfo beanInfo, BeanInfo superBeanInfo, int doFlags) { - this(beanInfo, doFlags); - - // Now go through the beaninfo to determine the merge state. - // The default is no merge. - - if ((doFlags & IBeanInfoIntrospectionConstants.DO_EVENTS) != 0) { - List full = addAll(beanInfo.getEventSetDescriptors()); - List inherited = addAll(superBeanInfo.getEventSetDescriptors()); - - fMergeInheritedEvents = stripList(full, inherited); - if (fMergeInheritedEvents) { - if (!full.isEmpty()) - fEventSets = (EventSetDescriptor[]) full.toArray(new EventSetDescriptor[full.size()]); - if (!inherited.isEmpty()) - createEventArray(inherited); // This is actually a list of those NOT inherited. - } - } - - if ((doFlags & IBeanInfoIntrospectionConstants.DO_METHODS) != 0) { - List full = addAll(beanInfo.getMethodDescriptors()); - List inherited = addAll(superBeanInfo.getMethodDescriptors()); - - fMergeInheritedMethods = stripList(full, inherited); - if (fMergeInheritedMethods) { - if (!full.isEmpty()) - fMethods = (MethodDescriptor[]) full.toArray(new MethodDescriptor[full.size()]); - if (!inherited.isEmpty()) - createMethodEntries(inherited); // This is actually a list of those NOT inherited. - } - } - - if ((doFlags & IBeanInfoIntrospectionConstants.DO_PROPERTIES) != 0) { - List full = addAll(beanInfo.getPropertyDescriptors()); - List inherited = addAll(superBeanInfo.getPropertyDescriptors()); - - fMergeInheritedProperties = stripList(full, inherited); - if (fMergeInheritedProperties) { - if (!full.isEmpty()) - fProperties = (PropertyDescriptor[]) full.toArray(new PropertyDescriptor[full.size()]); - if (!inherited.isEmpty()) - createPropertyArray(inherited); // This is actually a list of those NOT inherited. - } - } - } - - protected void createEventArray(List features) { - fNotInheritedEventSets = createDescriptorNames(features); - } - - protected void createMethodEntries(List features) { - int s = features.size(); - fNotInheritedMethods = new String[s]; - for (int i = 0; i < s; i++) { - fNotInheritedMethods[i] = longName((MethodDescriptor) features.get(i)); - } - } - - protected String longName(MethodDescriptor md) { - String n = md.getName(); - StringBuffer sb = new StringBuffer(n.length() + 20); - sb.append(n); - sb.append(':'); - Method m = md.getMethod(); - sb.append(m.getName()); - sb.append('('); - Class[] parms = m.getParameterTypes(); - for (int j = 0; j < parms.length; j++) { - if (j > 0) - sb.append(','); - if (!parms[j].isArray()) - sb.append(parms[j].getName().replace('$', '.')); - else { - Class finalType = parms[j].getComponentType(); - int insrt = sb.length(); - while (finalType.isArray()) { - sb.append("[]"); //$NON-NLS-1$ - finalType = finalType.getComponentType(); - } - sb.insert(insrt, finalType.getName().replace('$', '.')); - } - } - return sb.toString(); - } - - protected void createPropertyArray(List features) { - fNotInheritedProperties = createDescriptorNames(features); - } - - protected String[] createDescriptorNames(List features) { - String[] result = new String[features.size()]; - for (int i = 0; i < result.length; i++) { - result[i] = ((FeatureDescriptor) features.get(i)).getName(); - } - return result; - } - - protected List addAll(Object[] set) { - if (set != null) { - ArrayList l = new ArrayList(set.length); - for (int i = 0; i < set.length; i++) { - l.add(set[i]); - } - return l; - } else - return Collections.EMPTY_LIST; - } - - /** - * If this returns true, then all of the super class's events should be merged in. If it returns false, then the events returned are it, there are - * no others. - */ - public boolean isMergeInheritedEvents() { - return fMergeInheritedEvents; - } - - /** - * If this returns true, then all of the super class's methods should be merged in. If it returns false, then the methods returned are it, there - * are no others. - */ - public boolean isMergeInheritedMethods() { - return fMergeInheritedMethods; - } - - /** - * If this returns true, then all of the super class's properties should be merged in. If it returns false, then the properties returned are it, - * there are no others. - */ - public boolean isMergeInheritedProperties() { - return fMergeInheritedProperties; - } - - public BeanInfo[] getAdditionalBeanInfo() { - return fTargetBeanInfo.getAdditionalBeanInfo(); - } - - public BeanDescriptor getBeanDescriptor() { - return fTargetBeanInfo.getBeanDescriptor(); - } - - public EventSetDescriptor[] getEventSetDescriptors() { - return fMergeInheritedEvents ? fEventSets : fTargetBeanInfo.getEventSetDescriptors(); - } - - public java.awt.Image getIcon(int iconKind) { - return fTargetBeanInfo.getIcon(iconKind); - } - - public MethodDescriptor[] getMethodDescriptors() { - return fMergeInheritedMethods ? fMethods : fTargetBeanInfo.getMethodDescriptors(); - } - - public PropertyDescriptor[] getPropertyDescriptors() { - return fMergeInheritedProperties ? fProperties : fTargetBeanInfo.getPropertyDescriptors(); - } - - public String[] getNotInheritedEventSetDescriptors() { - return fNotInheritedEventSets; - } - - public String[] getNotInheritedMethodDescriptors() { - return fNotInheritedMethods; - } - - public String[] getNotInheritedPropertyDescriptors() { - return fNotInheritedProperties; - } - - protected String computeKey(FeatureDescriptor feature) { - return feature instanceof MethodDescriptor ? longName((MethodDescriptor) feature) : feature.getName(); - } - - /* - * Strip the list down using the Equality objects. - */ - protected boolean stripList(List fullList, List inheritedList) { - // The process is to create a boolean list mirroring the inheritedList. - // This boolean list indicates if the corresponding (by index) - // entry from the inheritedList is to be retained in the final computed - // list. - // - // A Hashmap is created where the key is the computedKey from the inheritedList - // and the value is the index into the inheritedList. This is so that we can quickly determine if the - // entry is matching. - // - // Then the fullList will be stepped through and see if there is - // an entry in the Hashmap for it. If there is an entry, then - // the entry is checked to see if it is semantically equal. - // If it is, then the boolean list entry is marked so that - // the inheritedList entry will be retained, the fullList entry removed and the counter - // of the number of entries in the inheritedList copy is incremented. - // If they aren't semantically equal, then we know that this is - // an override. In that case, the fullList entry is kept, the inheritedList - // entry is not retained, but we don't prevent merge later. - // - // If the fullList entry is not found in the HashMap, then we know it is not - // from the inheritedList, so it will be retained in the fullList. - // - // If we get all of the way through, then we know that what is left - // in fullList is just this level. - // - // When we return we know that - // a) fullList has only the features that are found at the local level - // b) inheritedList if not empty contains the ones from super that SHOULD NOT be inherited. - // If it is empty, then if this method returns true, then ALL should be inherited, - // or if this method returns false, then it doesn't matter because we aren't merging any. - // - // All of this is based upon the assumption that the list can - // get quite large (which it does for javax.swing) and that - // a simple n-squared order search would be too slow. - - if (fullList.isEmpty()) { - return false; // There are none in the full list, so there should be none, and don't merge. - } else if (inheritedList.isEmpty()) - return false; // There are no inheritedList features, so treat as no merge. - - // We have some features and some inheritedList features, so we need to go through the lists. - - // Create a working copy of the FeatureDescriptorEquality for fullList and stripList and just reuse them - FeatureDescriptorEquality workingStrip = FeatureDescriptorEquality.createEquality((FeatureDescriptor) inheritedList.get(0)); - FeatureDescriptorEquality workingFull = FeatureDescriptorEquality.createEquality((FeatureDescriptor) fullList.get(0)); - - int inheritedSize = inheritedList.size(); - boolean[] copy = new boolean[inheritedSize]; - - HashMap inheritedMap = new HashMap(inheritedSize); - for (int i = 0; i < inheritedSize; i++) { - FeatureDescriptor f = (FeatureDescriptor) inheritedList.get(i); - String key = computeKey(f); - Object value = inheritedMap.get(key); - if (value == null) - inheritedMap.put(key, new Integer(i)); - else { - // Shouldn't occur. - } - - } - - // When we are done with this processing, inheritedList will contain the super that should not be used, and full list will contain only the locals - // (those defined at this class level).; - int inheritedRetained = 0; - Iterator fullItr = fullList.iterator(); - // Continue while we've retained less than the full super amount. If we've retained all of the inheritedList, there is no - // need to continue processing the fullList because there can't possibly be any inheritedList entries left to find. - while (inheritedRetained < inheritedSize && fullItr.hasNext()) { - FeatureDescriptor f = (FeatureDescriptor) fullItr.next(); - boolean foundFull = false; - Object index = inheritedMap.get(computeKey(f)); - if (index != null) { - workingFull.setFeature(f); - int ndx = ((Integer) index).intValue(); - workingStrip.setFeature((FeatureDescriptor) inheritedList.get(ndx)); - if (workingFull.equals(workingStrip)) { - // They are semantically identical, so retain in the inheritedList. - copy[ndx] = true; - foundFull = true; - inheritedRetained++; - } - } - - if (foundFull) { - // We found the inheritedList entry semantically equal in the full list somewhere, so we need to remove the full entry. - fullItr.remove(); - } - } - - if (inheritedRetained == inheritedSize) { - inheritedList.clear(); // All were found in inheritedList, so just clear the inheritedList and return just what was left in the found. - // Those in full found in super had been removed from full during the processing. - return true; // We merge with all inherited. - } else if (inheritedRetained != 0) { - // Some were retained, take out of the list those that were retained. - // When done the list will contain those that should be dropped from the inherited list. - // We start from end because the actual number of bytes moved overall will be less than if we started from the front. - for (ListIterator itr = inheritedList.listIterator(inheritedList.size()); itr.hasPrevious();) { - int i = itr.previousIndex(); - itr.previous(); // To back up the itr so that remove can remove it. We actually don't care what the value is. - if (copy[i]) - itr.remove(); - } - return true; // We merge, and the list is not empty but it did have some removed, so we leave the list alone. Those are not inherited. - } else - return false; // All were removed (retained == 0). None were retained. So we just don't do a merge. The list will be ignored. - } - - // The modeling beaninfo is also used to send itself back in serialized mode as a callback. - - private IVMCallbackServer vmServer; - - private int callbackID; - - /* - * (non-Javadoc) - * - * @see org.eclipse.jem.internal.proxy.common.ICallback#initializeCallback(org.eclipse.jem.internal.proxy.common.IVMServer, int) - */ - public void initializeCallback(IVMCallbackServer vmServer, int callbackID) { - this.vmServer = vmServer; - this.callbackID = callbackID; - } - - public void send() throws IOException, CommandException { - if (doFlags != 0) { - ObjectOutputStream stream = new ObjectOutputStream(vmServer.requestStream(callbackID, 0)); - if ((doFlags & IBeanInfoIntrospectionConstants.DO_BEAN_DECOR) != 0) - sendBeanDecorator(stream); - if ((doFlags & IBeanInfoIntrospectionConstants.DO_PROPERTIES) != 0) - sendPropertyDecorators(stream); - if ((doFlags & IBeanInfoIntrospectionConstants.DO_METHODS) != 0) - sendMethodDecorators(stream); - if ((doFlags & IBeanInfoIntrospectionConstants.DO_EVENTS) != 0) - sendEventDecorators(stream); - stream.writeInt(IBeanInfoIntrospectionConstants.DONE); - stream.close(); - } - } - - /** - * Called by IDE to send the bean decorator information back through the callback. - * @throws CommandException - * @throws IOException - * - * @since 1.1.0 - */ - public void sendBeanDecorator(ObjectOutputStream stream) throws IOException, CommandException { - BeanRecord br = new BeanRecord(); - BeanDescriptor bd = getBeanDescriptor(); - - if (bd != null) { - br.customizerClassName = getClassName(bd.getCustomizerClass()); - br.mergeInheritedProperties = isMergeInheritedProperties(); - br.mergeInheritedOperations = isMergeInheritedMethods(); - br.mergeInheritedEvents = isMergeInheritedEvents(); - br.notInheritedPropertyNames = getNotInheritedPropertyDescriptors(); - br.notInheritedOperationNames = getNotInheritedMethodDescriptors(); - br.notInheritedEventNames = getNotInheritedEventSetDescriptors(); - fill(bd, br, BEAN_RECORD_TYPE); - } - stream.writeInt(IBeanInfoIntrospectionConstants.BEAN_DECORATOR_SENT); - stream.writeObject(br); - } - - /** - * Called by IDE to send the property decorators information back through the callback. - * - * @throws CommandException - * @throws IOException - * @since 1.1.0 - */ - public void sendPropertyDecorators(ObjectOutputStream stream) throws IOException, CommandException { - PropertyDescriptor[] properties = getPropertyDescriptors(); - if (properties != null && properties.length > 0) { - // Now start writing the records. - stream.writeInt(IBeanInfoIntrospectionConstants.PROPERTY_DECORATORS_SENT); - stream.writeInt(properties.length); - for (int i = 0; i < properties.length; i++) { - PropertyDescriptor pd = properties[i]; - // Much of the two types are common, so if indexed, fill in the index part and then pass on to property part. - PropertyRecord usepr = null; - int useType = 0; - if (pd.getClass() == IndexedPropertyDescriptor.class) { - IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd; - IndexedPropertyRecord ipr = new IndexedPropertyRecord(); - usepr = ipr; - useType = INDEXEDPROPERTY_RECORD_TYPE; - ipr.indexedReadMethod = getReflectedMethodRecord(ipd.getIndexedReadMethod()); - ipr.indexedWriteMethod = getReflectedMethodRecord(ipd.getIndexedWriteMethod()); - ipr.indexedPropertyTypeName = getClassName(ipd.getIndexedPropertyType()); - } else { - usepr = new PropertyRecord(); - useType = PROPERTY_RECORD_TYPE; - } - usepr.propertyEditorClassName = getClassName(pd.getPropertyEditorClass()); - usepr.propertyTypeName = getClassName(pd.getPropertyType()); - usepr.readMethod = getReflectedMethodRecord(pd.getReadMethod()); - usepr.writeMethod = getReflectedMethodRecord((pd.getWriteMethod())); - usepr.bound = pd.isBound(); - usepr.constrained = pd.isConstrained(); - usepr.designTime = null; - usepr.field = null; - fill(pd, usepr, useType); - stream.writeObject(usepr); - } - } - } - - /** - * Called by IDE to send the method decorators information back through the callback. - * - * @throws CommandException - * @throws IOException - * @since 1.1.0 - */ - public void sendMethodDecorators(ObjectOutputStream stream) throws IOException, CommandException { - MethodDescriptor[] methods = getMethodDescriptors(); - if (methods != null && methods.length > 0) { - // Now start writing the records. - stream.writeInt(IBeanInfoIntrospectionConstants.METHOD_DECORATORS_SENT); - stream.writeInt(methods.length); - for (int i = 0; i < methods.length; i++) { - MethodRecord mr = new MethodRecord(); - fill(mr, methods[i]); - stream.writeObject(mr); - } - } - } - - /** - * Fill in a MethodRecord from the MethodDescriptor. - * @param mr - * @param md - * - * @since 1.1.0 - */ - protected void fill(MethodRecord mr, MethodDescriptor md) { - mr.methodForDescriptor = getReflectedMethodRecord(md.getMethod()); - ParameterDescriptor[] parms = md.getParameterDescriptors(); - if (parms == null) - mr.parameters = null; - else { - mr.parameters = new ParameterRecord[parms.length]; - for (int j = 0; j < parms.length; j++) { - ParameterRecord pr = new ParameterRecord(); - fill(parms[j], pr, PARAMETER_RECORD_TYPE); - mr.parameters[j] = pr; - } - } - fill(md, mr, METHOD_RECORD_TYPE); - } - - /** - * Called by IDE to send the event set decorators information back through the callback. - * - * @throws CommandException - * @throws IOException - * @since 1.1.0 - */ - public void sendEventDecorators(ObjectOutputStream stream ) throws IOException, CommandException { - EventSetDescriptor[] events = getEventSetDescriptors(); - if (events != null && events.length > 0) { - // Now start writing the records. - stream.writeInt(IBeanInfoIntrospectionConstants.EVENT_DECORATORS_SENT); - stream.writeInt(events.length); - for (int i = 0; i < events.length; i++) { - EventSetDescriptor ed = events[i]; - EventSetRecord er = new EventSetRecord(); - er.addListenerMethod = getReflectedMethodRecord(ed.getAddListenerMethod()); - MethodDescriptor[] mds = ed.getListenerMethodDescriptors(); - if (mds == null) - er.listenerMethodDescriptors = null; - else { - er.listenerMethodDescriptors = new MethodRecord[mds.length]; - for (int j = 0; j < mds.length; j++) { - fill(er.listenerMethodDescriptors[j] = new MethodRecord(), mds[j]); - } - } - er.listenerTypeName = getClassName(ed.getListenerType()); - er.removeListenerMethod = getReflectedMethodRecord(ed.getRemoveListenerMethod()); - er.inDefaultEventSet = ed.isInDefaultEventSet(); - er.unicast = ed.isUnicast(); - er.eventAdapterClassName = null; - fill(ed, er, EVENTSET_RECORD_TYPE); - stream.writeObject(er); - } - } - } - - protected static final int BEAN_RECORD_TYPE = 0; - - protected static final int PROPERTY_RECORD_TYPE = 1; - - protected static final int INDEXEDPROPERTY_RECORD_TYPE = 2; - - protected static final int METHOD_RECORD_TYPE = 3; - - protected static final int PARAMETER_RECORD_TYPE = 4; - - protected static final int EVENTSET_RECORD_TYPE = 5; - - /** - * Fill in the special attr/values for the given record type. The default handles the standard ones. - * - * @param record - * @param descr - * @param attributeName - * @param recordType - * type of record ultimately being processed. - * @return <code>true</code> if this attribute is a special one and processed, <code>false</code> if not special and should be added to - * attributes list transferred to IDE. - * - * @see ModelingBeanInfo#PROPERTY_RECORD_TYPE - * @since 1.1.0 - */ - protected boolean fillFromAttributes(FeatureRecord record, FeatureDescriptor descr, String attributeName, int recordType) { - switch (recordType) { - case INDEXEDPROPERTY_RECORD_TYPE: - case PROPERTY_RECORD_TYPE: - if (BaseBeanInfo.DESIGNTIMEPROPERTY.equals(attributeName)) { - ((PropertyRecord) record).designTime = (Boolean) descr.getValue(attributeName); - return true; - } else if (BaseBeanInfo.FIELDPROPERTY.equals(attributeName)) { - Field f = (Field) descr.getValue(attributeName); - // We have a field, set the property type to this since we couldn't correctly create this otherwise. - PropertyRecord pr = (PropertyRecord) record; - pr.propertyTypeName = getClassName(f.getType()); - pr.field = getReflectedFieldRecord(f); - pr.readMethod = null; // Need to wipe out our dummy. - pr.writeMethod = null; // Or if it set, not valid for a field. - return true; - } - break; - case EVENTSET_RECORD_TYPE: - if (BaseBeanInfo.EVENTADAPTERCLASS.equals(attributeName)) { - ((EventSetRecord) record).eventAdapterClassName = (String) descr.getValue(attributeName); - return true; - } - break; - default: - break; // Didn't handle it. - } - return false; - } - - /** - * Fill in the feature portion of the Descriptor into the record. We can be reusing some records (so we don't keep allocating when not needed), so - * we will null out unset fields. - * - * @param descr - * @param record - * @param recordType - * type of record ultimately being processed. Used for fillFromAttributes. - * - * @see ModelingBeanInfo#PROPERTY_RECORD_TYPE - * @since 1.1.0 - */ - protected void fill(FeatureDescriptor descr, FeatureRecord record, int recordType) { - record.name = descr.getName(); - String dn = descr.getDisplayName(); - if (!record.name.equals(dn)) - record.displayName = dn; // display name returns name if display name not set. We don't want to send it if identical. (Note some Beaninfos are setting displayname the same text but not same string). - else - record.displayName = null; - String shd = descr.getShortDescription(); - if (!dn.equals(shd)) - record.shortDescription = shd; // short description returns displayname if short description not set. We don't want to send it if - // identical. - else - record.shortDescription = null; - record.expert = descr.isExpert(); - record.hidden = descr.isHidden(); - record.preferred = descr.isPreferred(); - record.category = null; // Clear out in case not set. - Enumeration attrs = descr.attributeNames(); - if (attrs.hasMoreElements()) { - // We don't have a way of knowing how many there are ahead of time, so we will build into lists and then turn into arrays at the end. - List names = new ArrayList(); - List values = new ArrayList(); - while (attrs.hasMoreElements()) { - String attrName = (String) attrs.nextElement(); - if (attrName.equals(IBaseBeanInfoConstants.CATEGORY)) - record.category = (String) descr.getValue(IBaseBeanInfoConstants.CATEGORY); - else if (attrName.equals(BaseBeanInfo.PREFERRED)) { - // A bug in Java 1.3, doing setPreferred was lost. So for those also stored it in attributes. So if set here, then use it. - record.preferred = ((Boolean) descr.getValue(BaseBeanInfo.PREFERRED)).booleanValue(); - } else if (!fillFromAttributes(record, descr, attrName, recordType)) { - // Just copy accross. FillfromAttributes didn't handle it. - FeatureAttributeValue fv = new FeatureAttributeValue(); - fv.setValue(descr.getValue(attrName)); - names.add(attrName); - values.add(fv); - } - } - if (!names.isEmpty()) { - record.attributeNames = (String[]) names.toArray(new String[names.size()]); - record.attributeValues = (FeatureAttributeValue[]) values.toArray(new FeatureAttributeValue[values.size()]); - } else { - record.attributeNames = null; - record.attributeValues = null; - } - } else { - record.attributeNames = null; - record.attributeValues = null; - } - - } - - /* - * Get the classname from the class. If classs is null, then this return null. - */ - private String getClassName(Class classs) { - return classs != null ? classs.getName() : null; - } - - private ReflectMethodRecord getReflectedMethodRecord(Method method) { - if (method != null) { - ReflectMethodRecord rmr = new ReflectMethodRecord(); - rmr.className = getClassName(method.getDeclaringClass()); - rmr.methodName = method.getName(); - Class[] parmTypes = method.getParameterTypes(); - if (parmTypes.length > 0) { - rmr.parameterTypeNames = new String[parmTypes.length]; - for (int i = 0; i < parmTypes.length; i++) { - rmr.parameterTypeNames[i] = getClassName(parmTypes[i]); - } - } - return rmr; - } else - return null; - } - - private ReflectFieldRecord getReflectedFieldRecord(Field field) { - if (field != null) { - ReflectFieldRecord rf = new ReflectFieldRecord(); - rf.className = getClassName(field.getDeclaringClass()); - rf.fieldName = field.getName(); - rf.readOnly = Modifier.isFinal(field.getModifiers()); - return rf; - } else - return null; - } -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/ModelingBeanInfo15.java b/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/ModelingBeanInfo15.java deleted file mode 100644 index 04d2cb68f..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/ModelingBeanInfo15.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jem.internal.beaninfo.vm; -/* - - - */ - -import java.beans.BeanInfo; - -/** - * This was supposed to for 1.4 or above where it can use identity - * to test for inherited features, but it still is not correct - * in 1.4. See the header comments in ModelingBeanInfo. - * @see org.eclipse.jem.internal.beaninfo.vm.ModelingBeanInfo - */ -public class ModelingBeanInfo15 extends ModelingBeanInfo { - - /** - * Constructor for ModelingBeanInfo15. - * @param beanInfo - */ - public ModelingBeanInfo15(BeanInfo beanInfo, int doFlags) { - super(beanInfo, doFlags); - } - - /** - * Constructor for ModelingBeanInfo15. - * @param beanInfo - * @param superBeanInfo - */ - public ModelingBeanInfo15(BeanInfo beanInfo, BeanInfo superBeanInfo, int doFlags) { - super(beanInfo, superBeanInfo, doFlags); - } -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/ModelingBeanInfoPre15.java b/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/ModelingBeanInfoPre15.java deleted file mode 100644 index bd2d85cbb..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/ModelingBeanInfoPre15.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jem.internal.beaninfo.vm; -/* - - - */ - -import java.beans.BeanInfo; - -/** - * This is the modeling BeanInfo for Pre-JDK 1.4. - */ -public class ModelingBeanInfoPre15 extends ModelingBeanInfo { - - public ModelingBeanInfoPre15(BeanInfo beanInfo, int doFlags) { - super(beanInfo, doFlags); - } - - public ModelingBeanInfoPre15(BeanInfo beanInfo, BeanInfo superBeanInfo, int doFlags) { - super(beanInfo, superBeanInfo, doFlags); - } -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/ParameterDescriptorEquality.java b/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/ParameterDescriptorEquality.java deleted file mode 100644 index 8e09fcdf5..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/ParameterDescriptorEquality.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jem.internal.beaninfo.vm; -/* - - - */ - -import java.beans.*; -/** - * ParameterDescriptor equality tester - */ -public class ParameterDescriptorEquality extends FeatureDescriptorEquality { - - static void INIT() { - try { - MAP_EQUALITY.put(ParameterDescriptor.class, (ParameterDescriptorEquality.class).getConstructor(new Class[] {ParameterDescriptor.class})); - } catch (NoSuchMethodException e) { - } - } - - public ParameterDescriptorEquality() { - } - - public ParameterDescriptorEquality(ParameterDescriptor descr) { - super(descr); - } - -} diff --git a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/PropertyDescriptorEquality.java b/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/PropertyDescriptorEquality.java deleted file mode 100644 index 75d5eee64..000000000 --- a/plugins/org.eclipse.jem.beaninfo.common/vm_beaninfovm/org/eclipse/jem/internal/beaninfo/vm/PropertyDescriptorEquality.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jem.internal.beaninfo.vm; -/* - - - */ - -import java.beans.*; -/** - * PropertyDescriptor equality tester - */ -public abstract class PropertyDescriptorEquality extends FeatureDescriptorEquality { - - public PropertyDescriptorEquality() { - } - - public PropertyDescriptorEquality(PropertyDescriptor descr) { - super(descr); - } - /** - * Calculate the hashcode for the current feature, add this - * to the hashcode received from super.calculateHashCode - * and return the new value. - * - * NOTE: for subclasses, it is MANDITORY that the first line be: - * int hashcode = super.calculateHashCode(); - * and the last line be: - * return hashcode*31 + (your calculated hashcode for just this subclass); - */ - protected int calculateHashCode() { - int hashcode = super.calculateHashCode(); - PropertyDescriptor pd = (PropertyDescriptor) fFeature; - int hc = 0; - if (pd.getPropertyEditorClass() != null) - hc += pd.getPropertyEditorClass().hashCode(); - if (pd.getPropertyType() != null) - hc += pd.getPropertyType().hashCode(); - if (pd.getReadMethod() != null) - hc += pd.getReadMethod().hashCode(); - if (pd.getWriteMethod() != null) - hc += pd.getWriteMethod().hashCode(); - - hc += (pd.isBound() ? Boolean.TRUE : Boolean.FALSE).hashCode(); - hc += (pd.isConstrained() ? Boolean.TRUE : Boolean.FALSE).hashCode(); - - return hashcode*31 + hc; - } - - public boolean equals(Object obj) { - if (identityTest(obj)) - return true; - - if (!super.equals(obj)) - return false; - - PropertyDescriptor op = (PropertyDescriptor) ((FeatureDescriptorEquality) obj).fFeature; - PropertyDescriptor fp = (PropertyDescriptor) fFeature; - - if (op.getPropertyEditorClass() != fp.getPropertyEditorClass()) - return false; - if (op.getReadMethod() != fp.getReadMethod()) - return false; - if (op.getWriteMethod() != fp.getWriteMethod()) - return false; - if (op.isBound() != fp.isBound()) - return false; - if (op.isConstrained() != fp.isConstrained()) - return false; - - return true; - } - - -} |