summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Kriese2010-12-02 03:03:38 (EST)
committerSteffen Kriese2010-12-02 03:03:38 (EST)
commit9e2f62257ef66b84c8c283d3706e801b0ba25763 (patch)
treea2d51f0dd1ad36c59500dfcd5dd7356a5e9770ca
parent6f35b1980a625791c91de1b4fe0f8b63ea43197c (diff)
downloadorg.eclipse.riena.toolbox-9e2f62257ef66b84c8c283d3706e801b0ba25763.zip
org.eclipse.riena.toolbox-9e2f62257ef66b84c8c283d3706e801b0ba25763.tar.gz
org.eclipse.riena.toolbox-9e2f62257ef66b84c8c283d3706e801b0ba25763.tar.bz2
- Code Cleaning
- Editor does not create whitespace on save anymore - delete rcp-perspective on subapplication delete
-rw-r--r--org.eclipse.riena.toolbox/.settings/org.eclipse.jdt.ui.prefs72
-rw-r--r--org.eclipse.riena.toolbox/AssemblyEditor.launch8
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/Activator.java42
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/Util.java20
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AbstractXmlProvider.java51
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AddUIControlCallGenerator.java14
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AddUIControlCallVisitor.java23
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AssemblyDataProvider.java66
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/CodeGenerator.java79
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/CollectMethodDeclerationsVisitor.java10
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ModelService.java96
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/NodeFactory.java72
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/PluginXmlParser.java163
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/PluginXmlRenderer.java137
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ResourceChangeListener.java7
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/RidgetCallVisitor.java33
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/RidgetGenerator.java140
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/SWTControlInstantiationVisitor.java132
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/StartupEditorListener.java46
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/SwtControl.java8
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/UIControlVisitor.java94
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IAssemblyDataProvider.java7
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/ICodeGenerator.java3
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IModelService.java6
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/INodeFactory.java9
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IPluginXmlParser.java11
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IPluginXmlRenderer.java2
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AbstractAssemblyNode.java26
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AbstractTypedNode.java41
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AssemblyModel.java73
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AssemblyNode.java27
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/BundleNode.java28
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/ModuleGroupNode.java11
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/ModuleNode.java13
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/RCPPerspective.java16
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/RCPView.java26
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/SubApplicationNode.java20
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/SubModuleNode.java22
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/DetailSection.java32
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IconSelectorText.java37
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IdSelectorText.java46
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/OpenClassLink.java47
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/TextButtonComposite.java10
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/ToolboxTransfer.java29
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/UIControlsFactory.java34
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/VerifyTypeIdText.java37
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/ViewSelectorText.java32
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/AbstractDetailComposite.java88
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/AssemblyComposite.java62
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/BundleComposite.java10
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/ModuleComposite.java8
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/ModuleGroupComposite.java27
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubApplicationComposite.java12
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubModuleComposite.java39
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/preferences/PreferenceInitializer.java2
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/preferences/ToolboxConfigurationPreferencePage.java24
-rw-r--r--org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/views/AssemblyView.java319
57 files changed, 1382 insertions, 1167 deletions
diff --git a/org.eclipse.riena.toolbox/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.riena.toolbox/.settings/org.eclipse.jdt.ui.prefs
index af25100..5b058a0 100644
--- a/org.eclipse.riena.toolbox/.settings/org.eclipse.jdt.ui.prefs
+++ b/org.eclipse.riena.toolbox/.settings/org.eclipse.jdt.ui.prefs
@@ -1,4 +1,57 @@
-#Mon Feb 04 14:53:13 CET 2008
+#Fri Nov 26 13:14:53 GMT+01:00 2010
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=true
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=true
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_Riena Toolbox
+cleanup_settings_version=2
content_assist_disabled_computers=org.eclipse.jdt.ui.javaNoTypeProposalCategory\u0000org.eclipse.jdt.ui.spellingProposalCategory\u0000org.eclipse.jdt.ui.textProposalCategory\u0000org.eclipse.jdt.ui.templateProposalCategory\u0000org.eclipse.jdt.ui.javaTypeProposalCategory\u0000
content_assist_lru_history=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><history maxLHS\="100" maxRHS\="10"/>
eclipse.preferences.version=1
@@ -8,8 +61,8 @@ formatter_profile=_Eclipse Riena [built-in]
formatter_settings_version=11
org.eclipse.jdt.ui.editor.tab.width=
org.eclipse.jdt.ui.exception.name=e
-org.eclipse.jdt.ui.formatterprofiles.version=11
org.eclipse.jdt.ui.formatterprofiles=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<profiles version\="11">\r\n<profile kind\="CodeFormatterProfile" name\="Eclipse Riena [built-in]" version\="11">\r\n<setting id\="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value\="end_of_line"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_field" value\="0"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value\="false"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value\="80"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value\="end_of_line"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.blank_lines_after_package" value\="1"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.continuation_indentation" value\="2"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value\="1"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_package" value\="0"/>\r\n<setting id\="org.eclipse.jdt.core.compiler.source" value\="1.5"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.comment.format_line_comments" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value\="1"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value\="false"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value\="false"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.lineSplit" value\="120"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value\="0"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.indentation.size" value\="4"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_assignment" value\="0"/>\r\n<setting id\="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value\="error"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.tabulation.char" value\="tab"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_method" value\="1"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value\="false"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value\="end_of_line"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.brace_position_for_switch" value\="end_of_line"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value\="error"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value\="false"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.brace_position_for_block" value\="end_of_line"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value\="end_of_line"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.compact_else_if" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value\="end_of_line"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.tabulation.size" value\="4"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value\="false"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.indent_empty_lines" value\="false"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value\="end_of_line"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value\="1"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.compiler.compliance" value\="1.5"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value\="2"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value\="false"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value\="false"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value\="end_of_line"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value\="enabled"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.comment.line_length" value\="80"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value\="1"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value\="end_of_line"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value\="0"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value\="1"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value\="1"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.comment.format_html" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.comment.format_source_code" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value\="16"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value\="1.5"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value\="false"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.comment.format_header" value\="false"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.comment.format_block_comments" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value\="0"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value\="end_of_line"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value\="1"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value\="true"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value\="insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value\="false"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value\="do not insert"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value\="false"/>\r\n<setting id\="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value\="false"/>\r\n</profile>\r\n</profiles>\r\n
+org.eclipse.jdt.ui.formatterprofiles.version=11
org.eclipse.jdt.ui.gettersetter.use.is=true
org.eclipse.jdt.ui.ignorelowercasenames=true
org.eclipse.jdt.ui.importorder=java;javax;org;com;org.osgi;org.eclipse;org.eclipse.riena;
@@ -28,22 +81,27 @@ sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=true
sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
sp_cleanup.add_missing_nls_tags=false
sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
sp_cleanup.add_serial_version_id=false
sp_cleanup.always_use_blocks=true
sp_cleanup.always_use_parentheses_in_expressions=false
sp_cleanup.always_use_this_for_non_static_field_access=false
sp_cleanup.always_use_this_for_non_static_method_access=false
sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
sp_cleanup.format_source_code=true
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=true
sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=true
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=false
+sp_cleanup.on_save_use_additional_actions=true
sp_cleanup.organize_imports=true
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
@@ -55,8 +113,8 @@ sp_cleanup.remove_trailing_whitespaces=false
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
sp_cleanup.remove_unnecessary_casts=true
-sp_cleanup.remove_unnecessary_nls_tags=false
-sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
sp_cleanup.remove_unused_local_variables=false
sp_cleanup.remove_unused_private_fields=true
sp_cleanup.remove_unused_private_members=false
diff --git a/org.eclipse.riena.toolbox/AssemblyEditor.launch b/org.eclipse.riena.toolbox/AssemblyEditor.launch
index 3371435..be4c45f 100644
--- a/org.eclipse.riena.toolbox/AssemblyEditor.launch
+++ b/org.eclipse.riena.toolbox/AssemblyEditor.launch
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
<booleanAttribute key="append.args" value="true"/>
<booleanAttribute key="askclear" value="true"/>
@@ -13,14 +13,14 @@
<booleanAttribute key="default" value="false"/>
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="location" value="${workspace_loc}/../runtime-assemblyeditor"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-consoleLog --launcher.XXMaxPermSize 256m -debug -data C:\build\workspaces\workspace_mamax_toolbox"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-consoleLog --launcher.XXMaxPermSize 256m -debug -data C:\build\workspaces\toolbox_runtime"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms300m -Xmx900m"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<booleanAttribute key="restart" value="false"/>
-<stringAttribute key="selected_target_plugins" value="org.eclipse.ecf.identity@default:default,org.eclipse.equinox.p2.engine@default:default,javax.servlet.jsp@default:default,org.eclipse.jface@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.update.scheduler@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ant.ui@default:default,org.apache.jasper@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.team.cvs.ui@default:default,org.eclipse.update.core@default:default,org.apache.lucene.analysis@default:default,org.eclipse.swt.win32.win32.x86@default:false,org.eclipse.jdt@default:default,org.eclipse.compare@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.help.appserver@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.pde.ds.core@default:default,org.eclipse.equinox.p2.repository@default:default,com.jcraft.jsch@default:default,org.eclipse.help.base@default:default,org.eclipse.text@default:default,org.eclipse.osgi@-1:true,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.pde.ui@default:default,org.slf4j.api@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.net4j.jms.api@default:default,org.eclipse.ui.views@default:default,org.sat4j.core@default:default,org.eclipse.team.core@default:default,org.eclipse.equinox.ds@default:true,org.eclipse.equinox.p2.directorywatcher@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.jdt.compiler.apt@default:false,org.junit*3.8.2.v3_8_2_v20100427-1100@default:default,org.eclipse.jdt.doc.user@default:default,org.eclipse.ui@default:default,org.eclipse.jdt.junit.core@default:default,org.eclipse.pde@default:default,org.eclipse.update.core.win32@default:false,org.eclipse.core.runtime.compatibility@default:default,ch.qos.logback.classic@default:default,org.eclipse.help.webapp@default:default,org.eclipse.pde.ds.ui@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.ui.editors@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.jdt.apt.ui@default:default,org.sat4j.pb@default:default,org.eclipse.core.resources.win32.x86@default:false,org.eclipse.equinox.p2.director@default:default,org.eclipse.core.databinding@default:default,org.eclipse.pde.build@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.pde.ui.templates@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,javax.servlet@default:default,org.eclipse.equinox.p2.reconciler.dropins@default:default,org.eclipse.ecf.provider.filetransfer.httpclient@default:default,org.eclipse.core.jobs@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.core.net.win32.x86@default:false,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.search@default:default,org.apache.commons.httpclient@default:default,org.eclipse.ui.net@default:default,org.eclipse.jdt.core@default:default,org.eclipse.core.variables@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.ui.ide.application@default:default,org.apache.commons.codec@default:default,org.eclipse.pde.runtime@default:default,org.eclipse.equinox.p2.ql@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.security.win32.x86@default:false,org.eclipse.jsch.core@default:default,org.eclipse.equinox.p2.metadata.generator@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.pde.launching@default:default,org.eclipse.osgi.services@default:default,org.eclipse.core.net@default:default,org.eclipse.equinox.jsp.jasper@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.ui.workbench.compatibility@default:false,org.eclipse.core.runtime@default:true,ch.qos.logback.core@default:default,org.eclipse.jdt.junit@default:default,org.eclipse.debug.ui@default:default,org.eclipse.ui.views.log@default:default,org.eclipse.compare.core@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.equinox.p2.console@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.win32@default:false,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.help@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.objectweb.asm@default:default,org.mortbay.jetty.util@default:default,org.eclipse.ui.console@default:default,org.eclipse.equinox.p2.updatechecker@default:default,org.eclipse.osgi.util@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.equinox.util@default:default,org.eclipse.equinox.launcher.win32.win32.x86@default:false,org.eclipse.core.commands@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.swt@default:default,org.eclipse.core.resources@default:default,org.eclipse.equinox.http.registry@default:default,org.apache.commons.logging@default:default,org.eclipse.ant.core@default:default,org.eclipse.core.filebuffers@default:default,com.ibm.icu@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.cvs@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.app@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.ui.intro.universal@default:default,org.eclipse.pde.ua.ui@default:default,org.eclipse.ui.ide@default:default,org.eclipse.equinox.launcher@default:default,org.eclipse.update.configurator@3:true,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.core.boot@default:default,org.eclipse.equinox.p2.extensionlocation@default:default,org.mortbay.jetty.server@default:default,org.eclipse.team.cvs.ssh2@default:default,org.eclipse.jdt.launching@default:default,org.apache.lucene@default:default,org.eclipse.platform@default:default,org.eclipse.team.cvs.core@default:default,org.eclipse.pde.api.tools@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.ui.intro@default:default,org.eclipse.core.filesystem.win32.x86@default:false,org.apache.ant@default:default,org.eclipse.jdt.debug.ui@default:default,ch.qos.logback.slf4j@default:false,org.eclipse.ui.browser@default:default,org.eclipse.update.ui@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.platform.doc.isv@default:default,org.eclipse.help.ui@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.ui.forms@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.ecf.provider.filetransfer.httpclient.ssl@default:false,org.eclipse.core.databinding.observable@default:default,org.eclipse.ant.launching@default:default,org.eclipse.pde.junit.runtime@default:default,org.eclipse.debug.core@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.compare.win32@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.core.expressions@default:default,org.eclipse.ui.externaltools@default:default,org.eclipse.platform.doc.user@default:default,org.eclipse.ui.presentations.r21@default:default,org.eclipse.pde.core@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.jdt.apt.core@default:default,org.eclipse.jdt.apt.pluggable.core@default:default,org.eclipse.equinox.security@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.rcp@default:default,org.apache.commons.el@default:default,org.eclipse.equinox.jsp.jasper.registry@default:default,org.eclipse.team.ui@default:default,org.eclipse.pde.ua.core@default:default,org.eclipse.pde.api.tools.ui@default:default,org.hamcrest.core@default:default,org.eclipse.pde.doc.user@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.jdt.doc.isv@default:default,org.eclipse.core.externaltools@default:default,org.eclipse.ecf@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.equinox.p2.ui.sdk.scheduler@default:default,org.eclipse.jface.text@default:default,org.eclipse.equinox.p2.ui.sdk@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.jsch.ui@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="org.pushingpixels.trident@default:default,org.apache.commons.beanutils@default:default,org.eclipse.riena.toolbox@default:default,org.eclipse.riena.ui.swt@default:default,org.apache.commons.collections@default:default,org.apache.commons.lang@default:default,org.apache.oro@default:default,org.apache.velocity@default:default,org.apache.log4j@default:default,org.eclipse.riena.ui.ridgets.swt@default:default,org.eclipse.riena.ui.common@default:default,org.eclipse.riena.ui.templates@default:default,org.eclipse.nebula.widgets.compositetable@default:default,org.jdom@default:default,org.eclipse.riena.ui.core@default:default,org.eclipse.riena.beans.common@default:default,org.eclipse.equinox.log@default:default,org.eclipse.riena.ui.ridgets@default:default,org.eclipse.riena.ui.wizard.cs@default:default,org.eclipse.riena.core@default:default"/>
+<stringAttribute key="selected_target_plugins" value="org.eclipse.help@default:default,org.eclipse.osgi.util@default:default,org.eclipse.jdt.apt.pluggable.core@default:default,org.eclipse.team.cvs.core@default:default,org.eclipse.jsch.ui@default:default,org.eclipse.ui.net@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.core.externaltools@default:default,javax.servlet.jsp@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.core.resources.win32.x86@default:false,org.eclipse.update.configurator@3:true,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.debug.core@default:default,org.eclipse.ui.intro@default:default,org.eclipse.ui.views.log@default:default,org.eclipse.ant.core@default:default,org.eclipse.equinox.p2.ql@default:default,org.sat4j.pb@default:default,org.eclipse.pde.ui.templates@default:default,org.eclipse.jdt.core.manipulation@default:default,org.mortbay.jetty.util@default:default,org.eclipse.pde.doc.user@default:default,org.eclipse.ui.externaltools@default:default,org.eclipse.swt@default:default,org.eclipse.jdt.doc.isv@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.ui.console@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.equinox.launcher@default:default,org.apache.lucene@default:default,org.eclipse.help.base@default:default,org.eclipse.jface.text@default:default,org.eclipse.pde.api.tools.ui@default:default,org.eclipse.pde@default:default,org.objectweb.asm@default:default,org.sat4j.core@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.pde.ds.core@default:default,org.eclipse.ecf@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.help.webapp@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.jdt.apt.core@default:default,org.eclipse.ui.win32@default:false,org.eclipse.pde.api.tools@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.team.core@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.p2.directorywatcher@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.pde.ui@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.equinox.p2.extensionlocation@default:default,org.eclipse.team.cvs.ssh2@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.core.databinding@default:default,org.eclipse.equinox.p2.ui.sdk@default:default,org.eclipse.equinox.common@2:true,org.eclipse.debug.ui@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.team.cvs.ui@default:default,org.eclipse.jsch.core@default:default,org.eclipse.ui.editors@default:default,org.eclipse.swt.win32.win32.x86@default:false,org.eclipse.ui.navigator.resources@default:default,org.eclipse.core.resources@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.junit*3.8.2.v3_8_2_v20100427-1100@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.equinox.ds@default:true,org.eclipse.ecf.identity@default:default,javax.activation@default:default,org.eclipse.jface@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.security@default:default,org.apache.ant@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.pde.ua.core@default:default,org.eclipse.pde.core@default:default,org.eclipse.core.boot@default:default,org.eclipse.update.ui@default:default,org.eclipse.ui.intro.universal@default:default,org.eclipse.core.expressions@default:default,org.eclipse.equinox.jsp.jasper.registry@default:default,org.eclipse.ui.forms@default:default,org.eclipse.jdt.doc.user@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.osgi.services@default:default,org.eclipse.jdt.junit.core@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.ui@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.core.jobs@default:default,javax.servlet@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.text@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.jdt.debug@default:default,org.apache.lucene.analysis@default:default,org.eclipse.pde.runtime@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.equinox.p2.core@default:default,org.apache.commons.logging@default:default,org.eclipse.compare.core@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.search@default:default,org.eclipse.team.ui@default:default,org.eclipse.update.core.win32@default:false,org.eclipse.ant.ui@default:default,org.eclipse.jdt.core@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.jdt@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ant.launching@default:default,org.apache.commons.httpclient@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.update.core@default:default,org.eclipse.core.runtime@default:true,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.ui.presentations.r21@default:default,org.eclipse.core.runtime.compatibility@default:default,com.ibm.icu@default:default,org.eclipse.platform.doc.user@default:default,org.eclipse.compare@default:default,org.eclipse.jdt.junit@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.pde.launching@default:default,org.eclipse.osgi@-1:true,org.eclipse.core.runtime.compatibility.auth@default:default,com.jcraft.jsch@default:default,org.apache.jasper@default:default,org.eclipse.platform.doc.isv@default:default,org.eclipse.cvs@default:default,org.eclipse.jdt.debug.ui@default:default,org.hamcrest.core@default:default,javax.mail@default:default,org.eclipse.compare.win32@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.ecf.provider.filetransfer.httpclient.ssl@default:false,org.eclipse.ecf.filetransfer@default:default,org.eclipse.update.scheduler@default:default,org.eclipse.core.net.win32.x86@default:false,org.eclipse.equinox.p2.metadata.generator@default:default,org.eclipse.ui.workbench.compatibility@default:false,org.eclipse.equinox.security.ui@default:default,org.apache.commons.codec@default:default,org.eclipse.help.ui@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.pde.build@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.core.filesystem.win32.x86@default:false,org.eclipse.pde.junit.runtime@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.mortbay.jetty.server@default:default,org.apache.commons.el@default:default,org.eclipse.equinox.util@default:default,org.eclipse.equinox.jsp.jasper@default:default,org.eclipse.pde.ds.ui@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.help.appserver@default:default,org.eclipse.pde.ua.ui@default:default,org.eclipse.platform@default:default,org.eclipse.equinox.p2.console@default:default,org.eclipse.rcp@default:default,org.eclipse.ecf.provider.filetransfer.httpclient@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.core.net@default:default,org.eclipse.equinox.launcher.win32.win32.x86@default:false,org.eclipse.equinox.p2.updatechecker@default:default,org.eclipse.equinox.p2.reconciler.dropins@default:default,org.eclipse.jdt.apt.ui@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.p2.ui.sdk.scheduler@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.ui.browser@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.core.commands@default:default,org.eclipse.net4j.jms.api@default:default,org.eclipse.core.variables@default:default,org.eclipse.equinox.security.win32.x86@default:false,org.eclipse.ui.views@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.riena.ui.common@default:default,org.apache.log4j@default:default,org.eclipse.riena.ui.swt@default:default,org.apache.velocity@default:default,org.eclipse.riena.ui.templates@default:default,org.apache.commons.beanutils@default:default,org.eclipse.riena.ui.ridgets@default:default,org.eclipse.riena.toolbox@default:default,org.eclipse.riena.core@default:default,org.eclipse.riena.ui.core@default:default,org.apache.commons.lang@default:default,org.eclipse.equinox.log@default:default,org.eclipse.nebula.widgets.compositetable@default:default,org.eclipse.riena.beans.common@default:default,org.eclipse.riena.ui.ridgets.swt@default:default,org.pushingpixels.trident@default:default,org.apache.commons.collections@default:default,org.apache.oro@default:default,org.eclipse.riena.ui.wizard.cs@default:default,org.jdom@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
<booleanAttribute key="tracing" value="false"/>
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/Activator.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/Activator.java
index e427b84..82be414 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/Activator.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/Activator.java
@@ -10,7 +10,11 @@
*******************************************************************************/
package org.eclipse.riena.toolbox;
+import org.osgi.framework.BundleContext;
+
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
import org.eclipse.riena.toolbox.assemblyeditor.AssemblyDataProvider;
import org.eclipse.riena.toolbox.assemblyeditor.CodeGenerator;
import org.eclipse.riena.toolbox.assemblyeditor.ModelService;
@@ -18,9 +22,6 @@ import org.eclipse.riena.toolbox.assemblyeditor.NodeFactory;
import org.eclipse.riena.toolbox.assemblyeditor.PluginXmlParser;
import org.eclipse.riena.toolbox.assemblyeditor.PluginXmlRenderer;
import org.eclipse.riena.toolbox.assemblyeditor.model.AssemblyModel;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
/**
* The activator class controls the plug-in life cycle
@@ -42,7 +43,7 @@ public class Activator extends AbstractUIPlugin {
private NodeFactory nodeFactory;
private CodeGenerator codeGenerator;
-
+
/**
* The constructor
*/
@@ -51,12 +52,16 @@ public class Activator extends AbstractUIPlugin {
/*
* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+ * )
*/
- public void start(BundleContext context) throws Exception {
+ @Override
+ public void start(final BundleContext context) throws Exception {
super.start(context);
plugin = this;
-
+
dataProvider = new AssemblyDataProvider();
dataProvider.setXmlParser(new PluginXmlParser());
dataProvider.setXmlRenderer(new PluginXmlRenderer());
@@ -74,7 +79,7 @@ public class Activator extends AbstractUIPlugin {
return assemblyModel;
}
- public void setAssemblyModel(AssemblyModel assemblyModel) {
+ public void setAssemblyModel(final AssemblyModel assemblyModel) {
this.assemblyModel = assemblyModel;
}
@@ -92,16 +97,20 @@ public class Activator extends AbstractUIPlugin {
/*
* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+ * )
*/
- public void stop(BundleContext context) throws Exception {
+ @Override
+ public void stop(final BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
@@ -109,13 +118,14 @@ public class Activator extends AbstractUIPlugin {
}
/**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path the path
+ * Returns an image descriptor for the image file at the given plug-in
+ * relative path
+ *
+ * @param path
+ * the path
* @return the image descriptor
*/
- public static ImageDescriptor getImageDescriptor(String path) {
+ public static ImageDescriptor getImageDescriptor(final String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/Util.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/Util.java
index f04a84e..617653b 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/Util.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/Util.java
@@ -13,7 +13,7 @@ package org.eclipse.riena.toolbox;
import org.eclipse.riena.toolbox.assemblyeditor.model.AbstractAssemblyNode;
public class Util {
- public static boolean isGiven(String in) {
+ public static boolean isGiven(final String in) {
return (null != in && in.trim().length() > 0);
}
@@ -26,20 +26,28 @@ public class Util {
*
*
* @param nodeId
+ * @param toLowerCase
+ *
* @return
*/
- public static String cleanNodeId(final String nodeId) {
- String cleanNodeId = nodeId.toLowerCase();
+ public static String cleanNodeId(final String nodeId, final boolean toLowerCase) {
+ String cleanNodeId = nodeId;
+ if (toLowerCase) {
+ cleanNodeId = cleanNodeId.toLowerCase();
+ }
+
cleanNodeId = cleanNodeId.replaceAll("\\s", ""); // remove Whitespace //$NON-NLS-1$ //$NON-NLS-2$
cleanNodeId = cleanNodeId.replaceAll("[^A-Za-z0-9]+", ""); // remove invalid Characters //$NON-NLS-1$ //$NON-NLS-2$
- if (cleanNodeId.length() > 1) {
+
+ if (!toLowerCase && cleanNodeId.length() > 1) {
cleanNodeId = Character.toUpperCase(cleanNodeId.charAt(0)) + cleanNodeId.substring(1); // Capitalize first Character
}
+
return cleanNodeId;
}
- public static <T extends AbstractAssemblyNode> T findParentOfType(AbstractAssemblyNode current,
- Class<? extends T> type) {
+ public static <T extends AbstractAssemblyNode> T findParentOfType(final AbstractAssemblyNode current,
+ final Class<? extends T> type) {
if (null == current) {
return null;
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AbstractXmlProvider.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AbstractXmlProvider.java
index b10ba48..51c7e13 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AbstractXmlProvider.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AbstractXmlProvider.java
@@ -88,6 +88,11 @@ public class AbstractXmlProvider {
protected static final String ATTR_VIEW_NAME = "name"; //$NON-NLS-1$
protected static final String ATTR_VIEW_ID = "id"; //$NON-NLS-1$
+ // ##### RCP-Perspective
+ protected static final String ATTR_PERSPECTIVE_NAME = "name"; //$NON-NLS-1$
+ protected static final String ATTR_PERSPECTIVE_ID = "id"; //$NON-NLS-1$
+ protected static final String ATTR_PERSPECTIVE_CLASS = "class"; //$NON-NLS-1$
+
protected static final String ELEM_PLUGIN = "plugin"; //$NON-NLS-1$
protected static final String ELEM_EXTENSION = "extension"; //$NON-NLS-1$
protected static final String ELEM_VIEW = "view"; //$NON-NLS-1$
@@ -103,32 +108,32 @@ public class AbstractXmlProvider {
protected BundleNode bundleNode;
public AbstractXmlProvider() {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setValidating(false);
dbf.setNamespaceAware(false);
dbf.setIgnoringElementContentWhitespace(true);
try {
builder = dbf.newDocumentBuilder();
- } catch (ParserConfigurationException e) {
+ } catch (final ParserConfigurationException e) {
throw new RuntimeException(e);
}
}
- protected File convertToFile(IFile pluginXml) {
+ protected File convertToFile(final IFile pluginXml) {
return new File(bundleNode.getPluginXml().getLocationURI());
}
protected Transformer createTransformer() throws TransformerException {
- TransformerFactory transformerFactory = TransformerFactory.newInstance();
+ final TransformerFactory transformerFactory = TransformerFactory.newInstance();
try {
transformerFactory.setAttribute("indent-number", new Integer(4)); //$NON-NLS-1$
- } catch (IllegalArgumentException exception) {
+ } catch (final IllegalArgumentException exception) {
// Ignore
}
- Transformer transformer = transformerFactory.newTransformer();
+ final Transformer transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.METHOD, "xml");
@@ -142,48 +147,48 @@ public class AbstractXmlProvider {
return transformer;
}
- protected void saveDocument(Document doc, BundleNode bundleNode) {
+ protected void saveDocument(final Document doc, final BundleNode bundleNode) {
try {
- Transformer xformer = createTransformer();
+ final Transformer xformer = createTransformer();
xformer.transform(new DOMSource(doc), new StreamResult(convertToFile(bundleNode.getPluginXml())));
- } catch (TransformerException e) {
+ } catch (final TransformerException e) {
throw new RuntimeException(e);
}
}
- protected Document getDocument(BundleNode bundleNode) {
+ protected Document getDocument(final BundleNode bundleNode) {
this.bundleNode = bundleNode;
try {
return builder.parse(new FileInputStream(convertToFile(bundleNode.getPluginXml())));
- } catch (SAXException e) {
+ } catch (final SAXException e) {
e.printStackTrace();
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
return null;
}
- protected static boolean parseBoolean(Element elm, String attributeName, boolean defaultValue) {
- String attr = elm.getAttribute(attributeName);
+ protected static boolean parseBoolean(final Element elm, final String attributeName, final boolean defaultValue) {
+ final String attr = elm.getAttribute(attributeName);
if (null != attr && attr.length() > 0) {
return "true".equals(attr); //$NON-NLS-1$
}
return defaultValue;
}
- protected static Integer parseInteger(Element elm, String attributeName) {
- String attr = elm.getAttribute(attributeName);
+ protected static Integer parseInteger(final Element elm, final String attributeName) {
+ final String attr = elm.getAttribute(attributeName);
if (Util.isGiven(attr)) {
return new Integer(Integer.parseInt(attr));
}
return null;
}
- protected Element getFirstChild(Element rootElement, String childElementName) {
- NodeList elementList = rootElement.getChildNodes();
+ protected Element getFirstChild(final Element rootElement, final String childElementName) {
+ final NodeList elementList = rootElement.getChildNodes();
for (int i = 0; i < elementList.getLength(); i++) {
- Node node = elementList.item(i);
+ final Node node = elementList.item(i);
if (node instanceof Element) {
if (node.getNodeName().equals(childElementName)) {
@@ -198,17 +203,17 @@ public class AbstractXmlProvider {
private final Element rootElement;
private final List<String> childElementNames;
- public NodeIterator(Element element, String... childElements) {
+ public NodeIterator(final Element element, final String... childElements) {
this.rootElement = element;
this.childElementNames = Arrays.asList(childElements);
}
public void iterate() {
- NodeList elementList = rootElement.getChildNodes();
+ final NodeList elementList = rootElement.getChildNodes();
for (int i = 0; i < elementList.getLength(); i++) {
- Node childNode = elementList.item(i);
+ final Node childNode = elementList.item(i);
if (childNode instanceof Element && childElementNames.contains(childNode.getNodeName())) {
- Element elm = (Element) childNode;
+ final Element elm = (Element) childNode;
handle(elm);
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AddUIControlCallGenerator.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AddUIControlCallGenerator.java
index cb45b56..7fae5f0 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AddUIControlCallGenerator.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AddUIControlCallGenerator.java
@@ -32,9 +32,9 @@ public class AddUIControlCallGenerator extends RidgetGenerator {
*/
private String[] controlBlacklist = new String[] {};
- public AddUIControlCallGenerator(IProject project) {
+ public AddUIControlCallGenerator(final IProject project) {
super(project);
- String blackListString = Activator.getDefault().getPreferenceStore()
+ final String blackListString = Activator.getDefault().getPreferenceStore()
.getString(PreferenceConstants.CONST_CONFIGURE_RIDGETS_BLACKLIST);
if (Util.isGiven(blackListString)) {
controlBlacklist = blackListString.split(";");
@@ -50,23 +50,23 @@ public class AddUIControlCallGenerator extends RidgetGenerator {
*
* @param fullyQualifiedClassName
*/
- public boolean generateAddUIControlCalls(String fullyQualifiedClassName) {
- CompilationUnit astNode = findCompilationUnit(fullyQualifiedClassName);
+ public boolean generateAddUIControlCalls(final String fullyQualifiedClassName) {
+ final CompilationUnit astNode = findCompilationUnit(fullyQualifiedClassName);
if (null == astNode) {
return false;
}
astNode.recordModifications();
- MethodDeclaration methodBasicCreatePartControl = findMethod(astNode, METHOD_BASIC_CREATE_PART_CONTROL);
+ final MethodDeclaration methodBasicCreatePartControl = findMethod(astNode, METHOD_BASIC_CREATE_PART_CONTROL);
if (null == methodBasicCreatePartControl) {
return false;
}
- CollectMethodDeclerationsVisitor collector = new CollectMethodDeclerationsVisitor();
+ final CollectMethodDeclerationsVisitor collector = new CollectMethodDeclerationsVisitor();
astNode.accept(collector);
- SWTControlInstantiationVisitor controlCollector = new SWTControlInstantiationVisitor(controlBlacklist,
+ final SWTControlInstantiationVisitor controlCollector = new SWTControlInstantiationVisitor(controlBlacklist,
collector.getMethods());
methodBasicCreatePartControl.accept(controlCollector);
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AddUIControlCallVisitor.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AddUIControlCallVisitor.java
index f99e03e..48ae567 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AddUIControlCallVisitor.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AddUIControlCallVisitor.java
@@ -21,20 +21,19 @@ import org.eclipse.jdt.core.dom.SimpleName;
* Collects all addUIControl-Calls
*
*/
-public class AddUIControlCallVisitor extends ASTVisitor{
-
- private Set<String> variables = new HashSet<String>();
-
+public class AddUIControlCallVisitor extends ASTVisitor {
+
+ private final Set<String> variables = new HashSet<String>();
@Override
- public boolean visit(MethodInvocation node) {
- if ("addUIControl".equals(node.getName().getFullyQualifiedName())){
- if (!node.arguments().isEmpty()){
- Object obj = node.arguments().get(0);
-
- if (obj instanceof SimpleName){
- SimpleName sn = (SimpleName) obj;
- String varName = sn.getFullyQualifiedName();
+ public boolean visit(final MethodInvocation node) {
+ if ("addUIControl".equals(node.getName().getFullyQualifiedName())) {
+ if (!node.arguments().isEmpty()) {
+ final Object obj = node.arguments().get(0);
+
+ if (obj instanceof SimpleName) {
+ final SimpleName sn = (SimpleName) obj;
+ final String varName = sn.getFullyQualifiedName();
variables.add(varName);
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AssemblyDataProvider.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AssemblyDataProvider.java
index 1516dd7..cf5c7ed 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AssemblyDataProvider.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/AssemblyDataProvider.java
@@ -45,15 +45,15 @@ public class AssemblyDataProvider implements IAssemblyDataProvider {
private IPluginXmlRenderer xmlRenderer;
private List<ResourceChangeListener> changeListener;
- private Set<Long> receivedTimeStamps = new HashSet<Long>();
+ private final Set<Long> receivedTimeStamps = new HashSet<Long>();
public AssemblyDataProvider() {
changeListener = new ArrayList<ResourceChangeListener>();
ResourcesPlugin.getWorkspace().addResourceChangeListener(new IResourceChangeListener() {
- public void resourceChanged(IResourceChangeEvent event) {
+ public void resourceChanged(final IResourceChangeEvent event) {
try {
- PluginXmlVisitor pluginXmlVisitor = new PluginXmlVisitor(receivedTimeStamps);
+ final PluginXmlVisitor pluginXmlVisitor = new PluginXmlVisitor(receivedTimeStamps);
event.getDelta().accept(pluginXmlVisitor);
final IProject changedProject = pluginXmlVisitor.getChangedProject();
@@ -63,7 +63,7 @@ public class AssemblyDataProvider implements IAssemblyDataProvider {
return;
}
- for (ResourceChangeListener listener : changeListener) {
+ for (final ResourceChangeListener listener : changeListener) {
if (null != changedProject) {
listener.pluginXmlChanged(changedProject);
}
@@ -73,18 +73,18 @@ public class AssemblyDataProvider implements IAssemblyDataProvider {
}
}
- } catch (CoreException e) {
+ } catch (final CoreException e) {
e.printStackTrace();
}
}
}, IResourceChangeEvent.POST_CHANGE);
}
- public boolean addResourceChangeListener(ResourceChangeListener e) {
+ public boolean addResourceChangeListener(final ResourceChangeListener e) {
return changeListener.add(e);
}
- public boolean removeResourceChangeListener(ResourceChangeListener o) {
+ public boolean removeResourceChangeListener(final ResourceChangeListener o) {
return changeListener.remove(o);
}
@@ -92,21 +92,21 @@ public class AssemblyDataProvider implements IAssemblyDataProvider {
private IProject changedProject;
private IProject addedProject;
- private Set<Long> receivedTimeStamps;
+ private final Set<Long> receivedTimeStamps;
/**
* @param receivedTimeStamps
*/
- public PluginXmlVisitor(Set<Long> receivedTimeStamps) {
+ public PluginXmlVisitor(final Set<Long> receivedTimeStamps) {
super();
this.receivedTimeStamps = receivedTimeStamps;
}
- public boolean visit(IResourceDelta delta) throws CoreException {
- IResource res = delta.getResource();
+ public boolean visit(final IResourceDelta delta) throws CoreException {
+ final IResource res = delta.getResource();
if (res.getType() == IResource.FILE) {
- Long currentTimestamp = res.getLocalTimeStamp();
+ final Long currentTimestamp = res.getLocalTimeStamp();
if (!receivedTimeStamps.contains(currentTimestamp)) {
receivedTimeStamps.add(currentTimestamp);
if (PLUGIN_XML.equals(res.getName())) {
@@ -118,7 +118,7 @@ public class AssemblyDataProvider implements IAssemblyDataProvider {
}
} else if (res.getType() == IResource.PROJECT) {
- IProject project = (IProject) res;
+ final IProject project = (IProject) res;
if (delta.getKind() == IResourceDelta.ADDED) {
addedProject = (IProject) res;
return false;
@@ -140,7 +140,7 @@ public class AssemblyDataProvider implements IAssemblyDataProvider {
return xmlRenderer;
}
- public void setXmlRenderer(IPluginXmlRenderer xmlRenderer) {
+ public void setXmlRenderer(final IPluginXmlRenderer xmlRenderer) {
this.xmlRenderer = xmlRenderer;
}
@@ -148,7 +148,7 @@ public class AssemblyDataProvider implements IAssemblyDataProvider {
return xmlParser;
}
- public void setXmlParser(IPluginXmlParser xmlParser) {
+ public void setXmlParser(final IPluginXmlParser xmlParser) {
this.xmlParser = xmlParser;
}
@@ -158,12 +158,12 @@ public class AssemblyDataProvider implements IAssemblyDataProvider {
* @param model
* @return
*/
- private List<BundleNode> findBundles(AssemblyModel model) {
- List<BundleNode> bundles = new ArrayList<BundleNode>();
- for (IProject proj : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
- IFile pluginXml = proj.getFile(PLUGIN_XML);
+ private List<BundleNode> findBundles(final AssemblyModel model) {
+ final List<BundleNode> bundles = new ArrayList<BundleNode>();
+ for (final IProject proj : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
+ final IFile pluginXml = proj.getFile(PLUGIN_XML);
if (isJavaProject(proj)) {
- BundleNode bundle = new BundleNode(model);
+ final BundleNode bundle = new BundleNode(model);
bundle.setName(proj.getName());
bundle.setProject(proj);
if (null != pluginXml && pluginXml.exists()) {
@@ -177,7 +177,7 @@ public class AssemblyDataProvider implements IAssemblyDataProvider {
return bundles;
}
- private boolean isJavaProject(IProject project) {
+ private boolean isJavaProject(final IProject project) {
try {
// ignore closed projects, otherwise an exception is thrown
if (!project.isAccessible()) {
@@ -186,17 +186,17 @@ public class AssemblyDataProvider implements IAssemblyDataProvider {
//org.eclipse.jdt.core.javanature
return null != project.getNature("org.eclipse.pde.PluginNature"); //$NON-NLS-1$
- } catch (CoreException e) {
+ } catch (final CoreException e) {
e.printStackTrace();
}
return false;
}
- public void saveData(AssemblyModel model) {
+ public void saveData(final AssemblyModel model) {
Assert.isNotNull(model);
Assert.isNotNull(xmlRenderer);
- for (BundleNode bundle : model.getChildren()) {
+ for (final BundleNode bundle : model.getChildren()) {
if (!bundle.isDirty()) {
continue;
@@ -206,14 +206,14 @@ public class AssemblyDataProvider implements IAssemblyDataProvider {
if (null == bundle.getPluginXml() || !bundle.getPluginXml().exists()) {
if (bundle.getChildren() != null && bundle.getChildren().size() != 0) {
// plugin.xml does not exist, assemblies exist
- IFile pluginXml = bundle.getProject().getFile(PLUGIN_XML);
+ final IFile pluginXml = bundle.getProject().getFile(PLUGIN_XML);
try {
String dummy = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>"; //$NON-NLS-1$
dummy += "<?eclipse version=\"3.4\"?>"; //$NON-NLS-1$
dummy += "<plugin></plugin>\n"; //$NON-NLS-1$
pluginXml.create(new ByteArrayInputStream(dummy.getBytes()), true, null);
bundle.setPluginXml(pluginXml);
- } catch (CoreException e) {
+ } catch (final CoreException e) {
e.printStackTrace();
}
xmlRenderer.saveDocument(bundle);
@@ -237,21 +237,21 @@ public class AssemblyDataProvider implements IAssemblyDataProvider {
}
public AssemblyModel createData() {
- AssemblyModel model = new AssemblyModel();
- List<BundleNode> bundles = findBundles(model);
- for (BundleNode bundle : bundles) {
- IFile pluginXml = bundle.getPluginXml();
+ final AssemblyModel model = new AssemblyModel();
+ final List<BundleNode> bundles = findBundles(model);
+ for (final BundleNode bundle : bundles) {
+ final IFile pluginXml = bundle.getPluginXml();
if (null == pluginXml) {
continue;
}
- Set<RCPView> rcpViews = xmlParser.getRcpViews(bundle);
+ final Set<RCPView> rcpViews = xmlParser.getRcpViews(bundle);
bundle.setRegisteredRcpViews(rcpViews);
- Set<RCPPerspective> rcpPerspectivs = xmlParser.getRcpPerspectives(bundle);
+ final Set<RCPPerspective> rcpPerspectivs = xmlParser.getRcpPerspectives(bundle);
bundle.setRegisteredRcpPerspectives(rcpPerspectivs);
- List<AssemblyNode> asses = xmlParser.parseDocument(bundle);
+ final List<AssemblyNode> asses = xmlParser.parseDocument(bundle);
model.addAllRcpViews(rcpViews);
model.addAllRcpPerspectives(rcpPerspectivs);
bundle.addAll(asses);
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/CodeGenerator.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/CodeGenerator.java
index 8747f2d..ed658de 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/CodeGenerator.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/CodeGenerator.java
@@ -50,10 +50,10 @@ public class CodeGenerator implements ICodeGenerator {
private static final String VAR_PACKAGE_NAME = "PackageName"; //$NON-NLS-1$
private VelocityEngine velocityEngine;
- private String baseAbsolutePath;
+ private final String baseAbsolutePath;
public CodeGenerator() {
- Properties p = new Properties();
+ final Properties p = new Properties();
baseAbsolutePath = getBaseDir();
if (baseAbsolutePath.contains(".jar!")) { //$NON-NLS-1$
p.setProperty("resource.loader", "url"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -69,12 +69,12 @@ public class CodeGenerator implements ICodeGenerator {
try {
velocityEngine = new VelocityEngine(p);
velocityEngine.init();
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException();
}
}
- private String getPreference(String key) {
+ private String getPreference(final String key) {
String defaultPackageController = Activator.getDefault().getPreferenceStore().getString(key);
if (!Util.isGiven(defaultPackageController)) {
defaultPackageController = Activator.getDefault().getPreferenceStore().getDefaultString(key);
@@ -82,47 +82,48 @@ public class CodeGenerator implements ICodeGenerator {
return defaultPackageController;
}
- public String generateController(SubModuleNode subModule) {
- String defaultPackageController = getPreference(PreferenceConstants.CONST_GENERATE_CONTROLLER_PACKAGE_NAME);
+ public String generateController(final SubModuleNode subModule) {
+ final String defaultPackageController = getPreference(PreferenceConstants.CONST_GENERATE_CONTROLLER_PACKAGE_NAME);
String packageName = subModule.getBundle().getName() + PACKAGE_SEPARATOR + defaultPackageController;
packageName = packageName.toLowerCase();
- String className = Util.cleanNodeId(subModule.getName()) + CONTROLLER_SUFFIX;
+ final String className = Util.cleanNodeId(subModule.getName(), false) + CONTROLLER_SUFFIX;
- Map<String, String> properties = new HashMap<String, String>();
+ final Map<String, String> properties = new HashMap<String, String>();
properties.put(VAR_CLASS_NAME, className);
properties.put(VAR_PACKAGE_NAME, packageName);
- String fullClassName = generateClass(packageName, className, subModule, TEMPLATE_SUB_MODULE_CONTROLLER,
+ final String fullClassName = generateClass(packageName, className, subModule, TEMPLATE_SUB_MODULE_CONTROLLER,
properties);
return fullClassName;
}
- public RCPView generateView(SubModuleNode subModule) {
- String defaultPackageView = getPreference(PreferenceConstants.CONST_GENERATE_VIEW_PACKAGE_NAME);
+ public RCPView generateView(final SubModuleNode subModule) {
+ final String defaultPackageView = getPreference(PreferenceConstants.CONST_GENERATE_VIEW_PACKAGE_NAME);
String packageName = subModule.getBundle().getName() + PACKAGE_SEPARATOR + defaultPackageView;
packageName = packageName.toLowerCase();
- String className = Util.cleanNodeId(subModule.getName()) + VIEW_SUFFIX;
+ final String className = Util.cleanNodeId(subModule.getName(), false) + VIEW_SUFFIX;
- Map<String, String> properties = new HashMap<String, String>();
+ final Map<String, String> properties = new HashMap<String, String>();
properties.put(VAR_CLASS_NAME, className);
properties.put(VAR_PACKAGE_NAME, packageName);
- String classFileName = generateClass(packageName, className, subModule, TEMPLATE_SUB_MODULE_VIEW, properties);
+ final String classFileName = generateClass(packageName, className, subModule, TEMPLATE_SUB_MODULE_VIEW,
+ properties);
- RCPView view = new RCPView();
+ final RCPView view = new RCPView();
view.setViewClass(classFileName);
view.setId(classFileName);
view.setName(classFileName);
return view;
}
- private boolean createFile(IFile outFile, String data) {
- ByteArrayInputStream bis = new ByteArrayInputStream(data.getBytes());
+ private boolean createFile(final IFile outFile, final String data) {
+ final ByteArrayInputStream bis = new ByteArrayInputStream(data.getBytes());
if (!outFile.exists()) {
try {
outFile.create(bis, true, null);
return true;
- } catch (CoreException e) {
+ } catch (final CoreException e) {
throw new RuntimeException(e);
}
}
@@ -131,7 +132,7 @@ public class CodeGenerator implements ICodeGenerator {
private String getBaseDir() {
try {
- File bundle = FileLocator.getBundleFile(Activator.getDefault().getBundle());
+ final File bundle = FileLocator.getBundleFile(Activator.getDefault().getBundle());
String bundleAbsolutePath = bundle.getAbsolutePath();
if (bundleAbsolutePath.endsWith(".jar")) { //$NON-NLS-1$
bundleAbsolutePath = bundleAbsolutePath.replace('\\', '/');
@@ -142,74 +143,74 @@ public class CodeGenerator implements ICodeGenerator {
return bundleAbsolutePath;
}
return bundleAbsolutePath + "/" + DIR_TEMPLATES; //$NON-NLS-1$
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new RuntimeException(e);
}
}
- private String generateClass(String packageName, String className, SubModuleNode subModule, String templateName,
- Map<String, String> properties) {
+ private String generateClass(final String packageName, final String className, final SubModuleNode subModule,
+ final String templateName, final Map<String, String> properties) {
StringWriter writer = null;
try {
- Template t = velocityEngine.getTemplate(templateName);
- VelocityContext context = new VelocityContext();
+ final Template t = velocityEngine.getTemplate(templateName);
+ final VelocityContext context = new VelocityContext();
- for (Iterator<Entry<String, String>> it = properties.entrySet().iterator(); it.hasNext();) {
- Entry<String, String> entry = it.next();
+ for (final Iterator<Entry<String, String>> it = properties.entrySet().iterator(); it.hasNext();) {
+ final Entry<String, String> entry = it.next();
context.put(entry.getKey(), entry.getValue());
}
writer = new StringWriter();
t.merge(context, writer);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
throw new RuntimeException("exception in generateClass: basePath =" + baseAbsolutePath, e); //$NON-NLS-1$
}
- IFolder packageFolder = subModule
+ final IFolder packageFolder = subModule
.getBundle()
.getProject()
.getFolder(
subModule.getBundle().getSourceFolder() + File.separator
+ packageName.replace(PACKAGE_SEPARATOR, File.separator));
createFolder(packageFolder);
- IFile classFile = packageFolder.getFile(className + EXTENSION_JAVA);
+ final IFile classFile = packageFolder.getFile(className + EXTENSION_JAVA);
createFile(classFile, writer.toString());
return packageName + PACKAGE_SEPARATOR + className;
}
- private void createFolder(IFolder folder) {
- IContainer parent = folder.getParent();
+ private void createFolder(final IFolder folder) {
+ final IContainer parent = folder.getParent();
if (parent instanceof IFolder) {
createFolder((IFolder) parent);
}
if (!folder.exists()) {
try {
folder.create(true, true, null);
- } catch (CoreException e) {
+ } catch (final CoreException e) {
e.printStackTrace();
}
}
}
- private boolean deleteSourceFile(SubModuleNode subModule, String className) {
+ private boolean deleteSourceFile(final SubModuleNode subModule, final String className) {
if (!Util.isGiven(className)) {
System.err.println("ClassName is null subModule " + subModule);
return false;
}
- IProject project = subModule.getBundle().getProject();
- String fileName = subModule.getBundle().getSourceFolder() + File.separator
+ final IProject project = subModule.getBundle().getProject();
+ final String fileName = subModule.getBundle().getSourceFolder() + File.separator
+ className.replace(PACKAGE_SEPARATOR, File.separator) + EXTENSION_JAVA;
- IFile file = project.getFile(fileName);
+ final IFile file = project.getFile(fileName);
if (file.exists()) {
try {
file.delete(true, null);
return true;
- } catch (CoreException e) {
+ } catch (final CoreException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
@@ -217,7 +218,7 @@ public class CodeGenerator implements ICodeGenerator {
return false;
}
- public void deleteControllerClass(SubModuleNode subModule) {
+ public void deleteControllerClass(final SubModuleNode subModule) {
if (null == subModule) {
return;
}
@@ -225,7 +226,7 @@ public class CodeGenerator implements ICodeGenerator {
deleteSourceFile(subModule, subModule.getController());
}
- public void deleteViewClass(SubModuleNode subModule) {
+ public void deleteViewClass(final SubModuleNode subModule) {
if (null == subModule) {
return;
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/CollectMethodDeclerationsVisitor.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/CollectMethodDeclerationsVisitor.java
index 9981091..b53de25 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/CollectMethodDeclerationsVisitor.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/CollectMethodDeclerationsVisitor.java
@@ -16,12 +16,12 @@ import java.util.List;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.MethodDeclaration;
-public class CollectMethodDeclerationsVisitor extends ASTVisitor{
-
- private List<MethodDeclaration> methods = new ArrayList<MethodDeclaration>();
-
+public class CollectMethodDeclerationsVisitor extends ASTVisitor {
+
+ private final List<MethodDeclaration> methods = new ArrayList<MethodDeclaration>();
+
@Override
- public boolean visit(MethodDeclaration node) {
+ public boolean visit(final MethodDeclaration node) {
methods.add(node);
return true;
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ModelService.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ModelService.java
index dbb5474..8f12079 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ModelService.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ModelService.java
@@ -14,6 +14,7 @@ import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.resources.IProject;
+
import org.eclipse.riena.toolbox.Util;
import org.eclipse.riena.toolbox.assemblyeditor.api.IModelService;
import org.eclipse.riena.toolbox.assemblyeditor.model.AbstractTypedNode;
@@ -22,102 +23,97 @@ import org.eclipse.riena.toolbox.assemblyeditor.model.AssemblyNode;
import org.eclipse.riena.toolbox.assemblyeditor.model.BundleNode;
import org.eclipse.riena.toolbox.assemblyeditor.model.SubModuleNode;
+public class ModelService implements IModelService {
-public class ModelService implements IModelService{
+ private final static String CONST_APPLICATION = "application"; //$NON-NLS-1$
- private final static String CONST_APPLICATION ="application"; //$NON-NLS-1$
-
- public Set<String> getAllParentTypeIds(AssemblyModel model) {
- Set<String> typeIds = getAllTypeIds(model, null);
+ public Set<String> getAllParentTypeIds(final AssemblyModel model) {
+ final Set<String> typeIds = getAllTypeIds(model, null);
typeIds.add(CONST_APPLICATION);
return typeIds;
}
- public Set<String> getAllTypeIds(AssemblyModel model, AbstractTypedNode ignoreNode){
- Set<String> typeIds = new HashSet<String>();
+ public Set<String> getAllTypeIds(final AssemblyModel model, final AbstractTypedNode ignoreNode) {
+ final Set<String> typeIds = new HashSet<String>();
typeIds.add(CONST_APPLICATION);
-
- for (BundleNode bundle : model.getChildren()){
- for (AssemblyNode ass: bundle.getChildren()){
- for (AbstractTypedNode typeNode : ass.getChildren()){
-
- if (!typeNode.equals(ignoreNode) &&
- Util.isGiven(typeNode.getNodeId())){
+
+ for (final BundleNode bundle : model.getChildren()) {
+ for (final AssemblyNode ass : bundle.getChildren()) {
+ for (final AbstractTypedNode typeNode : ass.getChildren()) {
+
+ if (!typeNode.equals(ignoreNode) && Util.isGiven(typeNode.getNodeId())) {
typeIds.add(typeNode.getNodeId());
}
-
+
findTypeIds(typeIds, typeNode, ignoreNode);
}
}
}
return typeIds;
}
-
- private void findTypeIds(Set<String> ids, AbstractTypedNode parent, AbstractTypedNode ignoreNode){
- for (Object typeNode : parent.getChildren()){
- AbstractTypedNode abs = (AbstractTypedNode) typeNode;
-
- if (!typeNode.equals(ignoreNode)){
- if (null != abs && Util.isGiven(abs.getNodeId())){
+
+ private void findTypeIds(final Set<String> ids, final AbstractTypedNode parent, final AbstractTypedNode ignoreNode) {
+ for (final Object typeNode : parent.getChildren()) {
+ final AbstractTypedNode abs = (AbstractTypedNode) typeNode;
+
+ if (!typeNode.equals(ignoreNode)) {
+ if (null != abs && Util.isGiven(abs.getNodeId())) {
ids.add(abs.getNodeId());
}
}
-
-
- if (!abs.getChildren().isEmpty()){
+
+ if (!abs.getChildren().isEmpty()) {
findTypeIds(ids, abs, ignoreNode);
}
}
}
- public SubModuleNode findSubModuleByClassName(final AssemblyModel model, final IProject project, final String className) {
- BundleNode bundle = model.getBundle(project);
-
- if (null == bundle){
+ public SubModuleNode findSubModuleByClassName(final AssemblyModel model, final IProject project,
+ final String className) {
+ final BundleNode bundle = model.getBundle(project);
+
+ if (null == bundle) {
return null;
}
-
- ClassNameVisitor nodeVisitor = new ClassNameVisitor(className);
-
- for (AssemblyNode ass : bundle.getChildren()){
- for (AbstractTypedNode child : ass.getChildren()){
+
+ final ClassNameVisitor nodeVisitor = new ClassNameVisitor(className);
+
+ for (final AssemblyNode ass : bundle.getChildren()) {
+ for (final AbstractTypedNode child : ass.getChildren()) {
visitNode(child, nodeVisitor);
}
}
return nodeVisitor.getFoundNode();
}
-
-
- private void visitNode(AbstractTypedNode parent, AssemblyNodeVisitor visitor){
- for (Object typeNode : parent.getChildren()){
- AbstractTypedNode abs = (AbstractTypedNode) typeNode;
- if (visitor.visit(abs)){
+ private void visitNode(final AbstractTypedNode parent, final AssemblyNodeVisitor visitor) {
+ for (final Object typeNode : parent.getChildren()) {
+ final AbstractTypedNode abs = (AbstractTypedNode) typeNode;
+ if (visitor.visit(abs)) {
visitNode(abs, visitor);
} else {
return;
}
}
}
-
+
private final static class ClassNameVisitor implements AssemblyNodeVisitor {
private final String className;
private SubModuleNode foundNode;
- private ClassNameVisitor(String className) {
+ private ClassNameVisitor(final String className) {
this.className = className;
}
- public boolean visit(AbstractTypedNode node) {
- if (node instanceof SubModuleNode){
- SubModuleNode subMod = (SubModuleNode) node;
- if (className.equals(subMod.getController())){
+ public boolean visit(final AbstractTypedNode node) {
+ if (node instanceof SubModuleNode) {
+ final SubModuleNode subMod = (SubModuleNode) node;
+ if (className.equals(subMod.getController())) {
foundNode = subMod;
return false;
}
-
- if (null != subMod.getRcpView() &&
- className.equals(subMod.getRcpView().getViewClass())){
+
+ if (null != subMod.getRcpView() && className.equals(subMod.getRcpView().getViewClass())) {
foundNode = subMod;
return false;
}
@@ -130,7 +126,7 @@ public class ModelService implements IModelService{
}
}
- private interface AssemblyNodeVisitor{
+ private interface AssemblyNodeVisitor {
public boolean visit(AbstractTypedNode node);
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/NodeFactory.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/NodeFactory.java
index 839344b..d2a7fc8 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/NodeFactory.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/NodeFactory.java
@@ -11,6 +11,7 @@
package org.eclipse.riena.toolbox.assemblyeditor;
import org.eclipse.core.runtime.Assert;
+
import org.eclipse.riena.toolbox.assemblyeditor.api.INodeFactory;
import org.eclipse.riena.toolbox.assemblyeditor.model.AbstractAssemblyNode;
import org.eclipse.riena.toolbox.assemblyeditor.model.AbstractTypedNode;
@@ -22,21 +23,20 @@ import org.eclipse.riena.toolbox.assemblyeditor.model.RCPPerspective;
import org.eclipse.riena.toolbox.assemblyeditor.model.SubApplicationNode;
import org.eclipse.riena.toolbox.assemblyeditor.model.SubModuleNode;
+public class NodeFactory implements INodeFactory {
-public class NodeFactory implements INodeFactory{
-
private static final String SEP = "."; //$NON-NLS-1$
- private String SUFFIX_ASSEMBLY = "assembly"; //$NON-NLS-1$
- private String SUFFIX_SUBAPPLICATION = "subapp"; //$NON-NLS-1$
- private String SUFFIX_MODULE_GROUP = "modulegroup"; //$NON-NLS-1$
- private String SUFFIX_MODULE = "module"; //$NON-NLS-1$
- private String SUFFIX_SUBMODULE = "submodule"; //$NON-NLS-1$
- private String SUFFIX_PERSPECTIVE = "perspective"; //$NON-NLS-1$
-
- private String CONST_NEW_IDENTIFIER = "NEW"; //$NON-NLS-1$
-
- public AssemblyNode createAssembly(BundleNode parentBundle) {
- AssemblyNode ass = new AssemblyNode(parentBundle);
+ private final String SUFFIX_ASSEMBLY = "assembly"; //$NON-NLS-1$
+ private final String SUFFIX_SUBAPPLICATION = "subapp"; //$NON-NLS-1$
+ private final String SUFFIX_MODULE_GROUP = "modulegroup"; //$NON-NLS-1$
+ private final String SUFFIX_MODULE = "module"; //$NON-NLS-1$
+ private final String SUFFIX_SUBMODULE = "submodule"; //$NON-NLS-1$
+ private final String SUFFIX_PERSPECTIVE = "perspective"; //$NON-NLS-1$
+
+ private final String CONST_NEW_IDENTIFIER = "NEW"; //$NON-NLS-1$
+
+ public AssemblyNode createAssembly(final BundleNode parentBundle) {
+ final AssemblyNode ass = new AssemblyNode(parentBundle);
setPreSuffixes(parentBundle, ass, SUFFIX_ASSEMBLY);
ass.setName(CONST_NEW_IDENTIFIER);
ass.setNodeTypeId("application");
@@ -44,8 +44,8 @@ public class NodeFactory implements INodeFactory{
return ass;
}
- public ModuleNode createModule(AbstractAssemblyNode parent, BundleNode parentBundle) {
- ModuleNode node = new ModuleNode(parent);
+ public ModuleNode createModule(final AbstractAssemblyNode parent, final BundleNode parentBundle) {
+ final ModuleNode node = new ModuleNode(parent);
setPreSuffixes(parentBundle, node, SUFFIX_MODULE);
node.setName(CONST_NEW_IDENTIFIER);
node.setBundle(parentBundle);
@@ -53,25 +53,24 @@ public class NodeFactory implements INodeFactory{
return node;
}
- public ModuleGroupNode createModuleGroup(AbstractAssemblyNode parent, BundleNode parentBundle) {
- ModuleGroupNode node = new ModuleGroupNode(parent);
+ public ModuleGroupNode createModuleGroup(final AbstractAssemblyNode parent, final BundleNode parentBundle) {
+ final ModuleGroupNode node = new ModuleGroupNode(parent);
setPreSuffixes(parentBundle, node, SUFFIX_MODULE_GROUP);
node.setName(CONST_NEW_IDENTIFIER);
node.setBundle(parentBundle);
return node;
}
- public SubApplicationNode createSubApplication(AbstractAssemblyNode parent, BundleNode parentBundle) {
- SubApplicationNode node = new SubApplicationNode(parent);
+ public SubApplicationNode createSubApplication(final AbstractAssemblyNode parent, final BundleNode parentBundle) {
+ final SubApplicationNode node = new SubApplicationNode(parent);
setPreSuffixes(parentBundle, node, SUFFIX_SUBAPPLICATION);
node.setBundle(parentBundle);
node.setName(CONST_NEW_IDENTIFIER);
return node;
}
-
- public SubModuleNode createSubModule(AbstractAssemblyNode parent, BundleNode parentBundle) {
- SubModuleNode node = new SubModuleNode(parent);
+ public SubModuleNode createSubModule(final AbstractAssemblyNode parent, final BundleNode parentBundle) {
+ final SubModuleNode node = new SubModuleNode(parent);
setPreSuffixes(parentBundle, node, SUFFIX_SUBMODULE);
node.setName(CONST_NEW_IDENTIFIER);
node.setBundle(parentBundle);
@@ -79,30 +78,31 @@ public class NodeFactory implements INodeFactory{
return node;
}
- public RCPPerspective createRcpPerspective(SubApplicationNode parent) {
+ public RCPPerspective createRcpPerspective(final SubApplicationNode parent) {
Assert.isNotNull(parent);
Assert.isNotNull(parent.getName());
-
- RCPPerspective persp = new RCPPerspective();
- String id = parent.getBundle().getName()+SEP+parent.getName()+SEP+SUFFIX_PERSPECTIVE;
+
+ final RCPPerspective persp = new RCPPerspective();
+ final String id = parent.getBundle().getName() + SEP + parent.getName() + SEP + SUFFIX_PERSPECTIVE;
persp.setId(id);
persp.setName(id);
persp.setPerspectiveClass(RCPPerspective.PERSPECTIVE_CLASS_NAME);
return persp;
}
-
- private void setPreSuffixes(AbstractAssemblyNode parent, AssemblyNode typedNode, String suffix){
- typedNode.setPrefix(parent.getName()+SEP);
- typedNode.setSuffix(SEP+ suffix);
+
+ private void setPreSuffixes(final AbstractAssemblyNode parent, final AssemblyNode typedNode, final String suffix) {
+ typedNode.setPrefix(parent.getName() + SEP);
+ typedNode.setSuffix(SEP + suffix);
typedNode.setId(typedNode.getPrefix() + CONST_NEW_IDENTIFIER + typedNode.getSuffix());
-
+
}
-
- private void setPreSuffixes(AbstractAssemblyNode parent, AbstractTypedNode typedNode, String suffix){
- typedNode.setPrefix(parent.getName()+SEP);
- typedNode.setSuffix(SEP+ suffix);
+
+ private void setPreSuffixes(final AbstractAssemblyNode parent, final AbstractTypedNode typedNode,
+ final String suffix) {
+ typedNode.setPrefix(parent.getName() + SEP);
+ typedNode.setSuffix(SEP + suffix);
typedNode.setNodeId(typedNode.getPrefix() + CONST_NEW_IDENTIFIER + typedNode.getSuffix());
-
+
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/PluginXmlParser.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/PluginXmlParser.java
index d991b27..3be91b7 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/PluginXmlParser.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/PluginXmlParser.java
@@ -40,12 +40,12 @@ import org.eclipse.riena.toolbox.assemblyeditor.model.SubModuleNode;
public class PluginXmlParser extends AbstractXmlProvider implements IPluginXmlParser {
- public List<AssemblyNode> parseDocument(BundleNode bundleNode) {
+ public List<AssemblyNode> parseDocument(final BundleNode bundleNode) {
return parseDocument(bundleNode, getDocument(bundleNode));
}
- public Set<RCPView> getRcpViews(BundleNode bundleNode) {
+ public Set<RCPView> getRcpViews(final BundleNode bundleNode) {
return parseViewIds(getDocument(bundleNode));
}
@@ -56,104 +56,104 @@ public class PluginXmlParser extends AbstractXmlProvider implements IPluginXmlPa
* getRcpPerspectives
* (org.eclipse.riena.toolbox.assemblyeditor.model.BundleNode)
*/
- public Set<RCPPerspective> getRcpPerspectives(BundleNode bundleNode) {
+ public Set<RCPPerspective> getRcpPerspectives(final BundleNode bundleNode) {
return parsePerspectiveIds(getDocument(bundleNode));
}
- private Set<RCPPerspective> parsePerspectiveIds(Document doc) {
- Set<RCPPerspective> viewIds = new HashSet<RCPPerspective>();
+ private Set<RCPPerspective> parsePerspectiveIds(final Document doc) {
+ final Set<RCPPerspective> viewIds = new HashSet<RCPPerspective>();
if (null == doc) {
return viewIds;
}
- XPath xpath = XPathFactory.newInstance().newXPath();
+ final XPath xpath = XPathFactory.newInstance().newXPath();
try {
- NodeList nlViewExtensions = (NodeList) xpath
+ final NodeList nlViewExtensions = (NodeList) xpath
.evaluate(
String.format("//%s[@%s='%s']", ELEM_EXTENSION, ELEM_POINT, VALUE_EXT_POINT_PERSPECTIVES), doc, XPathConstants.NODESET); //$NON-NLS-1$
for (int i = 0; i < nlViewExtensions.getLength(); i++) {
- Element elmViewExtension = (Element) nlViewExtensions.item(i);
- NodeList nlViews = elmViewExtension.getElementsByTagName(ELEM_PERSPECTIVE);
+ final Element elmViewExtension = (Element) nlViewExtensions.item(i);
+ final NodeList nlViews = elmViewExtension.getElementsByTagName(ELEM_PERSPECTIVE);
for (int j = 0; j < nlViews.getLength(); j++) {
- Element elmPersp = (Element) nlViews.item(j);
+ final Element elmPersp = (Element) nlViews.item(j);
- RCPPerspective persp = parsePerspective(elmPersp);
+ final RCPPerspective persp = parsePerspective(elmPersp);
if (RCPPerspective.PERSPECTIVE_CLASS_NAME.equals(persp.getPerspectiveClass())) {
viewIds.add(persp);
}
}
}
- } catch (XPathExpressionException e) {
+ } catch (final XPathExpressionException e) {
throw new RuntimeException(e);
}
return viewIds;
}
- private Set<RCPView> parseViewIds(Document doc) {
- Set<RCPView> viewIds = new HashSet<RCPView>();
+ private Set<RCPView> parseViewIds(final Document doc) {
+ final Set<RCPView> viewIds = new HashSet<RCPView>();
if (null == doc) {
return viewIds;
}
- XPath xpath = XPathFactory.newInstance().newXPath();
+ final XPath xpath = XPathFactory.newInstance().newXPath();
try {
- NodeList nlViewExtensions = (NodeList) xpath
+ final NodeList nlViewExtensions = (NodeList) xpath
.evaluate(
String.format("//%s[@%s='%s']", ELEM_EXTENSION, ELEM_POINT, VALUE_EXT_POINT_VIEWS), doc, XPathConstants.NODESET); //$NON-NLS-1$
for (int i = 0; i < nlViewExtensions.getLength(); i++) {
- Element elmViewExtension = (Element) nlViewExtensions.item(i);
- NodeList nlViews = elmViewExtension.getElementsByTagName(ELEM_VIEW);
+ final Element elmViewExtension = (Element) nlViewExtensions.item(i);
+ final NodeList nlViews = elmViewExtension.getElementsByTagName(ELEM_VIEW);
for (int j = 0; j < nlViews.getLength(); j++) {
- Element elmView = (Element) nlViews.item(j);
+ final Element elmView = (Element) nlViews.item(j);
- RCPView view = parseView(elmView);
+ final RCPView view = parseView(elmView);
viewIds.add(view);
}
}
- } catch (XPathExpressionException e) {
+ } catch (final XPathExpressionException e) {
throw new RuntimeException(e);
}
return viewIds;
}
- private RCPPerspective parsePerspective(Element elm) {
- RCPPerspective view = new RCPPerspective();
+ private RCPPerspective parsePerspective(final Element elm) {
+ final RCPPerspective view = new RCPPerspective();
view.setId(elm.getAttribute("id"));
view.setPerspectiveClass(elm.getAttribute("class"));
view.setName(elm.getAttribute("name"));
return view;
}
- private RCPView parseView(Element elm) {
- RCPView view = new RCPView();
+ private RCPView parseView(final Element elm) {
+ final RCPView view = new RCPView();
view.setId(elm.getAttribute(ATTR_VIEW_ID));
view.setViewClass(elm.getAttribute(ATTR_VIEW_CLASS));
view.setName(elm.getAttribute(ATTR_VIEW_NAME));
return view;
}
- private List<AssemblyNode> parseDocument(BundleNode parent, Document doc) {
- List<AssemblyNode> assemblyList = new ArrayList<AssemblyNode>();
+ private List<AssemblyNode> parseDocument(final BundleNode parent, final Document doc) {
+ final List<AssemblyNode> assemblyList = new ArrayList<AssemblyNode>();
if (null == doc) {
return assemblyList;
}
- NodeList lstAssembly = doc.getElementsByTagName(ELEM_ASSEMBLY);
+ final NodeList lstAssembly = doc.getElementsByTagName(ELEM_ASSEMBLY);
for (int i = 0; i < lstAssembly.getLength(); i++) {
final Element elmAssembly = (Element) lstAssembly.item(i);
final AssemblyNode assemblyNode = parseAssembly(parent, elmAssembly);
new NodeIterator(elmAssembly, ELEM_SUBAPP, ELEM_MODULE_GROUP, ELEM_MODULE, ELEM_SUBMODULE) {
@Override
- public void handle(Element childElement) {
+ public void handle(final Element childElement) {
if (ELEM_SUBAPP.equals(childElement.getNodeName())) {
parseSubApplication(assemblyNode, childElement);
} else if (ELEM_MODULE_GROUP.equals(childElement.getNodeName())) {
@@ -170,9 +170,9 @@ public class PluginXmlParser extends AbstractXmlProvider implements IPluginXmlPa
return assemblyList;
}
- private void computePreSuffixe(AssemblyNode typedNode) {
- String name = typedNode.getName();
- String typeId = typedNode.getId();
+ private void computePreSuffixe(final AssemblyNode typedNode) {
+ final String name = typedNode.getName();
+ final String typeId = typedNode.getId();
if (null == typeId) {
return;
@@ -183,11 +183,11 @@ public class PluginXmlParser extends AbstractXmlProvider implements IPluginXmlPa
return;
}
- Pattern pattern = Pattern.compile("(.*?)\\." + name + "\\.(.*?)");
- Matcher matcher = pattern.matcher(typeId);
+ final Pattern pattern = Pattern.compile("(.*?)\\." + name + "\\.(.*?)");
+ final Matcher matcher = pattern.matcher(typeId);
if (matcher.matches()) {
- String prefix = matcher.group(1);
- String suffix = matcher.group(2);
+ final String prefix = matcher.group(1);
+ final String suffix = matcher.group(2);
typedNode.setPrefix(prefix + ".");
typedNode.setSuffix("." + suffix);
}
@@ -200,9 +200,9 @@ public class PluginXmlParser extends AbstractXmlProvider implements IPluginXmlPa
*
* @param typedNode
*/
- private void computePreSuffixe(AbstractTypedNode typedNode) {
- String name = typedNode.getName();
- String nodeId = typedNode.getNodeId();
+ private void computePreSuffixe(final AbstractTypedNode typedNode) {
+ final String name = typedNode.getName();
+ final String nodeId = typedNode.getNodeId();
if (null == nodeId) {
return;
@@ -213,17 +213,17 @@ public class PluginXmlParser extends AbstractXmlProvider implements IPluginXmlPa
return;
}
- Pattern pattern = Pattern.compile("(.*?)\\." + name + "\\.(.*?)");
- Matcher matcher = pattern.matcher(nodeId);
+ final Pattern pattern = Pattern.compile("(.*?)\\." + name + "\\.(.*?)");
+ final Matcher matcher = pattern.matcher(nodeId);
if (matcher.matches()) {
- String prefix = matcher.group(1);
- String suffix = matcher.group(2);
+ final String prefix = matcher.group(1);
+ final String suffix = matcher.group(2);
typedNode.setPrefix(prefix + ".");
typedNode.setSuffix("." + suffix);
}
}
- private AssemblyNode parseAssembly(BundleNode parent, Element elm) {
+ private AssemblyNode parseAssembly(final BundleNode parent, final Element elm) {
final AssemblyNode assemblyNode = new AssemblyNode(parent);
assemblyNode.setId(elm.getAttribute(ATTR_ASSEMBLY_ID));
assemblyNode.setAssembler(elm.getAttribute(ATTR_ASSEMBLY_ASSEMBLER));
@@ -235,7 +235,7 @@ public class PluginXmlParser extends AbstractXmlProvider implements IPluginXmlPa
return assemblyNode;
}
- private SubApplicationNode parseSubApplication(AbstractAssemblyNode parent, Element elm) {
+ private SubApplicationNode parseSubApplication(final AbstractAssemblyNode parent, final Element elm) {
final SubApplicationNode subapp = new SubApplicationNode(parent);
subapp.setNodeId(elm.getAttribute(ATTR_SUBAPP_NODE_ID));
subapp.setPerspective(elm.getAttribute(ATTR_SUBAPP_PERSPECTIVE_ID));
@@ -247,14 +247,14 @@ public class PluginXmlParser extends AbstractXmlProvider implements IPluginXmlPa
new NodeIterator(elm, ELEM_MODULE_GROUP) {
@Override
- public void handle(Element childElement) {
+ public void handle(final Element childElement) {
parseModuleGroup(subapp, childElement);
}
}.iterate();
return subapp;
}
- private ModuleGroupNode parseModuleGroup(AbstractAssemblyNode parent, Element elm) {
+ private ModuleGroupNode parseModuleGroup(final AbstractAssemblyNode parent, final Element elm) {
final ModuleGroupNode moduleGroup = new ModuleGroupNode(parent);
moduleGroup.setNodeId(elm.getAttribute(ATTR_MODGROUP_NODE_ID));
moduleGroup.setName(elm.getAttribute(ATTR_MODGROUP_NAME));
@@ -264,14 +264,14 @@ public class PluginXmlParser extends AbstractXmlProvider implements IPluginXmlPa
new NodeIterator(elm, ELEM_MODULE) {
@Override
- public void handle(Element childElement) {
+ public void handle(final Element childElement) {
parseModule(moduleGroup, childElement);
}
}.iterate();
return moduleGroup;
}
- private ModuleNode parseModule(AbstractAssemblyNode parent, Element elm) {
+ private ModuleNode parseModule(final AbstractAssemblyNode parent, final Element elm) {
final ModuleNode module = new ModuleNode(parent);
module.setNodeId(elm.getAttribute(ATTR_MODULE_NODE_ID));
module.setName(elm.getAttribute(ATTR_MODULE_NAME));
@@ -284,7 +284,7 @@ public class PluginXmlParser extends AbstractXmlProvider implements IPluginXmlPa
new NodeIterator(elm, ELEM_SUBMODULE) {
@Override
- public void handle(Element childElement) {
+ public void handle(final Element childElement) {
parseSubModule(module, childElement);
}
}.iterate();
@@ -292,7 +292,7 @@ public class PluginXmlParser extends AbstractXmlProvider implements IPluginXmlPa
return module;
}
- private SubModuleNode parseSubModule(AbstractAssemblyNode parent, Element elm) {
+ private SubModuleNode parseSubModule(final AbstractAssemblyNode parent, final Element elm) {
final SubModuleNode sub = new SubModuleNode(parent);
sub.setName(elm.getAttribute(ATTR_SUBMOD_NAME));
sub.setNodeId(elm.getAttribute(ATTR_SUBMOD_NODE_ID));
@@ -303,14 +303,14 @@ public class PluginXmlParser extends AbstractXmlProvider implements IPluginXmlPa
sub.setRequiresPreparation(parseBoolean(elm, ATTR_SUBMOD_REQUIRES_PREPARATION, false));
sub.setVisible(parseBoolean(elm, ATTR_SUBMOD_VISIBLE, true));
sub.setExpanded(parseBoolean(elm, ATTR_SUBMOD_EXPANDED, false));
-
+
sub.setBundle(bundleNode);
computePreSuffixe(sub);
- String rcpViewId = elm.getAttribute(ATTR_SUBMOD_VIEW);
+ final String rcpViewId = elm.getAttribute(ATTR_SUBMOD_VIEW);
if (null != rcpViewId) {
sub.setRcpView(new RCPView(elm.getAttribute(ATTR_SUBMOD_VIEW)));
- RCPView rcpView = parent.getBundle().findRcpView(rcpViewId);
+ final RCPView rcpView = parent.getBundle().findRcpView(rcpViewId);
if (null != rcpView) {
sub.setRcpView(rcpView);
@@ -323,33 +323,33 @@ public class PluginXmlParser extends AbstractXmlProvider implements IPluginXmlPa
new NodeIterator(elm, ELEM_SUBMODULE) {
@Override
- public void handle(Element childElement) {
+ public void handle(final Element childElement) {
parseSubModule(sub, childElement);
}
}.iterate();
return sub;
}
- public boolean unregisterView(SubModuleNode subModule) {
- Document doc = getDocument(subModule.getBundle());
+ public boolean unregisterView(final SubModuleNode subModule) {
+ final Document doc = getDocument(subModule.getBundle());
if (null == doc) {
return false;
}
- XPath xpath = XPathFactory.newInstance().newXPath();
+ final XPath xpath = XPathFactory.newInstance().newXPath();
try {
- NodeList nlViewExtensions = (NodeList) xpath
+ final NodeList nlViewExtensions = (NodeList) xpath
.evaluate(
String.format("//%s[@%s='%s']", ELEM_EXTENSION, ELEM_POINT, VALUE_EXT_POINT_VIEWS), doc, XPathConstants.NODESET); //$NON-NLS-1$
for (int i = 0; i < nlViewExtensions.getLength(); i++) {
- Element elmViewExtension = (Element) nlViewExtensions.item(i);
- NodeList nlViews = elmViewExtension.getElementsByTagName(ELEM_VIEW);
+ final Element elmViewExtension = (Element) nlViewExtensions.item(i);
+ final NodeList nlViews = elmViewExtension.getElementsByTagName(ELEM_VIEW);
for (int j = 0; j < nlViews.getLength(); j++) {
- Element elmView = (Element) nlViews.item(j);
- String viewId = elmView.getAttribute(ATTR_VIEW_ID);
+ final Element elmView = (Element) nlViews.item(j);
+ final String viewId = elmView.getAttribute(ATTR_VIEW_ID);
if (null != viewId && viewId.equals(subModule.getRcpView().getId())) {
elmViewExtension.removeChild(elmView);
@@ -358,7 +358,42 @@ public class PluginXmlParser extends AbstractXmlProvider implements IPluginXmlPa
}
}
}
- } catch (XPathExpressionException e) {
+ } catch (final XPathExpressionException e) {
+ throw new RuntimeException(e);
+ }
+
+ return false;
+ }
+
+ public boolean unregisterPerspective(final SubApplicationNode subApplication) {
+ final Document doc = getDocument(subApplication.getBundle());
+
+ if (null == doc) {
+ return false;
+ }
+
+ final XPath xpath = XPathFactory.newInstance().newXPath();
+ try {
+ final NodeList nlPerspectivesExtensions = (NodeList) xpath
+ .evaluate(
+ String.format("//%s[@%s='%s']", ELEM_EXTENSION, ELEM_POINT, VALUE_EXT_POINT_PERSPECTIVES), doc, XPathConstants.NODESET); //$NON-NLS-1$
+
+ for (int i = 0; i < nlPerspectivesExtensions.getLength(); i++) {
+ final Element elmPerspectiveExtension = (Element) nlPerspectivesExtensions.item(i);
+ final NodeList nlPerspectives = elmPerspectiveExtension.getElementsByTagName(ELEM_PERSPECTIVE);
+
+ for (int j = 0; j < nlPerspectives.getLength(); j++) {
+ final Element elmPerspective = (Element) nlPerspectives.item(j);
+ final String perspectiveId = elmPerspective.getAttribute(ATTR_PERSPECTIVE_ID);
+
+ if (null != perspectiveId && perspectiveId.equals(subApplication.getPerspective())) {
+ elmPerspectiveExtension.removeChild(elmPerspective);
+ saveDocument(doc, bundleNode);
+ return true;
+ }
+ }
+ }
+ } catch (final XPathExpressionException e) {
throw new RuntimeException(e);
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/PluginXmlRenderer.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/PluginXmlRenderer.java
index 73585ca..813c6b6 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/PluginXmlRenderer.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/PluginXmlRenderer.java
@@ -19,6 +19,7 @@ import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
@@ -49,60 +50,79 @@ public class PluginXmlRenderer extends AbstractXmlProvider implements IPluginXml
}
// FIXME redundant saveDocument-Method
- public void saveDocument(BundleNode bundleNode) {
+ public void saveDocument(final BundleNode bundleNode) {
try {
- File pluginXml = new File(bundleNode.getPluginXml().getLocationURI());
+ final File pluginXml = new File(bundleNode.getPluginXml().getLocationURI());
doc = builder.parse(pluginXml);
removeOldAssemblies();
// render the given BundleNode, unless it has no childelements
if (bundleNode.getChildren() != null && !bundleNode.getChildren().isEmpty()) {
- Element elmExt = doc.createElement(ELEM_EXTENSION);
+ final Element elmExt = doc.createElement(ELEM_EXTENSION);
elmExt.setAttribute(ATTR_EXTENSION_POINT, VALUE_EXT_POINT_ASSEMBLIES);
- NodeList nlPlugin = doc.getElementsByTagName(ELEM_PLUGIN);
+ final NodeList nlPlugin = doc.getElementsByTagName(ELEM_PLUGIN);
nlPlugin.item(0).appendChild(elmExt);
renderModel(elmExt, bundleNode);
}
- Transformer xformer = createTransformer();
+ cleanWhiteSpace();
+
+ final Transformer xformer = createTransformer();
xformer.transform(new DOMSource(doc), new StreamResult(pluginXml));
bundleNode.refreshPluginXml();
- } catch (SAXException e) {
+ } catch (final SAXException e) {
+ throw new RuntimeException(e);
+ } catch (final IOException e) {
throw new RuntimeException(e);
- } catch (IOException e) {
+ } catch (final TransformerException e) {
throw new RuntimeException(e);
- } catch (TransformerException e) {
+ } catch (final CoreException e) {
throw new RuntimeException(e);
- } catch (CoreException e) {
+ }
+ }
+
+ /**
+ * Removes all blank lines between elements
+ */
+ private void cleanWhiteSpace() {
+ try {
+ final XPathFactory xpathFactory = XPathFactory.newInstance();
+ final XPathExpression xpathExp = xpathFactory.newXPath().compile("//text()[normalize-space(.) = '']"); //$NON-NLS-1$
+ final NodeList emptyTextNodes = (NodeList) xpathExp.evaluate(doc, XPathConstants.NODESET);
+ for (int i = 0; i < emptyTextNodes.getLength(); i++) {
+ final Node emptyTextNode = emptyTextNodes.item(i);
+ emptyTextNode.getParentNode().removeChild(emptyTextNode);
+ }
+ } catch (final XPathExpressionException e) {
throw new RuntimeException(e);
}
}
- private void renderRcpView(Element elmView, RCPView view) {
+ private void renderRcpView(final Element elmView, final RCPView view) {
elmView.setAttribute(ATTR_VIEW_NAME, view.getName());
elmView.setAttribute(ATTR_VIEW_ID, view.getId());
elmView.setAttribute(ATTR_VIEW_CLASS, view.getViewClass());
elmView.setAttribute(ATTR_VIEW_ALLOW_MULTIPLE, view.isAllowMultiple() + ""); //$NON-NLS-1$
}
- private void renderRcpPerspective(Element elmView, RCPPerspective persp) {
- elmView.setAttribute("class", persp.getPerspectiveClass());
- elmView.setAttribute("id", persp.getId());
- elmView.setAttribute("name", persp.getName());
+ private void renderRcpPerspective(final Element elmView, final RCPPerspective persp) {
+ elmView.setAttribute(ATTR_PERSPECTIVE_CLASS, persp.getPerspectiveClass());
+ elmView.setAttribute(ATTR_PERSPECTIVE_ID, persp.getId());
+ elmView.setAttribute(ATTR_PERSPECTIVE_NAME, persp.getName());
}
- public boolean registerPerspective(BundleNode bundle, RCPPerspective perspective) {
- Document currentDoc = getDocument(bundle);
+ public boolean registerPerspective(final BundleNode bundle, final RCPPerspective perspective) {
+ final Document currentDoc = getDocument(bundle);
if (currentDoc == null) {
return false;
}
- XPath xpath = XPathFactory.newInstance().newXPath();
+ final XPath xpath = XPathFactory.newInstance().newXPath();
try {
- NodeList nlViewExtensions = (NodeList) xpath
+ final NodeList nlViewExtensions = (NodeList) xpath
.evaluate(
String.format("//%s[@%s='%s']", ELEM_EXTENSION, ELEM_POINT, VALUE_EXT_POINT_PERSPECTIVES), currentDoc, XPathConstants.NODESET); //$NON-NLS-1$
@@ -113,14 +133,14 @@ public class PluginXmlRenderer extends AbstractXmlProvider implements IPluginXml
elmPerspectiveExt = currentDoc.createElement(ELEM_EXTENSION);
elmPerspectiveExt.setAttribute(ELEM_POINT, VALUE_EXT_POINT_PERSPECTIVES);
- NodeList nlRoot = currentDoc.getElementsByTagName(ELEM_PLUGIN);
+ final NodeList nlRoot = currentDoc.getElementsByTagName(ELEM_PLUGIN);
nlRoot.item(0).appendChild(elmPerspectiveExt);
} else {
elmPerspectiveExt = (Element) nlViewExtensions.item(0);
}
if (!perspectiveAlreadyExists(currentDoc, perspective.getId())) {
- Element elmPerspective = currentDoc.createElement(ELEM_PERSPECTIVE);
+ final Element elmPerspective = currentDoc.createElement(ELEM_PERSPECTIVE);
renderRcpPerspective(elmPerspective, perspective);
elmPerspectiveExt.appendChild(elmPerspective);
saveDocument(currentDoc, bundleNode);
@@ -128,21 +148,21 @@ public class PluginXmlRenderer extends AbstractXmlProvider implements IPluginXml
}
return false;
- } catch (XPathExpressionException e) {
+ } catch (final XPathExpressionException e) {
throw new RuntimeException(e);
}
}
- public boolean registerView(BundleNode bundle, RCPView view) {
- Document currentDoc = getDocument(bundle);
+ public boolean registerView(final BundleNode bundle, final RCPView view) {
+ final Document currentDoc = getDocument(bundle);
if (currentDoc == null) {
return false;
}
- XPath xpath = XPathFactory.newInstance().newXPath();
+ final XPath xpath = XPathFactory.newInstance().newXPath();
try {
- NodeList nlViewExtensions = (NodeList) xpath
+ final NodeList nlViewExtensions = (NodeList) xpath
.evaluate(
String.format("//%s[@%s='%s']", ELEM_EXTENSION, ELEM_POINT, VALUE_EXT_POINT_VIEWS), currentDoc, XPathConstants.NODESET); //$NON-NLS-1$
@@ -153,14 +173,14 @@ public class PluginXmlRenderer extends AbstractXmlProvider implements IPluginXml
elmViewExt = currentDoc.createElement(ELEM_EXTENSION);
elmViewExt.setAttribute(ELEM_POINT, VALUE_EXT_POINT_VIEWS);
- NodeList nlRoot = currentDoc.getElementsByTagName(ELEM_PLUGIN);
+ final NodeList nlRoot = currentDoc.getElementsByTagName(ELEM_PLUGIN);
nlRoot.item(0).appendChild(elmViewExt);
} else {
elmViewExt = (Element) nlViewExtensions.item(0);
}
if (!viewAlreadyExists(currentDoc, view.getId())) {
- Element elmView = currentDoc.createElement(ELEM_VIEW);
+ final Element elmView = currentDoc.createElement(ELEM_VIEW);
renderRcpView(elmView, view);
elmViewExt.appendChild(elmView);
saveDocument(currentDoc, bundleNode);
@@ -168,36 +188,37 @@ public class PluginXmlRenderer extends AbstractXmlProvider implements IPluginXml
}
return false;
- } catch (XPathExpressionException e) {
+ } catch (final XPathExpressionException e) {
throw new RuntimeException(e);
}
}
- private boolean viewAlreadyExists(Document currentDoc, String viewId) throws XPathExpressionException {
- XPath xpath = XPathFactory.newInstance().newXPath();
+ private boolean viewAlreadyExists(final Document currentDoc, final String viewId) throws XPathExpressionException {
+ final XPath xpath = XPathFactory.newInstance().newXPath();
// look for an element view with an ID = viewId anywhere under an
// extensionpoint org.eclipse.ui.views
- String xpathQuery = String.format(
+ final String xpathQuery = String.format(
"//%s[@%s='%s']/view[@id='%s']", ELEM_EXTENSION, ELEM_POINT, VALUE_EXT_POINT_VIEWS, viewId); //$NON-NLS-1$
- NodeList nlViewExtensions = (NodeList) xpath.evaluate(xpathQuery, currentDoc, XPathConstants.NODESET);
+ final NodeList nlViewExtensions = (NodeList) xpath.evaluate(xpathQuery, currentDoc, XPathConstants.NODESET);
return nlViewExtensions.getLength() > 0;
}
- private boolean perspectiveAlreadyExists(Document currentDoc, String perspectiveId) throws XPathExpressionException {
- XPath xpath = XPathFactory.newInstance().newXPath();
+ private boolean perspectiveAlreadyExists(final Document currentDoc, final String perspectiveId)
+ throws XPathExpressionException {
+ final XPath xpath = XPathFactory.newInstance().newXPath();
// look for an element perspective with an ID = perspectiveId anywhere
// under an extensionpoint org.eclipse.ui.perspectives
- String xpathQuery = String
+ final String xpathQuery = String
.format("//%s[@%s='%s']/view[@id='%s']", ELEM_EXTENSION, ELEM_POINT, VALUE_EXT_POINT_PERSPECTIVES, perspectiveId); //$NON-NLS-1$
- NodeList nlViewExtensions = (NodeList) xpath.evaluate(xpathQuery, currentDoc, XPathConstants.NODESET);
+ final NodeList nlViewExtensions = (NodeList) xpath.evaluate(xpathQuery, currentDoc, XPathConstants.NODESET);
return nlViewExtensions.getLength() > 0;
}
- private void renderModel(Element elmExtension, BundleNode bundleNode) {
- for (AssemblyNode ass : bundleNode.getChildren()) {
- Element elmAss = renderAssembly(elmExtension, ass);
+ private void renderModel(final Element elmExtension, final BundleNode bundleNode) {
+ for (final AssemblyNode ass : bundleNode.getChildren()) {
+ final Element elmAss = renderAssembly(elmExtension, ass);
- for (AbstractAssemblyNode child : ass.getChildren()) {
+ for (final AbstractAssemblyNode child : ass.getChildren()) {
if (child instanceof SubApplicationNode) {
renderSubApplication(elmAss, (SubApplicationNode) child);
} else if (child instanceof ModuleGroupNode) {
@@ -211,8 +232,8 @@ public class PluginXmlRenderer extends AbstractXmlProvider implements IPluginXml
}
}
- private Element renderAssembly(Element elmExtension, AssemblyNode ass) {
- Element elm = doc.createElement(ELEM_ASSEMBLY);
+ private Element renderAssembly(final Element elmExtension, final AssemblyNode ass) {
+ final Element elm = doc.createElement(ELEM_ASSEMBLY);
elm.setAttribute(ATTR_ASSEMBLY_ID, ass.getId());
if (Util.isGiven(ass.getAssembler())) {
@@ -236,8 +257,8 @@ public class PluginXmlRenderer extends AbstractXmlProvider implements IPluginXml
}
- private void renderSubApplication(Element parent, SubApplicationNode ass) {
- Element elm = doc.createElement(ELEM_SUBAPP);
+ private void renderSubApplication(final Element parent, final SubApplicationNode ass) {
+ final Element elm = doc.createElement(ELEM_SUBAPP);
if (Util.isGiven(ass.getName())) {
elm.setAttribute(ATTR_SUBAPP_NAME, ass.getName());
@@ -255,15 +276,15 @@ public class PluginXmlRenderer extends AbstractXmlProvider implements IPluginXml
elm.setAttribute(ATTR_SUBAPP_PERSPECTIVE_ID, ass.getPerspective());
}
- for (ModuleGroupNode mod : ass.getChildren()) {
+ for (final ModuleGroupNode mod : ass.getChildren()) {
renderModuleGroup(elm, mod);
}
parent.appendChild(elm);
}
- private void renderModuleGroup(Element parent, ModuleGroupNode ass) {
- Element elm = doc.createElement(ELEM_MODULE_GROUP);
+ private void renderModuleGroup(final Element parent, final ModuleGroupNode ass) {
+ final Element elm = doc.createElement(ELEM_MODULE_GROUP);
if (Util.isGiven(ass.getName())) {
elm.setAttribute(ATTR_MODGROUP_NAME, ass.getName());
@@ -273,15 +294,15 @@ public class PluginXmlRenderer extends AbstractXmlProvider implements IPluginXml
elm.setAttribute(ATTR_MODGROUP_NODE_ID, ass.getNodeId());
}
- for (ModuleNode mod : ass.getChildren()) {
+ for (final ModuleNode mod : ass.getChildren()) {
renderModule(elm, mod);
}
parent.appendChild(elm);
}
- private void renderModule(Element parent, ModuleNode ass) {
- Element elm = doc.createElement(ELEM_MODULE);
+ private void renderModule(final Element parent, final ModuleNode ass) {
+ final Element elm = doc.createElement(ELEM_MODULE);
if (Util.isGiven(ass.getName())) {
elm.setAttribute(ATTR_MODULE_NAME, ass.getName());
@@ -297,15 +318,15 @@ public class PluginXmlRenderer extends AbstractXmlProvider implements IPluginXml
elm.setAttribute(ATTR_MODULE_CLOSABLE, ass.isCloseable() + ""); //$NON-NLS-1$
- for (SubModuleNode mod : ass.getChildren()) {
+ for (final SubModuleNode mod : ass.getChildren()) {
renderSubModule(elm, mod);
}
parent.appendChild(elm);
}
- private void renderSubModule(Element parent, SubModuleNode subMod) {
- Element elm = doc.createElement(ELEM_SUBMODULE);
+ private void renderSubModule(final Element parent, final SubModuleNode subMod) {
+ final Element elm = doc.createElement(ELEM_SUBMODULE);
if (Util.isGiven(subMod.getNodeId())) {
elm.setAttribute(ATTR_SUBMOD_NODE_ID, subMod.getNodeId());
@@ -336,7 +357,7 @@ public class PluginXmlRenderer extends AbstractXmlProvider implements IPluginXml
elm.setAttribute(ATTR_SUBMOD_EXPANDED, subMod.isExpanded() + ""); //$NON-NLS-1$
elm.setAttribute(ATTR_SUBMOD_VISIBLE, subMod.isVisible() + ""); //$NON-NLS-1$
- for (SubModuleNode mod : subMod.getChildren()) {
+ for (final SubModuleNode mod : subMod.getChildren()) {
renderSubModule(elm, mod);
}
@@ -344,17 +365,17 @@ public class PluginXmlRenderer extends AbstractXmlProvider implements IPluginXml
}
private void removeOldAssemblies() {
- XPath xpath = XPathFactory.newInstance().newXPath();
+ final XPath xpath = XPathFactory.newInstance().newXPath();
try {
- NodeList nlExt = (NodeList) xpath
+ final NodeList nlExt = (NodeList) xpath
.evaluate(
String.format(
"//%s[@%s='%s']", ELEM_EXTENSION, ATTR_EXTENSION_POINT, VALUE_EXT_POINT_ASSEMBLIES), doc, XPathConstants.NODESET); //$NON-NLS-1$
for (int i = 0; i < nlExt.getLength(); i++) {
- Node noAss = nlExt.item(i);
+ final Node noAss = nlExt.item(i);
noAss.getParentNode().removeChild(noAss);
}
- } catch (XPathExpressionException e) {
+ } catch (final XPathExpressionException e) {
e.printStackTrace();
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ResourceChangeListener.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ResourceChangeListener.java
index a7cc4e5..ce6cc1d 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ResourceChangeListener.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ResourceChangeListener.java
@@ -13,11 +13,12 @@ package org.eclipse.riena.toolbox.assemblyeditor;
import org.eclipse.core.resources.IProject;
/**
- * Listener that will be notified, when Changes in the workbench occur
- * like a plugin.xml in of the bundles changes or a project is added/removed.
- *
+ * Listener that will be notified, when Changes in the workbench occur like a
+ * plugin.xml in of the bundles changes or a project is added/removed.
+ *
*/
public interface ResourceChangeListener {
public void pluginXmlChanged(IProject project);
+
public void projectAdded(IProject project);
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/RidgetCallVisitor.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/RidgetCallVisitor.java
index 50c730d..85a3759 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/RidgetCallVisitor.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/RidgetCallVisitor.java
@@ -15,33 +15,34 @@ import org.eclipse.jdt.core.dom.MethodInvocation;
import org.eclipse.jdt.core.dom.StringLiteral;
/**
- * Visitor to check, if a Call to getRidget("ridgetID") or getRidget(RidgetType.class, "ridgetID") already exists.
- *
+ * Visitor to check, if a Call to getRidget("ridgetID") or
+ * getRidget(RidgetType.class, "ridgetID") already exists.
+ *
*/
-public class RidgetCallVisitor extends ASTVisitor{
+public class RidgetCallVisitor extends ASTVisitor {
private boolean callExists;
- private final String ridgetId;
- public RidgetCallVisitor(String ridgetId) {
+ private final String ridgetId;
+
+ public RidgetCallVisitor(final String ridgetId) {
this.ridgetId = ridgetId;
}
-
+
@Override
- public boolean visit(MethodInvocation node) {
- if (RidgetGenerator.METHOD_GET_RIDGET.equals(node.getName().getFullyQualifiedName())){
- if (!node.arguments().isEmpty()){
+ public boolean visit(final MethodInvocation node) {
+ if (RidgetGenerator.METHOD_GET_RIDGET.equals(node.getName().getFullyQualifiedName())) {
+ if (!node.arguments().isEmpty()) {
// check which getRidget-method is called (1 or 2 arguments)
// we just care for the last argument the ridgetId
Object obj = null;
- if (node.arguments().size() == 2){
+ if (node.arguments().size() == 2) {
obj = node.arguments().get(1);
- }
- else{
+ } else {
obj = node.arguments().get(0);
}
-
- if (obj instanceof StringLiteral){
- StringLiteral arg = (StringLiteral) obj;
- if (ridgetId.equals(arg.getLiteralValue())){
+
+ if (obj instanceof StringLiteral) {
+ final StringLiteral arg = (StringLiteral) obj;
+ if (ridgetId.equals(arg.getLiteralValue())) {
callExists = true;
return true;
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/RidgetGenerator.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/RidgetGenerator.java
index beb50e4..ae98117 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/RidgetGenerator.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/RidgetGenerator.java
@@ -54,7 +54,7 @@ public class RidgetGenerator {
protected static final String METHOD_CONFIGURE_RIDGETS = "configureRidgets"; //$NON-NLS-1$
protected final IProject project;
- public RidgetGenerator(IProject project) {
+ public RidgetGenerator(final IProject project) {
this.project = project;
}
@@ -64,29 +64,29 @@ public class RidgetGenerator {
* @param fullyQualifiedClassName
* @return if found the CompilationUnit, otherwise false
*/
- public ICompilationUnit findICompilationUnit(String fullyQualifiedClassName) {
+ public ICompilationUnit findICompilationUnit(final String fullyQualifiedClassName) {
try {
if (project.isNatureEnabled(NATURE_JAVA)) {
- IJavaProject javaProject = JavaCore.create(project);
+ final IJavaProject javaProject = JavaCore.create(project);
- Pattern p = Pattern.compile("(.*)\\.(.*?)"); //$NON-NLS-1$
- Matcher m = p.matcher(fullyQualifiedClassName);
+ final Pattern p = Pattern.compile("(.*)\\.(.*?)"); //$NON-NLS-1$
+ final Matcher m = p.matcher(fullyQualifiedClassName);
if (m.matches()) {
- String packageName = m.group(1);
- String className = m.group(2);
+ final String packageName = m.group(1);
+ final String className = m.group(2);
- IPackageFragment viewPackage = findPackage(javaProject, packageName);
- for (ICompilationUnit unit : viewPackage.getCompilationUnits()) {
+ final IPackageFragment viewPackage = findPackage(javaProject, packageName);
+ for (final ICompilationUnit unit : viewPackage.getCompilationUnits()) {
if (unit.getElementName().equals(className + EXTENSION_JAVA)) {
return unit;
}
}
}
}
- } catch (JavaModelException e) {
+ } catch (final JavaModelException e) {
e.printStackTrace();
throw new RuntimeException(e);
- } catch (CoreException e) {
+ } catch (final CoreException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
@@ -103,23 +103,23 @@ public class RidgetGenerator {
* @param fullyQualifiedClassName
* @return all found SwtControls, or an empty list
*/
- public List<SwtControl> findSwtControls(String fullyQualifiedClassName) {
- CompilationUnit astNode = findCompilationUnit(fullyQualifiedClassName);
+ public List<SwtControl> findSwtControls(final String fullyQualifiedClassName) {
+ final CompilationUnit astNode = findCompilationUnit(fullyQualifiedClassName);
if (null == astNode) {
return Collections.EMPTY_LIST;
}
- MethodDeclaration methodBasicCreatePartControl = findMethod(astNode, METHOD_BASIC_CREATE_PART_CONTROL);
+ final MethodDeclaration methodBasicCreatePartControl = findMethod(astNode, METHOD_BASIC_CREATE_PART_CONTROL);
if (null == methodBasicCreatePartControl) {
return Collections.EMPTY_LIST;
}
- CollectMethodDeclerationsVisitor collector = new CollectMethodDeclerationsVisitor();
+ final CollectMethodDeclerationsVisitor collector = new CollectMethodDeclerationsVisitor();
astNode.accept(collector);
- UIControlVisitor visitor = new UIControlVisitor(collector.getMethods());
+ final UIControlVisitor visitor = new UIControlVisitor(collector.getMethods());
methodBasicCreatePartControl.accept(visitor);
- List<SwtControl> controls = visitor.getControls();
+ final List<SwtControl> controls = visitor.getControls();
return controls;
}
@@ -135,32 +135,33 @@ public class RidgetGenerator {
* @param controls
* @return true if the given class was found, otherwise false
*/
- public boolean generateConfigureRidgets(String fullyQualifiedControllerClassName, List<SwtControl> controls) {
- ICompilationUnit unit = findICompilationUnit(fullyQualifiedControllerClassName);
+ public boolean generateConfigureRidgets(final String fullyQualifiedControllerClassName,
+ final List<SwtControl> controls) {
+ final ICompilationUnit unit = findICompilationUnit(fullyQualifiedControllerClassName);
if (null == unit) {
System.err.println("controller not found " + fullyQualifiedControllerClassName);
return false;
}
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- IJavaProject javaProject = JavaCore.create(project);
+ final ASTParser parser = ASTParser.newParser(AST.JLS3);
+ final IJavaProject javaProject = JavaCore.create(project);
parser.setProject(javaProject);
parser.setSource(unit);
parser.setResolveBindings(true);
- CompilationUnit astNode = (CompilationUnit) parser.createAST(null);
+ final CompilationUnit astNode = (CompilationUnit) parser.createAST(null);
astNode.recordModifications();
- AST ast = astNode.getAST();
+ final AST ast = astNode.getAST();
MethodDeclaration methodDeclaration = findMethod(astNode, METHOD_CONFIGURE_RIDGETS);
if (null == methodDeclaration) {
methodDeclaration = ast.newMethodDeclaration();
- Block methodBlock = ast.newBlock();
+ final Block methodBlock = ast.newBlock();
methodDeclaration.setConstructor(false);
methodDeclaration.modifiers().addAll(ast.newModifiers(Modifier.PUBLIC));
methodDeclaration.setName(ast.newSimpleName(METHOD_CONFIGURE_RIDGETS));
methodDeclaration.setBody(methodBlock);
- TypeDeclaration typeDecl = (TypeDeclaration) astNode.types().get(0);
+ final TypeDeclaration typeDecl = (TypeDeclaration) astNode.types().get(0);
typeDecl.bodyDeclarations().add(methodDeclaration);
}
@@ -191,29 +192,30 @@ public class RidgetGenerator {
* @param parentMethod
* @param controls
*/
- private void generateGetRidgetCalls(AST ast, MethodDeclaration parentMethod, List<SwtControl> controls) {
+ private void generateGetRidgetCalls(final AST ast, final MethodDeclaration parentMethod,
+ final List<SwtControl> controls) {
- for (SwtControl control : controls) {
+ for (final SwtControl control : controls) {
// if a call to getRidget with this ridgetId already exist, skip it
if (getRidgetCallExists(parentMethod, control.getRidgetId())) {
continue;
}
- VariableDeclarationFragment frag = ast.newVariableDeclarationFragment();
- String cleanVariableName = cleanVariableName(control.getRidgetId());
+ final VariableDeclarationFragment frag = ast.newVariableDeclarationFragment();
+ final String cleanVariableName = cleanVariableName(control.getRidgetId());
frag.setName(ast.newSimpleName(cleanVariableName));
- VariableDeclarationStatement vds = ast.newVariableDeclarationStatement(frag);
+ final VariableDeclarationStatement vds = ast.newVariableDeclarationStatement(frag);
vds.setType(ast.newSimpleType(ast.newSimpleName(control.getRidgetClassName())));
parentMethod.getBody().statements().add(vds);
- MethodInvocation mi = ast.newMethodInvocation();
+ final MethodInvocation mi = ast.newMethodInvocation();
mi.setName(ast.newSimpleName(METHOD_GET_RIDGET));
- TypeLiteral argClass = ast.newTypeLiteral();
+ final TypeLiteral argClass = ast.newTypeLiteral();
argClass.setType(ast.newSimpleType(ast.newSimpleName(control.getRidgetClassName())));
mi.arguments().add(argClass);
- StringLiteral argRidgetId = ast.newStringLiteral();
+ final StringLiteral argRidgetId = ast.newStringLiteral();
argRidgetId.setLiteralValue(control.getRidgetId());
mi.arguments().add(argRidgetId);
@@ -229,21 +231,21 @@ public class RidgetGenerator {
* @param unit
* @param controls
*/
- private void addImportStatements(AST ast, CompilationUnit unit, List<SwtControl> controls) {
- for (SwtControl swtControl : controls) {
+ private void addImportStatements(final AST ast, final CompilationUnit unit, final List<SwtControl> controls) {
+ for (final SwtControl swtControl : controls) {
if (!hasImportStatement(unit, swtControl.getFullyQualifiedRidgetClassName())) {
- ImportDeclaration newImport = ast.newImportDeclaration();
+ final ImportDeclaration newImport = ast.newImportDeclaration();
newImport.setName(ast.newName(swtControl.getFullyQualifiedRidgetClassName()));
unit.imports().add(newImport);
}
}
}
- private boolean hasImportStatement(CompilationUnit unit, String ridgetClassName) {
+ private boolean hasImportStatement(final CompilationUnit unit, final String ridgetClassName) {
Assert.isNotNull(ridgetClassName);
- for (Object obj : unit.imports()) {
+ for (final Object obj : unit.imports()) {
if (obj instanceof ImportDeclaration) {
- ImportDeclaration imp = (ImportDeclaration) obj;
+ final ImportDeclaration imp = (ImportDeclaration) obj;
if (ridgetClassName.equals(imp.getName().getFullyQualifiedName())) {
return true;
}
@@ -252,18 +254,18 @@ public class RidgetGenerator {
return false;
}
- private boolean getRidgetCallExists(MethodDeclaration method, String ridgetId) {
- RidgetCallVisitor visitor = new RidgetCallVisitor(ridgetId);
+ private boolean getRidgetCallExists(final MethodDeclaration method, final String ridgetId) {
+ final RidgetCallVisitor visitor = new RidgetCallVisitor(ridgetId);
method.accept(visitor);
return visitor.isCallExists();
}
- protected MethodDeclaration findMethod(CompilationUnit astNode, String name) {
- for (Object typeDeclObj : astNode.types()) {
- TypeDeclaration typeDecl = (TypeDeclaration) typeDeclObj;
- for (Object obj : typeDecl.bodyDeclarations()) {
+ protected MethodDeclaration findMethod(final CompilationUnit astNode, final String name) {
+ for (final Object typeDeclObj : astNode.types()) {
+ final TypeDeclaration typeDecl = (TypeDeclaration) typeDeclObj;
+ for (final Object obj : typeDecl.bodyDeclarations()) {
if (obj instanceof MethodDeclaration) {
- MethodDeclaration method = (MethodDeclaration) obj;
+ final MethodDeclaration method = (MethodDeclaration) obj;
if (name.equals(method.getName().getFullyQualifiedName())) {
return method;
@@ -274,49 +276,49 @@ public class RidgetGenerator {
return null;
}
- private IPackageFragment findPackage(IJavaProject javaProject, String packageName) {
+ private IPackageFragment findPackage(final IJavaProject javaProject, final String packageName) {
try {
- for (IPackageFragment mypackage : javaProject.getPackageFragments()) {
+ for (final IPackageFragment mypackage : javaProject.getPackageFragments()) {
if (mypackage.getKind() == IPackageFragmentRoot.K_SOURCE) {
if (packageName.equals(mypackage.getElementName())) {
return mypackage;
}
}
}
- } catch (JavaModelException e) {
+ } catch (final JavaModelException e) {
e.printStackTrace();
}
return null;
}
- protected CompilationUnit findCompilationUnit(String fullyQualifiedClassName) {
+ protected CompilationUnit findCompilationUnit(final String fullyQualifiedClassName) {
try {
if (project.isNatureEnabled(NATURE_JAVA)) {
- IJavaProject javaProject = JavaCore.create(project);
+ final IJavaProject javaProject = JavaCore.create(project);
- Pattern p = Pattern.compile("(.*)\\.(.*?)"); //$NON-NLS-1$
- Matcher m = p.matcher(fullyQualifiedClassName);
+ final Pattern p = Pattern.compile("(.*)\\.(.*?)"); //$NON-NLS-1$
+ final Matcher m = p.matcher(fullyQualifiedClassName);
if (m.matches()) {
- String packageName = m.group(1);
- String className = m.group(2);
+ final String packageName = m.group(1);
+ final String className = m.group(2);
- IPackageFragment viewPackage = findPackage(javaProject, packageName);
- for (ICompilationUnit unit : viewPackage.getCompilationUnits()) {
+ final IPackageFragment viewPackage = findPackage(javaProject, packageName);
+ for (final ICompilationUnit unit : viewPackage.getCompilationUnits()) {
if (unit.getElementName().equals(className + EXTENSION_JAVA)) {
- ASTParser parser = ASTParser.newParser(AST.JLS3);
+ final ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setProject(javaProject);
parser.setSource(unit);
parser.setResolveBindings(true);
- CompilationUnit astNode = (CompilationUnit) parser.createAST(null);
+ final CompilationUnit astNode = (CompilationUnit) parser.createAST(null);
return astNode;
}
}
}
}
- } catch (JavaModelException e) {
+ } catch (final JavaModelException e) {
e.printStackTrace();
throw new RuntimeException(e);
- } catch (CoreException e) {
+ } catch (final CoreException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
@@ -324,9 +326,9 @@ public class RidgetGenerator {
return null;
}
- protected boolean saveDocument(CompilationUnit astNode) {
+ protected boolean saveDocument(final CompilationUnit astNode) {
try {
- ICompilationUnit unit = (ICompilationUnit) astNode.getJavaElement();
+ final ICompilationUnit unit = (ICompilationUnit) astNode.getJavaElement();
if (unit == null) {
System.err.println("iCompilationUnit is null " + astNode);
@@ -336,21 +338,21 @@ public class RidgetGenerator {
if (!unit.isOpen()) {
unit.open(null);
}
- IEditorPart part = EditorUtility.openInEditor(unit, false);
+ final IEditorPart part = EditorUtility.openInEditor(unit, false);
JavaUI.revealInEditor(part, (IJavaElement) unit);
- Document doc = new Document(unit.getSource());
- TextEdit edits = astNode.rewrite(doc, unit.getJavaProject().getOptions(true));
+ final Document doc = new Document(unit.getSource());
+ final TextEdit edits = astNode.rewrite(doc, unit.getJavaProject().getOptions(true));
unit.applyTextEdit(edits, null);
part.doSave(null);
return true;
- } catch (MalformedTreeException e) {
+ } catch (final MalformedTreeException e) {
e.printStackTrace();
throw new RuntimeException(e);
- } catch (JavaModelException e) {
+ } catch (final JavaModelException e) {
e.printStackTrace();
throw new RuntimeException(e);
- } catch (PartInitException e) {
+ } catch (final PartInitException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/SWTControlInstantiationVisitor.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/SWTControlInstantiationVisitor.java
index 7f645f7..2eae3b9 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/SWTControlInstantiationVisitor.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/SWTControlInstantiationVisitor.java
@@ -27,130 +27,128 @@ import org.eclipse.jdt.core.dom.MethodInvocation;
import org.eclipse.jdt.core.dom.StringLiteral;
import org.eclipse.jdt.core.dom.VariableDeclaration;
-
public class SWTControlInstantiationVisitor extends ASTVisitor {
-
- private Set<String> controlBlackList;
- private List<MethodDeclaration> methods;
- private VariabelCache variabelCache;
-
- public SWTControlInstantiationVisitor(String[] controlBlacklist, List<MethodDeclaration> methods) {
+
+ private final Set<String> controlBlackList;
+ private final List<MethodDeclaration> methods;
+ private final VariabelCache variabelCache;
+
+ public SWTControlInstantiationVisitor(final String[] controlBlacklist, final List<MethodDeclaration> methods) {
this.methods = methods;
this.controlBlackList = new HashSet<String>(Arrays.asList(controlBlacklist));
this.variabelCache = new VariabelCache();
}
-
- private MethodDeclaration getMethodDeclaration(MethodInvocation invocation){
- for (MethodDeclaration decl: methods){
- if (decl.getName().getFullyQualifiedName().equals(invocation.getName().getFullyQualifiedName())){
+
+ private MethodDeclaration getMethodDeclaration(final MethodInvocation invocation) {
+ for (final MethodDeclaration decl : methods) {
+ if (decl.getName().getFullyQualifiedName().equals(invocation.getName().getFullyQualifiedName())) {
return decl;
}
}
return null;
}
-
+
@Override
- public boolean visit(MethodInvocation node) {
- MethodDeclaration decla = getMethodDeclaration(node);
-
+ public boolean visit(final MethodInvocation node) {
+ final MethodDeclaration decla = getMethodDeclaration(node);
+
// if the methodDeclaration was found, it is a private method and has to processed
- if (null != decla){
+ if (null != decla) {
decla.getBody().accept(this);
}
return super.visit(node);
}
-
- private MethodDeclaration findDeclaringMethod(ASTNode current){
- if (null == current){
+
+ private MethodDeclaration findDeclaringMethod(final ASTNode current) {
+ if (null == current) {
return null;
}
-
- if (current instanceof MethodDeclaration){
+
+ if (current instanceof MethodDeclaration) {
return (MethodDeclaration) current;
}
-
- return findDeclaringMethod(current.getParent());
+
+ return findDeclaringMethod(current.getParent());
}
@Override
- public boolean visit(ClassInstanceCreation node) {
- ITypeBinding binding = node.resolveTypeBinding();
-
- String fullClassName = binding.getQualifiedName();
- if (null != fullClassName &&
- fullClassName.startsWith("org.eclipse.swt.widgets")){
-
- if (controlBlackList.contains(fullClassName)){
+ public boolean visit(final ClassInstanceCreation node) {
+ final ITypeBinding binding = node.resolveTypeBinding();
+
+ final String fullClassName = binding.getQualifiedName();
+ if (null != fullClassName && fullClassName.startsWith("org.eclipse.swt.widgets")) {
+
+ if (controlBlackList.contains(fullClassName)) {
return false;
}
-
- ASTNode parent = node.getParent();
-
- if (parent instanceof VariableDeclaration){
- VariableDeclaration decl = (VariableDeclaration) parent;
-
- String varName = decl.getName().getFullyQualifiedName();
-
-
- MethodDeclaration enclosingMethod = findDeclaringMethod(node);
- if (null == enclosingMethod){
+
+ final ASTNode parent = node.getParent();
+
+ if (parent instanceof VariableDeclaration) {
+ final VariableDeclaration decl = (VariableDeclaration) parent;
+
+ final String varName = decl.getName().getFullyQualifiedName();
+
+ final MethodDeclaration enclosingMethod = findDeclaringMethod(node);
+ if (null == enclosingMethod) {
System.err.println("could not detect enclosing method for " + node);
return false;
}
-
- if (!variabelCache.isRegistered(enclosingMethod, varName)){
+
+ if (!variabelCache.isRegistered(enclosingMethod, varName)) {
generateAddUIControlCall(enclosingMethod, varName);
}
}
}
return super.visit(node);
}
-
- private void generateAddUIControlCall(MethodDeclaration enclosingMethod, String variableName){
- AST ast = enclosingMethod.getAST();
-
- MethodInvocation methodAddUIControl = ast.newMethodInvocation();
-
+
+ private void generateAddUIControlCall(final MethodDeclaration enclosingMethod, final String variableName) {
+ final AST ast = enclosingMethod.getAST();
+
+ final MethodInvocation methodAddUIControl = ast.newMethodInvocation();
+
methodAddUIControl.setName(ast.newSimpleName("addUIControl"));
methodAddUIControl.arguments().add(ast.newSimpleName(variableName));
- StringLiteral ridgetId = ast.newStringLiteral();
+ final StringLiteral ridgetId = ast.newStringLiteral();
ridgetId.setLiteralValue(variableName);
methodAddUIControl.arguments().add(ridgetId);
-
+
enclosingMethod.getBody().statements().add(ast.newExpressionStatement(methodAddUIControl));
}
-
+
/**
- * Caches for each MethodDeclaration all calls to addUIControl.
- *
+ * Caches for each MethodDeclaration all calls to addUIControl.
+ *
*/
- private static class VariabelCache{
- private Map<MethodDeclaration, Set<String>> cache;
-
+ private static class VariabelCache {
+ private final Map<MethodDeclaration, Set<String>> cache;
+
public VariabelCache() {
cache = new HashMap<MethodDeclaration, Set<String>>();
}
-
+
/**
- * Returns true if the given {@link MethodDeclaration} contains a call to addUIControl for the given variableName.
+ * Returns true if the given {@link MethodDeclaration} contains a call
+ * to addUIControl for the given variableName.
*
* @param enclosingMethod
* @param variableName
* @return
*/
- public boolean isRegistered(MethodDeclaration enclosingMethod, String variableName){
+ public boolean isRegistered(final MethodDeclaration enclosingMethod, final String variableName) {
Set<String> variables = cache.get(enclosingMethod);
-
- if (null == variables){
-
- AddUIControlCallVisitor addUIControlVisitor = new AddUIControlCallVisitor();
+
+ if (null == variables) {
+
+ final AddUIControlCallVisitor addUIControlVisitor = new AddUIControlCallVisitor();
enclosingMethod.accept(addUIControlVisitor);
variables = addUIControlVisitor.getVariables();
cache.put(enclosingMethod, variables);
}
-
+
return variables.contains(variableName);
}
-
+
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/StartupEditorListener.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/StartupEditorListener.java
index 1910010..b293c05 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/StartupEditorListener.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/StartupEditorListener.java
@@ -15,11 +15,6 @@ import java.util.regex.Pattern;
import org.eclipse.core.resources.IFile;
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
-import org.eclipse.riena.toolbox.Activator;
-import org.eclipse.riena.toolbox.assemblyeditor.model.AssemblyModel;
-import org.eclipse.riena.toolbox.assemblyeditor.model.BundleNode;
-import org.eclipse.riena.toolbox.assemblyeditor.model.SubModuleNode;
-import org.eclipse.riena.toolbox.assemblyeditor.ui.views.AssemblyView;
import org.eclipse.ui.IPartListener;
import org.eclipse.ui.IStartup;
import org.eclipse.ui.IWorkbenchPage;
@@ -28,12 +23,17 @@ import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.riena.toolbox.Activator;
+import org.eclipse.riena.toolbox.assemblyeditor.model.AssemblyModel;
+import org.eclipse.riena.toolbox.assemblyeditor.model.BundleNode;
+import org.eclipse.riena.toolbox.assemblyeditor.model.SubModuleNode;
+import org.eclipse.riena.toolbox.assemblyeditor.ui.views.AssemblyView;
public class StartupEditorListener implements IStartup {
public void earlyStartup() {
IWorkbenchPage activePage = null;
- IPartListener listener = new ActiveEditorPartListener();
+ final IPartListener listener = new ActiveEditorPartListener();
IWorkbenchWindow[] windows = null;
IWorkbenchPart activePart = null;
@@ -55,41 +55,43 @@ public class StartupEditorListener implements IStartup {
}
private static class ActiveEditorPartListener implements IPartListener {
- public void partBroughtToTop(IWorkbenchPart part) {
+ public void partBroughtToTop(final IWorkbenchPart part) {
}
- public void partClosed(IWorkbenchPart part) {
+ public void partClosed(final IWorkbenchPart part) {
}
- public void partDeactivated(IWorkbenchPart part) {
+ public void partDeactivated(final IWorkbenchPart part) {
}
- public void partActivated(IWorkbenchPart part) {
+ public void partActivated(final IWorkbenchPart part) {
selectCorrespondingNodeInAssemblyTree(part);
}
- public void partOpened(IWorkbenchPart part) {
+ public void partOpened(final IWorkbenchPart part) {
selectCorrespondingNodeInAssemblyTree(part);
}
- private void selectCorrespondingNodeInAssemblyTree(IWorkbenchPart part) {
+ private void selectCorrespondingNodeInAssemblyTree(final IWorkbenchPart part) {
if (part instanceof CompilationUnitEditor) {
- CompilationUnitEditor edi = (CompilationUnitEditor) part;
- FileEditorInput inp = (FileEditorInput) edi.getEditorInput();
- IFile file = inp.getFile();
+ final CompilationUnitEditor edi = (CompilationUnitEditor) part;
+ final FileEditorInput inp = (FileEditorInput) edi.getEditorInput();
+ final IFile file = inp.getFile();
// FIXME get src folder from projectsettings
- Pattern pattern = Pattern.compile(BundleNode.SRC_FOLDER + "(.*?)\\.java"); //$NON-NLS-1$
- Matcher matcher = pattern.matcher(file.getProjectRelativePath().toOSString());
+ final Pattern pattern = Pattern.compile(BundleNode.SRC_FOLDER + "(.*?)\\.java"); //$NON-NLS-1$
+ final Matcher matcher = pattern.matcher(file.getProjectRelativePath().toOSString());
if (matcher.matches()) {
- String cleanClassName = matcher.group(1).substring(1).replace("\\", "."); //$NON-NLS-1$ //$NON-NLS-2$
- AssemblyModel model = Activator.getDefault().getAssemblyModel();
- SubModuleNode subMod = Activator.getDefault().getModelService().findSubModuleByClassName(model, file.getProject(), cleanClassName);
+ final String cleanClassName = matcher.group(1).substring(1).replace("\\", "."); //$NON-NLS-1$ //$NON-NLS-2$
+ final AssemblyModel model = Activator.getDefault().getAssemblyModel();
+ final SubModuleNode subMod = Activator.getDefault().getModelService()
+ .findSubModuleByClassName(model, file.getProject(), cleanClassName);
if (null != subMod) {
if (null != PlatformUI.getWorkbench().getActiveWorkbenchWindow()) {
- AssemblyView assView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(AssemblyView.ID);
- if (null != assView){
+ final AssemblyView assView = (AssemblyView) PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().findView(AssemblyView.ID);
+ if (null != assView) {
assView.selectNode(subMod);
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/SwtControl.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/SwtControl.java
index be0aa8e..7051fab 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/SwtControl.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/SwtControl.java
@@ -21,9 +21,9 @@ package org.eclipse.riena.toolbox.assemblyeditor;
public class SwtControl {
private String swtControlClassName;
private String ridgetId;
- private Class<?> ridgetClass;
+ private final Class<?> ridgetClass;
- public SwtControl(String swtControlClassName, String ridgetId, Class<?> ridgetClass) {
+ public SwtControl(final String swtControlClassName, final String ridgetId, final Class<?> ridgetClass) {
super();
this.swtControlClassName = swtControlClassName;
this.ridgetId = ridgetId;
@@ -34,7 +34,7 @@ public class SwtControl {
return swtControlClassName;
}
- public void setSwtControlClassName(String swtControlClassName) {
+ public void setSwtControlClassName(final String swtControlClassName) {
this.swtControlClassName = swtControlClassName;
}
@@ -42,7 +42,7 @@ public class SwtControl {
return ridgetId;
}
- public void setRidgetId(String ridgetId) {
+ public void setRidgetId(final String ridgetId) {
this.ridgetId = ridgetId;
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/UIControlVisitor.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/UIControlVisitor.java
index 45aa222..976fa65 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/UIControlVisitor.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/UIControlVisitor.java
@@ -37,9 +37,9 @@ public class UIControlVisitor extends ASTVisitor {
private static final String CLASS_UI_CONTROLS_FACTORY = "UIControlsFactory"; //$NON-NLS-1$
private static final String METHOD_ADD_UI_CONTROL = "addUIControl"; //$NON-NLS-1$
- private List<SwtControl> controls = new ArrayList<SwtControl>();
+ private final List<SwtControl> controls = new ArrayList<SwtControl>();
private final List<MethodDeclaration> methods;
- private List<String> uiControlFactoryNames = new ArrayList<String>();
+ private final List<String> uiControlFactoryNames = new ArrayList<String>();
/**
* List of controls that have to be ignored, when searching for SWT-Controls
@@ -47,25 +47,25 @@ public class UIControlVisitor extends ASTVisitor {
*/
private List<String> controlBlacklist = new ArrayList<String>();
- public UIControlVisitor(List<MethodDeclaration> methods) {
+ public UIControlVisitor(final List<MethodDeclaration> methods) {
this.methods = methods;
this.uiControlFactoryNames.add(CLASS_UI_CONTROLS_FACTORY);
- String customUIControlsFactory = Activator.getDefault().getPreferenceStore()
+ final String customUIControlsFactory = Activator.getDefault().getPreferenceStore()
.getString(PreferenceConstants.CONST_CUSTOM_UI_CONTROLS_FACTORY);
if (Util.isGiven(customUIControlsFactory)) {
uiControlFactoryNames.add(customUIControlsFactory);
}
- String blackListString = Activator.getDefault().getPreferenceStore()
+ final String blackListString = Activator.getDefault().getPreferenceStore()
.getString(PreferenceConstants.CONST_CONFIGURE_RIDGETS_BLACKLIST);
if (Util.isGiven(blackListString)) {
controlBlacklist = Arrays.asList(blackListString.split(";"));
}
}
- private MethodDeclaration getMethodDeclaration(MethodInvocation invocation) {
- for (MethodDeclaration decl : methods) {
+ private MethodDeclaration getMethodDeclaration(final MethodInvocation invocation) {
+ for (final MethodDeclaration decl : methods) {
if (decl.getName().getFullyQualifiedName().equals(invocation.getName().getFullyQualifiedName())) {
return decl;
}
@@ -73,56 +73,56 @@ public class UIControlVisitor extends ASTVisitor {
return null;
}
- private Class<?> getRidgetInterface(String swtControlClassName) {
- SwtControlRidgetMapper mapper = SwtControlRidgetMapper.getInstance();
+ private Class<?> getRidgetInterface(final String swtControlClassName) {
+ final SwtControlRidgetMapper mapper = SwtControlRidgetMapper.getInstance();
try {
- Class<?> clazz = Activator.getDefault().getBundle().loadClass(swtControlClassName);
- Class<? extends IRidget> ridget = mapper.getRidgetClass(clazz);
- Class<?> ridgetInterface = mapper.getPrimaryRidgetInterface(ridget);
+ final Class<?> clazz = Activator.getDefault().getBundle().loadClass(swtControlClassName);
+ final Class<? extends IRidget> ridget = mapper.getRidgetClass(clazz);
+ final Class<?> ridgetInterface = mapper.getPrimaryRidgetInterface(ridget);
if (null != ridgetInterface) {
return ridgetInterface;
}
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
e.printStackTrace();
- } catch (BindingException e) {
+ } catch (final BindingException e) {
return null;
}
return IRidget.class;
}
@Override
- public boolean visit(MethodInvocation methodCall) {
+ public boolean visit(final MethodInvocation methodCall) {
- MethodDeclaration decla = getMethodDeclaration(methodCall);
+ final MethodDeclaration decla = getMethodDeclaration(methodCall);
if (null != decla) {
decla.getBody().accept(this);
}
- IMethodBinding methodBinding = methodCall.resolveMethodBinding();
- String className = methodBinding.getDeclaringClass().getName();
- String superClassName = methodBinding.getDeclaringClass().getSuperclass().getName();
- Expression exp = methodCall.getExpression();
+ final IMethodBinding methodBinding = methodCall.resolveMethodBinding();
+ final String className = methodBinding.getDeclaringClass().getName();
+ final String superClassName = methodBinding.getDeclaringClass().getSuperclass().getName();
+ final Expression exp = methodCall.getExpression();
if (uiControlFactoryNames.contains(className) || uiControlFactoryNames.contains(superClassName)) {
- List<?> args = methodCall.arguments();
+ final List<?> args = methodCall.arguments();
if (args.isEmpty()) {
System.err.println("call to UIControlsFactory without arguments: " + methodCall);
return true;
}
- Object lastArgument = args.get(args.size() - 1);
+ final Object lastArgument = args.get(args.size() - 1);
- IMethodBinding typeBind = methodCall.resolveMethodBinding();
+ final IMethodBinding typeBind = methodCall.resolveMethodBinding();
// TODO annotate bindingId in UIControlsFactory to detect the correct parameter
if (lastArgument instanceof SimpleName) {
- SimpleName sm = (SimpleName) lastArgument;
- String value = getConstantStringFromSimpleName(sm);
+ final SimpleName sm = (SimpleName) lastArgument;
+ final String value = getConstantStringFromSimpleName(sm);
if (null != value) {
- String swtControlClassName = typeBind.getReturnType().getQualifiedName();
- Class<?> ridgetClass = getRidgetInterface(swtControlClassName);
+ final String swtControlClassName = typeBind.getReturnType().getQualifiedName();
+ final Class<?> ridgetClass = getRidgetInterface(swtControlClassName);
if (null != ridgetClass) {
controls.add(new SwtControl(swtControlClassName, value, ridgetClass));
}
@@ -131,11 +131,11 @@ public class UIControlVisitor extends ASTVisitor {
}
} else if (lastArgument instanceof org.eclipse.jdt.core.dom.QualifiedName) {
// TODO use the constant in the Controller, instead of extracting the value
- org.eclipse.jdt.core.dom.QualifiedName sm = (org.eclipse.jdt.core.dom.QualifiedName) lastArgument;
- String value = getConstantStringFromSimpleName(sm.getName());
+ final org.eclipse.jdt.core.dom.QualifiedName sm = (org.eclipse.jdt.core.dom.QualifiedName) lastArgument;
+ final String value = getConstantStringFromSimpleName(sm.getName());
if (null != value) {
- String swtControlClassName = typeBind.getReturnType().getQualifiedName();
- Class<?> ridgetClass = getRidgetInterface(swtControlClassName);
+ final String swtControlClassName = typeBind.getReturnType().getQualifiedName();
+ final Class<?> ridgetClass = getRidgetInterface(swtControlClassName);
if (null != ridgetClass) {
controls.add(new SwtControl(swtControlClassName, value, ridgetClass));
}
@@ -143,10 +143,10 @@ public class UIControlVisitor extends ASTVisitor {
System.err.println("Parameter is not a constant " + sm);
}
} else if (lastArgument instanceof StringLiteral) {
- StringLiteral sm = (StringLiteral) lastArgument;
+ final StringLiteral sm = (StringLiteral) lastArgument;
- String swtControlClassName = typeBind.getReturnType().getQualifiedName();
- Class<?> ridgetClass = getRidgetInterface(swtControlClassName);
+ final String swtControlClassName = typeBind.getReturnType().getQualifiedName();
+ final Class<?> ridgetClass = getRidgetInterface(swtControlClassName);
if (null != ridgetClass) {
controls.add(new SwtControl(swtControlClassName, sm.getLiteralValue(), ridgetClass));
}
@@ -154,22 +154,22 @@ public class UIControlVisitor extends ASTVisitor {
System.err.println("unknown arg type " + lastArgument);
}
} else if (METHOD_ADD_UI_CONTROL.equals(methodCall.getName().getIdentifier())) {
- List<?> args = methodCall.arguments();
+ final List<?> args = methodCall.arguments();
if (args.size() < 2) {
System.err.println("call to addUIControl without arguments: " + methodCall);
return true;
}
- SimpleName swtControl = (SimpleName) args.get(0);
+ final SimpleName swtControl = (SimpleName) args.get(0);
- IBinding swtControlBinding = swtControl.resolveBinding();
+ final IBinding swtControlBinding = swtControl.resolveBinding();
if (swtControlBinding instanceof IVariableBinding) {
- IVariableBinding decl = ((IVariableBinding) swtControlBinding).getVariableDeclaration();
- ITypeBinding type = decl.getType();
- StringLiteral ridgetId = (StringLiteral) args.get(1);
- String swtControlClassName = type.getQualifiedName();
+ final IVariableBinding decl = ((IVariableBinding) swtControlBinding).getVariableDeclaration();
+ final ITypeBinding type = decl.getType();
+ final StringLiteral ridgetId = (StringLiteral) args.get(1);
+ final String swtControlClassName = type.getQualifiedName();
controls.add(new SwtControl(swtControlClassName, ridgetId.getLiteralValue(),
getRidgetInterface(swtControlClassName)));
}
@@ -184,19 +184,19 @@ public class UIControlVisitor extends ASTVisitor {
return true;
}
- private String getConstantStringFromSimpleName(SimpleName simpleName) {
- IBinding swtControlBinding = simpleName.resolveBinding();
+ private String getConstantStringFromSimpleName(final SimpleName simpleName) {
+ final IBinding swtControlBinding = simpleName.resolveBinding();
if (swtControlBinding instanceof IVariableBinding) {
- IVariableBinding decl = ((IVariableBinding) swtControlBinding).getVariableDeclaration();
- Object contValue = decl.getConstantValue();
+ final IVariableBinding decl = ((IVariableBinding) swtControlBinding).getVariableDeclaration();
+ final Object contValue = decl.getConstantValue();
return null != contValue ? contValue.toString() : null;
}
return null;
}
public List<SwtControl> getControls() {
- List<SwtControl> out = new ArrayList<SwtControl>();
- for (SwtControl control : controls) {
+ final List<SwtControl> out = new ArrayList<SwtControl>();
+ for (final SwtControl control : controls) {
if (!controlBlacklist.contains(control.getSwtControlClassName())) {
out.add(control);
} else {
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IAssemblyDataProvider.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IAssemblyDataProvider.java
index 1358fda..92e592a 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IAssemblyDataProvider.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IAssemblyDataProvider.java
@@ -14,14 +14,15 @@ import org.eclipse.riena.toolbox.assemblyeditor.model.AssemblyModel;
public interface IAssemblyDataProvider {
public void saveData(AssemblyModel model);
-
+
/**
- * Iterates over all Projects in the workspace and parses the plugin.xml if existent.
+ * Iterates over all Projects in the workspace and parses the plugin.xml if
+ * existent.
*
* @return the AssemblyModel
*/
public AssemblyModel createData();
-
+
public IPluginXmlRenderer getXmlRenderer();
public void setXmlRenderer(IPluginXmlRenderer xmlRenderer);
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/ICodeGenerator.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/ICodeGenerator.java
index d53af2d..e3ee9aa 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/ICodeGenerator.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/ICodeGenerator.java
@@ -15,7 +15,10 @@ import org.eclipse.riena.toolbox.assemblyeditor.model.SubModuleNode;
public interface ICodeGenerator {
public RCPView generateView(SubModuleNode subModule);
+
public String generateController(SubModuleNode subModule);
+
public void deleteControllerClass(SubModuleNode subModule);
+
public void deleteViewClass(SubModuleNode subModule);
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IModelService.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IModelService.java
index de2d8b9..2ce494e 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IModelService.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IModelService.java
@@ -13,17 +13,19 @@ package org.eclipse.riena.toolbox.assemblyeditor.api;
import java.util.Set;
import org.eclipse.core.resources.IProject;
+
import org.eclipse.riena.toolbox.assemblyeditor.model.AbstractTypedNode;
import org.eclipse.riena.toolbox.assemblyeditor.model.AssemblyModel;
import org.eclipse.riena.toolbox.assemblyeditor.model.SubModuleNode;
-
/**
* Services for retrieving Information from the domainmodel.
- *
+ *
*/
public interface IModelService {
public Set<String> getAllParentTypeIds(AssemblyModel model);
+
public Set<String> getAllTypeIds(AssemblyModel model, AbstractTypedNode nodesToIgnore);
+
public SubModuleNode findSubModuleByClassName(AssemblyModel model, IProject project, String className);
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/INodeFactory.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/INodeFactory.java
index 05d5f0c..f7e23f0 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/INodeFactory.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/INodeFactory.java
@@ -21,14 +21,19 @@ import org.eclipse.riena.toolbox.assemblyeditor.model.SubModuleNode;
/**
* Factory for the different nodes that sets the default values.
- *
+ *
*/
public interface INodeFactory {
AssemblyNode createAssembly(BundleNode model);
+
SubApplicationNode createSubApplication(AbstractAssemblyNode parent, BundleNode model);
+
ModuleGroupNode createModuleGroup(AbstractAssemblyNode parent, BundleNode model);
+
ModuleNode createModule(AbstractAssemblyNode parent, BundleNode model);
+
SubModuleNode createSubModule(AbstractAssemblyNode parent, BundleNode model);
+
RCPPerspective createRcpPerspective(SubApplicationNode parent);
-
+
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IPluginXmlParser.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IPluginXmlParser.java
index 2ac40ef..760a98f 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IPluginXmlParser.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IPluginXmlParser.java
@@ -17,18 +17,25 @@ import org.eclipse.riena.toolbox.assemblyeditor.model.AssemblyNode;
import org.eclipse.riena.toolbox.assemblyeditor.model.BundleNode;
import org.eclipse.riena.toolbox.assemblyeditor.model.RCPPerspective;
import org.eclipse.riena.toolbox.assemblyeditor.model.RCPView;
+import org.eclipse.riena.toolbox.assemblyeditor.model.SubApplicationNode;
import org.eclipse.riena.toolbox.assemblyeditor.model.SubModuleNode;
-
public interface IPluginXmlParser {
List<AssemblyNode> parseDocument(BundleNode bundle);
+
Set<RCPView> getRcpViews(BundleNode bundle);
+
/**
- * Returns all registered RCP-Perspectives in this bundles plugin.xml with the class-name <code>org.eclipse.riena.navigation.ui.swt.views.SubApplicationView</code>
+ * Returns all registered RCP-Perspectives in this bundles plugin.xml with
+ * the class-name
+ * <code>org.eclipse.riena.navigation.ui.swt.views.SubApplicationView</code>
*
* @param bundleNode
* @return
*/
Set<RCPPerspective> getRcpPerspectives(BundleNode bundleNode);
+
boolean unregisterView(SubModuleNode subModule);
+
+ boolean unregisterPerspective(SubApplicationNode subApplication);
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IPluginXmlRenderer.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IPluginXmlRenderer.java
index cf2df36..9f12328 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IPluginXmlRenderer.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/api/IPluginXmlRenderer.java
@@ -16,6 +16,8 @@ import org.eclipse.riena.toolbox.assemblyeditor.model.RCPView;
public interface IPluginXmlRenderer {
void saveDocument(BundleNode bundle);
+
boolean registerView(BundleNode bundle, RCPView view);
+
boolean registerPerspective(BundleNode bundle, RCPPerspective perspective);
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AbstractAssemblyNode.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AbstractAssemblyNode.java
index b348d7d..0424cb4 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AbstractAssemblyNode.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AbstractAssemblyNode.java
@@ -24,7 +24,7 @@ public abstract class AbstractAssemblyNode<T> {
protected BundleNode bundle;
protected AbstractAssemblyNode parent;
- public AbstractAssemblyNode(AbstractAssemblyNode parent) {
+ public AbstractAssemblyNode(final AbstractAssemblyNode parent) {
this.parent = parent;
}
@@ -44,7 +44,7 @@ public abstract class AbstractAssemblyNode<T> {
return name;
}
- public void setName(String name) {
+ public void setName(final String name) {
this.name = name;
}
@@ -55,7 +55,7 @@ public abstract class AbstractAssemblyNode<T> {
public abstract boolean add(T child);
public boolean hasChildren() {
- List<T> children = getChildren();
+ final List<T> children = getChildren();
if (null == children) {
return false;
}
@@ -67,7 +67,7 @@ public abstract class AbstractAssemblyNode<T> {
return bundle;
}
- public void setBundle(BundleNode bundle) {
+ public void setBundle(final BundleNode bundle) {
this.bundle = bundle;
}
@@ -77,7 +77,7 @@ public abstract class AbstractAssemblyNode<T> {
}
for (int i = 0; i < parent.getChildren().size(); i++) {
- Object sibling = parent.getChildren().get(i);
+ final Object sibling = parent.getChildren().get(i);
if (sibling.equals(this)) {
return i;
@@ -87,7 +87,7 @@ public abstract class AbstractAssemblyNode<T> {
}
public boolean hasNextSibling() {
- int currentIndex = getCurrentIndex();
+ final int currentIndex = getCurrentIndex();
if (currentIndex == -1) {
return false;
@@ -97,7 +97,7 @@ public abstract class AbstractAssemblyNode<T> {
}
public boolean hasPreviousSibling() {
- int currentIndex = getCurrentIndex();
+ final int currentIndex = getCurrentIndex();
if (currentIndex == -1) {
return false;
@@ -107,7 +107,7 @@ public abstract class AbstractAssemblyNode<T> {
}
public T getPreviousSibling() {
- int currentIndex = getCurrentIndex();
+ final int currentIndex = getCurrentIndex();
if (currentIndex < 1) {
return null;
@@ -121,9 +121,9 @@ public abstract class AbstractAssemblyNode<T> {
return false;
}
- List<T> siblings = parent.getChildren();
- int selfIndex = getCurrentIndex();
- T self = siblings.remove(selfIndex);
+ final List<T> siblings = parent.getChildren();
+ final int selfIndex = getCurrentIndex();
+ final T self = siblings.remove(selfIndex);
siblings.add(selfIndex + 1, self);
return true;
}
@@ -133,9 +133,9 @@ public abstract class AbstractAssemblyNode<T> {
return false;
}
- List<T> siblings = parent.getChildren();
+ final List<T> siblings = parent.getChildren();
int selfIndex = getCurrentIndex();
- T self = siblings.remove(selfIndex);
+ final T self = siblings.remove(selfIndex);
siblings.add(--selfIndex, self);
return false;
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AbstractTypedNode.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AbstractTypedNode.java
index 28d7bc2..0c57efc 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AbstractTypedNode.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AbstractTypedNode.java
@@ -14,24 +14,25 @@ import org.eclipse.riena.toolbox.Util;
/**
* A Node that has a typeId
- *
- * @param <T> the type of the childNode
+ *
+ * @param <T>
+ * the type of the childNode
*/
-public abstract class AbstractTypedNode<T extends AbstractTypedNode> extends AbstractAssemblyNode<T>{
+public abstract class AbstractTypedNode<T extends AbstractTypedNode> extends AbstractAssemblyNode<T> {
- public AbstractTypedNode(AbstractAssemblyNode parent) {
+ public AbstractTypedNode(final AbstractAssemblyNode parent) {
super(parent);
}
protected String nodeId;
private String prefix;
private String suffix;
-
+
public String getPrefix() {
return prefix;
}
- public void setPrefix(String prefix) {
+ public void setPrefix(final String prefix) {
this.prefix = prefix;
}
@@ -39,7 +40,7 @@ public abstract class AbstractTypedNode<T extends AbstractTypedNode> extends Abs
return suffix;
}
- public void setSuffix(String suffix) {
+ public void setSuffix(final String suffix) {
this.suffix = suffix;
}
@@ -47,44 +48,44 @@ public abstract class AbstractTypedNode<T extends AbstractTypedNode> extends Abs
return nodeId;
}
- public void setNodeId(String typeId) {
+ public void setNodeId(final String typeId) {
this.nodeId = typeId;
}
-
- public AssemblyNode getAssemblyNode(){
+
+ public AssemblyNode getAssemblyNode() {
return Util.findParentOfType(this, AssemblyNode.class);
}
-
+
@Override
public String getTreeLabel() {
- String treeLabelValue = getTreeLabelValue();
- return Util.isGiven(treeLabelValue) ? treeLabelValue : "(nodeId="+nodeId+")"; //$NON-NLS-1$ //$NON-NLS-2$;
+ final String treeLabelValue = getTreeLabelValue();
+ return Util.isGiven(treeLabelValue) ? treeLabelValue : "(nodeId=" + nodeId + ")"; //$NON-NLS-1$ //$NON-NLS-2$;
}
-
+
protected abstract String getTreeLabelValue();
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
- AssemblyNode ass = getAssemblyNode();
+ final AssemblyNode ass = getAssemblyNode();
result = prime * result + ((ass == null) ? 0 : ass.hashCode());
result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode());
return result;
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
- AbstractTypedNode other = (AbstractTypedNode) obj;
- AssemblyNode ass = getAssemblyNode();
- AssemblyNode otherAss = other.getAssemblyNode();
-
+ final AbstractTypedNode other = (AbstractTypedNode) obj;
+ final AssemblyNode ass = getAssemblyNode();
+ final AssemblyNode otherAss = other.getAssemblyNode();
+
if (ass == null) {
if (otherAss != null)
return false;
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AssemblyModel.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AssemblyModel.java
index 01ab679..8dd06e6 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AssemblyModel.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AssemblyModel.java
@@ -22,65 +22,64 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.Assert;
/**
- * This class is a container for the {@link BundleNode}s in the workspace.
+ * This class is a container for the {@link BundleNode}s in the workspace.
*/
public class AssemblyModel extends AbstractAssemblyNode<BundleNode> {
- private List<BundleNode> bundles;
- private Set<RCPView> rcpViews;
- private Set<RCPPerspective> rcpPerspectives;
-
+ private final List<BundleNode> bundles;
+ private final Set<RCPView> rcpViews;
+ private final Set<RCPPerspective> rcpPerspectives;
+
public AssemblyModel() {
super(null);
bundles = new ArrayList<BundleNode>();
rcpViews = new HashSet<RCPView>();
rcpPerspectives = new HashSet<RCPPerspective>();
}
-
- public void addAllRcpViews(Set<RCPView> viewIds){
+
+ public void addAllRcpViews(final Set<RCPView> viewIds) {
this.rcpViews.addAll(viewIds);
}
-
- public void addAllRcpPerspectives(Set<RCPPerspective> perspectives){
+
+ public void addAllRcpPerspectives(final Set<RCPPerspective> perspectives) {
this.rcpPerspectives.addAll(perspectives);
}
public List<String> getRcpViewIds() {
- List<String> viewIds = new ArrayList<String>();
-
- for (RCPView view: getRcpViews()){
+ final List<String> viewIds = new ArrayList<String>();
+
+ for (final RCPView view : getRcpViews()) {
viewIds.add(view.getId());
}
return viewIds;
}
-
-
+
public List<String> getRcpPerspectiveIds() {
- List<String> perspectiveIds = new ArrayList<String>();
-
- for (RCPPerspective persp: getRcpPerspectives()){
+ final List<String> perspectiveIds = new ArrayList<String>();
+
+ for (final RCPPerspective persp : getRcpPerspectives()) {
perspectiveIds.add(persp.getId());
}
return perspectiveIds;
}
-
- public BundleNode getBundle(IProject project){
+
+ public BundleNode getBundle(final IProject project) {
Assert.isNotNull(project);
-
- for (BundleNode bn: bundles){
- if (project.equals(bn.getProject())){
+
+ for (final BundleNode bn : bundles) {
+ if (project.equals(bn.getProject())) {
return bn;
}
}
return null;
}
-
+
public List<RCPView> getRcpViews() {
- List<RCPView> out = new ArrayList<RCPView>();
+ final List<RCPView> out = new ArrayList<RCPView>();
out.addAll(rcpViews);
-
+
Collections.sort(out, new Comparator<RCPView>() {
- public int compare(RCPView o1, RCPView o2) {
- if (null == o1 || null == o2){
+ public int compare(final RCPView o1, final RCPView o2) {
+ if (null == o1 || null == o2) {
return 0;
}
return o1.getId().compareTo(o2.getId());
@@ -88,15 +87,14 @@ public class AssemblyModel extends AbstractAssemblyNode<BundleNode> {
});
return out;
}
-
-
+
public List<RCPPerspective> getRcpPerspectives() {
- List<RCPPerspective> out = new ArrayList<RCPPerspective>();
+ final List<RCPPerspective> out = new ArrayList<RCPPerspective>();
out.addAll(rcpPerspectives);
-
+
Collections.sort(out, new Comparator<RCPPerspective>() {
- public int compare(RCPPerspective o1, RCPPerspective o2) {
- if (null == o1 || null == o2){
+ public int compare(final RCPPerspective o1, final RCPPerspective o2) {
+ if (null == o1 || null == o2) {
return 0;
}
return o1.getId().compareTo(o2.getId());
@@ -106,7 +104,7 @@ public class AssemblyModel extends AbstractAssemblyNode<BundleNode> {
}
@Override
- public boolean add(BundleNode e) {
+ public boolean add(final BundleNode e) {
return bundles.add(e);
}
@@ -117,10 +115,10 @@ public class AssemblyModel extends AbstractAssemblyNode<BundleNode> {
@Override
public String toString() {
- return "AssemblyModel [bundles=" + bundles + "]"; //$NON-NLS-1$//$NON-NLS-2$
+ return "AssemblyModel [bundles=" + bundles + "]"; //$NON-NLS-1$//$NON-NLS-2$
}
- public boolean addAll(Collection<? extends BundleNode> c) {
+ public boolean addAll(final Collection<? extends BundleNode> c) {
return bundles.addAll(c);
}
@@ -129,14 +127,13 @@ public class AssemblyModel extends AbstractAssemblyNode<BundleNode> {
return null;
}
-
@Override
public BundleNode getBundle() {
throw new UnsupportedOperationException();
}
@Override
- public void setBundle(BundleNode bundle) {
+ public void setBundle(final BundleNode bundle) {
throw new UnsupportedOperationException();
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AssemblyNode.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AssemblyNode.java
index 2c73543..95fe467 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AssemblyNode.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/AssemblyNode.java
@@ -13,7 +13,6 @@ package org.eclipse.riena.toolbox.assemblyeditor.model;
import java.util.ArrayList;
import java.util.List;
-import org.apache.velocity.util.StringUtils;
import org.eclipse.riena.toolbox.Util;
/**
@@ -25,12 +24,12 @@ public class AssemblyNode extends AbstractAssemblyNode<AbstractTypedNode> {
private String assembler;
private String parentNodeId;
private Integer startOrder;
-
+
private String prefix;
private String suffix;
- private List<AbstractTypedNode> children;
+ private final List<AbstractTypedNode> children;
- public AssemblyNode(AbstractAssemblyNode parent) {
+ public AssemblyNode(final AbstractAssemblyNode parent) {
super(parent);
children = new ArrayList<AbstractTypedNode>();
}
@@ -39,7 +38,7 @@ public class AssemblyNode extends AbstractAssemblyNode<AbstractTypedNode> {
return prefix;
}
- public void setPrefix(String prefix) {
+ public void setPrefix(final String prefix) {
this.prefix = prefix;
}
@@ -47,7 +46,7 @@ public class AssemblyNode extends AbstractAssemblyNode<AbstractTypedNode> {
return suffix;
}
- public void setSuffix(String suffix) {
+ public void setSuffix(final String suffix) {
this.suffix = suffix;
}
@@ -55,7 +54,7 @@ public class AssemblyNode extends AbstractAssemblyNode<AbstractTypedNode> {
return assembler;
}
- public void setAssembler(String assembler) {
+ public void setAssembler(final String assembler) {
this.assembler = assembler;
}
@@ -63,7 +62,7 @@ public class AssemblyNode extends AbstractAssemblyNode<AbstractTypedNode> {
return id;
}
- public void setId(String id) {
+ public void setId(final String id) {
this.id = id;
}
@@ -71,7 +70,7 @@ public class AssemblyNode extends AbstractAssemblyNode<AbstractTypedNode> {
return parentNodeId;
}
- public void setNodeTypeId(String parentTypeId) {
+ public void setNodeTypeId(final String parentTypeId) {
this.parentNodeId = parentTypeId;
}
@@ -79,12 +78,12 @@ public class AssemblyNode extends AbstractAssemblyNode<AbstractTypedNode> {
return startOrder;
}
- public void setAutostartSequence(Integer autostartSequence) {
+ public void setAutostartSequence(final Integer autostartSequence) {
this.startOrder = autostartSequence;
}
@Override
- public boolean add(AbstractTypedNode resultNode) {
+ public boolean add(final AbstractTypedNode resultNode) {
children.add(resultNode);
return true;
}
@@ -99,7 +98,7 @@ public class AssemblyNode extends AbstractAssemblyNode<AbstractTypedNode> {
if (Util.isGiven(name)) {
return name;
}
- return "(id="+id+")"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "(id=" + id + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
@Override
@@ -117,14 +116,14 @@ public class AssemblyNode extends AbstractAssemblyNode<AbstractTypedNode> {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
- AssemblyNode other = (AssemblyNode) obj;
+ final AssemblyNode other = (AssemblyNode) obj;
if (id == null) {
if (other.id != null)
return false;
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/BundleNode.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/BundleNode.java
index 5b0252e..9a17093 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/BundleNode.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/BundleNode.java
@@ -26,7 +26,7 @@ import org.eclipse.core.runtime.CoreException;
*
*/
public class BundleNode extends AbstractAssemblyNode<AssemblyNode> {
- private List<AssemblyNode> assemblies;
+ private final List<AssemblyNode> assemblies;
private IFile pluginXml;
private String sourceFolder; // FIXME compute correct sourceFolder with JDT
private IProject project;
@@ -48,7 +48,7 @@ public class BundleNode extends AbstractAssemblyNode<AssemblyNode> {
public final static String SRC_FOLDER = "src"; //$NON-NLS-1$
- public BundleNode(AbstractAssemblyNode parent) {
+ public BundleNode(final AbstractAssemblyNode parent) {
super(parent);
assemblies = new ArrayList<AssemblyNode>();
registeredRcpViews = new HashSet<RCPView>();
@@ -67,7 +67,7 @@ public class BundleNode extends AbstractAssemblyNode<AssemblyNode> {
* @param dirty
* the dirty to set
*/
- public void setDirty(boolean dirty) {
+ public void setDirty(final boolean dirty) {
this.dirty = dirty;
}
@@ -79,12 +79,12 @@ public class BundleNode extends AbstractAssemblyNode<AssemblyNode> {
return registeredRcpPerspectives;
}
- public void setRegisteredRcpPerspectives(Set<RCPPerspective> registeredRcpPerspectives) {
+ public void setRegisteredRcpPerspectives(final Set<RCPPerspective> registeredRcpPerspectives) {
this.registeredRcpPerspectives = registeredRcpPerspectives;
}
- public RCPView findRcpView(String viewId) {
- for (RCPView view : registeredRcpViews) {
+ public RCPView findRcpView(final String viewId) {
+ for (final RCPView view : registeredRcpViews) {
if (viewId.equals(view.getId())) {
return view;
}
@@ -92,7 +92,7 @@ public class BundleNode extends AbstractAssemblyNode<AssemblyNode> {
return null;
}
- public void setRegisteredRcpViews(Set<RCPView> registeredRcpViews) {
+ public void setRegisteredRcpViews(final Set<RCPView> registeredRcpViews) {
this.registeredRcpViews = registeredRcpViews;
}
@@ -106,7 +106,7 @@ public class BundleNode extends AbstractAssemblyNode<AssemblyNode> {
return project;
}
- public void setProject(IProject project) {
+ public void setProject(final IProject project) {
this.project = project;
}
@@ -114,7 +114,7 @@ public class BundleNode extends AbstractAssemblyNode<AssemblyNode> {
return pluginXml;
}
- public void setPluginXml(IFile pluginXml) {
+ public void setPluginXml(final IFile pluginXml) {
this.pluginXml = pluginXml;
}
@@ -122,7 +122,7 @@ public class BundleNode extends AbstractAssemblyNode<AssemblyNode> {
return sourceFolder;
}
- public void setSourceFolder(String sourceFolder) {
+ public void setSourceFolder(final String sourceFolder) {
this.sourceFolder = sourceFolder;
}
@@ -132,7 +132,7 @@ public class BundleNode extends AbstractAssemblyNode<AssemblyNode> {
}
@Override
- public boolean add(AssemblyNode assNode) {
+ public boolean add(final AssemblyNode assNode) {
return assemblies.add(assNode);
}
@@ -142,7 +142,7 @@ public class BundleNode extends AbstractAssemblyNode<AssemblyNode> {
+ pluginXml + "]"; //$NON-NLS-1$
}
- public boolean addAll(Collection<? extends AssemblyNode> c) {
+ public boolean addAll(final Collection<? extends AssemblyNode> c) {
return assemblies.addAll(c);
}
@@ -165,14 +165,14 @@ public class BundleNode extends AbstractAssemblyNode<AssemblyNode> {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
- BundleNode other = (BundleNode) obj;
+ final BundleNode other = (BundleNode) obj;
if (name == null) {
if (other.name != null)
return false;
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/ModuleGroupNode.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/ModuleGroupNode.java
index d9cd4dd..1e44b98 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/ModuleGroupNode.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/ModuleGroupNode.java
@@ -15,12 +15,12 @@ import java.util.List;
/**
* This class represents a ModuleGroup in the Riena-Navigation.
- *
+ *
*/
public class ModuleGroupNode extends AbstractTypedNode<ModuleNode> {
- private List<ModuleNode> modules;
-
- public ModuleGroupNode(AbstractAssemblyNode parent) {
+ private final List<ModuleNode> modules;
+
+ public ModuleGroupNode(final AbstractAssemblyNode parent) {
super(parent);
modules = new ArrayList<ModuleNode>();
}
@@ -30,9 +30,8 @@ public class ModuleGroupNode extends AbstractTypedNode<ModuleNode> {
return modules;
}
-
@Override
- public boolean add(ModuleNode e) {
+ public boolean add(final ModuleNode e) {
return modules.add(e);
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/ModuleNode.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/ModuleNode.java
index ef5c91d..efe2225 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/ModuleNode.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/ModuleNode.java
@@ -15,15 +15,14 @@ import java.util.List;
/**
* This class represents a Module in the Riena-Navigation.
- *
+ *
*/
public class ModuleNode extends AbstractTypedNode<SubModuleNode> {
- private List<SubModuleNode> subModules;
+ private final List<SubModuleNode> subModules;
private String icon;
private boolean closeable;
-
- public ModuleNode(AbstractAssemblyNode parent) {
+ public ModuleNode(final AbstractAssemblyNode parent) {
super(parent);
this.subModules = new ArrayList<SubModuleNode>();
}
@@ -32,7 +31,7 @@ public class ModuleNode extends AbstractTypedNode<SubModuleNode> {
return icon;
}
- public void setIcon(String icon) {
+ public void setIcon(final String icon) {
this.icon = icon;
}
@@ -40,7 +39,7 @@ public class ModuleNode extends AbstractTypedNode<SubModuleNode> {
return closeable;
}
- public void setCloseable(boolean uncloseable) {
+ public void setCloseable(final boolean uncloseable) {
this.closeable = uncloseable;
}
@@ -50,7 +49,7 @@ public class ModuleNode extends AbstractTypedNode<SubModuleNode> {
}
@Override
- public boolean add(SubModuleNode e) {
+ public boolean add(final SubModuleNode e) {
return subModules.add(e);
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/RCPPerspective.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/RCPPerspective.java
index 80cbe15..b0c3860 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/RCPPerspective.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/RCPPerspective.java
@@ -14,17 +14,17 @@ public class RCPPerspective {
private String id;
private String perspectiveClass;
private String name;
-
+
/**
* Default Classname for all Riena-Perspectives.
*/
public final static String PERSPECTIVE_CLASS_NAME = "org.eclipse.riena.navigation.ui.swt.views.SubApplicationView"; //$NON-NLS-1$
-
+
public RCPPerspective() {
super();
}
- public RCPPerspective(String id) {
+ public RCPPerspective(final String id) {
super();
this.id = id;
}
@@ -33,7 +33,7 @@ public class RCPPerspective {
return id;
}
- public void setId(String id) {
+ public void setId(final String id) {
this.id = id;
}
@@ -41,7 +41,7 @@ public class RCPPerspective {
return perspectiveClass;
}
- public void setPerspectiveClass(String perspectiveClass) {
+ public void setPerspectiveClass(final String perspectiveClass) {
this.perspectiveClass = perspectiveClass;
}
@@ -49,7 +49,7 @@ public class RCPPerspective {
return name;
}
- public void setName(String name) {
+ public void setName(final String name) {
this.name = name;
}
@@ -62,14 +62,14 @@ public class RCPPerspective {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
- RCPPerspective other = (RCPPerspective) obj;
+ final RCPPerspective other = (RCPPerspective) obj;
if (id == null) {
if (other.id != null)
return false;
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/RCPView.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/RCPView.java
index f0c0d4d..5987432 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/RCPView.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/RCPView.java
@@ -12,22 +12,22 @@ package org.eclipse.riena.toolbox.assemblyeditor.model;
/**
* This class represents a View in the Eclipse RCP.
- *
+ *
*/
public class RCPView {
private String id;
private String name;
private String viewClass;
- private boolean allowMultiple = true;
- private boolean restorable = false;
+ private final boolean allowMultiple = true;
+ private final boolean restorable = false;
public RCPView() {
}
-
- public RCPView(String id) {
+
+ public RCPView(final String id) {
this.id = id;
}
-
+
public String getId() {
return id;
}
@@ -35,8 +35,8 @@ public class RCPView {
public String getName() {
return name;
}
-
- public void setName(String name) {
+
+ public void setName(final String name) {
this.name = name;
}
@@ -52,18 +52,18 @@ public class RCPView {
return restorable;
}
- public void setId(String id) {
+ public void setId(final String id) {
this.id = id;
}
- public void setViewClass(String clazz) {
+ public void setViewClass(final String clazz) {
this.viewClass = clazz;
}
@Override
public String toString() {
return "RCPView [allowMultiple=" + allowMultiple + ", clazz=" + viewClass //$NON-NLS-1$ //$NON-NLS-2$
- + ", id=" + id + ", name=" + name + ", restorable=" //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
+ + ", id=" + id + ", name=" + name + ", restorable=" //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
+ restorable + "]"; //$NON-NLS-1$
}
@@ -76,14 +76,14 @@ public class RCPView {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
- RCPView other = (RCPView) obj;
+ final RCPView other = (RCPView) obj;
if (id == null) {
if (other.id != null)
return false;
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/SubApplicationNode.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/SubApplicationNode.java
index 18b00c6..6d967ae 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/SubApplicationNode.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/SubApplicationNode.java
@@ -15,24 +15,24 @@ import java.util.List;
/**
* This class represents a SubApplication in Riena-Navigation.
- *
+ *
*/
public class SubApplicationNode extends AbstractTypedNode<ModuleGroupNode> {
- private List<ModuleGroupNode> moduleGroups;
+ private final List<ModuleGroupNode> moduleGroups;
private String perspective;
private String icon;
- public SubApplicationNode(AbstractAssemblyNode parent) {
+ public SubApplicationNode(final AbstractAssemblyNode parent) {
super(parent);
this.moduleGroups = new ArrayList<ModuleGroupNode>();
}
-
+
public String getIcon() {
return icon;
}
- public void setIcon(String icon) {
+ public void setIcon(final String icon) {
this.icon = icon;
}
@@ -40,7 +40,7 @@ public class SubApplicationNode extends AbstractTypedNode<ModuleGroupNode> {
return perspective;
}
- public void setPerspective(String view) {
+ public void setPerspective(final String view) {
this.perspective = view;
}
@@ -50,18 +50,18 @@ public class SubApplicationNode extends AbstractTypedNode<ModuleGroupNode> {
}
@Override
- public boolean add(ModuleGroupNode arg0) {
+ public boolean add(final ModuleGroupNode arg0) {
return moduleGroups.add(arg0);
}
-
+
@Override
- protected String getTreeLabelValue(){
+ protected String getTreeLabelValue() {
return name;
}
@Override
public String toString() {
return "SubApplicationNode [moduleGroups=" + moduleGroups + ", perspective=" + perspective + ", icon=" + icon + ", nodeId=" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- + nodeId + ", name=" + name + "]"; //$NON-NLS-1$//$NON-NLS-2$
+ + nodeId + ", name=" + name + "]"; //$NON-NLS-1$//$NON-NLS-2$
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/SubModuleNode.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/SubModuleNode.java
index 1e5f960..41aeb4a 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/SubModuleNode.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/model/SubModuleNode.java
@@ -20,7 +20,7 @@ import org.eclipse.riena.toolbox.Util;
*
*/
public class SubModuleNode extends AbstractTypedNode<SubModuleNode> {
- private List<SubModuleNode> subModules;
+ private final List<SubModuleNode> subModules;
private RCPView rcpView;
private String controller;
private boolean shared;
@@ -30,7 +30,7 @@ public class SubModuleNode extends AbstractTypedNode<SubModuleNode> {
private boolean visible = true;
private boolean expanded;
- public SubModuleNode(AbstractAssemblyNode parent) {
+ public SubModuleNode(final AbstractAssemblyNode parent) {
super(parent);
subModules = new ArrayList<SubModuleNode>();
}
@@ -39,7 +39,7 @@ public class SubModuleNode extends AbstractTypedNode<SubModuleNode> {
return visible;
}
- public void setVisible(boolean visible) {
+ public void setVisible(final boolean visible) {
this.visible = visible;
}
@@ -47,7 +47,7 @@ public class SubModuleNode extends AbstractTypedNode<SubModuleNode> {
return expanded;
}
- public void setExpanded(boolean expanded) {
+ public void setExpanded(final boolean expanded) {
this.expanded = expanded;
}
@@ -55,7 +55,7 @@ public class SubModuleNode extends AbstractTypedNode<SubModuleNode> {
return requiresPreparation;
}
- public void setRequiresPreparation(boolean requiresPreparation) {
+ public void setRequiresPreparation(final boolean requiresPreparation) {
this.requiresPreparation = requiresPreparation;
}
@@ -70,7 +70,7 @@ public class SubModuleNode extends AbstractTypedNode<SubModuleNode> {
return rcpView;
}
- public void setRcpView(RCPView view) {
+ public void setRcpView(final RCPView view) {
this.rcpView = view;
}
@@ -78,7 +78,7 @@ public class SubModuleNode extends AbstractTypedNode<SubModuleNode> {
return controller;
}
- public void setController(String controller) {
+ public void setController(final String controller) {
this.controller = controller;
}
@@ -86,7 +86,7 @@ public class SubModuleNode extends AbstractTypedNode<SubModuleNode> {
return shared;
}
- public void setShared(boolean shared) {
+ public void setShared(final boolean shared) {
this.shared = shared;
}
@@ -94,7 +94,7 @@ public class SubModuleNode extends AbstractTypedNode<SubModuleNode> {
return icon;
}
- public void setIcon(String icon) {
+ public void setIcon(final String icon) {
this.icon = icon;
}
@@ -102,7 +102,7 @@ public class SubModuleNode extends AbstractTypedNode<SubModuleNode> {
return selectable;
}
- public void setSelectable(boolean selectable) {
+ public void setSelectable(final boolean selectable) {
this.selectable = selectable;
}
@@ -112,7 +112,7 @@ public class SubModuleNode extends AbstractTypedNode<SubModuleNode> {
}
@Override
- public boolean add(SubModuleNode e) {
+ public boolean add(final SubModuleNode e) {
return subModules.add(e);
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/DetailSection.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/DetailSection.java
index 127b0d2..388526a 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/DetailSection.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/DetailSection.java
@@ -42,22 +42,22 @@ import org.eclipse.riena.toolbox.assemblyeditor.ui.composites.SubModuleComposite
*
*/
public class DetailSection extends Composite {
- private StackLayout stackLayout;
- private Map<Class<?>, AbstractDetailComposite> compositeMap;
- private Composite emptyComposite;
+ private final StackLayout stackLayout;
+ private final Map<Class<?>, AbstractDetailComposite> compositeMap;
+ private final Composite emptyComposite;
- private List<IDirtyListener> dirtyListener;
+ private final List<IDirtyListener> dirtyListener;
- public boolean addDirtyListener(IDirtyListener e) {
+ public boolean addDirtyListener(final IDirtyListener e) {
return dirtyListener.add(e);
}
- public boolean removeDirtyListener(IDirtyListener e) {
+ public boolean removeDirtyListener(final IDirtyListener e) {
return dirtyListener.remove(e);
}
- private void fireDirtyChanged(AbstractAssemblyNode abstractAssemblyNode, boolean isDirty) {
- for (IDirtyListener l : dirtyListener) {
+ private void fireDirtyChanged(final AbstractAssemblyNode abstractAssemblyNode, final boolean isDirty) {
+ for (final IDirtyListener l : dirtyListener) {
l.dirtyStateChanged(abstractAssemblyNode, isDirty);
}
}
@@ -70,7 +70,7 @@ public class DetailSection extends Composite {
return false;
}
- public DetailSection(Composite parent) {
+ public DetailSection(final Composite parent) {
super(parent, SWT.None);
dirtyListener = new ArrayList<IDirtyListener>();
@@ -81,11 +81,11 @@ public class DetailSection extends Composite {
}
@Override
- public void bind(AbstractAssemblyNode node) {
+ public void bind(final AbstractAssemblyNode node) {
}
@Override
- protected void createWorkarea(Composite parent) {
+ protected void createWorkarea(final Composite parent) {
}
};
@@ -99,7 +99,7 @@ public class DetailSection extends Composite {
for (final AbstractDetailComposite comp : compositeMap.values()) {
comp.addDirtyListener(new IDirtyListener() {
- public void dirtyStateChanged(AbstractAssemblyNode node, boolean isDirty) {
+ public void dirtyStateChanged(final AbstractAssemblyNode node, final boolean isDirty) {
fireDirtyChanged(comp.getNode(), isDirty);
}
});
@@ -118,7 +118,7 @@ public class DetailSection extends Composite {
*/
public AbstractDetailComposite unbindCurrentComposite() {
if (null != stackLayout.topControl) {
- AbstractDetailComposite comp = (AbstractDetailComposite) stackLayout.topControl;
+ final AbstractDetailComposite comp = (AbstractDetailComposite) stackLayout.topControl;
comp.unbind();
return comp;
}
@@ -130,7 +130,7 @@ public class DetailSection extends Composite {
*
* @param node
*/
- public void update(AbstractAssemblyNode node) {
+ public void update(final AbstractAssemblyNode node) {
Assert.isNotNull(node);
if (null != stackLayout.topControl) {
@@ -138,7 +138,7 @@ public class DetailSection extends Composite {
}
}
- public void showDetails(AbstractAssemblyNode node) {
+ public void showDetails(final AbstractAssemblyNode node) {
if (null != stackLayout.topControl) {
((AbstractDetailComposite) stackLayout.topControl).unbind();
@@ -150,7 +150,7 @@ public class DetailSection extends Composite {
return;
}
- AbstractDetailComposite detailComposite = compositeMap.get(node.getClass());
+ final AbstractDetailComposite detailComposite = compositeMap.get(node.getClass());
if (null != detailComposite) {
detailComposite.bind(node);
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IconSelectorText.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IconSelectorText.java
index f684f67..a3eddb0 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IconSelectorText.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IconSelectorText.java
@@ -24,7 +24,8 @@ import org.eclipse.ui.model.WorkbenchLabelProvider;
/**
* Textfield with a Button, that opens a IconSelectorDialog. All Images in the
- * current Bundle (JavaProject) that have the Extension (.gif, .jpg, .png) are selectable by the user.
+ * current Bundle (JavaProject) that have the Extension (.gif, .jpg, .png) are
+ * selectable by the user.
*
*/
public class IconSelectorText extends TextButtonComposite {
@@ -35,35 +36,34 @@ public class IconSelectorText extends TextButtonComposite {
return project;
}
- public void setProject(IProject project) {
+ public void setProject(final IProject project) {
this.project = project;
}
- public IconSelectorText(final Composite parent, Color background) {
+ public IconSelectorText(final Composite parent, final Color background) {
super(parent, background);
getBrowseButton().addSelectionListener(new SelectionAdapter() {
@Override
- public void widgetSelected(SelectionEvent e) {
+ public void widgetSelected(final SelectionEvent e) {
if (null == project) {
return;
}
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(parent.getShell(),
- new WorkbenchLabelProvider(),
- new BaseWorkbenchContentProvider());
-
+ final ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(parent.getShell(),
+ new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
+
dialog.setTitle("Tree Selection");
dialog.setMessage("Select the elements from the tree:");
dialog.setInput(project);
dialog.addFilter(new ImageFilter());
dialog.open();
- Object[] result = dialog.getResult();
+ final Object[] result = dialog.getResult();
if (null != result) {
- for (Object obj : result) {
- File file = (File) obj;
+ for (final Object obj : result) {
+ final File file = (File) obj;
getText().setText(file.getName());
}
}
@@ -71,17 +71,16 @@ public class IconSelectorText extends TextButtonComposite {
});
}
-
+
private static class ImageFilter extends ViewerFilter {
@Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof File){
- File file = (File) element;
- return (file.getName().endsWith(".gif") ||
- file.getName().endsWith(".jpg") ||
- file.getName().endsWith(".png"));
+ public boolean select(final Viewer viewer, final Object parentElement, final Object element) {
+ if (element instanceof File) {
+ final File file = (File) element;
+ return (file.getName().endsWith(".gif") || file.getName().endsWith(".jpg") || file.getName().endsWith(
+ ".png"));
}
- return true;
+ return true;
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IdSelectorText.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IdSelectorText.java
index e8c16bb..5f71558 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IdSelectorText.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/IdSelectorText.java
@@ -13,7 +13,6 @@ package org.eclipse.riena.toolbox.assemblyeditor.ui;
import java.util.List;
import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.riena.toolbox.Util;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
@@ -22,57 +21,58 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
+import org.eclipse.riena.toolbox.Util;
/**
- * A Textfield with a Button thath shows a Dialog to pick a Id from a given List of Strings like View-Ids.
- *
+ * A Textfield with a Button thath shows a Dialog to pick a Id from a given List
+ * of Strings like View-Ids.
+ *
*/
-public class IdSelectorText extends TextButtonComposite{
+public class IdSelectorText extends TextButtonComposite {
private List<String> ids;
-
+
/**
* Sets the predefined value in the filter-textfield
*/
private String currentId;
-
+
public IdSelectorText(final Composite parent, final Color background, final String title, final String message) {
super(parent, background);
-
+
getBrowseButton().addSelectionListener(new SelectionAdapter() {
@Override
- public void widgetSelected(SelectionEvent e) {
- org.eclipse.core.runtime.Assert.isNotNull(ids);
-
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- ElementListSelectionDialog dia = new ElementListSelectionDialog(shell, new LabelProvider());
-
- if (Util.isGiven(currentId)){
+ public void widgetSelected(final SelectionEvent e) {
+ org.eclipse.core.runtime.Assert.isNotNull(ids);
+
+ final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ final ElementListSelectionDialog dia = new ElementListSelectionDialog(shell, new LabelProvider());
+
+ if (Util.isGiven(currentId)) {
dia.setFilter(currentId);
}
-
+
dia.setTitle(title);
dia.setMessage(message);
dia.setElements(ids.toArray(new Object[ids.size()]));
dia.open();
- Object[] result = dia.getResult();
-
+ final Object[] result = dia.getResult();
+
if (null != result) {
- for (Object obj : result) {
+ for (final Object obj : result) {
getText().setText(obj.toString());
}
}
}
-
+
});
}
-
- public void setCurrentId(String currentId) {
+
+ public void setCurrentId(final String currentId) {
this.currentId = currentId;
}
- public void setIds(List<String> viewIds) {
+ public void setIds(final List<String> viewIds) {
this.ids = viewIds;
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/OpenClassLink.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/OpenClassLink.java
index 3dbced9..3d2c3bf 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/OpenClassLink.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/OpenClassLink.java
@@ -15,8 +15,6 @@ import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.riena.toolbox.assemblyeditor.RidgetGenerator;
-import org.eclipse.riena.toolbox.assemblyeditor.model.SubModuleNode;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -27,52 +25,53 @@ import org.eclipse.swt.widgets.Link;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
+import org.eclipse.riena.toolbox.assemblyeditor.RidgetGenerator;
+import org.eclipse.riena.toolbox.assemblyeditor.model.SubModuleNode;
public class OpenClassLink extends Composite {
private Link lnk;
private String className;
private SubModuleNode subModule;
-
- public OpenClassLink(Composite parent, String text) {
+
+ public OpenClassLink(final Composite parent, final String text) {
super(parent, SWT.None);
Assert.isNotNull(text);
setLayout(new FillLayout());
-
+
lnk = new Link(this, SWT.None);
- lnk.setText("<a>"+text+"</a>");
+ lnk.setText("<a>" + text + "</a>");
lnk.addSelectionListener(new SelectionAdapter() {
@Override
- public void widgetSelected(SelectionEvent e) {
- if (subModule == null ||
- className == null){
+ public void widgetSelected(final SelectionEvent e) {
+ if (subModule == null || className == null) {
return;
}
-
- RidgetGenerator gen = new RidgetGenerator(subModule.getBundle().getProject());
-
+
+ final RidgetGenerator gen = new RidgetGenerator(subModule.getBundle().getProject());
+
try {
- ICompilationUnit unit = gen.findICompilationUnit(className);
- if (null != unit){
- IEditorPart part = EditorUtility.openInEditor(unit, false);
- JavaUI.revealInEditor(part, (IJavaElement)unit);
+ final ICompilationUnit unit = gen.findICompilationUnit(className);
+ if (null != unit) {
+ final IEditorPart part = EditorUtility.openInEditor(unit, false);
+ JavaUI.revealInEditor(part, (IJavaElement) unit);
}
- } catch (PartInitException pix) {
+ } catch (final PartInitException pix) {
pix.printStackTrace();
}
-
+
}
});
}
-
+
@Override
- public void setEnabled(boolean enabled) {
+ public void setEnabled(final boolean enabled) {
super.setEnabled(enabled);
lnk.setEnabled(enabled);
}
-
+
@Override
- public void setBackground(Color color) {
+ public void setBackground(final Color color) {
super.setBackground(color);
lnk.setBackground(color);
}
@@ -81,7 +80,7 @@ public class OpenClassLink extends Composite {
return className;
}
- public void setClassName(String className) {
+ public void setClassName(final String className) {
this.className = className;
}
@@ -89,7 +88,7 @@ public class OpenClassLink extends Composite {
return subModule;
}
- public void setSubModule(SubModuleNode subModule) {
+ public void setSubModule(final SubModuleNode subModule) {
this.subModule = subModule;
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/TextButtonComposite.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/TextButtonComposite.java
index 76fe6ff..df48bed 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/TextButtonComposite.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/TextButtonComposite.java
@@ -18,12 +18,11 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
-
public class TextButtonComposite extends Composite {
- private Text text;
- private Button browseButton;
+ private final Text text;
+ private final Button browseButton;
- public TextButtonComposite(Composite parent, Color background) {
+ public TextButtonComposite(final Composite parent, final Color background) {
super(parent, SWT.None);
setBackground(background);
@@ -35,8 +34,7 @@ public class TextButtonComposite extends Composite {
browseButton = new Button(this, SWT.PUSH);
browseButton.setText("Browse ...");
- GridDataFactory.swtDefaults().hint(100, SWT.DEFAULT).applyTo(
- browseButton);
+ GridDataFactory.swtDefaults().hint(100, SWT.DEFAULT).applyTo(browseButton);
}
public Text getText() {
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/ToolboxTransfer.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/ToolboxTransfer.java
new file mode 100644
index 0000000..4cfba69
--- /dev/null
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/ToolboxTransfer.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 compeople AG 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:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.toolbox.assemblyeditor.ui;
+
+import org.eclipse.swt.dnd.ByteArrayTransfer;
+
+/**
+ *
+ */
+public class ToolboxTransfer extends ByteArrayTransfer {
+
+ @Override
+ protected int[] getTypeIds() {
+ return new int[] {};
+ }
+
+ @Override
+ protected String[] getTypeNames() {
+ return new String[] { "FOO" };
+ }
+}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/UIControlsFactory.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/UIControlsFactory.java
index 0a7a0de..4dbccc0 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/UIControlsFactory.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/UIControlsFactory.java
@@ -16,38 +16,36 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
-
public class UIControlsFactory {
- public static Label createLabel(Composite parent, String text){
- Label lbl = new Label(parent, SWT.None);
+ public static Label createLabel(final Composite parent, final String text) {
+ final Label lbl = new Label(parent, SWT.None);
lbl.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
lbl.setText(text);
return lbl;
}
-
- public static Text createText(Composite parent){
- Text txt = new Text(parent, SWT.BORDER);
+
+ public static Text createText(final Composite parent) {
+ final Text txt = new Text(parent, SWT.BORDER);
return txt;
}
-
-
- public static VerifyTypeIdText createCheckTypeIdText(Composite parent){
- VerifyTypeIdText txt = new VerifyTypeIdText(parent);
+
+ public static VerifyTypeIdText createCheckTypeIdText(final Composite parent) {
+ final VerifyTypeIdText txt = new VerifyTypeIdText(parent);
return txt;
}
- public static Button createCheckbox(Composite parent) {
- Button butt = new Button(parent, SWT.CHECK);
+ public static Button createCheckbox(final Composite parent) {
+ final Button butt = new Button(parent, SWT.CHECK);
return butt;
}
-
- public static Button createCombo(Composite parent) {
- Button butt = new Button(parent, SWT.CHECK);
+
+ public static Button createCombo(final Composite parent) {
+ final Button butt = new Button(parent, SWT.CHECK);
return butt;
}
-
- public static OpenClassLink createOpenClassLink(Composite parent, String text){
- OpenClassLink lnk = new OpenClassLink(parent, text);
+
+ public static OpenClassLink createOpenClassLink(final Composite parent, final String text) {
+ final OpenClassLink lnk = new OpenClassLink(parent, text);
lnk.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
return lnk;
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/VerifyTypeIdText.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/VerifyTypeIdText.java
index 6efdff3..9bde195 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/VerifyTypeIdText.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/VerifyTypeIdText.java
@@ -14,8 +14,6 @@ import java.util.Set;
import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.riena.toolbox.Activator;
-import org.eclipse.riena.toolbox.assemblyeditor.model.AbstractTypedNode;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
@@ -24,38 +22,38 @@ import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.riena.toolbox.Activator;
+import org.eclipse.riena.toolbox.assemblyeditor.model.AbstractTypedNode;
public class VerifyTypeIdText extends Composite {
- private Text text;
+ private final Text text;
private AbstractTypedNode ignoreNode;
- private ControlDecoration decoration;
+ private final ControlDecoration decoration;
- public VerifyTypeIdText(Composite parent) {
+ public VerifyTypeIdText(final Composite parent) {
super(parent, SWT.None);
setLayout(new FillLayout());
text = new Text(this, SWT.BORDER);
- decoration = new ControlDecoration(text,
- SWT.LEFT | SWT.TOP);
+ decoration = new ControlDecoration(text, SWT.LEFT | SWT.TOP);
decoration.setShowHover(true);
- Image errorImage = FieldDecorationRegistry.getDefault()
- .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR)
- .getImage();
+ final Image errorImage = FieldDecorationRegistry.getDefault()
+ .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage();
decoration.setDescriptionText("TypeId already exists");
decoration.setImage(errorImage);
decoration.hide();
text.addFocusListener(new FocusAdapter() {
@Override
- public void focusLost(FocusEvent e) {
+ public void focusLost(final FocusEvent e) {
isValid();
}
});
}
-
- public boolean isValid(){
- boolean valid = typeIdAlreadyExists(text.getText());
-
+
+ public boolean isValid() {
+ final boolean valid = typeIdAlreadyExists(text.getText());
+
if (valid) {
decoration.show();
} else {
@@ -68,14 +66,15 @@ public class VerifyTypeIdText extends Composite {
return ignoreNode;
}
- public void setIgnoreNode(AbstractTypedNode ignoreNode) {
+ public void setIgnoreNode(final AbstractTypedNode ignoreNode) {
this.ignoreNode = ignoreNode;
}
- private boolean typeIdAlreadyExists(String text) {
+ private boolean typeIdAlreadyExists(final String text) {
- Set<String> typeIds = Activator.getDefault().getModelService().getAllTypeIds(Activator.getDefault().getAssemblyModel(), ignoreNode);
- boolean ret = (typeIds.contains(text.trim()));
+ final Set<String> typeIds = Activator.getDefault().getModelService()
+ .getAllTypeIds(Activator.getDefault().getAssemblyModel(), ignoreNode);
+ final boolean ret = (typeIds.contains(text.trim()));
return ret;
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/ViewSelectorText.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/ViewSelectorText.java
index 691b755..0d4ed89 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/ViewSelectorText.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/ViewSelectorText.java
@@ -21,34 +21,33 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
-public class ViewSelectorText extends TextButtonComposite{
+public class ViewSelectorText extends TextButtonComposite {
private List<String> viewIds;
-
- public ViewSelectorText(final Composite parent, Color background) {
+
+ public ViewSelectorText(final Composite parent, final Color background) {
super(parent, background);
-
+
getBrowseButton().addSelectionListener(new SelectionAdapter() {
@Override
- public void widgetSelected(SelectionEvent e) {
- org.eclipse.core.runtime.Assert.isNotNull(viewIds);
-
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- ElementListSelectionDialog dia = new ElementListSelectionDialog(shell, new LabelProvider());
+ public void widgetSelected(final SelectionEvent e) {
+ org.eclipse.core.runtime.Assert.isNotNull(viewIds);
+
+ final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ final ElementListSelectionDialog dia = new ElementListSelectionDialog(shell, new LabelProvider());
dia.setTitle("View Selection");
dia.setMessage("Select a View (* = any string, ? = any char):");
dia.setElements(viewIds.toArray(new Object[viewIds.size()]));
dia.open();
- Object[] result = dia.getResult();
-
+ final Object[] result = dia.getResult();
+
if (null != result) {
- for (Object obj : result) {
+ for (final Object obj : result) {
getText().setText(obj.toString());
}
}
}
-
+
});
}
@@ -56,9 +55,8 @@ public class ViewSelectorText extends TextButtonComposite{
return viewIds;
}
- public void setViewIds(List<String> viewIds) {
+ public void setViewIds(final List<String> viewIds) {
this.viewIds = viewIds;
}
-
-
+
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/AbstractDetailComposite.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/AbstractDetailComposite.java
index b45bfd5..bd19a80 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/AbstractDetailComposite.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/AbstractDetailComposite.java
@@ -41,12 +41,12 @@ import org.eclipse.riena.toolbox.assemblyeditor.ui.ViewSelectorText;
public abstract class AbstractDetailComposite<T extends AbstractAssemblyNode> extends Composite {
protected T node;
protected Color workareaBackground;
- private Color headerBackground;
- private DirtyChecker dirtyChecker;
- private List<IDirtyListener> dirtyListener;
- private Composite cmpWorkarea;
+ private final Color headerBackground;
+ private final DirtyChecker dirtyChecker;
+ private final List<IDirtyListener> dirtyListener;
+ private final Composite cmpWorkarea;
- public AbstractDetailComposite(Composite parent, String headerImageLeft, String headerImageRight) {
+ public AbstractDetailComposite(final Composite parent, final String headerImageLeft, final String headerImageRight) {
super(parent, SWT.None);
dirtyListener = new ArrayList<IDirtyListener>();
@@ -57,7 +57,7 @@ public abstract class AbstractDetailComposite<T extends AbstractAssemblyNode> ex
GridLayoutFactory.fillDefaults().numColumns(1).applyTo(this);
- Composite cmpHeader = new Composite(this, SWT.None);
+ final Composite cmpHeader = new Composite(this, SWT.None);
GridDataFactory.fillDefaults().hint(SWT.DEFAULT, 95).grab(true, false).applyTo(cmpHeader);
createHeader(cmpHeader, headerImageLeft, headerImageRight);
@@ -76,9 +76,9 @@ public abstract class AbstractDetailComposite<T extends AbstractAssemblyNode> ex
}
public boolean isValid() {
- for (Control cont : cmpWorkarea.getChildren()) {
+ for (final Control cont : cmpWorkarea.getChildren()) {
if (cont instanceof VerifyTypeIdText) {
- VerifyTypeIdText verifier = (VerifyTypeIdText) cont;
+ final VerifyTypeIdText verifier = (VerifyTypeIdText) cont;
if (!verifier.isValid()) {
return false;
}
@@ -87,38 +87,38 @@ public abstract class AbstractDetailComposite<T extends AbstractAssemblyNode> ex
return true;
}
- public boolean addDirtyListener(IDirtyListener e) {
+ public boolean addDirtyListener(final IDirtyListener e) {
return dirtyListener.add(e);
}
- public boolean removeDirtyListener(IDirtyListener e) {
+ public boolean removeDirtyListener(final IDirtyListener e) {
return dirtyListener.remove(e);
}
- private void fireDirtyChanged(boolean isDirty) {
- for (IDirtyListener l : dirtyListener) {
+ private void fireDirtyChanged(final boolean isDirty) {
+ for (final IDirtyListener l : dirtyListener) {
l.dirtyStateChanged(null, isDirty);
}
}
private class DirtyChecker implements SelectionListener, KeyListener {
- public void keyPressed(KeyEvent e) {
+ public void keyPressed(final KeyEvent e) {
fireDirtyChanged(true);
}
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
}
- public void widgetDefaultSelected(SelectionEvent e) {
+ public void widgetDefaultSelected(final SelectionEvent e) {
}
- public void widgetSelected(SelectionEvent e) {
+ public void widgetSelected(final SelectionEvent e) {
fireDirtyChanged(true);
}
}
- private void addModifyListener(Composite parent) {
- for (Control child : parent.getChildren()) {
+ private void addModifyListener(final Composite parent) {
+ for (final Control child : parent.getChildren()) {
if (child instanceof Text) {
((Text) child).addKeyListener(dirtyChecker);
} else if (child instanceof Button) {
@@ -129,11 +129,11 @@ public abstract class AbstractDetailComposite<T extends AbstractAssemblyNode> ex
}
}
- private void createHeader(Composite parent, String headerImageLeft, String headerImageRight) {
+ private void createHeader(final Composite parent, final String headerImageLeft, final String headerImageRight) {
parent.setBackground(headerBackground);
GridLayoutFactory.fillDefaults().numColumns(2).applyTo(parent);
- Label lblImageLeft = UIControlsFactory.createLabel(parent, ""); //$NON-NLS-1$
+ final Label lblImageLeft = UIControlsFactory.createLabel(parent, ""); //$NON-NLS-1$
ImageDescriptor desc = null;
if (headerImageLeft != null && headerImageLeft.length() > 0) {
@@ -145,7 +145,7 @@ public abstract class AbstractDetailComposite<T extends AbstractAssemblyNode> ex
GridDataFactory.swtDefaults().indent(5, 5).grab(false, false).align(SWT.LEFT, SWT.CENTER).applyTo(lblImageLeft);
- Label lblImageRight = UIControlsFactory.createLabel(parent, ""); //$NON-NLS-1$
+ final Label lblImageRight = UIControlsFactory.createLabel(parent, ""); //$NON-NLS-1$
ImageDescriptor desc2 = null;
if (headerImageRight != null && headerImageRight.length() > 0) {
@@ -159,7 +159,7 @@ public abstract class AbstractDetailComposite<T extends AbstractAssemblyNode> ex
}
private class Separator extends Canvas {
- public Separator(Composite parent) {
+ public Separator(final Composite parent) {
super(parent, SWT.None);
setBackground(getDisplay().getSystemColor(SWT.COLOR_BLACK));
GridDataFactory.fillDefaults().span(2, 1).align(SWT.CENTER, SWT.END).hint(2000, 1).grab(true, false)
@@ -180,75 +180,75 @@ public abstract class AbstractDetailComposite<T extends AbstractAssemblyNode> ex
public abstract void unbind();
- protected VerifyTypeIdText createLabeledVerifyText(Composite parent, String labelText) {
- Label lbl = UIControlsFactory.createLabel(parent, labelText);
+ protected VerifyTypeIdText createLabeledVerifyText(final Composite parent, final String labelText) {
+ final Label lbl = UIControlsFactory.createLabel(parent, labelText);
lbl.setBackground(workareaBackground);
GridDataFactory.swtDefaults().applyTo(lbl);
- VerifyTypeIdText text = UIControlsFactory.createCheckTypeIdText(parent);
+ final VerifyTypeIdText text = UIControlsFactory.createCheckTypeIdText(parent);
GridDataFactory.fillDefaults().grab(true, false).applyTo(text);
return text;
}
- protected Text createLabeledText(Composite parent, String labelText) {
- Label lbl = UIControlsFactory.createLabel(parent, labelText);
+ protected Text createLabeledText(final Composite parent, final String labelText) {
+ final Label lbl = UIControlsFactory.createLabel(parent, labelText);
lbl.setBackground(workareaBackground);
GridDataFactory.swtDefaults().applyTo(lbl);
- Text text = UIControlsFactory.createText(parent);
+ final Text text = UIControlsFactory.createText(parent);
GridDataFactory.fillDefaults().grab(true, false).applyTo(text);
return text;
}
- protected TextButtonComposite createLabeledBrowseableText(Composite parent, String labelText) {
- Label lbl = UIControlsFactory.createLabel(parent, labelText);
+ protected TextButtonComposite createLabeledBrowseableText(final Composite parent, final String labelText) {
+ final Label lbl = UIControlsFactory.createLabel(parent, labelText);
lbl.setBackground(workareaBackground);
GridDataFactory.swtDefaults().applyTo(lbl);
- TextButtonComposite cmpControl = new TextButtonComposite(parent, workareaBackground);
+ final TextButtonComposite cmpControl = new TextButtonComposite(parent, workareaBackground);
GridDataFactory.fillDefaults().grab(true, false).applyTo(cmpControl);
return cmpControl;
}
- protected TextButtonComposite createLinkedBrowseableText(Composite parent, String labelText) {
- Label lbl = UIControlsFactory.createLabel(parent, labelText);
+ protected TextButtonComposite createLinkedBrowseableText(final Composite parent, final String labelText) {
+ final Label lbl = UIControlsFactory.createLabel(parent, labelText);
lbl.setBackground(workareaBackground);
GridDataFactory.swtDefaults().applyTo(lbl);
- TextButtonComposite cmpControl = new TextButtonComposite(parent, workareaBackground);
+ final TextButtonComposite cmpControl = new TextButtonComposite(parent, workareaBackground);
GridDataFactory.fillDefaults().grab(true, false).applyTo(cmpControl);
return cmpControl;
}
- protected IconSelectorText createLabeledIconSelector(Composite parent, String labelText) {
- Label lbl = UIControlsFactory.createLabel(parent, labelText);
+ protected IconSelectorText createLabeledIconSelector(final Composite parent, final String labelText) {
+ final Label lbl = UIControlsFactory.createLabel(parent, labelText);
lbl.setBackground(workareaBackground);
GridDataFactory.swtDefaults().applyTo(lbl);
- IconSelectorText cmpControl = new IconSelectorText(parent, workareaBackground);
+ final IconSelectorText cmpControl = new IconSelectorText(parent, workareaBackground);
GridDataFactory.fillDefaults().grab(true, false).applyTo(cmpControl);
return cmpControl;
}
- protected ViewSelectorText createLabeledViewSelector(Composite parent, String labelText) {
- Label lbl = UIControlsFactory.createLabel(parent, labelText);
+ protected ViewSelectorText createLabeledViewSelector(final Composite parent, final String labelText) {
+ final Label lbl = UIControlsFactory.createLabel(parent, labelText);
lbl.setBackground(workareaBackground);
GridDataFactory.swtDefaults().applyTo(lbl);
- ViewSelectorText cmpControl = new ViewSelectorText(parent, workareaBackground);
+ final ViewSelectorText cmpControl = new ViewSelectorText(parent, workareaBackground);
GridDataFactory.fillDefaults().grab(true, false).applyTo(cmpControl);
return cmpControl;
}
- protected Button createLabeledCheckbox(Composite parent, String labelText) {
- Label lbl = UIControlsFactory.createLabel(parent, labelText);
+ protected Button createLabeledCheckbox(final Composite parent, final String labelText) {
+ final Label lbl = UIControlsFactory.createLabel(parent, labelText);
lbl.setBackground(workareaBackground);
GridDataFactory.swtDefaults().applyTo(lbl);
- Button butt = UIControlsFactory.createCheckbox(parent);
+ final Button butt = UIControlsFactory.createCheckbox(parent);
butt.setBackground(workareaBackground);
GridDataFactory.fillDefaults().grab(true, false).applyTo(butt);
return butt;
}
- protected String getTextSave(Object in) {
+ protected String getTextSave(final Object in) {
if (null == in) {
return ""; //$NON-NLS-1$
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/AssemblyComposite.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/AssemblyComposite.java
index a7b2847..87c97f0 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/AssemblyComposite.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/AssemblyComposite.java
@@ -16,16 +16,16 @@ import org.eclipse.jface.fieldassist.ContentProposalAdapter;
import org.eclipse.jface.fieldassist.SimpleContentProposalProvider;
import org.eclipse.jface.fieldassist.TextContentAdapter;
import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.riena.toolbox.Activator;
-import org.eclipse.riena.toolbox.Util;
-import org.eclipse.riena.toolbox.assemblyeditor.model.AssemblyNode;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.riena.toolbox.Activator;
+import org.eclipse.riena.toolbox.Util;
+import org.eclipse.riena.toolbox.assemblyeditor.model.AssemblyNode;
-public class AssemblyComposite extends AbstractDetailComposite<AssemblyNode>{
+public class AssemblyComposite extends AbstractDetailComposite<AssemblyNode> {
private Text txtId;
private Text txtParentTypeId;
private Text txtName;
@@ -33,32 +33,32 @@ public class AssemblyComposite extends AbstractDetailComposite<AssemblyNode>{
private Text txtAutostartsequence;
private ContentProposalAdapter contentProposalTypeId;
- public AssemblyComposite(Composite parent) {
+ public AssemblyComposite(final Composite parent) {
super(parent, "", "ass_re.png");
}
@Override
- public void bind(AssemblyNode node) {
+ public void bind(final AssemblyNode node) {
this.node = node;
-
+
txtId.setText(getTextSave(node.getId()));
txtAssembler.setText(getTextSave(node.getAssembler()));
txtParentTypeId.setText(getTextSave(node.getNodeTypeId()));
-
- Set<String> typeIds = Activator.getDefault().getModelService().getAllParentTypeIds(Activator.getDefault().getAssemblyModel());
- String[] typeIdsArray = typeIds.toArray(new String[typeIds.size()]);
- ((SimpleContentProposalProvider)contentProposalTypeId.getContentProposalProvider()).setProposals(typeIdsArray);
-
+
+ final Set<String> typeIds = Activator.getDefault().getModelService()
+ .getAllParentTypeIds(Activator.getDefault().getAssemblyModel());
+ final String[] typeIdsArray = typeIds.toArray(new String[typeIds.size()]);
+ ((SimpleContentProposalProvider) contentProposalTypeId.getContentProposalProvider()).setProposals(typeIdsArray);
+
txtName.setText(getTextSave(node.getName()));
-
- if (null != node.getAutostartSequence()){
- txtAutostartsequence.setText(getTextSave(node.getAutostartSequence()+""));
- }
- else{
+
+ if (null != node.getAutostartSequence()) {
+ txtAutostartsequence.setText(getTextSave(node.getAutostartSequence() + ""));
+ } else {
txtAutostartsequence.setText("");
}
}
-
+
@Override
public boolean setFocus() {
return txtId.setFocus();
@@ -70,38 +70,34 @@ public class AssemblyComposite extends AbstractDetailComposite<AssemblyNode>{
node.setAssembler(txtAssembler.getText());
node.setNodeTypeId(txtParentTypeId.getText());
node.setName(txtName.getText());
-
- if (Util.isGiven(txtAutostartsequence.getText())){
+
+ if (Util.isGiven(txtAutostartsequence.getText())) {
node.setAutostartSequence(Integer.valueOf(txtAutostartsequence.getText()));
- } else{
+ } else {
node.setAutostartSequence(null);
}
}
@Override
- protected void createWorkarea(Composite parent) {
+ protected void createWorkarea(final Composite parent) {
GridLayoutFactory.swtDefaults().numColumns(2).applyTo(parent);
txtName = createLabeledText(parent, "Name");
txtName.addKeyListener(new KeyAdapter() {
@Override
- public void keyReleased(KeyEvent e) {
- if (null == node.getPrefix()){
+ public void keyReleased(final KeyEvent e) {
+ if (null == node.getPrefix()) {
return;
}
- String simpleName = txtName.getText().trim();
- txtId.setText(node.getPrefix()+simpleName+node.getSuffix());
+ final String simpleName = txtName.getText().trim();
+ txtId.setText(node.getPrefix() + simpleName + node.getSuffix());
}
});
-
+
txtId = createLabeledText(parent, "Id");
txtAssembler = createLabeledText(parent, "Assembler");
txtParentTypeId = createLabeledText(parent, "ParentNodeId");
- contentProposalTypeId = new ContentProposalAdapter(
- txtParentTypeId,
- new TextContentAdapter(),
- new SimpleContentProposalProvider(null),
- null,
- null);
+ contentProposalTypeId = new ContentProposalAdapter(txtParentTypeId, new TextContentAdapter(),
+ new SimpleContentProposalProvider(null), null, null);
contentProposalTypeId.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
txtAutostartsequence = createLabeledText(parent, "StartOrder");
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/BundleComposite.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/BundleComposite.java
index b2315d8..c8d5233 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/BundleComposite.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/BundleComposite.java
@@ -11,20 +11,20 @@
package org.eclipse.riena.toolbox.assemblyeditor.ui.composites;
import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.riena.toolbox.assemblyeditor.model.BundleNode;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.riena.toolbox.assemblyeditor.model.BundleNode;
-public class BundleComposite extends AbstractDetailComposite<BundleNode>{
+public class BundleComposite extends AbstractDetailComposite<BundleNode> {
private Text txtName;
- public BundleComposite(Composite parent) {
+ public BundleComposite(final Composite parent) {
super(parent, "", "");
}
@Override
- public void bind(BundleNode node) {
+ public void bind(final BundleNode node) {
this.node = node;
txtName.setText(getTextSave(node.getName()));
}
@@ -35,7 +35,7 @@ public class BundleComposite extends AbstractDetailComposite<BundleNode>{
}
@Override
- protected void createWorkarea(Composite parent) {
+ protected void createWorkarea(final Composite parent) {
GridLayoutFactory.swtDefaults().numColumns(2).applyTo(parent);
txtName = createLabeledText(parent, "Name");
txtName.setEnabled(false);
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/ModuleComposite.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/ModuleComposite.java
index 288d2eb..669d4c8 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/ModuleComposite.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/ModuleComposite.java
@@ -28,7 +28,7 @@ public class ModuleComposite extends AbstractDetailComposite<ModuleNode> {
private Button btnUncloseable;
private Text txtName;
- public ModuleComposite(Composite parent) {
+ public ModuleComposite(final Composite parent) {
super(parent, "module_li.png", "module_re.png");
}
@@ -43,7 +43,7 @@ public class ModuleComposite extends AbstractDetailComposite<ModuleNode> {
txtName.setText(getTextSave(node.getName()));
txtName.addKeyListener(new KeyAdapter() {
@Override
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if (null == node.getPrefix()) {
return;
}
@@ -52,7 +52,7 @@ public class ModuleComposite extends AbstractDetailComposite<ModuleNode> {
if (node.hasChildren()) {
return;
}
- String simpleName = Util.cleanNodeId(txtName.getText().trim());
+ final String simpleName = Util.cleanNodeId(txtName.getText().trim(), false);
txtNodeId.getText().setText(node.getPrefix() + simpleName + node.getSuffix());
}
});
@@ -72,7 +72,7 @@ public class ModuleComposite extends AbstractDetailComposite<ModuleNode> {
}
@Override
- protected void createWorkarea(Composite parent) {
+ protected void createWorkarea(final Composite parent) {
GridLayoutFactory.swtDefaults().numColumns(2).applyTo(parent);
txtName = createLabeledText(parent, "Name");
txtNodeId = createLabeledVerifyText(parent, "NodeId");
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/ModuleGroupComposite.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/ModuleGroupComposite.java
index c7cddd6..f0da3bf 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/ModuleGroupComposite.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/ModuleGroupComposite.java
@@ -11,20 +11,19 @@
package org.eclipse.riena.toolbox.assemblyeditor.ui.composites;
import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.riena.toolbox.assemblyeditor.model.ModuleGroupNode;
-import org.eclipse.riena.toolbox.assemblyeditor.ui.VerifyTypeIdText;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.riena.toolbox.assemblyeditor.model.ModuleGroupNode;
-public class ModuleGroupComposite extends AbstractDetailComposite<ModuleGroupNode>{
+public class ModuleGroupComposite extends AbstractDetailComposite<ModuleGroupNode> {
private Text txtNodeId;
private Text txtName;
- public ModuleGroupComposite(Composite parent) {
- super(parent,"modulegroup_li.png","modulegroup_re.png");
+ public ModuleGroupComposite(final Composite parent) {
+ super(parent, "modulegroup_li.png", "modulegroup_re.png");
}
@Override
@@ -33,18 +32,18 @@ public class ModuleGroupComposite extends AbstractDetailComposite<ModuleGroupNod
txtName.setText(getTextSave(node.getName()));
txtName.addKeyListener(new KeyAdapter() {
@Override
- public void keyReleased(KeyEvent e) {
- if (null == node.getPrefix()){
+ public void keyReleased(final KeyEvent e) {
+ if (null == node.getPrefix()) {
return;
}
- String simpleName = txtName.getText().trim();
- txtNodeId.setText(node.getPrefix()+simpleName+node.getSuffix());
+ final String simpleName = txtName.getText().trim();
+ txtNodeId.setText(node.getPrefix() + simpleName + node.getSuffix());
}
});
-
+
txtNodeId.setText(getTextSave(node.getNodeId()));
}
-
+
@Override
public boolean setFocus() {
return txtName.setFocus();
@@ -57,9 +56,9 @@ public class ModuleGroupComposite extends AbstractDetailComposite<ModuleGroupNod
}
@Override
- protected void createWorkarea(Composite parent) {
+ protected void createWorkarea(final Composite parent) {
GridLayoutFactory.swtDefaults().numColumns(2).applyTo(parent);
- txtName = createLabeledText(parent,"Name");
- txtNodeId = createLabeledText(parent,"NodeId");
+ txtName = createLabeledText(parent, "Name");
+ txtNodeId = createLabeledText(parent, "NodeId");
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubApplicationComposite.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubApplicationComposite.java
index fa7d6b2..eaa623b 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubApplicationComposite.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubApplicationComposite.java
@@ -32,7 +32,7 @@ public class SubApplicationComposite extends AbstractDetailComposite<SubApplicat
private IconSelectorText txtIcon;
private IdSelectorText txtPerspective;
- public SubApplicationComposite(Composite parent) {
+ public SubApplicationComposite(final Composite parent) {
super(parent, "subapplication_li.png", "subapplication_re.png");
}
@@ -42,11 +42,11 @@ public class SubApplicationComposite extends AbstractDetailComposite<SubApplicat
txtName.setText(getTextSave(node.getName()));
txtName.addKeyListener(new KeyAdapter() {
@Override
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if (null == node.getPrefix()) {
return;
}
- String simpleName = txtName.getText().trim();
+ final String simpleName = txtName.getText().trim();
txtNodeId.getText().setText(node.getPrefix() + simpleName + node.getSuffix());
}
});
@@ -79,7 +79,7 @@ public class SubApplicationComposite extends AbstractDetailComposite<SubApplicat
}
@Override
- protected void createWorkarea(Composite parent) {
+ protected void createWorkarea(final Composite parent) {
GridLayoutFactory.swtDefaults().numColumns(2).applyTo(parent);
txtName = createLabeledText(parent, "Name");
txtNodeId = createLabeledVerifyText(parent, "NodeId");
@@ -87,8 +87,8 @@ public class SubApplicationComposite extends AbstractDetailComposite<SubApplicat
buildViewSection(parent);
}
- private void buildViewSection(Composite parent) {
- Label lblPersp = UIControlsFactory.createLabel(parent, "PerspectiveId");
+ private void buildViewSection(final Composite parent) {
+ final Label lblPersp = UIControlsFactory.createLabel(parent, "PerspectiveId");
GridDataFactory.swtDefaults().applyTo(lblPersp);
txtPerspective = new IdSelectorText(parent, workareaBackground, "Perspective Selection",
"Select a Perspective (* = any string, ? = any char):");
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubModuleComposite.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubModuleComposite.java
index 1907827..13a5237 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubModuleComposite.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/composites/SubModuleComposite.java
@@ -29,6 +29,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.FilteredItemsSelectionDialog;
import org.eclipse.riena.toolbox.Activator;
import org.eclipse.riena.toolbox.Util;
@@ -56,8 +57,8 @@ public class SubModuleComposite extends AbstractDetailComposite<SubModuleNode> {
private Button btnVisible;
private Button btnExpanded;
- public SubModuleComposite(Composite parent) {
- super(parent, "submodule_li.png", "submodule_re.png");
+ public SubModuleComposite(final Composite parent) {
+ super(parent, "submodule_li.png", "submodule_re.png"); //$NON-NLS-1$ //$NON-NLS-2$
}
@Override
@@ -122,12 +123,12 @@ public class SubModuleComposite extends AbstractDetailComposite<SubModuleNode> {
}
@Override
- protected void createWorkarea(Composite parent) {
+ protected void createWorkarea(final Composite parent) {
GridLayoutFactory.swtDefaults().numColumns(2).applyTo(parent);
txtName = createLabeledText(parent, "Name");
txtName.addKeyListener(new KeyAdapter() {
@Override
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if (null == node.getPrefix()) {
return;
}
@@ -137,7 +138,7 @@ public class SubModuleComposite extends AbstractDetailComposite<SubModuleNode> {
return;
}
- String simpleName = Util.cleanNodeId(txtName.getText().trim());
+ final String simpleName = Util.cleanNodeId(txtName.getText().trim(), false);
txtNodeId.getText().setText(node.getPrefix() + simpleName + node.getSuffix());
}
});
@@ -154,7 +155,7 @@ public class SubModuleComposite extends AbstractDetailComposite<SubModuleNode> {
btnExpanded = createLabeledCheckbox(parent, "Expanded");
}
- private void buildViewSection(Composite parent) {
+ private void buildViewSection(final Composite parent) {
lnkView = new OpenClassLink(parent, "ViewId");
lnkView.setBackground(workareaBackground);
GridDataFactory.swtDefaults().applyTo(lnkView);
@@ -166,7 +167,7 @@ public class SubModuleComposite extends AbstractDetailComposite<SubModuleNode> {
GridDataFactory.fillDefaults().grab(true, false).applyTo(txtView);
}
- private void buildControllerSection(Composite parent) {
+ private void buildControllerSection(final Composite parent) {
lnkController = UIControlsFactory.createOpenClassLink(parent, "Controller");
txtController = new BrowseControllerComposite(parent, workareaBackground);
@@ -179,32 +180,32 @@ public class SubModuleComposite extends AbstractDetailComposite<SubModuleNode> {
private IProject project;
private String controllerName;
- public BrowseControllerComposite(Composite parent, Color background) {
+ public BrowseControllerComposite(final Composite parent, final Color background) {
super(parent, background);
getBrowseButton().addSelectionListener(new SelectionAdapter() {
@Override
- public void widgetSelected(SelectionEvent e) {
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- IJavaSearchScope searchScope = SearchEngine.createWorkspaceScope();
+ public void widgetSelected(final SelectionEvent e) {
+ final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ final IJavaSearchScope searchScope = SearchEngine.createWorkspaceScope();
- FilteredTypesSelectionDialog dia = new FilteredTypesSelectionDialog(shell, false,
+ final FilteredTypesSelectionDialog dia = new FilteredTypesSelectionDialog(shell, false,
(IRunnableContext) null, searchScope, IJavaSearchConstants.CLASS_AND_ENUM);
if (Util.isGiven(controllerName)) {
- dia.setInitialPattern(controllerName, FilteredTypesSelectionDialog.FULL_SELECTION);
+ dia.setInitialPattern(controllerName, FilteredItemsSelectionDialog.FULL_SELECTION);
} else {
dia.setInitialPattern(project.getName() + ".controller.",
- FilteredTypesSelectionDialog.FULL_SELECTION);
+ FilteredItemsSelectionDialog.FULL_SELECTION);
}
dia.open();
- Object[] result = dia.getResult();
+ final Object[] result = dia.getResult();
if (null != result) {
- for (Object obj : result) {
- SourceType source = (SourceType) obj;
+ for (final Object obj : result) {
+ final SourceType source = (SourceType) obj;
getText().setText(source.getFullyQualifiedName());
}
}
@@ -216,7 +217,7 @@ public class SubModuleComposite extends AbstractDetailComposite<SubModuleNode> {
return controllerName;
}
- public void setControllerName(String controllerName) {
+ public void setControllerName(final String controllerName) {
this.controllerName = controllerName;
}
@@ -224,7 +225,7 @@ public class SubModuleComposite extends AbstractDetailComposite<SubModuleNode> {
return project;
}
- public void setProject(IProject project) {
+ public void setProject(final IProject project) {
this.project = project;
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/preferences/PreferenceInitializer.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/preferences/PreferenceInitializer.java
index 759b58a..7a4c39d 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/preferences/PreferenceInitializer.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/preferences/PreferenceInitializer.java
@@ -11,7 +11,7 @@ import org.eclipse.riena.toolbox.Activator;
public class PreferenceInitializer extends AbstractPreferenceInitializer {
@Override
public void initializeDefaultPreferences() {
- IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
store.setDefault(PreferenceConstants.CONST_CUSTOM_UI_CONTROLS_FACTORY, "");
store.setDefault(PreferenceConstants.CONST_GENERATE_CONTROLLER_PACKAGE_NAME, "controller");
store.setDefault(PreferenceConstants.CONST_GENERATE_VIEW_PACKAGE_NAME, "views");
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/preferences/ToolboxConfigurationPreferencePage.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/preferences/ToolboxConfigurationPreferencePage.java
index 00e0156..b1cd503 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/preferences/ToolboxConfigurationPreferencePage.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/preferences/ToolboxConfigurationPreferencePage.java
@@ -28,8 +28,8 @@ public class ToolboxConfigurationPreferencePage extends FieldEditorPreferencePag
public static final String CONST_GENERATE_VIEW_PACKAGE_NAME = "Generate View packagename"; //$NON-NLS-1$
public static final String CONST_GENERATE_CONTROLLER_PACKAGE_NAME = "Generate Controller packagename"; //$NON-NLS-1$
- private Group createGroup(String text) {
- Group groupUIControls = new Group(getFieldEditorParent(), SWT.None);
+ private Group createGroup(final String text) {
+ final Group groupUIControls = new Group(getFieldEditorParent(), SWT.None);
groupUIControls.setText(text);
GridLayoutFactory.swtDefaults().numColumns(3).applyTo(groupUIControls);
GridDataFactory.fillDefaults().span(3, 1).align(SWT.FILL, SWT.FILL).applyTo(groupUIControls);
@@ -39,11 +39,11 @@ public class ToolboxConfigurationPreferencePage extends FieldEditorPreferencePag
@Override
public void createFieldEditors() {
- Group groupUIControls = createGroup("Custom UIControlsFactory");
+ final Group groupUIControls = createGroup("Custom UIControlsFactory");
addField(new StringFieldEditor(PreferenceConstants.CONST_CUSTOM_UI_CONTROLS_FACTORY, "&Classname",
groupUIControls));
- Group groupGenerateClasses = createGroup("Generate configureRidgets");
+ final Group groupGenerateClasses = createGroup("Generate configureRidgets");
addField(new StringFieldEditor(PreferenceConstants.CONST_GENERATE_CONTROLLER_PACKAGE_NAME,
"Controller Packagename", groupGenerateClasses));
@@ -52,7 +52,7 @@ public class ToolboxConfigurationPreferencePage extends FieldEditorPreferencePag
addField(new Blacklist(getFieldEditorParent()));
- GridLayout gdl = (GridLayout) getFieldEditorParent().getLayout();
+ final GridLayout gdl = (GridLayout) getFieldEditorParent().getLayout();
gdl.marginBottom = 0;
gdl.marginTop = 0;
gdl.marginHeight = 0;
@@ -62,22 +62,22 @@ public class ToolboxConfigurationPreferencePage extends FieldEditorPreferencePag
gdl.horizontalSpacing = 10;
}
- public void init(IWorkbench workbench) {
+ public void init(final IWorkbench workbench) {
}
private class Blacklist extends ListEditor {
/**
* @param groupBlacklist
*/
- public Blacklist(Composite groupBlacklist) {
+ public Blacklist(final Composite groupBlacklist) {
super(PreferenceConstants.CONST_CONFIGURE_RIDGETS_BLACKLIST, "configureRidgets Blacklist", groupBlacklist);
}
@Override
- protected String createList(String[] items) {
- StringBuilder bob = new StringBuilder();
+ protected String createList(final String[] items) {
+ final StringBuilder bob = new StringBuilder();
for (int i = 0; i < items.length; i++) {
- String item = items[i];
+ final String item = items[i];
bob.append(item);
if (i < items.length - 1) {
bob.append(";");
@@ -88,7 +88,7 @@ public class ToolboxConfigurationPreferencePage extends FieldEditorPreferencePag
@Override
protected String getNewInputObject() {
- InputDialog dlg = new InputDialog(Display.getCurrent().getActiveShell(), "",
+ final InputDialog dlg = new InputDialog(Display.getCurrent().getActiveShell(), "",
"Enter a fullyqualified Classname", "", null);
if (dlg.open() == Window.OK) {
return dlg.getValue();
@@ -97,7 +97,7 @@ public class ToolboxConfigurationPreferencePage extends FieldEditorPreferencePag
}
@Override
- protected String[] parseString(String stringList) {
+ protected String[] parseString(final String stringList) {
return stringList.split(";");
}
}
diff --git a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/views/AssemblyView.java b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/views/AssemblyView.java
index bcf2035..d99b071 100644
--- a/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/views/AssemblyView.java
+++ b/org.eclipse.riena.toolbox/src/org/eclipse/riena/toolbox/assemblyeditor/ui/views/AssemblyView.java
@@ -25,9 +25,11 @@ import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -35,7 +37,6 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.events.KeyEvent;
@@ -43,6 +44,7 @@ import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.ISaveablePart;
import org.eclipse.ui.PartInitException;
@@ -92,7 +94,7 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
private OpenControllerAction openControllerAction;
private OpenViewAction openViewAction;
private GenerateAddUIControlCallsAction generateAddUIControlCallsAction;
- private PluginXmlResourceChangeListener changeListener = new PluginXmlResourceChangeListener();
+ private final PluginXmlResourceChangeListener changeListener = new PluginXmlResourceChangeListener();
private RegisterPerspectiveAction registerPerspectiveAction;
public AssemblyView() {
@@ -101,7 +103,7 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
}
private void initActions() {
- INodeFactory nodeFactory = Activator.getDefault().getNodeFactory();
+ final INodeFactory nodeFactory = Activator.getDefault().getNodeFactory();
addAssemblyAction = new AddAssemblyAction(nodeFactory);
addSubAppAction = new AddSubApplication(nodeFactory);
@@ -125,48 +127,43 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
}
@Override
- public void createPartControl(Composite parent) {
+ public void createPartControl(final Composite parent) {
parent.setLayout(new FillLayout());
- SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL);
+ final SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL);
getViewSite().getActionBars().getToolBarManager().add(refreshAction);
- getViewSite().getActionBars().getToolBarManager().add(new Separator());
- getViewSite().getActionBars().getToolBarManager().add(moveNodeUpAction);
- getViewSite().getActionBars().getToolBarManager().add(moveNodeDownAction);
- getViewSite().getActionBars().getToolBarManager().add(new Separator());
-
new TreeComposite(sashForm);
detailSection = new DetailSection(sashForm);
sashForm.setWeights(new int[] { 30, 70 });
detailSection.addDirtyListener(new IDirtyListener() {
- public void dirtyStateChanged(AbstractAssemblyNode node, boolean isDirty) {
+ public void dirtyStateChanged(final AbstractAssemblyNode node, final boolean isDirty) {
node.getBundle().setDirty(true);
setDirty(isDirty);
}
});
}
- public void openClassInEditor(SubModuleNode submod, String className) {
+ public void openClassInEditor(final SubModuleNode submod, final String className) {
if (className == null) {
System.err.println("Controller is null " + submod);
return;
}
- RidgetGenerator gen = new RidgetGenerator(submod.getBundle().getProject());
+ final RidgetGenerator gen = new RidgetGenerator(submod.getBundle().getProject());
try {
- ICompilationUnit unit = gen.findICompilationUnit(className);
- IEditorPart part = EditorUtility.openInEditor(unit, false);
+ final ICompilationUnit unit = gen.findICompilationUnit(className);
+ final IEditorPart part = EditorUtility.openInEditor(unit, false);
JavaUI.revealInEditor(part, (IJavaElement) unit);
- } catch (PartInitException e) {
+ } catch (final PartInitException e) {
e.printStackTrace();
}
}
private void checkActionEnabledState() {
- AbstractAssemblyNode treeNode = getSelectedNode();
+ final AbstractAssemblyNode treeNode = getSelectedNode();
if (null == treeNode) {
return;
@@ -195,7 +192,7 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
openViewAction.setEnabled(false);
registerPerspectiveAction.setEnabled(false);
} else if (treeNode instanceof AssemblyNode) {
- AssemblyNode assNode = (AssemblyNode) treeNode;
+ final AssemblyNode assNode = (AssemblyNode) treeNode;
// if the assemblyNode has a NodeBuilder, than it can't have any childNodes
if (Util.isGiven(assNode.getAssembler())) {
@@ -207,7 +204,7 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
// if the assemblyNode already has a child, only child nodes of the same type are allowed
if (!assNode.getChildren().isEmpty()) {
- AbstractTypedNode firstChild = assNode.getChildren().get(0);
+ final AbstractTypedNode firstChild = assNode.getChildren().get(0);
if (firstChild instanceof SubApplicationNode) {
addSubAppAction.setEnabled(true);
@@ -258,9 +255,9 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
openViewAction.setEnabled(false);
// RegisterPerspectiveAction is active, when a persepectiveId is given and it is not yet registered
- String perspectiveId = ((SubApplicationNode) treeNode).getPerspective();
+ final String perspectiveId = ((SubApplicationNode) treeNode).getPerspective();
if (Util.isGiven(perspectiveId)) {
- boolean isPerspectiveRgistered = treeNode.getBundle().getRegisteredRcpPerspectives()
+ final boolean isPerspectiveRgistered = treeNode.getBundle().getRegisteredRcpPerspectives()
.contains(new RCPPerspective(perspectiveId));
registerPerspectiveAction.setEnabled(!isPerspectiveRgistered);
} else {
@@ -297,7 +294,7 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
addModuleGroupAction.setEnabled(false);
addModuleAction.setEnabled(false);
addSubModuleAction.setEnabled(true);
- SubModuleNode subMod = (SubModuleNode) treeNode;
+ final SubModuleNode subMod = (SubModuleNode) treeNode;
boolean enableViewControllerAction = false;
if (null != subMod.getRcpView()) {
@@ -318,7 +315,7 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
}
private final class PluginXmlResourceChangeListener implements ResourceChangeListener {
- public void pluginXmlChanged(IProject project) {
+ public void pluginXmlChanged(final IProject project) {
final AssemblyModel model = Activator.getDefault().getDataProvider().createData();
Activator.getDefault().setAssemblyModel(model);
@@ -333,40 +330,46 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
}
}
- public void projectAdded(IProject project) {
+ public void projectAdded(final IProject project) {
}
}
private class TreeComposite extends Composite {
- public TreeComposite(Composite parent) {
+ public TreeComposite(final Composite parent) {
super(parent, SWT.None);
- GridLayoutFactory.fillDefaults().numColumns(1).applyTo(this);
+ GridLayoutFactory.fillDefaults().numColumns(2).applyTo(this);
assemblyTree = new AssemblyTreeViewer(this, SWT.BORDER | SWT.VIRTUAL | SWT.SINGLE | SWT.H_SCROLL
| SWT.V_SCROLL);
assemblyTree.setModel(Activator.getDefault().getAssemblyModel(), true);
assemblyTree.getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
+ public void selectionChanged(final SelectionChangedEvent event) {
checkActionEnabledState();
- AbstractAssemblyNode node = getSelectedNode();
+ final AbstractAssemblyNode node = getSelectedNode();
detailSection.showDetails(node);
}
});
+ final ToolBar tb = new ToolBar(this, SWT.VERTICAL);
+ final ToolBarManager toolbarManager = new ToolBarManager(tb);
+ toolbarManager.add(moveNodeUpAction);
+ toolbarManager.add(moveNodeDownAction);
+ toolbarManager.update(true);
+
getSite().setSelectionProvider(assemblyTree.getTreeViewer());
assemblyTree.addDirtyListener(new IDirtyListener() {
- public void dirtyStateChanged(AbstractAssemblyNode node, boolean isDirty) {
+ public void dirtyStateChanged(final AbstractAssemblyNode node, final boolean isDirty) {
setDirty(isDirty);
}
});
assemblyTree.getTree().addKeyListener(new KeyListener() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
}
- public void keyPressed(KeyEvent e) {
+ public void keyPressed(final KeyEvent e) {
if (e.keyCode == SWT.DEL) {
deleteNodeAction.run();
}
@@ -375,8 +378,8 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
GridDataFactory.fillDefaults().grab(true, true).applyTo(assemblyTree.getTree());
- MenuManager menuManager = new MenuManager();
- Menu menu = menuManager.createContextMenu(assemblyTree.getTree());
+ final MenuManager menuManager = new MenuManager();
+ final Menu menu = menuManager.createContextMenu(assemblyTree.getTree());
menuManager.add(deleteNodeAction);
menuManager.add(new Separator());
@@ -402,19 +405,19 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
checkActionEnabledState();
assemblyTree.rebuild();
- AbstractAssemblyNode selectedNode = getSelectedNode();
+ final AbstractAssemblyNode selectedNode = getSelectedNode();
if (null != selectedNode) {
detailSection.update(selectedNode);
}
}
- public void expandNode(AbstractAssemblyNode parentNode) {
+ public void expandNode(final AbstractAssemblyNode parentNode) {
assemblyTree.getTreeViewer().setExpandedState(parentNode, true);
}
- public void selectNode(AbstractAssemblyNode node) {
- assemblyTree.getTreeViewer().expandToLevel(node, TreeViewer.ALL_LEVELS);
+ public void selectNode(final AbstractAssemblyNode node) {
+ assemblyTree.getTreeViewer().expandToLevel(node, AbstractTreeViewer.ALL_LEVELS);
assemblyTree.getTreeViewer().setSelection(new StructuredSelection(node));
}
@@ -423,7 +426,7 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
assemblyTree.getTree().setFocus();
}
- public synchronized void doSave(IProgressMonitor monitor) {
+ public synchronized void doSave(final IProgressMonitor monitor) {
Activator.getDefault().getDataProvider().removeResourceChangeListener(changeListener);
detailSection.unbindCurrentComposite();
Activator.getDefault().getDataProvider().saveData(Activator.getDefault().getAssemblyModel());
@@ -434,11 +437,11 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
}
public AbstractAssemblyNode getSelectedNode() {
- ISelection sel = assemblyTree.getTreeViewer().getSelection();
+ final ISelection sel = assemblyTree.getTreeViewer().getSelection();
if (sel instanceof StructuredSelection) {
- StructuredSelection selTree = (StructuredSelection) sel;
- AbstractAssemblyNode selectedNode = (AbstractAssemblyNode) selTree.getFirstElement();
+ final StructuredSelection selTree = (StructuredSelection) sel;
+ final AbstractAssemblyNode selectedNode = (AbstractAssemblyNode) selTree.getFirstElement();
return selectedNode;
}
return null;
@@ -447,7 +450,7 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
public void doSaveAs() {
}
- public void setDirty(boolean isDirty) {
+ public void setDirty(final boolean isDirty) {
dirtyState = isDirty;
firePropertyChange(ISaveablePart.PROP_DIRTY);
}
@@ -467,34 +470,34 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
private abstract class AbstractAddNodeAction extends Action {
protected final INodeFactory nodeFactory;
- public AbstractAddNodeAction(INodeFactory nodeFactory) {
+ public AbstractAddNodeAction(final INodeFactory nodeFactory) {
this.nodeFactory = nodeFactory;
}
protected BundleNode findBundle() {
- AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ final AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().findView(AssemblyView.ID);
- AbstractAssemblyNode treeNode = assemblyView.getSelectedNode();
+ final AbstractAssemblyNode treeNode = assemblyView.getSelectedNode();
if (null == treeNode) {
return null;
}
- AbstractAssemblyNode current = treeNode;
+ final AbstractAssemblyNode current = treeNode;
- BundleNode bundle = current.getBundle();
+ final BundleNode bundle = current.getBundle();
return bundle;
}
@Override
public final void run() {
- AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ final AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().findView(AssemblyView.ID);
- AbstractAssemblyNode parentNode = assemblyView.getSelectedNode();
+ final AbstractAssemblyNode parentNode = assemblyView.getSelectedNode();
if (null == parentNode) {
return;
}
- AbstractAssemblyNode newChild = createNode(parentNode);
+ final AbstractAssemblyNode newChild = createNode(parentNode);
parentNode.add(newChild);
assemblyView.updateTreeAndDetailSection();
assemblyView.expandNode(parentNode);
@@ -509,6 +512,7 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
private static class DeleteNodeAction extends Action {
private static final String TITLE = "Do you really want to delete the Node?";
private static final String OPTION_UNREGISTER_VIEW = "Unregister View";
+ private static final String OPTION_UNREGISTER_PERSPECTIVE = "Unregister Perspective";
private static final String OPTION_DELETE_CONTROLLER_CLASS = "Delete Controller Class";
private static final String OPTION_DELETE_VIEW_CLASS = "Delete View Class";
private static final String OPTION_DELETE_NODE = "Delete Node";
@@ -520,43 +524,15 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
@Override
public void run() {
- AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ final AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().findView(AssemblyView.ID);
- AbstractAssemblyNode selectedNode = assemblyView.getSelectedNode();
+ final AbstractAssemblyNode selectedNode = assemblyView.getSelectedNode();
if (selectedNode instanceof SubModuleNode) {
- SubModuleNode subMod = (SubModuleNode) selectedNode;
-
- String[] options = new String[] { OPTION_DELETE_NODE, OPTION_DELETE_VIEW_CLASS,
- OPTION_DELETE_CONTROLLER_CLASS, OPTION_UNREGISTER_VIEW };
-
- ListSelectionDialog dia = new ListSelectionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
- .getShell(), options, new ArrayContentProvider(), new LabelProvider(), TITLE);
- dia.open();
- List<Object> diaResult = Arrays.asList(dia.getResult());
-
- boolean isBundleDirty = false;
- if (diaResult.contains(OPTION_DELETE_VIEW_CLASS)) {
- Activator.getDefault().getCodeGenerator().deleteViewClass(subMod);
- isBundleDirty = true;
- }
-
- if (diaResult.contains(OPTION_DELETE_CONTROLLER_CLASS)) {
- Activator.getDefault().getCodeGenerator().deleteControllerClass(subMod);
- isBundleDirty = true;
- }
-
- if (diaResult.contains(OPTION_UNREGISTER_VIEW)) {
- Activator.getDefault().getDataProvider().getXmlParser().unregisterView(subMod);
- isBundleDirty = true;
- }
-
- if (diaResult.contains(OPTION_DELETE_NODE)) {
- isBundleDirty = true;
- selectedNode.getBundle().setDirty(isBundleDirty);
- deleteNode(assemblyView, selectedNode);
- }
+ deleteSubModuleNode(assemblyView, selectedNode);
+ } else if (selectedNode instanceof SubApplicationNode) {
+ deleteSubApplicationNode(assemblyView, selectedNode);
} else {
if (MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "",
TITLE)) {
@@ -566,7 +542,75 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
}
}
- private void deleteNode(AssemblyView assemblyView, AbstractAssemblyNode treeNode) {
+ /**
+ * @param assemblyView
+ * @param selectedNode
+ */
+ private void deleteSubApplicationNode(final AssemblyView assemblyView, final AbstractAssemblyNode selectedNode) {
+ final SubApplicationNode subApp = (SubApplicationNode) selectedNode;
+
+ final String[] options = new String[] { OPTION_DELETE_NODE, OPTION_UNREGISTER_PERSPECTIVE };
+
+ final ListSelectionDialog dia = new ListSelectionDialog(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell(), options, new ArrayContentProvider(), new LabelProvider(),
+ TITLE);
+ dia.open();
+ final List<Object> diaResult = Arrays.asList(dia.getResult());
+
+ boolean isBundleDirty = false;
+
+ if (diaResult.contains(OPTION_UNREGISTER_PERSPECTIVE)) {
+ Activator.getDefault().getDataProvider().getXmlParser().unregisterPerspective(subApp);
+ isBundleDirty = true;
+ }
+
+ if (diaResult.contains(OPTION_DELETE_NODE)) {
+ isBundleDirty = true;
+ selectedNode.getBundle().setDirty(isBundleDirty);
+ deleteNode(assemblyView, selectedNode);
+ }
+ }
+
+ /**
+ * @param assemblyView
+ * @param selectedNode
+ */
+ private void deleteSubModuleNode(final AssemblyView assemblyView, final AbstractAssemblyNode selectedNode) {
+ final SubModuleNode subMod = (SubModuleNode) selectedNode;
+
+ final String[] options = new String[] { OPTION_DELETE_NODE, OPTION_DELETE_VIEW_CLASS,
+ OPTION_DELETE_CONTROLLER_CLASS, OPTION_UNREGISTER_VIEW };
+
+ final ListSelectionDialog dia = new ListSelectionDialog(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell(), options, new ArrayContentProvider(), new LabelProvider(),
+ TITLE);
+ dia.open();
+ final List<Object> diaResult = Arrays.asList(dia.getResult());
+
+ boolean isBundleDirty = false;
+ if (diaResult.contains(OPTION_DELETE_VIEW_CLASS)) {
+ Activator.getDefault().getCodeGenerator().deleteViewClass(subMod);
+ isBundleDirty = true;
+ }
+
+ if (diaResult.contains(OPTION_DELETE_CONTROLLER_CLASS)) {
+ Activator.getDefault().getCodeGenerator().deleteControllerClass(subMod);
+ isBundleDirty = true;
+ }
+
+ if (diaResult.contains(OPTION_UNREGISTER_VIEW)) {
+ Activator.getDefault().getDataProvider().getXmlParser().unregisterView(subMod);
+ isBundleDirty = true;
+ }
+
+ if (diaResult.contains(OPTION_DELETE_NODE)) {
+ isBundleDirty = true;
+ selectedNode.getBundle().setDirty(isBundleDirty);
+ deleteNode(assemblyView, selectedNode);
+ }
+ }
+
+ private void deleteNode(final AssemblyView assemblyView, final AbstractAssemblyNode treeNode) {
// save the selection, to reset it after the tree is rebuilt
AbstractAssemblyNode newSelection = treeNode.getParent();
if (treeNode.hasPreviousSibling()) {
@@ -581,66 +625,66 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
}
private class AddSubModuleAction extends AbstractAddNodeAction {
- public AddSubModuleAction(INodeFactory nodeFactory) {
+ public AddSubModuleAction(final INodeFactory nodeFactory) {
super(nodeFactory);
setText("New SubModule");
setId("org.eclipse.riena.toolbox.assemblyeditor.ui.views.add.submodule.action"); //$NON-NLS-1$
}
@Override
- public AbstractAssemblyNode createNode(AbstractAssemblyNode parent) {
+ public AbstractAssemblyNode createNode(final AbstractAssemblyNode parent) {
return nodeFactory.createSubModule(parent, findBundle());
}
}
private class AddModuleAction extends AbstractAddNodeAction {
- public AddModuleAction(INodeFactory nodeFactory) {
+ public AddModuleAction(final INodeFactory nodeFactory) {
super(nodeFactory);
setText("New Module");
setId("org.eclipse.riena.toolbox.assemblyeditor.ui.views.add.module.action"); //$NON-NLS-1$
}
@Override
- public AbstractAssemblyNode createNode(AbstractAssemblyNode parent) {
+ public AbstractAssemblyNode createNode(final AbstractAssemblyNode parent) {
return nodeFactory.createModule(parent, findBundle());
}
}
private class AddAssemblyAction extends AbstractAddNodeAction {
- public AddAssemblyAction(INodeFactory nodeFactory) {
+ public AddAssemblyAction(final INodeFactory nodeFactory) {
super(nodeFactory);
setText("New Assembly");
setId("org.eclipse.riena.toolbox.assemblyeditor.ui.views.add.assembly.action"); //$NON-NLS-1$
}
@Override
- public AbstractAssemblyNode createNode(AbstractAssemblyNode parent) {
+ public AbstractAssemblyNode createNode(final AbstractAssemblyNode parent) {
return nodeFactory.createAssembly(findBundle());
}
}
private class AddModuleGroupAction extends AbstractAddNodeAction {
- public AddModuleGroupAction(INodeFactory nodeFactory) {
+ public AddModuleGroupAction(final INodeFactory nodeFactory) {
super(nodeFactory);
setText("New ModuleGroup");
setId("org.eclipse.riena.toolbox.assemblyeditor.ui.views.add.modulegroup.action"); //$NON-NLS-1$
}
@Override
- public AbstractAssemblyNode createNode(AbstractAssemblyNode parent) {
+ public AbstractAssemblyNode createNode(final AbstractAssemblyNode parent) {
return nodeFactory.createModuleGroup(parent, findBundle());
}
}
private class AddSubApplication extends AbstractAddNodeAction {
- public AddSubApplication(INodeFactory nodeFactory) {
+ public AddSubApplication(final INodeFactory nodeFactory) {
super(nodeFactory);
setText("New SubApplication");
setId("org.eclipse.riena.toolbox.assemblyeditor.ui.views.add.subapplication.action"); //$NON-NLS-1$
}
@Override
- public AbstractAssemblyNode createNode(AbstractAssemblyNode parent) {
+ public AbstractAssemblyNode createNode(final AbstractAssemblyNode parent) {
return nodeFactory.createSubApplication(parent, findBundle());
}
}
@@ -653,23 +697,23 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
@Override
public void run() {
- SubModuleNode subMod = (SubModuleNode) ((IStructuredSelection) assemblyTree.getTreeViewer().getSelection())
- .getFirstElement();
+ final SubModuleNode subMod = (SubModuleNode) ((IStructuredSelection) assemblyTree.getTreeViewer()
+ .getSelection()).getFirstElement();
if (null == subMod) {
return;
}
- String subModuleName = subMod.getName();
+ final String subModuleName = subMod.getName();
if (!Util.isGiven(subModuleName)) {
- MessageBox mb = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+ final MessageBox mb = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
mb.show("Warning",
"Could not generate the View/Controller classes, because the SubModuleName was not given",
SWT.ERROR, new String[] { "OK" });
return;
}
- String controllerClassName = Activator.getDefault().getCodeGenerator().generateController(subMod);
- RCPView rcpView = Activator.getDefault().getCodeGenerator().generateView(subMod);
+ final String controllerClassName = Activator.getDefault().getCodeGenerator().generateController(subMod);
+ final RCPView rcpView = Activator.getDefault().getCodeGenerator().generateView(subMod);
Activator.getDefault().getDataProvider().getXmlRenderer().registerView(subMod.getBundle(), rcpView);
subMod.setRcpView(rcpView);
subMod.setController(controllerClassName);
@@ -682,20 +726,21 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
public MoveNodeUpAction() {
setImageDescriptor(Activator.getImageDescriptor("/icons/move_up.gif"));
setId("org.eclipse.riena.toolbox.assemblyeditor.ui.views.movenodeup.action"); //$NON-NLS-1$
+ setToolTipText("Moves the selected node up");
}
@Override
public void run() {
- AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ final AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().findView(AssemblyView.ID);
- IStructuredSelection sel = (IStructuredSelection) assemblyView.getAssemblyTree().getTreeViewer()
+ final IStructuredSelection sel = (IStructuredSelection) assemblyView.getAssemblyTree().getTreeViewer()
.getSelection();
if (null == sel) {
return;
}
- AbstractAssemblyNode selectedNode = (AbstractAssemblyNode) sel.getFirstElement();
+ final AbstractAssemblyNode selectedNode = (AbstractAssemblyNode) sel.getFirstElement();
selectedNode.moveUp();
assemblyView.updateTreeAndDetailSection();
}
@@ -705,20 +750,21 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
public MoveNodeDownAction() {
setImageDescriptor(Activator.getImageDescriptor("/icons/move_down.gif"));
setId("org.eclipse.riena.toolbox.assemblyeditor.ui.views.movenodedown.action"); //$NON-NLS-1$
+ setToolTipText("Moves the selected node down");
}
@Override
public void run() {
- AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ final AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().findView(AssemblyView.ID);
- IStructuredSelection sel = (IStructuredSelection) assemblyView.getAssemblyTree().getTreeViewer()
+ final IStructuredSelection sel = (IStructuredSelection) assemblyView.getAssemblyTree().getTreeViewer()
.getSelection();
if (null == sel) {
return;
}
- AbstractAssemblyNode selectedNode = (AbstractAssemblyNode) sel.getFirstElement();
+ final AbstractAssemblyNode selectedNode = (AbstractAssemblyNode) sel.getFirstElement();
selectedNode.moveDown();
assemblyView.updateTreeAndDetailSection();
}
@@ -733,29 +779,29 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
@Override
public void run() {
- AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ final AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().findView(AssemblyView.ID);
- IStructuredSelection sel = (IStructuredSelection) assemblyView.getAssemblyTree().getTreeViewer()
+ final IStructuredSelection sel = (IStructuredSelection) assemblyView.getAssemblyTree().getTreeViewer()
.getSelection();
if (null == sel) {
return;
}
- AbstractAssemblyNode selectedNode = (AbstractAssemblyNode) sel.getFirstElement();
+ final AbstractAssemblyNode selectedNode = (AbstractAssemblyNode) sel.getFirstElement();
if (selectedNode instanceof SubModuleNode) {
- RCPView rcpView = ((SubModuleNode) selectedNode).getRcpView();
+ final RCPView rcpView = ((SubModuleNode) selectedNode).getRcpView();
if (null != rcpView) {
- String className = rcpView.getViewClass();
- RidgetGenerator generator = new RidgetGenerator(selectedNode.getBundle().getProject());
+ final String className = rcpView.getViewClass();
+ final RidgetGenerator generator = new RidgetGenerator(selectedNode.getBundle().getProject());
- List<SwtControl> controls = generator.findSwtControls(className);
+ final List<SwtControl> controls = generator.findSwtControls(className);
generator.generateConfigureRidgets(((SubModuleNode) selectedNode).getController(), controls);
if (Platform.inDebugMode()) {
- for (SwtControl control : controls) {
+ for (final SwtControl control : controls) {
System.out.println("DEBUG: found control: " + control.getSwtControlClassName()
+ " ridgetId: " + control.getRidgetId());
}
@@ -776,19 +822,19 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
@Override
public void run() {
- AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ final AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().findView(AssemblyView.ID);
- IStructuredSelection sel = (IStructuredSelection) assemblyView.getAssemblyTree().getTreeViewer()
+ final IStructuredSelection sel = (IStructuredSelection) assemblyView.getAssemblyTree().getTreeViewer()
.getSelection();
if (null == sel) {
return;
}
- AbstractAssemblyNode selectedNode = (AbstractAssemblyNode) sel.getFirstElement();
+ final AbstractAssemblyNode selectedNode = (AbstractAssemblyNode) sel.getFirstElement();
if (selectedNode instanceof SubModuleNode) {
- SubModuleNode submod = (SubModuleNode) selectedNode;
+ final SubModuleNode submod = (SubModuleNode) selectedNode;
openClassInEditor(submod, submod.getController());
}
}
@@ -802,19 +848,19 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
@Override
public void run() {
- AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ final AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().findView(AssemblyView.ID);
- IStructuredSelection sel = (IStructuredSelection) assemblyView.getAssemblyTree().getTreeViewer()
+ final IStructuredSelection sel = (IStructuredSelection) assemblyView.getAssemblyTree().getTreeViewer()
.getSelection();
if (null == sel) {
return;
}
- AbstractAssemblyNode selectedNode = (AbstractAssemblyNode) sel.getFirstElement();
+ final AbstractAssemblyNode selectedNode = (AbstractAssemblyNode) sel.getFirstElement();
if (selectedNode instanceof SubModuleNode) {
- SubModuleNode submod = (SubModuleNode) selectedNode;
+ final SubModuleNode submod = (SubModuleNode) selectedNode;
if (null != submod.getRcpView() && null != submod.getRcpView().getViewClass()) {
openClassInEditor(submod, submod.getRcpView().getViewClass());
}
@@ -830,23 +876,23 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
@Override
public void run() {
- AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ final AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().findView(AssemblyView.ID);
- IStructuredSelection sel = (IStructuredSelection) assemblyView.getAssemblyTree().getTreeViewer()
+ final IStructuredSelection sel = (IStructuredSelection) assemblyView.getAssemblyTree().getTreeViewer()
.getSelection();
if (null == sel) {
return;
}
- AbstractAssemblyNode selectedNode = (AbstractAssemblyNode) sel.getFirstElement();
+ final AbstractAssemblyNode selectedNode = (AbstractAssemblyNode) sel.getFirstElement();
if (selectedNode instanceof SubModuleNode) {
- SubModuleNode submod = (SubModuleNode) selectedNode;
+ final SubModuleNode submod = (SubModuleNode) selectedNode;
if (null != submod.getRcpView() && null != submod.getRcpView().getViewClass()) {
- AddUIControlCallGenerator generator = new AddUIControlCallGenerator(selectedNode.getBundle()
+ final AddUIControlCallGenerator generator = new AddUIControlCallGenerator(selectedNode.getBundle()
.getProject());
- boolean ret = generator.generateAddUIControlCalls(submod.getRcpView().getViewClass());
+ final boolean ret = generator.generateAddUIControlCalls(submod.getRcpView().getViewClass());
}
}
}
@@ -854,19 +900,19 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
private class RefreshAction extends Action {
public RefreshAction() {
- setToolTipText("Refresh");
+ setToolTipText("Reload all plugin.xml");
setImageDescriptor(Activator.getImageDescriptor("/icons/refresh.png"));
setId("org.eclipse.riena.toolbox.assemblyeditor.ui.views.refresh.action"); //$NON-NLS-1$
}
@Override
public void run() {
- AbstractAssemblyNode selectedNode = getSelectedNode();
+ final AbstractAssemblyNode selectedNode = getSelectedNode();
- AssemblyModel model = Activator.getDefault().getDataProvider().createData();
+ final AssemblyModel model = Activator.getDefault().getDataProvider().createData();
Activator.getDefault().setAssemblyModel(model);
- AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ final AssemblyView assemblyView = (AssemblyView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().findView(AssemblyView.ID);
assemblyView.getAssemblyTree().setModel(model, false);
assemblyView.updateTreeAndDetailSection();
@@ -886,18 +932,19 @@ public class AssemblyView extends ViewPart implements ISaveablePart {
@Override
public void run() {
- AbstractAssemblyNode selectedNode = getSelectedNode();
+ final AbstractAssemblyNode selectedNode = getSelectedNode();
if (selectedNode instanceof SubApplicationNode) {
- SubApplicationNode subapp = (SubApplicationNode) selectedNode;
+ final SubApplicationNode subapp = (SubApplicationNode) selectedNode;
if (!Util.isGiven(subapp.getPerspective())) {
- RCPPerspective perspective = Activator.getDefault().getNodeFactory().createRcpPerspective(subapp);
+ final RCPPerspective perspective = Activator.getDefault().getNodeFactory()
+ .createRcpPerspective(subapp);
Activator.getDefault().getDataProvider().getXmlRenderer()
.registerPerspective(selectedNode.getBundle(), perspective);
subapp.setPerspective(perspective.getId());
- Set<RCPPerspective> persp = Activator.getDefault().getDataProvider().getXmlParser()
+ final Set<RCPPerspective> persp = Activator.getDefault().getDataProvider().getXmlParser()
.getRcpPerspectives(selectedNode.getBundle());
Activator.getDefault().getAssemblyModel().addAllRcpPerspectives(persp);
detailSection.update(subapp);