diff options
Diffstat (limited to 'bundles')
122 files changed, 23 insertions, 8447 deletions
diff --git a/bundles/org.eclipse.e4.tools.bundle.spy/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.tools.bundle.spy/META-INF/MANIFEST.MF index 16f9c4aa..8eea1968 100644 --- a/bundles/org.eclipse.e4.tools.bundle.spy/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.e4.tools.bundle.spy/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Bundle Spy Bundle-SymbolicName: org.eclipse.e4.tools.bundle.spy;singleton:=true -Bundle-Version: 0.18.0.qualifier +Bundle-Version: 0.19.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.10.0", org.eclipse.jface;bundle-version="3.10.1", diff --git a/bundles/org.eclipse.e4.tools.bundle.spy/pom.xml b/bundles/org.eclipse.e4.tools.bundle.spy/pom.xml index c67e1815..926161a0 100644 --- a/bundles/org.eclipse.e4.tools.bundle.spy/pom.xml +++ b/bundles/org.eclipse.e4.tools.bundle.spy/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.eclipse.e4.tools</groupId> <artifactId>e4-tools-aggregator</artifactId> - <version>0.18.0-SNAPSHOT</version> + <version>0.19.0-SNAPSHOT</version> <relativePath>../../</relativePath> </parent> diff --git a/bundles/org.eclipse.e4.tools.context.spy/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.tools.context.spy/META-INF/MANIFEST.MF index cc36fe39..f4cc51e1 100644 --- a/bundles/org.eclipse.e4.tools.context.spy/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.e4.tools.context.spy/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Context Spy Bundle-SymbolicName: org.eclipse.e4.tools.context.spy;singleton:=true -Bundle-Version: 0.17.0.qualifier +Bundle-Version: 0.19.0.qualifier Bundle-Vendor: Eclipse Foundation Export-Package: org.eclipse.e4.tools.context.spy Require-Bundle: javax.inject;bundle-version="1.0.0", diff --git a/bundles/org.eclipse.e4.tools.context.spy/pom.xml b/bundles/org.eclipse.e4.tools.context.spy/pom.xml index 2f2088e4..076f7800 100644 --- a/bundles/org.eclipse.e4.tools.context.spy/pom.xml +++ b/bundles/org.eclipse.e4.tools.context.spy/pom.xml @@ -4,13 +4,13 @@ <parent> <groupId>org.eclipse.e4.tools</groupId> <artifactId>e4-tools-aggregator</artifactId> - <version>0.18.0-SNAPSHOT</version> + <version>0.19.0-SNAPSHOT</version> <relativePath>../../</relativePath> </parent> <groupId>org.eclipse.e4</groupId> <artifactId>org.eclipse.e4.tools.context.spy</artifactId> - <version>0.17.0-SNAPSHOT</version> + <version>0.19.0-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextSpyProvider.java b/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextSpyProvider.java index ba98d98a..dc660da2 100644 --- a/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextSpyProvider.java +++ b/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextSpyProvider.java @@ -13,7 +13,10 @@ *******************************************************************************/ package org.eclipse.e4.internal.tools.context.spy; +import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; +import java.util.List; import javax.inject.Inject; @@ -67,10 +70,14 @@ public class ContextSpyProvider extends LabelProvider implements ITreeContentPro @Override public Object[] getChildren(Object parentElement) { + List<EclipseContext> children = Collections.emptyList(); + if (parentElement instanceof EclipseContext) { - return ((EclipseContext) parentElement).getChildren().toArray(); + Iterable<EclipseContext> it = ((EclipseContext) parentElement).getChildren(); + children = new ArrayList<EclipseContext>(); + it.forEach(children::add); } - return null; + return children.toArray(); } @Override @@ -83,7 +90,7 @@ public class ContextSpyProvider extends LabelProvider implements ITreeContentPro @Override public boolean hasChildren(Object element) { - return ((element instanceof EclipseContext) && !(((EclipseContext) element).getChildren().isEmpty())); + return getChildren(element).length > 0; } @Override diff --git a/bundles/org.eclipse.e4.tools.css.spy/.classpath b/bundles/org.eclipse.e4.tools.css.spy/.classpath deleted file mode 100644 index e801ebfb..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/bundles/org.eclipse.e4.tools.css.spy/.project b/bundles/org.eclipse.e4.tools.css.spy/.project deleted file mode 100644 index f29584da..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.e4.tools.css.spy</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 2f55e9a2..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,315 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 -org.eclipse.jdt.core.compiler.compliance=11 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=11 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=80 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=120 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true -org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true -org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true -org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index c15b52b7..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,62 +0,0 @@ -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile -formatter_settings_version=12 -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_functional_interfaces=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=true -sp_cleanup.format_source_code_changes_only=true -sp_cleanup.insert_inferred_type_arguments=false -sp_cleanup.make_local_variable_final=true -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -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 -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_redundant_type_arguments=false -sp_cleanup.remove_trailing_whitespaces=true -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_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_anonymous_class_creation=false -sp_cleanup.use_blocks=true -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_lambda=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true -sp_cleanup.use_type_arguments=false diff --git a/bundles/org.eclipse.e4.tools.css.spy/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.tools.css.spy/META-INF/MANIFEST.MF deleted file mode 100644 index edd79615..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/META-INF/MANIFEST.MF +++ /dev/null @@ -1,30 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: CSS Spy -Bundle-SymbolicName: org.eclipse.e4.tools.css.spy;singleton:=true -Bundle-Version: 0.18.0.qualifier -Bundle-Vendor: Eclipse.org -Require-Bundle: org.eclipse.core.runtime;bundle-version="3.6.0", - org.eclipse.e4.ui.workbench;bundle-version="0.9.0";resolution:=optional, - org.eclipse.e4.ui.css.core;bundle-version="0.9.0", - org.eclipse.swt;bundle-version="3.6.0", - org.eclipse.jface;bundle-version="3.8.0", - org.eclipse.e4.ui.css.swt;bundle-version="0.10.0", - org.eclipse.e4.ui.css.swt.theme;bundle-version="0.9.201", - org.eclipse.e4.ui.widgets;bundle-version="0.11.0", - org.eclipse.e4.ui.model.workbench;bundle-version="0.9.1", - org.eclipse.e4.tools.spy;bundle-version="0.1.0", - org.eclipse.e4.ui.di, - org.eclipse.e4.core.di.extensions -Bundle-RequiredExecutionEnvironment: JavaSE-11 -Bundle-ActivationPolicy: lazy -Import-Package: javax.annotation;version="1.2.0", - javax.inject, - org.eclipse.e4.core.contexts, - org.eclipse.e4.core.di.annotations, - org.eclipse.e4.core.services.log, - org.eclipse.e4.core.services.statusreporter, - org.eclipse.e4.ui.bindings, - org.eclipse.e4.ui.services, - org.w3c.css.sac;version="1.3.0" -Automatic-Module-Name: org.eclipse.e4.tools.css.spy diff --git a/bundles/org.eclipse.e4.tools.css.spy/build.properties b/bundles/org.eclipse.e4.tools.css.spy/build.properties deleted file mode 100644 index 5e4181d7..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - icons/,\ - css/ diff --git a/bundles/org.eclipse.e4.tools.css.spy/css/dark-theme.css b/bundles/org.eclipse.e4.tools.css.spy/css/dark-theme.css deleted file mode 100644 index db401ee2..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/css/dark-theme.css +++ /dev/null @@ -1,3 +0,0 @@ -#css-spy { - background-color: red; -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.css.spy/forceQualifierUpdate.txt b/bundles/org.eclipse.e4.tools.css.spy/forceQualifierUpdate.txt deleted file mode 100644 index 396f0875..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/forceQualifierUpdate.txt +++ /dev/null @@ -1,2 +0,0 @@ -# To force a version qualifier update add the bug here -Bug 403237 - o.e.e4.tools cannot be build with "mvn clean install" diff --git a/bundles/org.eclipse.e4.tools.css.spy/icons/css_scratchpad.png b/bundles/org.eclipse.e4.tools.css.spy/icons/css_scratchpad.png Binary files differdeleted file mode 100644 index 7c8f5bce..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/icons/css_scratchpad.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.css.spy/icons/css_scratchpad@2x.png b/bundles/org.eclipse.e4.tools.css.spy/icons/css_scratchpad@2x.png Binary files differdeleted file mode 100644 index 28c950c5..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/icons/css_scratchpad@2x.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.css.spy/icons/cssspy.png b/bundles/org.eclipse.e4.tools.css.spy/icons/cssspy.png Binary files differdeleted file mode 100644 index 153d48ac..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/icons/cssspy.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.css.spy/icons/cssspy@2x.png b/bundles/org.eclipse.e4.tools.css.spy/icons/cssspy@2x.png Binary files differdeleted file mode 100644 index 05e4d822..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/icons/cssspy@2x.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.css.spy/plugin.xml b/bundles/org.eclipse.e4.tools.css.spy/plugin.xml deleted file mode 100644 index cda001e6..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/plugin.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.4"?> -<plugin> - <extension - point="org.eclipse.e4.tools.spy.spyPart"> - <spyPart - description="Open Css Spy" - icon="icons/cssspy.png" - name="CSS Spy" - part="org.eclipse.e4.tools.css.spy.CssSpyPart" - shortcut="M2+M3+F5"></spyPart> - <spyPart - description="Open Css Scratch Pad" - icon="icons/css_scratchpad.png" - name="CSS Scratch pad" - part="org.eclipse.e4.tools.css.spy.CSSScratchPadPart" - shortcut="M2+M3+F6"> - </spyPart> - </extension> - <extension - point="org.eclipse.e4.ui.css.swt.theme"> - <stylesheet - uri="css/dark-theme.css"> - <themeid - refid="org.eclipse.e4.ui.css.theme.e4_dark"></themeid> - </stylesheet> - </extension> - -</plugin> diff --git a/bundles/org.eclipse.e4.tools.css.spy/pom.xml b/bundles/org.eclipse.e4.tools.css.spy/pom.xml deleted file mode 100644 index 6ab98c7a..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.eclipse.e4.tools</groupId> - <artifactId>e4-tools-aggregator</artifactId> - <version>0.18.0-SNAPSHOT</version> - <relativePath>../../</relativePath> - </parent> - - <groupId>org.eclipse.e4</groupId> - <version>0.18.0-SNAPSHOT</version> - <artifactId>org.eclipse.e4.tools.css.spy</artifactId> - <packaging>eclipse-plugin</packaging> - -</project> diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertiesContentProvider.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertiesContentProvider.java deleted file mode 100644 index 6a78acb7..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertiesContentProvider.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Manumitting Technologies, Inc. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Brian de Alwis (MT) - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.css.spy; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.e4.ui.css.core.dom.CSSStylableElement; -import org.eclipse.e4.ui.css.core.engine.CSSEngine; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.widgets.Widget; - -public class CSSPropertiesContentProvider implements IStructuredContentProvider { - - protected CSSEngine cssEngine; - protected CSSStylableElement input; - - @Override - public void dispose() { - cssEngine = null; - input = null; - } - - @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - if (newInput instanceof CSSStylableElement) { - this.input = (CSSStylableElement) newInput; - this.cssEngine = CssSpyPart.getCSSEngine(input.getNativeWidget()); - } else if (newInput instanceof Widget) { - this.cssEngine = CssSpyPart.getCSSEngine(newInput); - this.input = (CSSStylableElement) cssEngine.getElement(newInput); - } - } - - @Override - public Object[] getElements(Object inputElement) { - Collection<String> propertyNames = cssEngine.getCSSProperties(input); - List<CSSPropertyProvider> properties = new ArrayList<>(propertyNames.size()); - for (String propertyName : propertyNames) { - properties.add(new CSSPropertyProvider(propertyName, input, cssEngine)); - } - return properties.toArray(); - } - -} diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertyProvider.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertyProvider.java deleted file mode 100644 index eef0e420..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertyProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Manumitting Technologies, Inc. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Brian de Alwis (MT) - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.css.spy; - -import org.eclipse.e4.ui.css.core.dom.CSSStylableElement; -import org.eclipse.e4.ui.css.core.engine.CSSEngine; -import org.w3c.dom.css.CSSValue; - -/** - * A getter and setter of a particular CSS property for a particular element. - */ -public class CSSPropertyProvider { - - private String propertyName; - private CSSStylableElement element; - private CSSEngine engine; - - public CSSPropertyProvider(String propertyName, CSSStylableElement element, CSSEngine engine) { - this.propertyName = propertyName; - this.element = element; - this.engine = engine; - } - - public String getPropertyName() { - return propertyName; - } - - public String getValue() throws Exception { - return engine.retrieveCSSProperty(element, propertyName, ""); - } - - public void setValue(String value) throws Exception { - CSSValue v = engine.parsePropertyValue(value); - engine.applyCSSProperty(element, propertyName, v, ""); - } - - @Override - public String toString() { - return propertyName; - } - -} diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSScratchPadPart.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSScratchPadPart.java deleted file mode 100644 index e235a8de..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSScratchPadPart.java +++ /dev/null @@ -1,175 +0,0 @@ -package org.eclipse.e4.tools.css.spy; - -import java.io.IOException; -import java.io.Reader; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import javax.annotation.PostConstruct; -import javax.inject.Inject; - -import org.eclipse.e4.core.di.annotations.Optional; -import org.eclipse.e4.ui.css.core.dom.ExtendedDocumentCSS; -import org.eclipse.e4.ui.css.core.engine.CSSEngine; -import org.eclipse.e4.ui.css.swt.internal.theme.ThemeEngine; -import org.eclipse.e4.ui.css.swt.theme.IThemeEngine; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.layout.GridDataFactory; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.SashForm; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.w3c.css.sac.CSSParseException; -import org.w3c.dom.stylesheets.StyleSheet; -import org.w3c.dom.stylesheets.StyleSheetList; - -@SuppressWarnings("restriction") -public class CSSScratchPadPart { - @Inject - @Optional - private IThemeEngine themeEngine; - - /* - * public CSSScratchPadPart(Shell parentShell, IThemeEngine themeEngine) { - * super(parentShell); this.themeEngine = themeEngine; - * setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE/* | SWT.PRIMARY_MODAL - */ - // ); - // setShellStyle(SWT.DIALOG_TRIM | SWT.MAX | SWT.RESIZE - // | getDefaultOrientation()); - // } - - /* - * @Override protected void configureShell(Shell newShell) { - * super.configureShell(newShell); newShell.setText("CSS Scratchpad"); } - */ - - private static final int APPLY_ID = IDialogConstants.OK_ID + 100; - /** - * Collection of buttons created by the <code>createButton</code> method. - */ - private HashMap<Integer, Button> buttons = new HashMap<>(); - - private Text cssText; - private Text exceptions; - - @PostConstruct - protected Control createDialogArea(Composite parent) { - - Composite outer = parent; - outer.setLayout(new GridLayout()); - outer.setLayoutData(new GridData(GridData.FILL_BOTH)); - - SashForm sashForm = new SashForm(outer, SWT.VERTICAL); - - cssText = new Text(sashForm, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL); - - exceptions = new Text(sashForm, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY); - - GridDataFactory.fillDefaults().grab(true, true).applyTo(sashForm); - sashForm.setWeights(new int[] { 80, 20 }); - - createButtonsForButtonBar(parent); - return outer; - } - - private void createButtonsForButtonBar(Composite parent) { - createButton(parent, APPLY_ID, "Apply", true); - createButton(parent, IDialogConstants.OK_ID, "Close", false); - // createButton(parent, IDialogConstants.CANCEL_ID, - // IDialogConstants.CANCEL_LABEL, false); - } - - protected Button createButton(Composite parent, int id, String label, boolean defaultButton) { - // increment the number of columns in the button bar - ((GridLayout) parent.getLayout()).numColumns++; - Button button = new Button(parent, SWT.PUSH); - button.setText(label); - button.setFont(JFaceResources.getDialogFont()); - button.setData(Integer.valueOf(id)); - button.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent event) { - buttonPressed(((Integer) event.widget.getData()).intValue()); - } - }); - if (defaultButton) { - Shell shell = parent.getShell(); - if (shell != null) { - shell.setDefaultButton(button); - } - } - buttons.put(Integer.valueOf(id), button); - // setButtonLayoutData(button); - return button; - } - - protected void buttonPressed(int buttonId) { - switch (buttonId) { - case APPLY_ID: - applyCSS(); - break; - default: - break; - } - } - - private void applyCSS() { - if (themeEngine == null) { - exceptions.setText("No theme engine available!"); - return; - } - long start = System.nanoTime(); - exceptions.setText(""); - - StringBuilder sb = new StringBuilder(); - - // FIXME: expose these new protocols: resetCurrentTheme() and - // getCSSEngines() - ((ThemeEngine) themeEngine).resetCurrentTheme(); - - int count = 0; - for (CSSEngine engine : ((ThemeEngine) themeEngine).getCSSEngines()) { - if (count++ > 0) { - sb.append("\n\n"); - } - sb.append("Engine[").append(engine.getClass().getSimpleName()).append("]"); - ExtendedDocumentCSS doc = (ExtendedDocumentCSS) engine.getDocumentCSS(); - List<StyleSheet> sheets = new ArrayList<>(); - StyleSheetList list = doc.getStyleSheets(); - for (int i = 0; i < list.getLength(); i++) { - sheets.add(list.item(i)); - } - - try { - Reader reader = new StringReader(cssText.getText()); - sheets.add(0, engine.parseStyleSheet(reader)); - doc.removeAllStyleSheets(); - for (StyleSheet sheet : sheets) { - doc.addStyleSheet(sheet); - } - engine.reapply(); - - long nanoDiff = System.nanoTime() - start; - sb.append("\nTime: ").append(nanoDiff / 1000000).append("ms"); - } catch (CSSParseException e) { - sb.append("\nError: line ").append(e.getLineNumber()).append(" col ").append(e.getColumnNumber()) - .append(": ").append(e.getLocalizedMessage()); - } catch (IOException e) { - sb.append("\nError: ").append(e.getLocalizedMessage()); - } - } - exceptions.setText(sb.toString()); - } - -} diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyPart.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyPart.java deleted file mode 100644 index 8a974132..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyPart.java +++ /dev/null @@ -1,912 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011, 2016 Manumitting Technologies, Inc. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Brian de Alwis (MT) - initial API and implementation - * Olivier Prouvost <olivier.prouvost@opcoach.com> - Bug 428903 - *******************************************************************************/ -package org.eclipse.e4.tools.css.spy; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; - -import javax.annotation.PostConstruct; -import javax.inject.Inject; -import javax.inject.Named; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.e4.core.contexts.IEclipseContext; -import org.eclipse.e4.ui.css.core.dom.CSSStylableElement; -import org.eclipse.e4.ui.css.core.engine.CSSEngine; -import org.eclipse.e4.ui.css.swt.dom.WidgetElement; -import org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl; -import org.eclipse.e4.ui.model.application.ui.basic.MPart; -import org.eclipse.e4.ui.services.IServiceConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.layout.GridDataFactory; -import org.eclipse.jface.layout.GridLayoutFactory; -import org.eclipse.jface.layout.TableColumnLayout; -import org.eclipse.jface.layout.TreeColumnLayout; -import org.eclipse.jface.viewers.CellEditor; -import org.eclipse.jface.viewers.ColumnLabelProvider; -import org.eclipse.jface.viewers.ColumnViewerEditor; -import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy; -import org.eclipse.jface.viewers.ColumnViewerToolTipSupport; -import org.eclipse.jface.viewers.ColumnWeightData; -import org.eclipse.jface.viewers.EditingSupport; -import org.eclipse.jface.viewers.FocusCellOwnerDrawHighlighter; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.TableViewerColumn; -import org.eclipse.jface.viewers.TableViewerEditor; -import org.eclipse.jface.viewers.TableViewerFocusCellManager; -import org.eclipse.jface.viewers.TextCellEditor; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.TreeViewerColumn; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerComparator; -import org.eclipse.jface.viewers.ViewerFilter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CTabItem; -import org.eclipse.swt.custom.SashForm; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.graphics.Region; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.ToolItem; -import org.eclipse.swt.widgets.Widget; -import org.w3c.css.sac.CSSParseException; -import org.w3c.css.sac.SelectorList; -import org.w3c.dom.NodeList; -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; - -@SuppressWarnings("restriction") -public class CssSpyPart { - - @Inject - @Named(IServiceConstants.ACTIVE_SHELL) - private Shell activeShell; - - /** - * @return the CSS element corresponding to the argument, or null if none - */ - public static CSSStylableElement getCSSElement(Object o) { - if (o instanceof CSSStylableElement) { - return (CSSStylableElement) o; - } else { - CSSEngine engine = getCSSEngine(o); - if (engine != null) { - return (CSSStylableElement) engine.getElement(o); - } - } - return null; - } - - /** @return the CSS engine governing the argument, or null if none */ - public static CSSEngine getCSSEngine(Object o) { - CSSEngine engine = null; - if (o instanceof CSSStylableElement) { - CSSStylableElement element = (CSSStylableElement) o; - engine = WidgetElement.getEngine((Widget) element.getNativeWidget()); - } - if (engine == null && o instanceof Widget) { - if (((Widget) o).isDisposed()) { - return null; - } - engine = WidgetElement.getEngine((Widget) o); - } - if (engine == null && Display.getCurrent() != null) { - engine = new CSSSWTEngineImpl(Display.getCurrent()); - } - return engine; - } - - @Inject - private Display display; - - private Widget specimen; // specimen (can be reused if reopened) - - @Inject - IEclipseContext mpartContext; // Used to remember of last specimen. - - private Widget shown; - - private TreeViewer widgetTreeViewer; - private WidgetTreeProvider widgetTreeProvider; - private Button followSelection; - private Button showAllShells; - private TableViewer cssPropertiesViewer; - private Text cssRules; - - private List<Shell> highlights = new LinkedList<>(); - private List<Region> highlightRegions = new LinkedList<>(); - private Text cssSearchBox; - private Button showUnsetProperties; - private Button showCssFragment; - - protected ViewerFilter unsetPropertyFilter = new ViewerFilter() { - - @Override - public boolean select(Viewer viewer, Object parentElement, Object element) { - if (element instanceof CSSPropertyProvider) { - try { - return ((CSSPropertyProvider) element).getValue() != null; - } catch (Exception e) { - return false; - } - } - return false; - } - }; - - private Composite outer; - - public Widget getSpecimen() { - return specimen; - } - - private boolean isLive() { - return specimen == null; - } - - public void setSpecimen(Widget specimen) { - this.specimen = specimen; - update(); - } - - private Widget getActiveSpecimen() { - if (specimen != null) { - return specimen; - } - return display.getCursorControl(); - } - - protected void update() { - if (activeShell == null) { - return; - } - Widget current = getActiveSpecimen(); - if (shown == current) { - return; - } - shown = current; - - CSSEngine engine = getCSSEngine(shown); - CSSStylableElement element = (CSSStylableElement) engine.getElement(shown); - if (element == null) { - return; - } - - updateWidgetTreeInput(); - revealAndSelect(Collections.singletonList(shown)); - } - - private <T> void revealAndSelect(List<T> elements) { - widgetTreeViewer.setSelection(new StructuredSelection(elements), true); - } - - private void updateForWidgetSelection(ISelection sel) { - disposeHighlights(); - if (sel.isEmpty()) { - return; - } - StructuredSelection selection = (StructuredSelection) sel; - for (Object s : selection.toList()) { - if (s instanceof Widget) { - highlightWidget((Widget) s); - } - } - populate(selection.size() == 1 && selection.getFirstElement() instanceof Widget - ? (Widget) selection.getFirstElement() : null); - } - - private void updateWidgetTreeInput() { - if (showAllShells.getSelection()) { - widgetTreeViewer.setInput(display); - } else { - widgetTreeViewer.setInput(new Object[] { shown instanceof Control ? ((Control) shown).getShell() : shown }); - } - performCSSSearch(new NullProgressMonitor()); - } - - protected void populate(Widget selected) { - if (selected == null) { - cssPropertiesViewer.setInput(null); - cssRules.setText(""); - return; - } - if (selected.isDisposed()) { - cssPropertiesViewer.setInput(null); - cssRules.setText("*DISPOSED*"); - return; - } - - CSSStylableElement element = getCSSElement(selected); - if (element == null) { - cssPropertiesViewer.setInput(null); - cssRules.setText("Not a stylable element"); - return; - } - - cssPropertiesViewer.setInput(selected); - - StringBuilder sb = new StringBuilder(); - CSSEngine engine = getCSSEngine(element); - CSSStyleDeclaration decl = engine.getViewCSS().getComputedStyle(element, null); - - if (element.getCSSStyle() != null) { - sb.append("\nCSS Inline Style(s):\n "); - Util.join(sb, element.getCSSStyle().split(";"), ";\n "); - } - - if (decl != null) { - sb.append("\n\nCSS Properties:\n"); - try { - if (decl != null) { - sb.append(decl.getCssText()); - } - } catch (Exception e) { - sb.append(e); - } - } - if (element.getStaticPseudoInstances().length > 0) { - sb.append("\n\nStatic Pseudoinstances:\n "); - Util.join(sb, element.getStaticPseudoInstances(), "\n "); - } - - if (element.getCSSClass() != null) { - sb.append("\n\nCSS Classes:\n "); - Util.join(sb, element.getCSSClass().split(" +"), "\n "); - } - - if (element.getCSSId() != null) { - sb.append("\n\nCSS ID:\n "); - Util.join(sb, element.getCSSId().split(" +"), "\n "); - } - - if (element.getAttribute("style") != null) { - sb.append("\n\nSWT Style Bits:\n "); - Util.join(sb, element.getAttribute("style").split(" +"), "\n "); - } - - sb.append("\n\nCSS Class Element:\n ").append(element.getClass().getName()); - - // this is useful for diagnosing issues - if (element.getNativeWidget() instanceof Shell && ((Shell) element.getNativeWidget()).getParent() != null) { - Shell nw = (Shell) element.getNativeWidget(); - sb.append("\n\nShell parent: ").append(nw.getParent()); - } - if (element.getNativeWidget() instanceof Composite) { - Composite nw = (Composite) element.getNativeWidget(); - sb.append("\n\nSWT Layout: ").append(nw.getLayout()); - } - Rectangle bounds = getBounds(selected); - if (bounds != null) { - sb.append("\nBounds: x=").append(bounds.x).append(" y=").append(bounds.y); - sb.append(" h=").append(bounds.height).append(" w=").append(bounds.width); - } - - if (element.getNativeWidget() instanceof Widget) { - Widget w = (Widget) element.getNativeWidget(); - if (w.getData() != null) { - sb.append("\nWidget data: ").append(w.getData()); - } - if (w.getData(SWT.SKIN_ID) != null) { - sb.append("\nWidget Skin ID (").append(SWT.SKIN_ID).append("): ").append(w.getData(SWT.SKIN_ID)); - } - if (w.getData(SWT.SKIN_CLASS) != null) { - sb.append("\nWidget Skin Class (").append(SWT.SKIN_CLASS).append("): ") - .append(w.getData(SWT.SKIN_CLASS)); - } - } - - cssRules.setText(sb.toString().trim()); - - disposeHighlights(); - highlightWidget(selected); - } - - private Shell getShell(Widget widget) { - if (widget instanceof Control) { - return ((Control) widget).getShell(); - } - return null; - } - - /** Add a highlight-rectangle for the selected widget */ - private void highlightWidget(Widget selected) { - if (selected == null || selected.isDisposed()) { - return; - } - - Rectangle bounds = getBounds(selected); // relative to absolute display, - // not the widget - if (bounds == null /* || bounds.height == 0 || bounds.width == 0 */) { - return; - } - // emulate a transparent background as per SWT Snippet180 - Shell selectedShell = getShell(selected); - // create the highlight; want it to appear on top - Shell highlight = new Shell(selectedShell, SWT.NO_TRIM | SWT.MODELESS | SWT.NO_FOCUS | SWT.ON_TOP); - highlight.setBackground(display.getSystemColor(SWT.COLOR_RED)); - // set CSS ID for the dark theme - highlight.setData("org.eclipse.e4.ui.css.id", "css-spy"); - Region highlightRegion = new Region(); - highlightRegion.add(0, 0, 1, bounds.height + 2); - highlightRegion.add(0, 0, bounds.width + 2, 1); - highlightRegion.add(bounds.width + 1, 0, 1, bounds.height + 2); - highlightRegion.add(0, bounds.height + 1, bounds.width + 2, 1); - highlight.setRegion(highlightRegion); - highlight.setBounds(bounds.x - 1, bounds.y - 1, bounds.width + 2, bounds.height + 2); - highlight.setEnabled(false); - highlight.setVisible(true); // not open(): setVisible() prevents taking - // focus - - highlights.add(highlight); - highlightRegions.add(highlightRegion); - } - - private void disposeHighlights() { - for (Shell highlight : highlights) { - highlight.dispose(); - } - highlights.clear(); - for (Region region : highlightRegions) { - region.dispose(); - } - highlightRegions.clear(); - } - - private Rectangle getBounds(Widget widget) { - if (widget instanceof Shell) { - // Shell bounds are already in display coordinates - return ((Shell) widget).getBounds(); - } else if (widget instanceof Control) { - Control control = (Control) widget; - Rectangle bounds = control.getBounds(); - return control.getDisplay().map(control.getParent(), null, bounds); - } else if (widget instanceof ToolItem) { - ToolItem item = (ToolItem) widget; - Rectangle bounds = item.getBounds(); - return item.getDisplay().map(item.getParent(), null, bounds); - } else if (widget instanceof CTabItem) { - CTabItem item = (CTabItem) widget; - Rectangle bounds = item.getBounds(); - return item.getDisplay().map(item.getParent(), null, bounds); - } - // FIXME: figure out how to map items to a position - return null; - } - - /** - * Create contents of the spy. - * - * @param parent - */ - @PostConstruct - protected Control createDialogArea(Composite parent, IEclipseContext ctx) { - outer = parent; - outer.setLayout(new GridLayout()); - outer.setLayoutData(new GridData(GridData.FILL_BOTH)); - - Composite top = new Composite(outer, SWT.NONE); - GridLayoutFactory.swtDefaults().numColumns(3).applyTo(top); - cssSearchBox = new Text(top, SWT.SEARCH | SWT.ICON_SEARCH | SWT.ICON_CANCEL); - cssSearchBox.setMessage("CSS Selector"); - cssSearchBox.setToolTipText("Highlight matching widgets"); - GridDataFactory.fillDefaults().grab(true, false).applyTo(cssSearchBox); - - followSelection = new Button(top, SWT.CHECK); - followSelection.setSelection(true); - followSelection.setText("Follow UI Selection"); - GridDataFactory.swtDefaults().applyTo(followSelection); - - showAllShells = new Button(top, SWT.CHECK); - showAllShells.setText("All shells"); - GridDataFactory.swtDefaults().applyTo(showAllShells); - - GridDataFactory.fillDefaults().applyTo(top); - - SashForm sashForm = new SashForm(outer, SWT.VERTICAL); - sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); - - // / THE WIDGET TREE - Composite widgetsComposite = new Composite(sashForm, SWT.NONE); - - widgetTreeViewer = new TreeViewer(widgetsComposite, SWT.BORDER | SWT.MULTI); - widgetTreeProvider = new WidgetTreeProvider(); - widgetTreeViewer.setContentProvider(widgetTreeProvider); - widgetTreeViewer.setAutoExpandLevel(0); - widgetTreeViewer.getTree().setLinesVisible(true); - widgetTreeViewer.getTree().setHeaderVisible(true); - ColumnViewerToolTipSupport.enableFor(widgetTreeViewer); - - TreeViewerColumn widgetTypeColumn = new TreeViewerColumn(widgetTreeViewer, SWT.NONE); - widgetTypeColumn.getColumn().setWidth(100); - widgetTypeColumn.getColumn().setText("Widget"); - widgetTypeColumn.setLabelProvider(new ColumnLabelProvider() { - @Override - public String getText(Object item) { - CSSStylableElement element = CssSpyPart.getCSSElement(item); - return element.getLocalName() + " (" + element.getNamespaceURI() + ")"; - } - }); - - TreeViewerColumn widgetClassColumn = new TreeViewerColumn(widgetTreeViewer, SWT.NONE); - widgetClassColumn.getColumn().setText("CSS Class"); - widgetClassColumn.getColumn().setWidth(100); - widgetClassColumn.setLabelProvider(new ColumnLabelProvider() { - @Override - public String getText(Object item) { - CSSStylableElement element = CssSpyPart.getCSSElement(item); - if (element.getCSSClass() == null) { - return null; - } - String classes[] = element.getCSSClass().split(" +"); - return classes.length <= 1 ? classes[0] : classes[0] + " (+" + (classes.length - 1) + " others)"; - } - - @Override - public String getToolTipText(Object item) { - CSSStylableElement element = CssSpyPart.getCSSElement(item); - if (element == null) { - return null; - } - StringBuilder sb = new StringBuilder(); - sb.append(element.getLocalName()).append(" (").append(element.getNamespaceURI()).append(")"); - if (element.getCSSClass() != null) { - sb.append("\nClasses:\n "); - Util.join(sb, element.getCSSClass().split(" +"), "\n "); - } - return sb.toString(); - } - }); - - TreeViewerColumn widgetIdColumn = new TreeViewerColumn(widgetTreeViewer, SWT.NONE); - widgetIdColumn.getColumn().setWidth(100); - widgetIdColumn.getColumn().setText("CSS Id"); - widgetIdColumn.setLabelProvider(new ColumnLabelProvider() { - @Override - public String getText(Object item) { - CSSStylableElement element = CssSpyPart.getCSSElement(item); - return element.getCSSId(); - } - }); - - TreeColumnLayout widgetsTableLayout = new TreeColumnLayout(); - widgetsTableLayout.setColumnData(widgetTypeColumn.getColumn(), new ColumnWeightData(50)); - widgetsTableLayout.setColumnData(widgetIdColumn.getColumn(), new ColumnWeightData(40)); - widgetsTableLayout.setColumnData(widgetClassColumn.getColumn(), new ColumnWeightData(40)); - widgetsComposite.setLayout(widgetsTableLayout); - - // / HEADERS - Composite container = new Composite(sashForm, SWT.NONE); - container.setLayout(new GridLayout(2, true)); - - Label lblCssProperties = new Label(container, SWT.NONE); - lblCssProperties.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1)); - lblCssProperties.setText("CSS Properties"); - - Label lblCssRules = new Label(container, SWT.NONE); - lblCssRules.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1)); - lblCssRules.setText("CSS Rules"); - - // // THE CSS PROPERTIES TABLE - Composite propsComposite = new Composite(container, SWT.BORDER); - GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1); - gridData.minimumHeight = 50; - propsComposite.setLayoutData(gridData); - - cssPropertiesViewer = new TableViewer(propsComposite, - SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION); - cssPropertiesViewer.setContentProvider(new CSSPropertiesContentProvider()); - cssPropertiesViewer.getTable().setLinesVisible(true); - cssPropertiesViewer.getTable().setHeaderVisible(true); - cssPropertiesViewer.setComparator(new ViewerComparator()); - - final TextCellEditor textCellEditor = new TextCellEditor(cssPropertiesViewer.getTable()); - TableViewerEditor.create(cssPropertiesViewer, - new TableViewerFocusCellManager(cssPropertiesViewer, - new FocusCellOwnerDrawHighlighter(cssPropertiesViewer)), - new ColumnViewerEditorActivationStrategy(cssPropertiesViewer), - ColumnViewerEditor.TABBING_HORIZONTAL | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR - | ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION); - - TableViewerColumn propName = new TableViewerColumn(cssPropertiesViewer, SWT.NONE); - propName.getColumn().setWidth(100); - propName.getColumn().setText("Property"); - propName.setLabelProvider(new ColumnLabelProvider() { - @Override - public String getText(Object element) { - return ((CSSPropertyProvider) element).getPropertyName(); - } - }); - - TableViewerColumn propValue = new TableViewerColumn(cssPropertiesViewer, SWT.NONE); - propValue.getColumn().setWidth(100); - propValue.getColumn().setText("Value"); - propValue.setLabelProvider(new ColumnLabelProvider() { - @Override - public String getText(Object element) { - try { - return ((CSSPropertyProvider) element).getValue(); - } catch (Exception e) { - System.err.println("Error fetching property: " + element + ": " + e); - return null; - } - } - }); - propValue.setEditingSupport(new EditingSupport(cssPropertiesViewer) { - @Override - protected CellEditor getCellEditor(Object element) { - // do the fancy footwork here to return an appropriate - // editor to - // the value-type - return textCellEditor; - } - - @Override - protected boolean canEdit(Object element) { - return true; - } - - @Override - protected Object getValue(Object element) { - try { - String value = ((CSSPropertyProvider) element).getValue(); - return value == null ? "" : value; - } catch (Exception e) { - return ""; - } - } - - @Override - protected void setValue(Object element, Object value) { - try { - if (value == null || ((String) value).trim().length() == 0) { - return; - } - CSSPropertyProvider provider = (CSSPropertyProvider) element; - provider.setValue((String) value); - } catch (Exception e) { - MessageDialog.openError(activeShell, "Error", "Unable to set property:\n\n" + e.getMessage()); - } - cssPropertiesViewer.update(element, null); - } - }); - - TableColumnLayout propsTableLayout = new TableColumnLayout(); - propsTableLayout.setColumnData(propName.getColumn(), new ColumnWeightData(50)); - propsTableLayout.setColumnData(propValue.getColumn(), new ColumnWeightData(50)); - propsComposite.setLayout(propsTableLayout); - - // / THE CSS RULES - cssRules = new Text(container, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI); - cssRules.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); - - // / THE CSS PROPERTIES TABLE (again) - showUnsetProperties = new Button(container, SWT.CHECK); - showUnsetProperties.setText("Show unset properties"); - showCssFragment = new Button(container, SWT.PUSH); - showCssFragment.setText("Show CSS fragment"); - showCssFragment.setToolTipText("Generates CSS rule block for the selected widget"); - - // and for balance - new Label(container, SWT.NONE); - - // / The listeners - - cssSearchBox.addModifyListener(new ModifyListener() { - private Runnable updater; - private IProgressMonitor monitor; - - @Override - public void modifyText(ModifyEvent e) { - if (monitor != null) { - monitor.setCanceled(false); - } - display.timerExec(200, updater = new Runnable() { - @Override - public void run() { - if (updater == this) { - performCSSSearch(monitor = new NullProgressMonitor()); - } - } - }); - } - }); - cssSearchBox.addKeyListener(new KeyAdapter() { - @Override - public void keyPressed(KeyEvent e) { - if (e.keyCode == SWT.ARROW_DOWN && (e.stateMask & SWT.MODIFIER_MASK) == 0) { - widgetTreeViewer.getControl().setFocus(); - } - } - }); - - widgetTreeViewer.addSelectionChangedListener(event -> { - updateForWidgetSelection(event.getSelection()); - showCssFragment.setEnabled(!event.getSelection().isEmpty()); - }); - if (isLive()) { - container.addMouseMoveListener(e -> { - if (followSelection.getSelection()) { - update(); - } - } - ); - } - - showAllShells.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - updateWidgetTreeInput(); - } - }); - - outer.addDisposeListener(e -> dispose()); - - showUnsetProperties.setSelection(true); - showUnsetProperties.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (showUnsetProperties.getSelection()) { - cssPropertiesViewer.removeFilter(unsetPropertyFilter); - } else { - cssPropertiesViewer.addFilter(unsetPropertyFilter); - } - } - }); - - showCssFragment.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - showCssFragment(); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - } - }); - - sashForm.setWeights(new int[] { 50, 50 }); - widgetTreeViewer.getControl().setFocus(); - - return outer; - } - - /** - * This method listen to current part and adapt the contents of spy part. - */ - @Inject - protected void reactOnActivate(@Named(IServiceConstants.ACTIVE_PART) MPart p, MPart cssPart, - @Named(IServiceConstants.ACTIVE_SHELL) Shell s) { - if (followSelection == null || !followSelection.getSelection()) { - return; - } - if (outer == null) { - // Do nothing if no UI created. - return; - } - activeShell = s; - - // Check if control is in the css spy part shell. - Control control = display.getCursorControl(); - - Shell controlShell = (control == null) ? display.getActiveShell() : control.getShell(); - Shell spyPartShell = outer.getShell(); - - if (p != cssPart) { - // Must remove the highlights if selected - disposeHighlights(); - - } else if (spyPartShell != controlShell) { - // A widget has been selected in another shell.. We can display the - // corresponding control as a specimen - shown = null; - setSpecimen(control); - } - - } - - protected void showCssFragment() { - if (!(widgetTreeViewer.getSelection() instanceof IStructuredSelection) - || widgetTreeViewer.getSelection().isEmpty()) { - return; - } - - StringBuilder sb = new StringBuilder(); - for (Object o : ((IStructuredSelection) widgetTreeViewer.getSelection()).toArray()) { - if (o instanceof Widget) { - if (sb.length() > 0) { - sb.append('\n'); - } - addCssFragment((Widget) o, sb); - } - } - TextPopupDialog tpd = new TextPopupDialog(widgetTreeViewer.getControl().getShell(), "CSS", sb.toString(), true, - "Escape to dismiss"); - tpd.open(); - } - - private void addCssFragment(Widget w, StringBuilder sb) { - CSSStylableElement element = getCSSElement(w); - if (element == null) { - return; - } - - sb.append(element.getLocalName()); - if (element.getCSSId() != null) { - sb.append("#").append(element.getCSSId()); - } - sb.append(" {"); - - CSSEngine engine = getCSSEngine(element); - // we first check the viewCSS and then the property values - CSSStyleDeclaration decl = engine.getViewCSS().getComputedStyle(element, null); - - List<String> propertyNames = new ArrayList<>(engine.getCSSProperties(element)); - Collections.sort(propertyNames); - - int count = 0; - - // First list the generated properties - for (Iterator<String> iter = propertyNames.iterator(); iter.hasNext();) { - String propertyName = iter.next(); - String genValue = trim(engine.retrieveCSSProperty(element, propertyName, "")); - String declValue = null; - - if (genValue == null) { - continue; - } - - if (decl != null) { - CSSValue cssValue = decl.getPropertyCSSValue(propertyName); - if (cssValue != null) { - declValue = trim(cssValue.getCssText()); - } - } - if (count == 0) { - sb.append("\n /* actual values */"); - } - sb.append("\n ").append(propertyName).append(": ").append(genValue).append(";"); - if (declValue != null) { - sb.append("\t/* declared in CSS: ").append(declValue).append(" */"); - } - count++; - iter.remove(); // remove so we don't re-report below - } - - // then list any declared properties; generated properties already - // removed - if (decl != null) { - int declCount = 0; - for (String propertyName : propertyNames) { - String declValue = null; - CSSValue cssValue = decl.getPropertyCSSValue(propertyName); - if (cssValue != null) { - declValue = trim(cssValue.getCssText()); - } - if (declValue == null) { - continue; - } - if (declCount == 0) { - sb.append("\n\n /* declared in CSS rules */"); - } - sb.append("\n ").append(propertyName).append(": ").append(declValue).append(";"); - count++; - declCount++; - } - } - sb.append(count > 0 ? "\n}" : "}"); - } - - /** Trim the string; return null if empty */ - private String trim(String s) { - if (s == null) { - return null; - } - s = s.trim(); - return s.length() > 0 ? s : null; - } - - protected void performCSSSearch(IProgressMonitor progress) { - List<Widget> widgets = new ArrayList<>(); - performCSSSearch(progress, cssSearchBox.getText(), widgets); - if (!progress.isCanceled()) { - revealAndSelect(widgets); - } - } - - private void performCSSSearch(IProgressMonitor monitor, String text, Collection<Widget> results) { - if (text.trim().length() == 0) { - return; - } - widgetTreeViewer.collapseAll(); - Object[] roots = widgetTreeProvider.getElements(widgetTreeViewer.getInput()); - monitor.beginTask("Searching for \"" + text + "\"", roots.length * 10); - for (Object root : roots) { - if (monitor.isCanceled()) { - return; - } - - CSSStylableElement element = getCSSElement(root); - if (element == null) { - continue; - } - - CSSEngine engine = getCSSEngine(root); - try { - SelectorList selectors = engine.parseSelectors(text); - monitor.worked(2); - processCSSSearch(new SubProgressMonitor(monitor, 8), engine, selectors, element, null, results); - } catch (CSSParseException | IOException e) { - System.out.println(e.toString()); - } - } - monitor.done(); - } - - private void processCSSSearch(IProgressMonitor monitor, CSSEngine engine, SelectorList selectors, - CSSStylableElement element, String pseudo, Collection<Widget> results) { - if (monitor.isCanceled()) { - return; - } - NodeList children = element.getChildNodes(); - monitor.beginTask("Searching", 5 + 5 * children.getLength()); - boolean matched = false; - for (int i = 0; i < selectors.getLength(); i++) { - if (matched = engine.matches(selectors.item(i), element, pseudo)) { - break; - } - } - if (matched) { - results.add((Widget) element.getNativeWidget()); - } - monitor.worked(5); - for (int i = 0; i < children.getLength(); i++) { - if (monitor.isCanceled()) { - return; - } - processCSSSearch(new SubProgressMonitor(monitor, 5), engine, selectors, - (CSSStylableElement) children.item(i), pseudo, results); - } - monitor.done(); - } - - protected void dispose() { - disposeHighlights(); - } - -} diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/TextPopupDialog.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/TextPopupDialog.java deleted file mode 100644 index 32174c38..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/TextPopupDialog.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.eclipse.e4.tools.css.spy; - -import org.eclipse.jface.dialogs.PopupDialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -public class TextPopupDialog extends PopupDialog { - - private String content; - private boolean contentEditable; - - public TextPopupDialog(Shell shell, String title, String content, boolean editable, String infoText) { - super(shell, SWT.RESIZE | SWT.ON_TOP, true, true, true, false, false, title, infoText); - this.content = content; - this.contentEditable = editable; - } - - @Override - protected Control createDialogArea(Composite parent) { - Composite container = (Composite) super.createDialogArea(parent); - int styleBits = SWT.MULTI | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL; - if (!contentEditable) { - styleBits |= SWT.READ_ONLY; - } - Text textWidget = new Text(container, styleBits); - textWidget.setText(content); - return container; - } - -} diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/Util.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/Util.java deleted file mode 100644 index 9ff2b11b..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/Util.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011, 2016 Manumitting Technologies, Inc. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Brian de Alwis (MT) - initial API and implementation - * Lars Vogel <Lars.Vogel@vogella.com> - Bug 509506 - *******************************************************************************/ -package org.eclipse.e4.tools.css.spy; - -public class Util { - - public static void join(StringBuilder sb, String[] elements, String glue) { - for (int i = 0; i < elements.length; i++) { - sb.append(elements[i]); - if (i < elements.length - 1) { - sb.append(glue); - } - } - } -} diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/WidgetTreeProvider.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/WidgetTreeProvider.java deleted file mode 100644 index 9b2cef03..00000000 --- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/WidgetTreeProvider.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Manumitting Technologies, Inc. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Brian de Alwis (MT) - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.css.spy; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.e4.ui.css.core.dom.CSSStylableElement; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.swt.custom.CTabItem; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.ToolItem; -import org.w3c.dom.NodeList; - -public class WidgetTreeProvider implements ITreeContentProvider { - private static final Object[] EMPTY_ARRAY = new Object[0]; - - @Override - public Object[] getElements(Object inputElement) { - if (inputElement instanceof Object[]) { - return (Object[]) inputElement; - } else if (inputElement instanceof Collection<?>) { - return ((Collection<?>) inputElement).toArray(); - } - return getChildren(inputElement); - } - - @Override - public Object[] getChildren(Object parentElement) { - if (parentElement instanceof Display) { - List<Shell> shells = new ArrayList<>(); - for (Shell s : ((Display) parentElement).getShells()) { - if (!s.isDisposed()) { - shells.add(s); - } - } - return shells.toArray(); - } - CSSStylableElement element = CssSpyPart.getCSSElement(parentElement); - if (element == null) { - return EMPTY_ARRAY; - } - NodeList kids = element.getChildNodes(); - ArrayList<Object> children = new ArrayList<>(kids.getLength()); - for (int i = 0; i < kids.getLength(); i++) { - children.add(((CSSStylableElement) kids.item(i)).getNativeWidget()); - } - return children.toArray(); - } - - @Override - public Object getParent(Object element) { - if (element instanceof Control) { - Control control = (Control) element; - return control.isDisposed() ? null : control.getParent(); - } else if (element instanceof CTabItem) { - return ((CTabItem) element).getParent(); - } else if (element instanceof ToolItem) { - return ((ToolItem) element).getParent(); - } - return null; - } - - @Override - public boolean hasChildren(Object element) { - return getChildren(element).length > 0; - } - -} diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/.classpath b/bundles/org.eclipse.e4.tools.emf.ui.script.js/.classpath deleted file mode 100644 index ad32c83a..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/.project b/bundles/org.eclipse.e4.tools.emf.ui.script.js/.project deleted file mode 100644 index 84e8de71..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/.project +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.e4.tools.emf.ui.script.js</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ds.core.builder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.e4.tools.emf.ui.script.js/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.tools.emf.ui.script.js/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 0eedf3d2..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Wed Mar 09 00:55:47 CET 2011 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.tools.emf.ui.script.js/META-INF/MANIFEST.MF deleted file mode 100644 index 99e8a9c6..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/META-INF/MANIFEST.MF +++ /dev/null @@ -1,22 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Js -Bundle-SymbolicName: org.eclipse.e4.tools.emf.ui.script.js;singleton:=true -Bundle-Version: 0.12.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Require-Bundle: org.eclipse.e4.tools.emf.ui;bundle-version="0.9.0", - org.eclipse.jface;bundle-version="3.7.0", - org.mozilla.javascript;bundle-version="1.7.2", - org.eclipse.e4.ui.services;bundle-version="0.9.1", - org.eclipse.e4.core.contexts;bundle-version="0.9.0", - org.eclipse.e4.core.services;bundle-version="0.9.1", - org.eclipse.e4.core.di;bundle-version="0.9.0", - org.eclipse.osgi;bundle-version="3.7.0", - org.eclipse.jface.text;bundle-version="3.7.0", - org.eclipse.e4.tools.services;bundle-version="0.11.0" -Bundle-ActivationPolicy: lazy -Service-Component: OSGI-INF/resourceprovider.xml -Import-Package: javax.inject;version="1.0.0" -Export-Package: org.eclipse.e4.tools.emf.ui.script.js;x-internal:=true, - org.eclipse.e4.tools.emf.ui.script.js.text;x-internal:=true, - org.eclipse.e4.tools.emf.ui.script.js.text.scanners;x-internal:=true diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/OSGI-INF/resourceprovider.xml b/bundles/org.eclipse.e4.tools.emf.ui.script.js/OSGI-INF/resourceprovider.xml deleted file mode 100644 index 51ac6121..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/OSGI-INF/resourceprovider.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.e4.tools.emf.ui.script.js"> - <implementation class="org.eclipse.e4.tools.emf.ui.script.js.ResourceProvider"/> - <service> - <provide interface="org.eclipse.e4.tools.services.IResourceProviderService"/> - </service> - <properties entry="OSGI-INF/resources.properties"/> -</scr:component> diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/OSGI-INF/resources.properties b/bundles/org.eclipse.e4.tools.emf.ui.script.js/OSGI-INF/resources.properties deleted file mode 100644 index 3265af20..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/OSGI-INF/resources.properties +++ /dev/null @@ -1,15 +0,0 @@ -IMG_org.eclipse.e4.tools.emf.ui.script.js.wizban_javascript = /icons/full/wizban/newsbook_wiz.png - -COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_multi_line_comment = rgb(102,153,102) -COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_single_line_comment = rgb(102,153,102) -COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_string = rgb(51,0,255) -COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_doc_default = rgb(51,102,204) -COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_doc_keyword = rgb(51,102,204) -COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_doc_link = rgb(255,0,255) -COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_doc_tag = rgb(255,255,0) -COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_comment_task_tag = rgb(255,100,0) -COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_keyword = rgb(153,51,102) -COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_default = rgb(0,0,0) -COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_keyword_return = rgb(153,51,102) -COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_operator = rgb(0,0,0) -COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_bracket = rgb(0,0,0)
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/build.properties b/bundles/org.eclipse.e4.tools.emf.ui.script.js/build.properties deleted file mode 100644 index bbb39d9d..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - OSGI-INF/,\ - icons/ -source.. = src/ diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/forceQualifierUpdate.txt b/bundles/org.eclipse.e4.tools.emf.ui.script.js/forceQualifierUpdate.txt deleted file mode 100644 index 396f0875..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/forceQualifierUpdate.txt +++ /dev/null @@ -1,2 +0,0 @@ -# To force a version qualifier update add the bug here -Bug 403237 - o.e.e4.tools cannot be build with "mvn clean install" diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/icons/full/wizban/newsbook_wiz.png b/bundles/org.eclipse.e4.tools.emf.ui.script.js/icons/full/wizban/newsbook_wiz.png Binary files differdeleted file mode 100644 index cd3b1629..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/icons/full/wizban/newsbook_wiz.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/plugin.xml b/bundles/org.eclipse.e4.tools.emf.ui.script.js/plugin.xml deleted file mode 100644 index b693455e..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/plugin.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.4"?> -<plugin> - <extension - point="org.eclipse.e4.tools.emf.ui.scripting"> - <scripting - class="org.eclipse.e4.tools.emf.ui.script.js.JavaScriptSupport" - label="JavaScript"> - </scripting> - </extension> - -</plugin> diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/pom.xml b/bundles/org.eclipse.e4.tools.emf.ui.script.js/pom.xml deleted file mode 100644 index 416cc214..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.eclipse.e4.tools</groupId> - <artifactId>e4-tools-aggregator</artifactId> - <version>0.18.0-SNAPSHOT</version> - <relativePath>../../</relativePath> - </parent> - - <groupId>org.eclipse.e4</groupId> - <artifactId>org.eclipse.e4.tools.emf.ui.script.js</artifactId> - <version>0.12.0-SNAPSHOT</version> - <packaging>eclipse-plugin</packaging> - -</project> diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/JavaScriptSupport.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/JavaScriptSupport.java deleted file mode 100644 index e96205a6..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/JavaScriptSupport.java +++ /dev/null @@ -1,309 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 BestSolution.at and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation - ******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.lang.annotation.Annotation; -import java.text.SimpleDateFormat; -import java.util.Date; - -import org.eclipse.e4.core.contexts.ContextInjectionFactory; -import org.eclipse.e4.core.contexts.IEclipseContext; -import org.eclipse.e4.core.di.annotations.Execute; -import org.eclipse.e4.tools.emf.ui.common.IScriptingSupport; -import org.eclipse.e4.tools.emf.ui.script.js.text.JavaScriptEditor; -import org.eclipse.e4.tools.services.IResourcePool; -import org.eclipse.e4.ui.services.IStylingEngine; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.TitleAreaDialog; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.Widget; -import org.mozilla.javascript.Context; -import org.mozilla.javascript.Scriptable; -import org.mozilla.javascript.ScriptableObject; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; -import org.osgi.service.packageadmin.PackageAdmin; - -@SuppressWarnings({ "restriction", "deprecation" }) -public class JavaScriptSupport implements IScriptingSupport { - @Override - public void openEditor(Shell shell, final Object mainElement, final IEclipseContext context) { - final IEclipseContext childContext = context.createChild(); - - TitleAreaDialog dialog = new TitleAreaDialog(shell) { - private JavaScriptEditor editor; - private Logger logger; - - @Override - protected Control createDialogArea(Composite parent) { - Composite container = (Composite) super.createDialogArea(parent); - logger = new Logger(getShell()); - getShell().setText("Execute JavaScript"); - setTitle("Execute JavaScript"); - setMessage("Enter some JavaScript and execute it"); - setTitleImage(childContext.get(IResourcePool.class).getImageUnchecked(ResourceProvider.IMG_WIZBAN_JAVASCRIPT)); - - childContext.set(Composite.class, container); - - editor = ContextInjectionFactory.make(JavaScriptEditor.class, childContext); - GridData gd = new GridData(GridData.FILL_BOTH); - gd.minimumHeight = 350; - gd.minimumWidth = 400; - editor.getControl().setLayoutData(gd); - return container; - } - - @Override - protected void okPressed() { - execute(logger, mainElement, context, editor.getContent()); - } - - - @Override - protected Button createButton(Composite parent, int id, - String label, boolean defaultButton) { - return super.createButton(parent, id, id == IDialogConstants.OK_ID ? "Execute" : label, defaultButton); - } - }; - - dialog.open(); - childContext.dispose(); - } - - private void execute(Logger logger, Object mainElement, IEclipseContext context, String script) { - Context cx = Context.enter(); - Scriptable sc = cx.initStandardObjects(); - - ScriptableObject.putProperty(sc, "mainObject", mainElement); - ScriptableObject.putProperty(sc, "eclipseContext", context); - ScriptableObject.putProperty(sc, "swt", new SWTSupport(Display.getCurrent())); - ScriptableObject.putProperty(sc, "service", new ServiceProvider(context)); - ScriptableObject.putProperty(sc, "di", new DiProvider(context)); - ScriptableObject.putProperty(sc, "log", logger); - - try { - cx.evaluateString(sc, script, "<cmd>", 1, null); - } catch (Exception e) { - try { - logger.error(e); - } catch (Exception e1) { - } - } - } - - public static class DiProvider { - private IEclipseContext context; - private PackageAdmin packageAdmin; - - public DiProvider(IEclipseContext context) { - this.context = context; - } - - public Object newInstance(String bundlename, String className) throws ClassNotFoundException { - Bundle bundle = getBundle(bundlename); - if( bundle != null ) { - Class<?> clazz = bundle.loadClass(className); - return ContextInjectionFactory.make(clazz, context); - } - return new IllegalArgumentException("Bundle '"+bundlename+"' is not known"); - } - - public Object execute(Object object) { - return ContextInjectionFactory.invoke(object, Execute.class, context); - } - - public Object invokeByAnnotation(Object object, String bundlename, String className) throws ClassNotFoundException { - Bundle bundle = getBundle(bundlename); - if( bundle != null ) { - @SuppressWarnings("unchecked") - Class<? extends Annotation> clazz = (Class<? extends Annotation>) bundle.loadClass(className); - return ContextInjectionFactory.invoke(object, clazz, context); - } - return new IllegalArgumentException("Bundle '"+bundlename+"' is not known"); - } - - private Bundle getBundle(String bundlename) { - if( packageAdmin == null ) { - Bundle bundle = FrameworkUtil.getBundle(getClass()); - BundleContext context = bundle.getBundleContext(); - ServiceReference<PackageAdmin> reference = context.getServiceReference(PackageAdmin.class); - packageAdmin = context.getService(reference); - } - - Bundle[] bundles = packageAdmin.getBundles(bundlename, null); - if (bundles == null) - return null; - // Return the first bundle that is not installed or uninstalled - for (int i = 0; i < bundles.length; i++) { - if ((bundles[i].getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) { - return bundles[i]; - } - } - return null; - } - } - - public static class ServiceProvider { - private IEclipseContext context; - - public ServiceProvider(IEclipseContext context) { - this.context = context; - } - - public Object getStyleEngine() { - return context.get(IStylingEngine.class); - } - - public Object getPartService() { - return context.get("org.eclipse.e4.ui.workbench.modeling.EPartService"); - } - - public Object getModelService() { - return context.get("org.eclipse.e4.ui.workbench.modeling.EModelService"); - } - } - - public static class Logger { - private Shell parentShell; - - private Shell shell; - private Text text; - - private static SimpleDateFormat DATEFORMAT = new SimpleDateFormat("hh:mm:ss.SSS"); - - public Logger(Shell parentShell) { - this.parentShell = parentShell; - } - - public void openLog() { - if( shell == null ) { - shell = new Shell(parentShell,SWT.SHELL_TRIM); - shell.setLayout(new GridLayout()); - text = new Text(shell, SWT.MULTI|SWT.BORDER|SWT.V_SCROLL|SWT.H_SCROLL); - text.setLayoutData(new GridData(GridData.FILL_BOTH)); - text.setFont(JFaceResources.getTextFont()); - text.setEditable(false); - shell.setVisible(true); - shell.addDisposeListener(new DisposeListener() { - - @Override - public void widgetDisposed(DisposeEvent e) { - shell = null; - text = null; - } - }); - } - } - - public void error(Object data) throws Exception { - _log(1, data); - } - - public void debug(Object data) throws Exception { - _log(0, data); - } - - private void _log(int type, Object data) throws Exception { - if( shell == null ) { - openLog(); - } - shell.setVisible(true); - if( data instanceof Throwable ) { - StringWriter w = new StringWriter(); - PrintWriter pw = new PrintWriter(w); - ((Throwable)data).printStackTrace(pw); - text.append(DATEFORMAT.format(new Date()) + " - " + w + "\n"); - pw.close(); - w.close(); - } else { - text.append(DATEFORMAT.format(new Date()) + " - " + data + "\n"); - } - - } - - public void clearLog() { - if( text != null ) { - text.setText(""); - } - } - - public void closeLog() { - shell.dispose(); - shell = null; - text = null; - } - } - - public static class SWTSupport { - private Display d; - - public static SWT SWT = new SWT(); - - public SWTSupport(Display d) { - this.d = d; - } - - public Color newColor(String color) { - if( color.startsWith("#") ) { - if( color.length() == 7 ) { - return new Color(d, new RGB( - Integer.parseInt(color.substring(1,3), 16), - Integer.parseInt(color.substring(3,5), 16), - Integer.parseInt(color.substring(5,7), 16))); - } else { - return new Color(d, new RGB( - Integer.parseInt( color.charAt(1) + "" +color.charAt(1), 16), - Integer.parseInt( color.charAt(2) + "" +color.charAt(2), 16), - Integer.parseInt( color.charAt(3) + "" +color.charAt(3), 16))); - } - } - return null; - } - - public Text newText(Composite parent, int style) { - return new Text(parent, style); - } - - public Widget newLabel(Composite parent, int style) { - return new Label(parent, style); - } - - public GridData newGridData() { - return new GridData(); - } - - public Combo newCombo(Composite parent, int style) { - return new Combo(parent, style); - } - } -} diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/ResourceProvider.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/ResourceProvider.java deleted file mode 100644 index 9e84b5b7..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/ResourceProvider.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 BestSolution.at - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js; - -import org.eclipse.e4.tools.services.BasicResourceProvider; - -public class ResourceProvider extends BasicResourceProvider { - public static String IMG_WIZBAN_JAVASCRIPT = "IMG_org.eclipse.e4.tools.emf.ui.script.js.wizban_javascript"; - - public static String JAVA_KEYWORD = "COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_keyword"; //$NON-NLS-1$ - - public static String JAVA_DEFAULT = "COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_default"; //$NON-NLS-1$ - - public static String JAVA_KEYWORD_RETURN = "COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_keyword_return"; //$NON-NLS-1$ - - public static String JAVA_OPERATOR = "COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_operator"; //$NON-NLS-1$ - - public static String JAVA_BRACKET = "COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_bracket"; //$NON-NLS-1$ - - public static String TASK_TAG = "COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_comment_task_tag"; //$NON-NLS-1$ - - public static String JAVA_MULTI_LINE_COMMENT = "COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_multi_line_comment"; //$NON-NLS-1$ - - public static String JAVA_SINGLE_LINE_COMMENT = "COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_single_line_comment"; //$NON-NLS-1$ - - public static String JAVA_STRING = "COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_string"; //$NON-NLS-1$ - - public static String JAVADOC_KEYWORD = "COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_doc_keyword"; //$NON-NLS-1$ - - public static String JAVADOC_TAG = "COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_doc_tag"; //$NON-NLS-1$ - - public static String JAVADOC_LINK = "COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_doc_link"; //$NON-NLS-1$ - - public static String JAVADOC_DEFAULT = "COLOR_org.eclipse.e4.tools.emf.ui.script.js.java_doc_default"; //$NON-NLS-1$ -} diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/JavaScriptEditor.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/JavaScriptEditor.java deleted file mode 100644 index ad9fbb4b..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/JavaScriptEditor.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 BestSolution.at - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js.text; - -import javax.inject.Inject; - -import org.eclipse.e4.tools.emf.ui.script.js.ResourceProvider; -import org.eclipse.e4.tools.emf.ui.script.js.text.scanners.IJavaScriptPartitions; -import org.eclipse.e4.tools.emf.ui.script.js.text.scanners.JavaScriptSourceViewerConfiguration; -import org.eclipse.e4.tools.emf.ui.script.js.text.scanners.JavaScriptTextTools; -import org.eclipse.e4.tools.emf.ui.script.js.text.scanners.PreferenceConstants; -import org.eclipse.e4.tools.services.IResourcePool; -import org.eclipse.jface.preference.PreferenceStore; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.jface.text.source.VerticalRuler; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -public class JavaScriptEditor { - private static final int VERTICAL_RULER_WIDTH = 12; - - private static PreferenceStore store = new PreferenceStore(); - - private Document document; - - private SourceViewer viewer; - - static { - store.setDefault(ResourceProvider.JAVADOC_KEYWORD+PreferenceConstants.EDITOR_BOLD_SUFFIX, true); - store.setDefault(ResourceProvider.JAVA_KEYWORD+PreferenceConstants.EDITOR_BOLD_SUFFIX, true); - store.setDefault(ResourceProvider.JAVA_KEYWORD_RETURN+PreferenceConstants.EDITOR_BOLD_SUFFIX, true); - } - - @Inject - public JavaScriptEditor(Composite parent, IResourcePool pool) { - this.document = new Document(); - VerticalRuler verticalRuler = new VerticalRuler(VERTICAL_RULER_WIDTH); - - int styles= SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION; - viewer = new SourceViewer(parent, verticalRuler, styles); - - Font f = null; - if( ! JFaceResources.getFontRegistry().hasValueFor("JavaEditorFont") ) { - if( SWT.getPlatform().equals("carbon") || SWT.getPlatform().equals("cocoa") ) { - JFaceResources.getFontRegistry().put("JavaEditorFont", new FontData[] {new FontData("Monaco",11,SWT.NONE)}); - } - } - - f = JFaceResources.getFontRegistry().get("JavaEditorFont"); - viewer.getTextWidget().setFont(f); - - JavaScriptTextTools textTools = new JavaScriptTextTools(pool, store); - viewer.configure(new JavaScriptSourceViewerConfiguration(textTools)); - - textTools.setupJavaDocumentPartitioner(document, IJavaScriptPartitions.JAVA_PARTITIONING); - viewer.setDocument(document); - } - - public Control getControl() { - return viewer.getControl(); - } - - public String getContent() { - return document.get(); - } -} diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/AbstractJavaScanner.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/AbstractJavaScanner.java deleted file mode 100644 index 4b47b906..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/AbstractJavaScanner.java +++ /dev/null @@ -1,357 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.e4.tools.services.IResourcePool; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.resource.StringConverter; -import org.eclipse.jface.text.TextAttribute; -import org.eclipse.jface.text.rules.BufferedRuleBasedScanner; -import org.eclipse.jface.text.rules.IRule; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.Token; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; - - -/** - * Initialized with a color manager and a preference store, its subclasses are - * only responsible for providing a list of preference keys for based on which tokens - * are generated and to use this tokens to define the rules controlling this scanner. - * <p> - * This scanner stores the color defined by the color preference key into - * the color manager under the same key. - * </p> - * <p> - * Preference color key + {@link PreferenceConstants#EDITOR_BOLD_SUFFIX} are used - * to retrieve whether the token is rendered in bold. - * </p> - * <p> - * Preference color key + {@link PreferenceConstants#EDITOR_ITALIC_SUFFIX} are used - * to retrieve whether the token is rendered in italic. - * </p> - * <p> - * Preference color key + {@link PreferenceConstants#EDITOR_STRIKETHROUGH_SUFFIX} are used - * to retrieve whether the token is rendered in strikethrough. - * </p> - * <p> - * Preference color key + {@link PreferenceConstants#EDITOR_UNDERLINE_SUFFIX} are used - * to retrieve whether the token is rendered in underline. - * </p> - */ -public abstract class AbstractJavaScanner extends BufferedRuleBasedScanner { - - - private IResourcePool fColorManager; - private IPreferenceStore fPreferenceStore; - - private Map<String,Token> fTokenMap= new HashMap<String,Token>(); - private String[] fPropertyNamesColor; - /** - * Preference keys for boolean preferences which are <code>true</code>, - * iff the corresponding token should be rendered bold. - */ - private String[] fPropertyNamesBold; - /** - * Preference keys for boolean preferences which are <code>true</code>, - * iff the corresponding token should be rendered italic. - * - * @since 3.0 - */ - private String[] fPropertyNamesItalic; - /** - * Preference keys for boolean preferences which are <code>true</code>, - * iff the corresponding token should be rendered strikethrough. - * - * @since 3.1 - */ - private String[] fPropertyNamesStrikethrough; - /** - * Preference keys for boolean preferences which are <code>true</code>, - * iff the corresponding token should be rendered underline. - * - * @since 3.1 - */ - private String[] fPropertyNamesUnderline; - - - private boolean fNeedsLazyColorLoading; - - /** - * Returns an array of preference keys which define the tokens - * used in the rules of this scanner. - * <p> - * The preference key is used access the color in the preference - * store and in the color manager. - * </p> - * <p> - * Preference key + {@link PreferenceConstants#EDITOR_BOLD_SUFFIX} is used - * to retrieve whether the token is rendered in bold. - * </p> - * <p> - * Preference key + {@link PreferenceConstants#EDITOR_ITALIC_SUFFIX} is used - * to retrieve whether the token is rendered in italic. - * </p> - * <p> - * Preference key + {@link PreferenceConstants#EDITOR_UNDERLINE_SUFFIX} is used - * to retrieve whether the token is rendered underlined. - * </p> - * <p> - * Preference key + {@link PreferenceConstants#EDITOR_STRIKETHROUGH_SUFFIX} is used - * to retrieve whether the token is rendered stricken out. - * </p> - */ - abstract protected String[] getTokenProperties(); - - /** - * Creates the list of rules controlling this scanner. - */ - abstract protected List<IRule> createRules(); - - - /** - * Creates an abstract Java scanner. - */ - public AbstractJavaScanner(IResourcePool manager, IPreferenceStore store) { - super(); - fColorManager= manager; - fPreferenceStore= store; - } - - /** - * Must be called after the constructor has been called. - */ - public final void initialize() { - - fPropertyNamesColor= getTokenProperties(); - int length= fPropertyNamesColor.length; - fPropertyNamesBold= new String[length]; - fPropertyNamesItalic= new String[length]; - fPropertyNamesStrikethrough= new String[length]; - fPropertyNamesUnderline= new String[length]; - - for (int i= 0; i < length; i++) { - fPropertyNamesBold[i]= getBoldKey(fPropertyNamesColor[i]); - fPropertyNamesItalic[i]= getItalicKey(fPropertyNamesColor[i]); - fPropertyNamesStrikethrough[i]= getStrikethroughKey(fPropertyNamesColor[i]); - fPropertyNamesUnderline[i]= getUnderlineKey(fPropertyNamesColor[i]); - } - - fNeedsLazyColorLoading= Display.getCurrent() == null; - for (int i= 0; i < length; i++) { - if (fNeedsLazyColorLoading) - addTokenWithProxyAttribute(fPropertyNamesColor[i], fPropertyNamesBold[i], fPropertyNamesItalic[i], fPropertyNamesStrikethrough[i], fPropertyNamesUnderline[i]); - else - addToken(fPropertyNamesColor[i], fPropertyNamesBold[i], fPropertyNamesItalic[i], fPropertyNamesStrikethrough[i], fPropertyNamesUnderline[i]); - } - - initializeRules(); - } - - protected String getBoldKey(String colorKey) { - return colorKey + PreferenceConstants.EDITOR_BOLD_SUFFIX; - } - - protected String getItalicKey(String colorKey) { - return colorKey + PreferenceConstants.EDITOR_ITALIC_SUFFIX; - } - - protected String getStrikethroughKey(String colorKey) { - return colorKey + PreferenceConstants.EDITOR_STRIKETHROUGH_SUFFIX; - } - - protected String getUnderlineKey(String colorKey) { - return colorKey + PreferenceConstants.EDITOR_UNDERLINE_SUFFIX; - } - - @Override - public IToken nextToken() { - if (fNeedsLazyColorLoading) - resolveProxyAttributes(); - return super.nextToken(); - } - - private void resolveProxyAttributes() { - if (fNeedsLazyColorLoading && Display.getCurrent() != null) { - for (int i= 0; i < fPropertyNamesColor.length; i++) { - addToken(fPropertyNamesColor[i], fPropertyNamesBold[i], fPropertyNamesItalic[i], fPropertyNamesStrikethrough[i], fPropertyNamesUnderline[i]); - } - fNeedsLazyColorLoading= false; - } - } - - private void addTokenWithProxyAttribute(String colorKey, String boldKey, String italicKey, String strikethroughKey, String underlineKey) { - fTokenMap.put(colorKey, new Token(createTextAttribute(null, boldKey, italicKey, strikethroughKey, underlineKey))); - } - - private void addToken(String colorKey, String boldKey, String italicKey, String strikethroughKey, String underlineKey) { -// if (fColorManager != null && colorKey != null && fColorManager.getColorUnchecked(colorKey) == null) { -// RGB rgb= PreferenceConverter.getColor(fPreferenceStore, colorKey); -// if (fColorManager instanceof IColorManagerExtension) { -// IColorManagerExtension ext= (IColorManagerExtension) fColorManager; -// ext.unbindColor(colorKey); -// ext.bindColor(colorKey, rgb); -// } -// } - - if (!fNeedsLazyColorLoading) - fTokenMap.put(colorKey, new Token(createTextAttribute(colorKey, boldKey, italicKey, strikethroughKey, underlineKey))); - else { - Token token= ((Token)fTokenMap.get(colorKey)); - if (token != null) - token.setData(createTextAttribute(colorKey, boldKey, italicKey, strikethroughKey, underlineKey)); - } - } - - /** - * Create a text attribute based on the given color, bold, italic, strikethrough and underline preference keys. - * - * @param colorKey the color preference key - * @param boldKey the bold preference key - * @param italicKey the italic preference key - * @param strikethroughKey the strikethrough preference key - * @param underlineKey the italic preference key - * @return the created text attribute - * @since 3.0 - */ - private TextAttribute createTextAttribute(String colorKey, String boldKey, String italicKey, String strikethroughKey, String underlineKey) { - Color color= null; - if (colorKey != null) - color= fColorManager.getColorUnchecked(colorKey); - - int style= fPreferenceStore.getBoolean(boldKey) ? SWT.BOLD : SWT.NORMAL; - if (fPreferenceStore.getBoolean(italicKey)) - style |= SWT.ITALIC; - - if (fPreferenceStore.getBoolean(strikethroughKey)) - style |= TextAttribute.STRIKETHROUGH; - - if (fPreferenceStore.getBoolean(underlineKey)) - style |= TextAttribute.UNDERLINE; - - return new TextAttribute(color, null, style); - } - - protected Token getToken(String key) { - if (fNeedsLazyColorLoading) - resolveProxyAttributes(); - return (Token) fTokenMap.get(key); - } - - private void initializeRules() { - List<IRule> rules= createRules(); - if (rules != null) { - IRule[] result= new IRule[rules.size()]; - rules.toArray(result); - setRules(result); - } - } - - private int indexOf(String property) { - if (property != null) { - int length= fPropertyNamesColor.length; - for (int i= 0; i < length; i++) { - if (property.equals(fPropertyNamesColor[i]) || property.equals(fPropertyNamesBold[i]) || property.equals(fPropertyNamesItalic[i]) || property.equals(fPropertyNamesStrikethrough[i]) || property.equals(fPropertyNamesUnderline[i])) - return i; - } - } - return -1; - } - - public boolean affectsBehavior(PropertyChangeEvent event) { - return indexOf(event.getProperty()) >= 0; - } - - public void adaptToPreferenceChange(PropertyChangeEvent event) { - String p= event.getProperty(); - int index= indexOf(p); - Token token= getToken(fPropertyNamesColor[index]); - if (fPropertyNamesColor[index].equals(p)) - adaptToColorChange(token, event); - else if (fPropertyNamesBold[index].equals(p)) - adaptToStyleChange(token, event, SWT.BOLD); - else if (fPropertyNamesItalic[index].equals(p)) - adaptToStyleChange(token, event, SWT.ITALIC); - else if (fPropertyNamesStrikethrough[index].equals(p)) - adaptToStyleChange(token, event, TextAttribute.STRIKETHROUGH); - else if (fPropertyNamesUnderline[index].equals(p)) - adaptToStyleChange(token, event, TextAttribute.UNDERLINE); - } - - private void adaptToColorChange(Token token, PropertyChangeEvent event) { - RGB rgb= null; - - Object value= event.getNewValue(); - if (value instanceof RGB) - rgb= (RGB) value; - else if (value instanceof String) - rgb= StringConverter.asRGB((String) value); - - if (rgb != null) { - - String property= event.getProperty(); - Color color= fColorManager.getColorUnchecked(property); - -// if ((color == null || !rgb.equals(color.getRGB())) && fColorManager instanceof IColorManagerExtension) { -// IColorManagerExtension ext= (IColorManagerExtension) fColorManager; -// -// ext.unbindColor(property); -// ext.bindColor(property, rgb); -// -// color= fColorManager.getColor(property); -// } - - Object data= token.getData(); - if (data instanceof TextAttribute) { - TextAttribute oldAttr= (TextAttribute) data; - token.setData(new TextAttribute(color, oldAttr.getBackground(), oldAttr.getStyle())); - } - } - } - - private void adaptToStyleChange(Token token, PropertyChangeEvent event, int styleAttribute) { - boolean eventValue= false; - Object value= event.getNewValue(); - if (value instanceof Boolean) - eventValue= ((Boolean) value).booleanValue(); - else if (IPreferenceStore.TRUE.equals(value)) - eventValue= true; - - Object data= token.getData(); - if (data instanceof TextAttribute) { - TextAttribute oldAttr= (TextAttribute) data; - boolean activeValue= (oldAttr.getStyle() & styleAttribute) == styleAttribute; - if (activeValue != eventValue) - token.setData(new TextAttribute(oldAttr.getForeground(), oldAttr.getBackground(), eventValue ? oldAttr.getStyle() | styleAttribute : oldAttr.getStyle() & ~styleAttribute)); - } - } - /** - * Returns the preference store. - * - * @return the preference store. - * - * @since 3.0 - */ - protected IPreferenceStore getPreferenceStore() { - return fPreferenceStore; - } -} diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/BufferedDocumentScanner.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/BufferedDocumentScanner.java deleted file mode 100644 index fc07e81a..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/BufferedDocumentScanner.java +++ /dev/null @@ -1,178 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.rules.ICharacterScanner; - - -/** - * A buffered document scanner. The buffer always contains a section - * of a fixed size of the document to be scanned. - */ - -public final class BufferedDocumentScanner implements ICharacterScanner { - - /** The document being scanned. */ - private IDocument fDocument; - /** The offset of the document range to scan. */ - private int fRangeOffset; - /** The length of the document range to scan. */ - private int fRangeLength; - /** The delimiters of the document. */ - private char[][] fDelimiters; - - /** The buffer. */ - private final char[] fBuffer; - /** The offset of the buffer within the document. */ - private int fBufferOffset; - /** The valid length of the buffer for access. */ - private int fBufferLength; - /** The offset of the scanner within the buffer. */ - private int fOffset; - - - /** - * Creates a new buffered document scanner. - * The buffer size is set to the given number of characters. - * - * @param size the buffer size - */ - public BufferedDocumentScanner(int size) { - fBuffer= new char[size]; - } - - /** - * Fills the buffer with the contents of the document starting at the given offset. - * - * @param offset the document offset at which the buffer starts - */ - private final void updateBuffer(int offset) { - - fBufferOffset= offset; - - if (fBufferOffset + fBuffer.length > fRangeOffset + fRangeLength) - fBufferLength= fRangeLength - (fBufferOffset - fRangeOffset); - else - fBufferLength= fBuffer.length; - - try { - final String content= fDocument.get(fBufferOffset, fBufferLength); - content.getChars(0, fBufferLength, fBuffer, 0); - } catch (BadLocationException e) { - } - } - - /** - * Configures the scanner by providing access to the document range over which to scan. - * - * @param document the document to scan - * @param offset the offset of the document range to scan - * @param length the length of the document range to scan - */ - public final void setRange(IDocument document, int offset, int length) { - - fDocument= document; - fRangeOffset= offset; - fRangeLength= length; - - String[] delimiters= document.getLegalLineDelimiters(); - fDelimiters= new char[delimiters.length][]; - for (int i= 0; i < delimiters.length; i++) - fDelimiters[i]= delimiters[i].toCharArray(); - - updateBuffer(offset); - fOffset= 0; - } - - /* - * @see ICharacterScanner#read() - */ - @Override - public final int read() { - - if (fOffset == fBufferLength) { - int end= fBufferOffset + fBufferLength; - if (end == fDocument.getLength() || end == fRangeOffset + fRangeLength) - return EOF; - else { - updateBuffer(fBufferOffset + fBufferLength); - fOffset= 0; - } - } - - try { - return fBuffer[fOffset++]; - } catch (ArrayIndexOutOfBoundsException ex) { - StringBuilder buf= new StringBuilder(); - buf.append("Detailed state of 'BufferedDocumentScanner:'"); //$NON-NLS-1$ - buf.append("\n\tfOffset= "); //$NON-NLS-1$ - buf.append(fOffset); - buf.append("\n\tfBufferOffset= "); //$NON-NLS-1$ - buf.append(fBufferOffset); - buf.append("\n\tfBufferLength= "); //$NON-NLS-1$ - buf.append(fBufferLength); - buf.append("\n\tfRangeOffset= "); //$NON-NLS-1$ - buf.append(fRangeOffset); - buf.append("\n\tfRangeLength= "); //$NON-NLS-1$ - buf.append(fRangeLength); - System.err.println(buf.toString()); //FIXME Logging -// JavaPlugin.logErrorMessage(buf.toString()); - throw ex; - } - } - - /* - * @see ICharacterScanner#unread - */ - @Override - public final void unread() { - - if (fOffset == 0) { - if (fBufferOffset != fRangeOffset) { - updateBuffer(fBufferOffset - fBuffer.length); - fOffset= fBuffer.length - 1; - } - } else { - --fOffset; - } - } - - /* - * @see ICharacterScanner#getColumn() - */ - @Override - public final int getColumn() { - - try { - final int offset= fBufferOffset + fOffset; - final int line= fDocument.getLineOfOffset(offset); - final int start= fDocument.getLineOffset(line); - return offset - start; - } catch (BadLocationException e) { - } - - return -1; - } - - /* - * @see ICharacterScanner#getLegalLineDelimiters() - */ - @Override - public final char[][] getLegalLineDelimiters() { - return fDelimiters; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/CombinedWordRule.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/CombinedWordRule.java deleted file mode 100644 index 6d8e8621..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/CombinedWordRule.java +++ /dev/null @@ -1,369 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.eclipse.jface.text.rules.ICharacterScanner; -import org.eclipse.jface.text.rules.IRule; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.IWordDetector; -import org.eclipse.jface.text.rules.Token; - - -/** - * An implementation of <code>IRule</code> capable of detecting words. - * <p> - * Word rules also allow for the association of tokens with specific words. - * That is, not only can the rule be used to provide tokens for exact matches, - * but also for the generalized notion of a word in the context in which it is used. - * A word rules uses a word detector to determine what a word is.</p> - * <p> - * This word rule allows a word detector to be shared among different word matchers. - * Its up to the word matchers to decide if a word matches and, in this a case, which - * token is associated with that word. - * </p> - * - * @see IWordDetector - * @since 3.0 - */ -public class CombinedWordRule implements IRule { - - /** - * Word matcher, that associates matched words with tokens. - */ - public static class WordMatcher { - - /** The table of predefined words and token for this matcher */ - private Map<CharacterBuffer,IToken> fWords= new HashMap<CharacterBuffer,IToken>(); - - /** - * Adds a word and the token to be returned if it is detected. - * - * @param word the word this rule will search for, may not be <code>null</code> - * @param token the token to be returned if the word has been found, may not be <code>null</code> - */ - public void addWord(String word, IToken token) { - fWords.put(new CharacterBuffer(word), token); - } - - /** - * Returns the token associated to the given word and the scanner state. - * - * @param scanner the scanner - * @param word the word - * @return the token or <code>null</code> if none is associated by this matcher - */ - public IToken evaluate(ICharacterScanner scanner, CharacterBuffer word) { - IToken token= (IToken) fWords.get(word); - if (token != null) - return token; - return Token.UNDEFINED; - } - - /** - * Removes all words. - */ - public void clearWords() { - fWords.clear(); - } - } - - /** - * Character buffer, mutable <b>or</b> suitable for use as key in hash maps. - */ - public static class CharacterBuffer { - - /** Buffer content */ - private char[] fContent; - /** Buffer content size */ - private int fLength= 0; - - /** Is hash code cached? */ - private boolean fIsHashCached= false; - /** The hash code */ - private int fHashCode; - - /** - * Initialize with the given capacity. - * - * @param capacity the initial capacity - */ - public CharacterBuffer(int capacity) { - fContent= new char[capacity]; - } - - /** - * Initialize with the given content. - * - * @param content the initial content - */ - public CharacterBuffer(String content) { - fContent= content.toCharArray(); - fLength= content.length(); - } - - /** - * Empties this buffer. - */ - public void clear() { - fIsHashCached= false; - fLength= 0; - } - - /** - * Appends the given character to the buffer. - * - * @param c the character - */ - public void append(char c) { - fIsHashCached= false; - if (fLength == fContent.length) { - char[] old= fContent; - fContent= new char[old.length << 1]; - System.arraycopy(old, 0, fContent, 0, old.length); - } - fContent[fLength++]= c; - } - - /** - * Returns the length of the content. - * - * @return the length - */ - public int length() { - return fLength; - } - - /** - * Returns the content as string. - * - * @return the content - */ - @Override - public String toString() { - return new String(fContent, 0, fLength); - } - - /** - * Returns the character at the given position. - * - * @param i the position - * @return the character at position <code>i</code> - */ - public char charAt(int i) { - return fContent[i]; - } - - /* - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - if (fIsHashCached) - return fHashCode; - - int hash= 0; - for (int i= 0, n= fLength; i < n; i++) - hash= 29*hash + fContent[i]; - fHashCode= hash; - fIsHashCached= true; - return hash; - } - - - /* - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (obj == this) - return true; - if (!(obj instanceof CharacterBuffer)) - return false; - CharacterBuffer buffer= (CharacterBuffer) obj; - int length= buffer.length(); - if (length != fLength) - return false; - for (int i= 0; i < length; i++) - if (buffer.charAt(i) != fContent[i]) - return false; - return true; - } - - /** - * Is the content equal to the given string? - * - * @param string the string - * @return <code>true</code> iff the content is the same character sequence as in the string - */ - public boolean equals(String string) { - int length= string.length(); - if (length != fLength) - return false; - for (int i= 0; i < length; i++) - if (string.charAt(i) != fContent[i]) - return false; - return true; - } - } - - /** Internal setting for the uninitialized column constraint */ - private static final int UNDEFINED= -1; - - /** The word detector used by this rule */ - private IWordDetector fDetector; - /** The default token to be returned on success and if nothing else has been specified. */ - private IToken fDefaultToken; - /** The column constraint */ - private int fColumn= UNDEFINED; - /** Buffer used for pattern detection */ - private CharacterBuffer fBuffer= new CharacterBuffer(16); - - /** List of word matchers */ - private List<WordMatcher> fMatchers= new ArrayList<WordMatcher>(); - - /** - * Creates a rule which, with the help of an word detector, will return the token - * associated with the detected word. If no token has been associated, the scanner - * will be rolled back and an undefined token will be returned in order to allow - * any subsequent rules to analyze the characters. - * - * @param detector the word detector to be used by this rule, may not be <code>null</code> - * - * @see WordMatcher#addWord(String, IToken) - */ - public CombinedWordRule(IWordDetector detector) { - this(detector, null, Token.UNDEFINED); - } - - /** - * Creates a rule which, with the help of an word detector, will return the token - * associated with the detected word. If no token has been associated, the - * specified default token will be returned. - * - * @param detector the word detector to be used by this rule, may not be <code>null</code> - * @param defaultToken the default token to be returned on success - * if nothing else is specified, may not be <code>null</code> - * - * @see WordMatcher#addWord(String, IToken) - */ - public CombinedWordRule(IWordDetector detector, IToken defaultToken) { - this(detector, null, defaultToken); - } - - /** - * Creates a rule which, with the help of an word detector, will return the token - * associated with the detected word. If no token has been associated, the scanner - * will be rolled back and an undefined token will be returned in order to allow - * any subsequent rules to analyze the characters. - * - * @param detector the word detector to be used by this rule, may not be <code>null</code> - * @param matcher the initial word matcher - * - * @see WordMatcher#addWord(String, IToken) - */ - public CombinedWordRule(IWordDetector detector, WordMatcher matcher) { - this(detector, matcher, Token.UNDEFINED); - } - - /** - * Creates a rule which, with the help of an word detector, will return the token - * associated with the detected word. If no token has been associated, the - * specified default token will be returned. - * - * @param detector the word detector to be used by this rule, may not be <code>null</code> - * @param matcher the initial word matcher - * @param defaultToken the default token to be returned on success - * if nothing else is specified, may not be <code>null</code> - * - * @see WordMatcher#addWord(String, IToken) - */ - public CombinedWordRule(IWordDetector detector, WordMatcher matcher, IToken defaultToken) { - fDetector= detector; - fDefaultToken= defaultToken; - if (matcher != null) - addWordMatcher(matcher); - } - - - /** - * Adds the given matcher. - * - * @param matcher the matcher - */ - public void addWordMatcher(WordMatcher matcher) { - fMatchers.add(matcher); - } - - /** - * Sets a column constraint for this rule. If set, the rule's token - * will only be returned if the pattern is detected starting at the - * specified column. If the column is smaller then 0, the column - * constraint is considered removed. - * - * @param column the column in which the pattern starts - */ - public void setColumnConstraint(int column) { - if (column < 0) - column= UNDEFINED; - fColumn= column; - } - - /* - * @see IRule#evaluate(ICharacterScanner) - */ - @Override - public IToken evaluate(ICharacterScanner scanner) { - int c= scanner.read(); - if (fDetector.isWordStart((char) c)) { - if (fColumn == UNDEFINED || (fColumn == scanner.getColumn() - 1)) { - - fBuffer.clear(); - do { - fBuffer.append((char) c); - c= scanner.read(); - } while (c != ICharacterScanner.EOF && fDetector.isWordPart((char) c)); - scanner.unread(); - - for (int i= 0, n= fMatchers.size(); i < n; i++) { - IToken token= ((WordMatcher) fMatchers.get(i)).evaluate(scanner, fBuffer); - if (!token.isUndefined()) - return token; - } - - if (fDefaultToken.isUndefined()) - unreadBuffer(scanner); - - return fDefaultToken; - } - } - - scanner.unread(); - return Token.UNDEFINED; - } - - /** - * Returns the characters in the buffer to the scanner. - * - * @param scanner the scanner to be used - */ - private void unreadBuffer(ICharacterScanner scanner) { - for (int i= fBuffer.length() - 1; i >= 0; i--) - scanner.unread(); - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/FastJavaScriptPartitionScanner.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/FastJavaScriptPartitionScanner.java deleted file mode 100644 index b9cae17c..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/FastJavaScriptPartitionScanner.java +++ /dev/null @@ -1,541 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.rules.ICharacterScanner; -import org.eclipse.jface.text.rules.IPartitionTokenScanner; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.Token; - - -/** - * This scanner recognizes the JavaDoc comments, Java multi line comments, Java single line comments, - * Java strings and Java characters. - */ -public class FastJavaScriptPartitionScanner implements IPartitionTokenScanner, IJavaScriptPartitions { - - // states - private static final int JAVA= 0; - private static final int SINGLE_LINE_COMMENT= 1; - private static final int MULTI_LINE_COMMENT= 2; - private static final int JAVADOC= 3; - private static final int CHARACTER= 4; - private static final int STRING= 5; - - // beginning of prefixes and postfixes - private static final int NONE= 0; - private static final int BACKSLASH= 1; // postfix for STRING and CHARACTER - private static final int SLASH= 2; // prefix for SINGLE_LINE or MULTI_LINE or JAVADOC - private static final int SLASH_STAR= 3; // prefix for MULTI_LINE_COMMENT or JAVADOC - private static final int SLASH_STAR_STAR= 4; // prefix for MULTI_LINE_COMMENT or JAVADOC - private static final int STAR= 5; // postfix for MULTI_LINE_COMMENT or JAVADOC - private static final int CARRIAGE_RETURN=6; // postfix for STRING, CHARACTER and SINGLE_LINE_COMMENT - - /** The scanner. */ - private final BufferedDocumentScanner fScanner= new BufferedDocumentScanner(1000); // faster implementation - - /** The offset of the last returned token. */ - private int fTokenOffset; - /** The length of the last returned token. */ - private int fTokenLength; - - /** The state of the scanner. */ - private int fState; - /** The last significant characters read. */ - private int fLast; - /** The amount of characters already read on first call to nextToken(). */ - private int fPrefixLength; - - // emulate JavaPartitionScanner - private boolean fEmulate= false; - private int fJavaOffset; - private int fJavaLength; - - private final IToken[] fTokens= new IToken[] { - new Token(null), - new Token(JAVA_SINGLE_LINE_COMMENT), - new Token(JAVA_MULTI_LINE_COMMENT), - new Token(JAVA_DOC), - new Token(JAVA_CHARACTER), - new Token(JAVA_STRING) - }; - - public FastJavaScriptPartitionScanner(boolean emulate) { - fEmulate= emulate; - } - - public FastJavaScriptPartitionScanner() { - this(false); - } - - /* - * @see org.eclipse.jface.text.rules.ITokenScanner#nextToken() - */ - @Override - public IToken nextToken() { - - // emulate JavaPartitionScanner - if (fEmulate) { - if (fJavaOffset != -1 && fTokenOffset + fTokenLength != fJavaOffset + fJavaLength) { - fTokenOffset += fTokenLength; - return fTokens[JAVA]; - } else { - fJavaOffset= -1; - fJavaLength= 0; - } - } - - fTokenOffset += fTokenLength; - fTokenLength= fPrefixLength; - - while (true) { - final int ch= fScanner.read(); - - // characters - switch (ch) { - case ICharacterScanner.EOF: - if (fTokenLength > 0) { - fLast= NONE; // ignore last - return preFix(fState, JAVA, NONE, 0); - - } else { - fLast= NONE; - fPrefixLength= 0; - return Token.EOF; - } - - case '\r': - // emulate JavaPartitionScanner - if (!fEmulate && fLast != CARRIAGE_RETURN) { - fLast= CARRIAGE_RETURN; - fTokenLength++; - continue; - - } else { - - switch (fState) { - case SINGLE_LINE_COMMENT: - case CHARACTER: - case STRING: - if (fTokenLength > 0) { - IToken token= fTokens[fState]; - - // emulate JavaPartitionScanner - if (fEmulate) { - fTokenLength++; - fLast= NONE; - fPrefixLength= 0; - } else { - fLast= CARRIAGE_RETURN; - fPrefixLength= 1; - } - - fState= JAVA; - return token; - - } else { - consume(); - continue; - } - - default: - consume(); - continue; - } - } - - case '\n': - switch (fState) { - case SINGLE_LINE_COMMENT: - case CHARACTER: - case STRING: - // assert(fTokenLength > 0); - return postFix(fState); - - default: - consume(); - continue; - } - - default: - if (!fEmulate && fLast == CARRIAGE_RETURN) { - switch (fState) { - case SINGLE_LINE_COMMENT: - case CHARACTER: - case STRING: - - int last; - int newState; - switch (ch) { - case '/': - last= SLASH; - newState= JAVA; - break; - - case '*': - last= STAR; - newState= JAVA; - break; - - case '\'': - last= NONE; - newState= CHARACTER; - break; - - case '"': - last= NONE; - newState= STRING; - break; - - case '\r': - last= CARRIAGE_RETURN; - newState= JAVA; - break; - - case '\\': - last= BACKSLASH; - newState= JAVA; - break; - - default: - last= NONE; - newState= JAVA; - break; - } - - fLast= NONE; // ignore fLast - return preFix(fState, newState, last, 1); - - default: - break; - } - } - } - - // states - switch (fState) { - case JAVA: - switch (ch) { - case '/': - if (fLast == SLASH) { - if (fTokenLength - getLastLength(fLast) > 0) { - return preFix(JAVA, SINGLE_LINE_COMMENT, NONE, 2); - } else { - preFix(JAVA, SINGLE_LINE_COMMENT, NONE, 2); - fTokenOffset += fTokenLength; - fTokenLength= fPrefixLength; - break; - } - - } else { - fTokenLength++; - fLast= SLASH; - break; - } - - case '*': - if (fLast == SLASH) { - if (fTokenLength - getLastLength(fLast) > 0) - return preFix(JAVA, MULTI_LINE_COMMENT, SLASH_STAR, 2); - else { - preFix(JAVA, MULTI_LINE_COMMENT, SLASH_STAR, 2); - fTokenOffset += fTokenLength; - fTokenLength= fPrefixLength; - break; - } - - } else { - consume(); - break; - } - - case '\'': - fLast= NONE; // ignore fLast - if (fTokenLength > 0) - return preFix(JAVA, CHARACTER, NONE, 1); - else { - preFix(JAVA, CHARACTER, NONE, 1); - fTokenOffset += fTokenLength; - fTokenLength= fPrefixLength; - break; - } - - case '"': - fLast= NONE; // ignore fLast - if (fTokenLength > 0) - return preFix(JAVA, STRING, NONE, 1); - else { - preFix(JAVA, STRING, NONE, 1); - fTokenOffset += fTokenLength; - fTokenLength= fPrefixLength; - break; - } - - default: - consume(); - break; - } - break; - - case SINGLE_LINE_COMMENT: - consume(); - break; - - case JAVADOC: - switch (ch) { - case '/': - switch (fLast) { - case SLASH_STAR_STAR: - return postFix(MULTI_LINE_COMMENT); - - case STAR: - return postFix(JAVADOC); - - default: - consume(); - break; - } - break; - - case '*': - fTokenLength++; - fLast= STAR; - break; - - default: - consume(); - break; - } - break; - - case MULTI_LINE_COMMENT: - switch (ch) { - case '*': - if (fLast == SLASH_STAR) { - fLast= SLASH_STAR_STAR; - fTokenLength++; - fState= JAVADOC; - } else { - fTokenLength++; - fLast= STAR; - } - break; - - case '/': - if (fLast == STAR) { - return postFix(MULTI_LINE_COMMENT); - } else { - consume(); - break; - } - - default: - consume(); - break; - } - break; - - case STRING: - switch (ch) { - case '\\': - fLast= (fLast == BACKSLASH) ? NONE : BACKSLASH; - fTokenLength++; - break; - - case '\"': - if (fLast != BACKSLASH) { - return postFix(STRING); - - } else { - consume(); - break; - } - - default: - consume(); - break; - } - break; - - case CHARACTER: - switch (ch) { - case '\\': - fLast= (fLast == BACKSLASH) ? NONE : BACKSLASH; - fTokenLength++; - break; - - case '\'': - if (fLast != BACKSLASH) { - return postFix(CHARACTER); - - } else { - consume(); - break; - } - - default: - consume(); - break; - } - break; - } - } - } - - private static final int getLastLength(int last) { - switch (last) { - default: - return -1; - - case NONE: - return 0; - - case CARRIAGE_RETURN: - case BACKSLASH: - case SLASH: - case STAR: - return 1; - - case SLASH_STAR: - return 2; - - case SLASH_STAR_STAR: - return 3; - } - } - - private final void consume() { - fTokenLength++; - fLast= NONE; - } - - private final IToken postFix(int state) { - fTokenLength++; - fLast= NONE; - fState= JAVA; - fPrefixLength= 0; - return fTokens[state]; - } - - private final IToken preFix(int state, int newState, int last, int prefixLength) { - // emulate JavaPartitionScanner - if (fEmulate && state == JAVA && (fTokenLength - getLastLength(fLast) > 0)) { - fTokenLength -= getLastLength(fLast); - fJavaOffset= fTokenOffset; - fJavaLength= fTokenLength; - fTokenLength= 1; - fState= newState; - fPrefixLength= prefixLength; - fLast= last; - return fTokens[state]; - - } else { - fTokenLength -= getLastLength(fLast); - fLast= last; - fPrefixLength= prefixLength; - IToken token= fTokens[state]; - fState= newState; - return token; - } - } - - private static int getState(String contentType) { - - if (contentType == null) - return JAVA; - - else if (contentType.equals(JAVA_SINGLE_LINE_COMMENT)) - return SINGLE_LINE_COMMENT; - - else if (contentType.equals(JAVA_MULTI_LINE_COMMENT)) - return MULTI_LINE_COMMENT; - - else if (contentType.equals(JAVA_DOC)) - return JAVADOC; - - else if (contentType.equals(JAVA_STRING)) - return STRING; - - else if (contentType.equals(JAVA_CHARACTER)) - return CHARACTER; - - else - return JAVA; - } - - /* - * @see IPartitionTokenScanner#setPartialRange(IDocument, int, int, String, int) - */ - @Override - public void setPartialRange(IDocument document, int offset, int length, String contentType, int partitionOffset) { - - fScanner.setRange(document, offset, length); - fTokenOffset= partitionOffset; - fTokenLength= 0; - fPrefixLength= offset - partitionOffset; - fLast= NONE; - - if (offset == partitionOffset) { - // restart at beginning of partition - fState= JAVA; - } else { - fState= getState(contentType); - } - - // emulate JavaPartitionScanner - if (fEmulate) { - fJavaOffset= -1; - fJavaLength= 0; - } - } - - /* - * @see ITokenScanner#setRange(IDocument, int, int) - */ - @Override - public void setRange(IDocument document, int offset, int length) { - - fScanner.setRange(document, offset, length); - fTokenOffset= offset; - fTokenLength= 0; - fPrefixLength= 0; - fLast= NONE; - fState= JAVA; - - // emulate JavaPartitionScanner - if (fEmulate) { - fJavaOffset= -1; - fJavaLength= 0; - } - } - - /* - * @see ITokenScanner#getTokenLength() - */ - @Override - public int getTokenLength() { - return fTokenLength; - } - - /* - * @see ITokenScanner#getTokenOffset() - */ - @Override - public int getTokenOffset() { - return fTokenOffset; - } - -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/IJavaScriptPartitions.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/IJavaScriptPartitions.java deleted file mode 100644 index 6d2b4c35..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/IJavaScriptPartitions.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - -/** - * Definition of Java partitioning and its partitions. - * - * @since 3.1 - */ -public interface IJavaScriptPartitions { - /** - * The identifier of the Java partitioning. - */ - String JAVA_PARTITIONING= "___java_partitioning"; //$NON-NLS-1$ - /** - * The identifier of the single-line (JLS2: EndOfLineComment) end comment partition content type. - */ - String JAVA_SINGLE_LINE_COMMENT= "__java_singleline_comment"; //$NON-NLS-1$ - - /** - * The identifier multi-line (JLS2: TraditionalComment) comment partition content type. - */ - String JAVA_MULTI_LINE_COMMENT= "__java_multiline_comment"; //$NON-NLS-1$ - - /** - * The identifier of the Javadoc (JLS2: DocumentationComment) partition content type. - */ - String JAVA_DOC= "__java_javadoc"; //$NON-NLS-1$ - - /** - * The identifier of the Java string partition content type. - */ - String JAVA_STRING= "__java_string"; //$NON-NLS-1$ - - /** - * The identifier of the Java character partition content type. - */ - String JAVA_CHARACTER= "__java_character"; //$NON-NLS-1$ -} diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptCodeScanner.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptCodeScanner.java deleted file mode 100644 index c2763d7a..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptCodeScanner.java +++ /dev/null @@ -1,593 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - * Philippe Ombredanne <pombredanne@nexb.com> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=150989 - * Anton Leherbauer (Wind River Systems) - [misc] Allow custom token for WhitespaceRule - https://bugs.eclipse.org/bugs/show_bug.cgi?id=251224 - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.e4.tools.emf.ui.script.js.ResourceProvider; -import org.eclipse.e4.tools.services.IResourcePool; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.rules.ICharacterScanner; -import org.eclipse.jface.text.rules.IRule; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.SingleLineRule; -import org.eclipse.jface.text.rules.Token; -import org.eclipse.jface.text.rules.WhitespaceRule; - - -/** - * A Java code scanner. - */ -public final class JavaScriptCodeScanner extends AbstractJavaScanner { - - /** - * Rule to detect java operators. - * - * @since 3.0 - */ - private static final class OperatorRule implements IRule { - - /** Java operators */ - private final char[] JAVA_OPERATORS= { ';', '.', '=', '/', '\\', '+', '-', '*', '<', '>', ':', '?', '!', ',', '|', '&', '^', '%', '~'}; - /** Token to return for this rule */ - private final IToken fToken; - - /** - * Creates a new operator rule. - * - * @param token Token to use for this rule - */ - public OperatorRule(IToken token) { - fToken= token; - } - - /** - * Is this character an operator character? - * - * @param character Character to determine whether it is an operator character - * @return <code>true</code> iff the character is an operator, <code>false</code> otherwise. - */ - public boolean isOperator(char character) { - for (int index= 0; index < JAVA_OPERATORS.length; index++) { - if (JAVA_OPERATORS[index] == character) - return true; - } - return false; - } - - /* - * @see org.eclipse.jface.text.rules.IRule#evaluate(org.eclipse.jface.text.rules.ICharacterScanner) - */ - @Override - public IToken evaluate(ICharacterScanner scanner) { - - int character= scanner.read(); - if (isOperator((char) character)) { - do { - character= scanner.read(); - } while (isOperator((char) character)); - scanner.unread(); - return fToken; - } else { - scanner.unread(); - return Token.UNDEFINED; - } - } - } - - /** - * Rule to detect java brackets. - * - * @since 3.3 - */ - private static final class BracketRule implements IRule { - - /** Java brackets */ - private final char[] JAVA_BRACKETS= { '(', ')', '{', '}', '[', ']' }; - /** Token to return for this rule */ - private final IToken fToken; - - /** - * Creates a new bracket rule. - * - * @param token Token to use for this rule - */ - public BracketRule(IToken token) { - fToken= token; - } - - /** - * Is this character a bracket character? - * - * @param character Character to determine whether it is a bracket character - * @return <code>true</code> iff the character is a bracket, <code>false</code> otherwise. - */ - public boolean isBracket(char character) { - for (int index= 0; index < JAVA_BRACKETS.length; index++) { - if (JAVA_BRACKETS[index] == character) - return true; - } - return false; - } - - /* - * @see org.eclipse.jface.text.rules.IRule#evaluate(org.eclipse.jface.text.rules.ICharacterScanner) - */ - @Override - public IToken evaluate(ICharacterScanner scanner) { - - int character= scanner.read(); - if (isBracket((char) character)) { - do { - character= scanner.read(); - } while (isBracket((char) character)); - scanner.unread(); - return fToken; - } else { - scanner.unread(); - return Token.UNDEFINED; - } - } - } - - -// private static class VersionedWordMatcher extends CombinedWordRule.WordMatcher implements ISourceVersionDependent { -// -// private final IToken fDefaultToken; -// private final String fVersion; -// private boolean fIsVersionMatch; -// -// public VersionedWordMatcher(IToken defaultToken, String version, String currentVersion) { -// fDefaultToken= defaultToken; -// fVersion= version; -// setSourceVersion(currentVersion); -// } -// -// /* -// * @see org.eclipse.jdt.internal.ui.text.ISourceVersionDependent#setSourceVersion(java.lang.String) -// */ -// public void setSourceVersion(String version) { -// fIsVersionMatch= fVersion.compareTo(version) <= 0; -// } -// -// /* -// * @see org.eclipse.jdt.internal.ui.text.CombinedWordRule.WordMatcher#evaluate(org.eclipse.jface.text.rules.ICharacterScanner, org.eclipse.jdt.internal.ui.text.CombinedWordRule.CharacterBuffer) -// */ -// public IToken evaluate(ICharacterScanner scanner, CombinedWordRule.CharacterBuffer word) { -// IToken token= super.evaluate(scanner, word); -// -// if (fIsVersionMatch || token.isUndefined()) -// return token; -// -// return fDefaultToken; -// } -// } - -// /** -// * An annotation rule matches the '@' symbol, any following whitespace and -// * optionally a following <code>interface</code> keyword. -// * -// * It does not match if there is a comment between the '@' symbol and -// * the identifier. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=82452 -// * -// * @since 3.1 -// */ -// private static class AnnotationRule implements IRule, ISourceVersionDependent { -// /** -// * A resettable scanner supports marking a position in a scanner and -// * unreading back to the marked position. -// */ -// private static final class ResettableScanner implements ICharacterScanner { -// private final ICharacterScanner fDelegate; -// private int fReadCount; -// -// /** -// * Creates a new resettable scanner that will forward calls -// * to <code>scanner</code>, but store a marked position. -// * -// * @param scanner the delegate scanner -// */ -// public ResettableScanner(final ICharacterScanner scanner) { -// fDelegate= scanner; -// mark(); -// } -// -// /* -// * @see org.eclipse.jface.text.rules.ICharacterScanner#getColumn() -// */ -// public int getColumn() { -// return fDelegate.getColumn(); -// } -// -// /* -// * @see org.eclipse.jface.text.rules.ICharacterScanner#getLegalLineDelimiters() -// */ -// public char[][] getLegalLineDelimiters() { -// return fDelegate.getLegalLineDelimiters(); -// } -// -// /* -// * @see org.eclipse.jface.text.rules.ICharacterScanner#read() -// */ -// public int read() { -// int ch= fDelegate.read(); -// if (ch != ICharacterScanner.EOF) -// fReadCount++; -// return ch; -// } -// -// /* -// * @see org.eclipse.jface.text.rules.ICharacterScanner#unread() -// */ -// public void unread() { -// if (fReadCount > 0) -// fReadCount--; -// fDelegate.unread(); -// } -// -// /** -// * Marks an offset in the scanned content. -// */ -// public void mark() { -// fReadCount= 0; -// } -// -// /** -// * Resets the scanner to the marked position. -// */ -// public void reset() { -// while (fReadCount > 0) -// unread(); -// -// while (fReadCount < 0) -// read(); -// } -// } -// -// private final IWhitespaceDetector fWhitespaceDetector= new JavaScriptWhitespaceDetector(); -// private final IWordDetector fWordDetector= new JavaScriptWordDetector(); -// private final IToken fInterfaceToken; -// private final IToken fAtToken; -// private final String fVersion; -// private boolean fIsVersionMatch; -// -// /** -// * Creates a new rule. -// * -// * @param interfaceToken the token to return if -// * <code>'@\s*interface'</code> is matched -// * @param atToken the token to return if <code>'@'</code> -// * is matched, but not <code>'@\s*interface'</code> -// * @param version the lowest <code>JavaCore.COMPILER_SOURCE</code> -// * version that this rule is enabled -// * @param currentVersion the current -// * <code>JavaCore.COMPILER_SOURCE</code> version -// */ -// public AnnotationRule(IToken interfaceToken, Token atToken, String version, String currentVersion) { -// fInterfaceToken= interfaceToken; -// fAtToken= atToken; -// fVersion= version; -// setSourceVersion(currentVersion); -// } -// -// /* -// * @see org.eclipse.jface.text.rules.IRule#evaluate(org.eclipse.jface.text.rules.ICharacterScanner) -// */ -// public IToken evaluate(ICharacterScanner scanner) { -// if (!fIsVersionMatch) -// return Token.UNDEFINED; -// -// ResettableScanner resettable= new ResettableScanner(scanner); -// if (resettable.read() == '@') -// return readAnnotation(resettable); -// -// resettable.reset(); -// return Token.UNDEFINED; -// } -// -// private IToken readAnnotation(ResettableScanner scanner) { -// scanner.mark(); -// skipWhitespace(scanner); -// if (readInterface(scanner)) { -// return fInterfaceToken; -// } else { -// scanner.reset(); -// return fAtToken; -// } -// } -// -// private boolean readInterface(ICharacterScanner scanner) { -// int ch= scanner.read(); -// int i= 0; -// while (i < INTERFACE.length() && INTERFACE.charAt(i) == ch) { -// i++; -// ch= scanner.read(); -// } -// if (i < INTERFACE.length()) -// return false; -// -// if (fWordDetector.isWordPart((char) ch)) -// return false; -// -// if (ch != ICharacterScanner.EOF) -// scanner.unread(); -// -// return true; -// } -// -// private boolean skipWhitespace(ICharacterScanner scanner) { -// while (fWhitespaceDetector.isWhitespace((char) scanner.read())) { -// // do nothing -// } -// -// scanner.unread(); -// return true; -// } -// -// /* -// * @see org.eclipse.jdt.internal.ui.text.ISourceVersionDependent#setSourceVersion(java.lang.String) -// */ -// public void setSourceVersion(String version) { -// fIsVersionMatch= fVersion.compareTo(version) <= 0; -// } -// -// } - -// private static final String SOURCE_VERSION= JavaCore.COMPILER_SOURCE; - - /*static String[] fgKeywords= { - "abstract", //$NON-NLS-1$ - "break", //$NON-NLS-1$ - "case", "catch", "class", "const", "continue", //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ - "default", "do", //$NON-NLS-2$ //$NON-NLS-1$ - "else", "extends", //$NON-NLS-2$ //$NON-NLS-1$ - "final", "finally", "for", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ - "goto", //$NON-NLS-1$ - "if", "implements", "import", "instanceof", "interface", //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ - "native", "new", //$NON-NLS-2$ //$NON-NLS-1$ - "package", "private", "protected", "public", //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ - "static", "super", "switch", "synchronized", //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ - "this", "throw", "throws", "transient", "try", //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ - "volatile", //$NON-NLS-1$ - "while" //$NON-NLS-1$ - };*/ - - static String[] fgKeywords= { - "break", - "case", - "catch", - "continue", - "debugger", - "default", - "delete", - "do", - "else", - "finally", - "for", - "function", - "if", - "in", - "instanceof", - "new", -// "return", - "switch", - "this", - "throw", - "try", - "typeof", - "var", - "void", - "while", - "with", - "class", - "enum", - "export", - "extends", - "import", - "super" - - }; - - -// private static final String INTERFACE= "interface"; //$NON-NLS-1$ - private static final String RETURN= "return"; //$NON-NLS-1$ -// private static String[] fgJava14Keywords= { "assert" }; //$NON-NLS-1$ -// private static String[] fgJava15Keywords= { "enum" }; //$NON-NLS-1$ - - private static String[] fgTypes= { "void", "boolean", "char", "byte", "short", "strictfp", "int", "long", "float", "double" }; //$NON-NLS-1$ //$NON-NLS-5$ //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-2$ - - private static String[] fgConstants= { "false", "null", "true" }; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ - -// private static final String ANNOTATION_BASE_KEY= PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX + SemanticHighlightings.ANNOTATION; -// private static final String ANNOTATION_COLOR_KEY= "COLOR_org.eclipse.e4.tools.emf.ui.script.js." + ANNOTATION_BASE_KEY + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_COLOR_SUFFIX; - - private static String[] fgTokenProperties= { - ResourceProvider.JAVA_KEYWORD, - ResourceProvider.JAVA_STRING, - ResourceProvider.JAVA_DEFAULT, - ResourceProvider.JAVA_KEYWORD_RETURN, - ResourceProvider.JAVA_OPERATOR, - ResourceProvider.JAVA_BRACKET/*, - ANNOTATION_COLOR_KEY,*/ - }; - -// private List<ISourceVersionDependent> fVersionDependentRules= new ArrayList<ISourceVersionDependent>(3); - - /** - * Creates a Java code scanner - * - * @param manager the color manager - * @param store the preference store - */ - public JavaScriptCodeScanner(IResourcePool manager, IPreferenceStore store) { - super(manager, store); - initialize(); - } - - /* - * @see AbstractJavaScanner#getTokenProperties() - */ - @Override - protected String[] getTokenProperties() { - return fgTokenProperties; - } - - /* - * @see AbstractJavaScanner#createRules() - */ - @Override - protected List<IRule> createRules() { - - List<IRule> rules= new ArrayList<IRule>(); - - // Add rule for character constants. - Token token= getToken(ResourceProvider.JAVA_STRING); - rules.add(new SingleLineRule("'", "'", token, '\\')); //$NON-NLS-2$ //$NON-NLS-1$ - - - Token defaultToken= getToken(ResourceProvider.JAVA_DEFAULT); - - // Add generic whitespace rule. - rules.add(new WhitespaceRule(new JavaScriptWhitespaceDetector(), defaultToken)); - -// String version= getPreferenceStore().getString(SOURCE_VERSION); - -// // Add JLS3 rule for /@\s*interface/ and /@\s*\w+/ -// token= getToken(ANNOTATION_COLOR_KEY); -// AnnotationRule atInterfaceRule= new AnnotationRule(getToken(IJavaScriptColorConstants.JAVA_KEYWORD), token, JavaCore.VERSION_1_5, version); -// rules.add(atInterfaceRule); -// fVersionDependentRules.add(atInterfaceRule); -// -// // Add word rule for new keywords, see bug 4077 - JavaScriptWordDetector wordDetector= new JavaScriptWordDetector(); - CombinedWordRule combinedWordRule= new CombinedWordRule(wordDetector, defaultToken); -// -// VersionedWordMatcher j14Matcher= new VersionedWordMatcher(defaultToken, JavaCore.VERSION_1_4, version); -// -// token= getToken(IJavaScriptColorConstants.JAVA_KEYWORD); -// for (int i=0; i<fgJava14Keywords.length; i++) -// j14Matcher.addWord(fgJava14Keywords[i], token); -// -// combinedWordRule.addWordMatcher(j14Matcher); -// fVersionDependentRules.add(j14Matcher); -// -// VersionedWordMatcher j15Matcher= new VersionedWordMatcher(defaultToken, JavaCore.VERSION_1_5, version); -// -// token= getToken(IJavaScriptColorConstants.JAVA_KEYWORD); -// for (int i=0; i<fgJava15Keywords.length; i++) -// j15Matcher.addWord(fgJava15Keywords[i], token); -// -// combinedWordRule.addWordMatcher(j15Matcher); -// fVersionDependentRules.add(j15Matcher); - - // Add rule for operators - token= getToken(ResourceProvider.JAVA_OPERATOR); - rules.add(new OperatorRule(token)); - - // Add rule for brackets - token= getToken(ResourceProvider.JAVA_BRACKET); - rules.add(new BracketRule(token)); - - // Add word rule for keyword 'return'. - CombinedWordRule.WordMatcher returnWordRule= new CombinedWordRule.WordMatcher(); - token= getToken(ResourceProvider.JAVA_KEYWORD_RETURN); - returnWordRule.addWord(RETURN, token); - combinedWordRule.addWordMatcher(returnWordRule); - - // Add word rule for keywords, types, and constants. - CombinedWordRule.WordMatcher wordRule= new CombinedWordRule.WordMatcher(); - token= getToken(ResourceProvider.JAVA_KEYWORD); - for (int i=0; i<fgKeywords.length; i++) - wordRule.addWord(fgKeywords[i], token); - for (int i=0; i<fgTypes.length; i++) - wordRule.addWord(fgTypes[i], token); - for (int i=0; i<fgConstants.length; i++) - wordRule.addWord(fgConstants[i], token); - - combinedWordRule.addWordMatcher(wordRule); - - rules.add(combinedWordRule); - - setDefaultReturnToken(defaultToken); - return rules; - } - -// /* -// * @see org.eclipse.jdt.internal.ui.text.AbstractJavaScanner#getBoldKey(java.lang.String) -// */ -// protected String getBoldKey(String colorKey) { -// if ((ANNOTATION_COLOR_KEY).equals(colorKey)) -// return ANNOTATION_BASE_KEY + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_BOLD_SUFFIX; -// return super.getBoldKey(colorKey); -// } -// -// /* -// * @see org.eclipse.jdt.internal.ui.text.AbstractJavaScanner#getItalicKey(java.lang.String) -// */ -// protected String getItalicKey(String colorKey) { -// if ((ANNOTATION_COLOR_KEY).equals(colorKey)) -// return ANNOTATION_BASE_KEY + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_ITALIC_SUFFIX; -// return super.getItalicKey(colorKey); -// } -// -// /* -// * @see org.eclipse.jdt.internal.ui.text.AbstractJavaScanner#getStrikethroughKey(java.lang.String) -// */ -// protected String getStrikethroughKey(String colorKey) { -// if ((ANNOTATION_COLOR_KEY).equals(colorKey)) -// return ANNOTATION_BASE_KEY + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_STRIKETHROUGH_SUFFIX; -// return super.getStrikethroughKey(colorKey); -// } -// -// /* -// * @see org.eclipse.jdt.internal.ui.text.AbstractJavaScanner#getUnderlineKey(java.lang.String) -// */ -// protected String getUnderlineKey(String colorKey) { -// if ((ANNOTATION_COLOR_KEY).equals(colorKey)) -// return ANNOTATION_BASE_KEY + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_UNDERLINE_SUFFIX; -// return super.getUnderlineKey(colorKey); -// } -// -// /* -// * @see AbstractJavaScanner#affectsBehavior(PropertyChangeEvent) -// */ -// public boolean affectsBehavior(PropertyChangeEvent event) { -// return event.getProperty().equals(SOURCE_VERSION) || super.affectsBehavior(event); -// } -// -// /* -// * @see AbstractJavaScanner#adaptToPreferenceChange(PropertyChangeEvent) -// */ -// public void adaptToPreferenceChange(PropertyChangeEvent event) { -// -// if (event.getProperty().equals(SOURCE_VERSION)) { -// Object value= event.getNewValue(); -// -// if (value instanceof String) { -// String s= (String) value; -// -// for (Iterator<ISourceVersionDependent> it= fVersionDependentRules.iterator(); it.hasNext();) { -// ISourceVersionDependent dependent= (ISourceVersionDependent) it.next(); -// dependent.setSourceVersion(s); -// } -// } -// -// } else if (super.affectsBehavior(event)) { -// super.adaptToPreferenceChange(event); -// } -// } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptCommentScanner.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptCommentScanner.java deleted file mode 100644 index 5c5fa5c8..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptCommentScanner.java +++ /dev/null @@ -1,246 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - * Michel Ishizuka <cqw10305@nifty.com> - Bug 113266 [syntax highlighting] javadoc tag names including period is not highlighting correctly - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.e4.tools.emf.ui.script.js.text.scanners.CombinedWordRule.WordMatcher; -import org.eclipse.e4.tools.services.IResourcePool; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.rules.IRule; -import org.eclipse.jface.text.rules.IWordDetector; -import org.eclipse.jface.text.rules.Token; - - -/** - * Java comment scanner. - */ -public class JavaScriptCommentScanner extends AbstractJavaScanner{ - - private static class AtJavaIdentifierDetector implements IWordDetector { - - @Override - public boolean isWordStart(char c) { - return c == '@' || Character.isJavaIdentifierStart(c); - } - - @Override - public boolean isWordPart(char c) { - return c == '.' || Character.isJavaIdentifierPart(c); - } - } - -// private class TaskTagMatcher extends CombinedWordRule.WordMatcher { -// -// private IToken fToken; -// /** -// * Uppercase words -// * @since 3.0 -// */ -// private Map<CombinedWordRule.CharacterBuffer,IToken> fUppercaseWords= new HashMap<CombinedWordRule.CharacterBuffer,IToken>(); -// /** -// * <code>true</code> if task tag detection is case-sensitive. -// * @since 3.0 -// */ -// private boolean fCaseSensitive= true; -// /** -// * Buffer for uppercase word -// * @since 3.0 -// */ -// private CombinedWordRule.CharacterBuffer fBuffer= new CombinedWordRule.CharacterBuffer(16); -// -// public TaskTagMatcher(IToken token) { -// fToken= token; -// } -// -// /* -// * @see org.eclipse.jdt.internal.ui.text.CombinedWordRule.WordMatcher#clearWords() -// * @since 3.0 -// */ -// public synchronized void clearWords() { -// super.clearWords(); -// fUppercaseWords.clear(); -// } -// -// public synchronized void addTaskTags(String value) { -// String[] tasks= split(value, ","); //$NON-NLS-1$ -// for (int i= 0; i < tasks.length; i++) { -// if (tasks[i].length() > 0) { -// addWord(tasks[i], fToken); -// } -// } -// } -// -// private String[] split(String value, String delimiters) { -// StringTokenizer tokenizer= new StringTokenizer(value, delimiters); -// int size= tokenizer.countTokens(); -// String[] tokens= new String[size]; -// int i= 0; -// while (i < size) -// tokens[i++]= tokenizer.nextToken(); -// return tokens; -// } -// -// /* -// * @see org.eclipse.jdt.internal.ui.text.CombinedWordRule.WordMatcher#addWord(java.lang.String, org.eclipse.jface.text.rules.IToken) -// * @since 3.0 -// */ -// public synchronized void addWord(String word, IToken token) { -// super.addWord(word, token); -// fUppercaseWords.put(new CombinedWordRule.CharacterBuffer(word.toUpperCase()), token); -// } -// -// /* -// * @see org.eclipse.jdt.internal.ui.text.CombinedWordRule.WordMatcher#evaluate(org.eclipse.jface.text.rules.ICharacterScanner, org.eclipse.jdt.internal.ui.text.CombinedWordRule.CharacterBuffer) -// * @since 3.0 -// */ -// public synchronized IToken evaluate(ICharacterScanner scanner, CombinedWordRule.CharacterBuffer word) { -// if (fCaseSensitive) -// return super.evaluate(scanner, word); -// -// fBuffer.clear(); -// for (int i= 0, n= word.length(); i < n; i++) -// fBuffer.append(Character.toUpperCase(word.charAt(i))); -// -// IToken token= (IToken) fUppercaseWords.get(fBuffer); -// if (token != null) -// return token; -// return Token.UNDEFINED; -// } -// -// /** -// * Enables/disables the case-sensitivity of the task tag detection. -// * -// * @param caseSensitive <code>true</code> iff case-sensitivity should be enabled -// * @since 3.0 -// */ -// public void setCaseSensitive(boolean caseSensitive) { -// fCaseSensitive= caseSensitive; -// } -// } - -// private static final String COMPILER_TASK_TAGS = JavaCore.COMPILER_TASK_TAGS; -// protected static final String TASK_TAG = IJavaColorConstants.TASK_TAG; -// /** -// * Preference key of a string preference, specifying if task tag detection is case-sensitive. -// * @since 3.0 -// */ -// private static final String COMPILER_TASK_CASE_SENSITIVE= JavaCore.COMPILER_TASK_CASE_SENSITIVE; -// /** -// * Preference value of enabled preferences. -// * @since 3.0 -// */ -// private static final String ENABLED= JavaCore.ENABLED; - -// private TaskTagMatcher fTaskTagMatcher; - private String fDefaultTokenProperty; - private String[] fTokenProperties; - - public JavaScriptCommentScanner(IResourcePool manager, IPreferenceStore store, String defaultTokenProperty) { - this(manager, store, defaultTokenProperty, new String[] { defaultTokenProperty/*, TASK_TAG*/ }); - } - - public JavaScriptCommentScanner(IResourcePool manager, IPreferenceStore store, String defaultTokenProperty, String[] tokenProperties) { - super(manager, store); - - fDefaultTokenProperty= defaultTokenProperty; - fTokenProperties= tokenProperties; - - initialize(); - } - - /* - * @see AbstractJavaScanner#createRules() - */ - @Override - protected List<IRule> createRules() { - List<IRule> list= new ArrayList<IRule>(); - Token defaultToken= getToken(fDefaultTokenProperty); - - List<WordMatcher> matchers= createMatchers(); - if (matchers.size() > 0) { - CombinedWordRule combinedWordRule= new CombinedWordRule(new AtJavaIdentifierDetector(), defaultToken); - for (int i= 0, n= matchers.size(); i < n; i++) - combinedWordRule.addWordMatcher((WordMatcher) matchers.get(i)); - list.add(combinedWordRule); - } - - setDefaultReturnToken(defaultToken); - - return list; - } - - /** - * Creates a list of word matchers. - * - * @return the list of word matchers - */ - protected List<WordMatcher> createMatchers() { - List<WordMatcher> list= new ArrayList<WordMatcher>(); - -// // Add rule for Task Tags. -// boolean isCaseSensitive= true; -// String tasks= null; -// if (getPreferenceStore().contains(COMPILER_TASK_TAGS)) { -// tasks= getPreferenceStore().getString(COMPILER_TASK_TAGS); -// isCaseSensitive= ENABLED.equals(getPreferenceStore().getString(COMPILER_TASK_CASE_SENSITIVE)); -// } -// if (tasks != null) { -// fTaskTagMatcher= new TaskTagMatcher(getToken(TASK_TAG)); -// fTaskTagMatcher.addTaskTags(tasks); -// fTaskTagMatcher.setCaseSensitive(isCaseSensitive); -// list.add(fTaskTagMatcher); -// } - - return list; - } - -// /* -// * @see org.eclipse.jdt.internal.ui.text.AbstractJavaScanner#affectsBehavior(org.eclipse.jface.util.PropertyChangeEvent) -// */ -// public boolean affectsBehavior(PropertyChangeEvent event) { -// return event.getProperty().equals(COMPILER_TASK_TAGS) || event.getProperty().equals(COMPILER_TASK_CASE_SENSITIVE) || super.affectsBehavior(event); -// } - -// /* -// * @see org.eclipse.jdt.internal.ui.text.AbstractJavaScanner#adaptToPreferenceChange(org.eclipse.jface.util.PropertyChangeEvent) -// */ -// public void adaptToPreferenceChange(PropertyChangeEvent event) { -// if (fTaskTagMatcher != null && event.getProperty().equals(COMPILER_TASK_TAGS)) { -// Object value= event.getNewValue(); -// if (value instanceof String) { -// synchronized (fTaskTagMatcher) { -// fTaskTagMatcher.clearWords(); -// fTaskTagMatcher.addTaskTags((String) value); -// } -// } -// } else if (fTaskTagMatcher != null && event.getProperty().equals(COMPILER_TASK_CASE_SENSITIVE)) { -// Object value= event.getNewValue(); -// if (value instanceof String) -// fTaskTagMatcher.setCaseSensitive(ENABLED.equals(value)); -// } else if (super.affectsBehavior(event)) -// super.adaptToPreferenceChange(event); -// } - - /* - * @see org.eclipse.jdt.internal.ui.text.AbstractJavaScanner#getTokenProperties() - */ - @Override - protected String[] getTokenProperties() { - return fTokenProperties; - } - -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptDocScanner.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptDocScanner.java deleted file mode 100644 index 06f3cb67..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptDocScanner.java +++ /dev/null @@ -1,211 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - * Anton Leherbauer (Wind River Systems) - [misc] Allow custom token for WhitespaceRule - https://bugs.eclipse.org/bugs/show_bug.cgi?id=251224 - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.e4.tools.emf.ui.script.js.ResourceProvider; -import org.eclipse.e4.tools.emf.ui.script.js.text.scanners.CombinedWordRule.CharacterBuffer; -import org.eclipse.e4.tools.emf.ui.script.js.text.scanners.CombinedWordRule.WordMatcher; -import org.eclipse.e4.tools.services.IResourcePool; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.rules.ICharacterScanner; -import org.eclipse.jface.text.rules.IRule; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.IWordDetector; -import org.eclipse.jface.text.rules.SingleLineRule; -import org.eclipse.jface.text.rules.Token; -import org.eclipse.jface.text.rules.WhitespaceRule; -import org.eclipse.jface.text.rules.WordRule; - -/** - * A rule based JavaDoc scanner. - */ -public final class JavaScriptDocScanner extends JavaScriptCommentScanner { - - - /** - * Detector for HTML comment delimiters. - */ - static class HTMLCommentDetector implements IWordDetector { - - /** - * @see IWordDetector#isWordStart(char) - */ - @Override - public boolean isWordStart(char c) { - return (c == '<' || c == '-'); - } - - /** - * @see IWordDetector#isWordPart(char) - */ - @Override - public boolean isWordPart(char c) { - return (c == '-' || c == '!' || c == '>'); - } - } - - class TagRule extends SingleLineRule { - - /* - * @see SingleLineRule - */ - public TagRule(IToken token) { - super("<", ">", token, (char) 0); //$NON-NLS-2$ //$NON-NLS-1$ - } - - /* - * @see SingleLineRule - */ - public TagRule(IToken token, char escapeCharacter) { - super("<", ">", token, escapeCharacter); //$NON-NLS-2$ //$NON-NLS-1$ - } - - private IToken evaluateToken() { - try { - final String token= getDocument().get(getTokenOffset(), getTokenLength()) + "."; //$NON-NLS-1$ - - int offset= 0; - char character= token.charAt(++offset); - - if (character == '/') - character= token.charAt(++offset); - - while (Character.isWhitespace(character)) - character= token.charAt(++offset); - - while (Character.isLetterOrDigit(character)) - character= token.charAt(++offset); - - while (Character.isWhitespace(character)) - character= token.charAt(++offset); - - if (offset >= 2 && token.charAt(offset) == fEndSequence[0]) - return fToken; - - } catch (BadLocationException exception) { - // Do nothing - } - return getToken(ResourceProvider.JAVADOC_DEFAULT); - } - - /* - * @see PatternRule#evaluate(ICharacterScanner) - */ - @Override - public IToken evaluate(ICharacterScanner scanner) { - IToken result= super.evaluate(scanner); - if (result == fToken) - return evaluateToken(); - return result; - } - } - - private static String[] fgTokenProperties= { - ResourceProvider.JAVADOC_KEYWORD, - ResourceProvider.JAVADOC_TAG, - ResourceProvider.JAVADOC_LINK, - ResourceProvider.JAVADOC_DEFAULT/*, - TASK_TAG*/ - }; - - - public JavaScriptDocScanner(IResourcePool manager, IPreferenceStore store) { - super(manager, store, ResourceProvider.JAVADOC_DEFAULT, fgTokenProperties); - } - - - public IDocument getDocument() { - return fDocument; - } - - /* - * @see AbstractJavaScanner#createRules() - */ - @Override - protected List<IRule> createRules() { - - List<IRule> list= new ArrayList<IRule>(); - - // Add rule for tags. - Token token= getToken(ResourceProvider.JAVADOC_TAG); - list.add(new TagRule(token)); - - - // Add rule for HTML comments - WordRule wordRule= new WordRule(new HTMLCommentDetector(), token); - wordRule.addWord("<!--", token); //$NON-NLS-1$ - wordRule.addWord("--!>", token); //$NON-NLS-1$ - list.add(wordRule); - - - // Add rule for links. - token= getToken(ResourceProvider.JAVADOC_LINK); - list.add(new SingleLineRule("{@link", "}", token)); //$NON-NLS-2$ //$NON-NLS-1$ - list.add(new SingleLineRule("{@value", "}", token)); //$NON-NLS-2$ //$NON-NLS-1$ - list.add(new SingleLineRule("{@inheritDoc", "}", token)); //$NON-NLS-2$ //$NON-NLS-1$ - - - // Add generic whitespace rule. - token= getToken(ResourceProvider.JAVADOC_DEFAULT); - list.add(new WhitespaceRule(new JavaScriptWhitespaceDetector(), token)); - - - list.addAll(super.createRules()); - return list; - } - - /* - * @see org.eclipse.jdt.internal.ui.text.JavaCommentScanner#createMatchers() - */ - @Override - protected List<WordMatcher> createMatchers() { - List<WordMatcher> list= super.createMatchers(); - - // Add word rule for keywords. - final IToken token= getToken(ResourceProvider.JAVADOC_KEYWORD); - WordMatcher matcher= new WordMatcher() { - @Override - public IToken evaluate(ICharacterScanner scanner, CharacterBuffer word) { - int length= word.length(); - if (length > 1 && word.charAt(0) == '@') { - int i= 0; - try { - for (; i <= length; i++) - scanner.unread(); - int c= scanner.read(); - i--; - if (c == '*' || Character.isWhitespace((char)c)) { - scanner.unread(); - return token; - } - } finally { - for (; i >= 0; i--) - scanner.read(); - } - } - return Token.UNDEFINED; - } - }; - list.add(matcher); - - return list; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptPresentationReconciler.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptPresentationReconciler.java deleted file mode 100644 index ef153ae7..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptPresentationReconciler.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.TextPresentation; -import org.eclipse.jface.text.presentation.PresentationReconciler; - - -/** - * Presentation reconciler, adding functionality for operation without a viewer. - * - * @since 3.0 - */ -public class JavaScriptPresentationReconciler extends PresentationReconciler { - - /** Last used document */ - private IDocument fLastDocument; - - /** - * Constructs a "repair description" for the given damage and returns - * this description as a text presentation. - * <p> - * NOTE: Should not be used if this reconciler is installed on a viewer. - * </p> - * - * @param damage the damage to be repaired - * @param document the document whose presentation must be repaired - * @return the presentation repair description as text presentation - */ - public TextPresentation createRepairDescription(IRegion damage, IDocument document) { - if (document != fLastDocument) { - setDocumentToDamagers(document); - setDocumentToRepairers(document); - fLastDocument= document; - } - return createPresentation(damage, document); - } -} diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptSourceViewerConfiguration.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptSourceViewerConfiguration.java deleted file mode 100644 index c4890f83..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptSourceViewerConfiguration.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.presentation.IPresentationReconciler; -import org.eclipse.jface.text.presentation.PresentationReconciler; -import org.eclipse.jface.text.rules.DefaultDamagerRepairer; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.jface.text.source.SourceViewerConfiguration; - -public class JavaScriptSourceViewerConfiguration extends SourceViewerConfiguration { - private JavaScriptTextTools textTools; - - public JavaScriptSourceViewerConfiguration(JavaScriptTextTools textTools) { - this.textTools = textTools; - } - - @Override - public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { - return new String[] { - IDocument.DEFAULT_CONTENT_TYPE, - IJavaScriptPartitions.JAVA_DOC, - IJavaScriptPartitions.JAVA_MULTI_LINE_COMMENT, - IJavaScriptPartitions.JAVA_SINGLE_LINE_COMMENT, - IJavaScriptPartitions.JAVA_STRING, - IJavaScriptPartitions.JAVA_CHARACTER - }; - } - - @Override - public String getConfiguredDocumentPartitioning(ISourceViewer sourceViewer) { - return IJavaScriptPartitions.JAVA_PARTITIONING; - } - - @Override - public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { - PresentationReconciler reconciler= new JavaScriptPresentationReconciler(); - reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); - - DefaultDamagerRepairer dr= new DefaultDamagerRepairer(textTools.getCodeScanner()); - reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); - reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); - - dr= new DefaultDamagerRepairer(textTools.getJavaDocScanner()); - reconciler.setDamager(dr, IJavaScriptPartitions.JAVA_DOC); - reconciler.setRepairer(dr, IJavaScriptPartitions.JAVA_DOC); - - dr= new DefaultDamagerRepairer(textTools.getMultilineCommentScanner()); - reconciler.setDamager(dr, IJavaScriptPartitions.JAVA_MULTI_LINE_COMMENT); - reconciler.setRepairer(dr, IJavaScriptPartitions.JAVA_MULTI_LINE_COMMENT); - - dr= new DefaultDamagerRepairer(textTools.getSinglelineCommentScanner()); - reconciler.setDamager(dr, IJavaScriptPartitions.JAVA_SINGLE_LINE_COMMENT); - reconciler.setRepairer(dr, IJavaScriptPartitions.JAVA_SINGLE_LINE_COMMENT); - - dr= new DefaultDamagerRepairer(textTools.getStringScanner()); - reconciler.setDamager(dr, IJavaScriptPartitions.JAVA_STRING); - reconciler.setRepairer(dr, IJavaScriptPartitions.JAVA_STRING); - - dr= new DefaultDamagerRepairer(textTools.getStringScanner()); - reconciler.setDamager(dr, IJavaScriptPartitions.JAVA_CHARACTER); - reconciler.setRepairer(dr, IJavaScriptPartitions.JAVA_CHARACTER); - - - return reconciler; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptTextTools.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptTextTools.java deleted file mode 100644 index 7dd10082..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptTextTools.java +++ /dev/null @@ -1,158 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - -import org.eclipse.e4.tools.emf.ui.script.js.ResourceProvider; -import org.eclipse.e4.tools.services.IResourcePool; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IDocumentExtension3; -import org.eclipse.jface.text.IDocumentPartitioner; -import org.eclipse.jface.text.rules.FastPartitioner; -import org.eclipse.jface.text.rules.IPartitionTokenScanner; -import org.eclipse.jface.text.rules.ITokenScanner; - -public class JavaScriptTextTools { - /** - * Array with legal content types. - * @since 3.0 - */ - private final static String[] LEGAL_CONTENT_TYPES= new String[] { - IJavaScriptPartitions.JAVA_DOC, - IJavaScriptPartitions.JAVA_MULTI_LINE_COMMENT, - IJavaScriptPartitions.JAVA_SINGLE_LINE_COMMENT, - IJavaScriptPartitions.JAVA_STRING, - IJavaScriptPartitions.JAVA_CHARACTER - }; - -// /** -// * This tools' preference listener. -// */ -// private class PreferenceListener implements IPropertyChangeListener { -// public void propertyChange(PropertyChangeEvent event) { -// adaptToPreferenceChange(event); -// } -// } - - /** The Java source code scanner. */ - private JavaScriptCodeScanner fCodeScanner; - /** The Java multi-line comment scanner. */ - private JavaScriptCommentScanner fMultilineCommentScanner; - /** The Java single-line comment scanner. */ - private JavaScriptCommentScanner fSinglelineCommentScanner; - /** The Java string scanner. */ - private SingleTokenJavaScanner fStringScanner; - /** The JavaDoc scanner. */ - private JavaScriptDocScanner fJavaDocScanner; -// /** The preference store. */ -// private IPreferenceStore fPreferenceStore; - - /** - * The core preference store. - * @since 2.1 - */ - /** The preference change listener */ -// private PreferenceListener fPreferenceListener= new PreferenceListener(); - - public JavaScriptTextTools(IResourcePool resourcePool, IPreferenceStore store) { -// fPreferenceStore = store; -// fPreferenceStore.addPropertyChangeListener(fPreferenceListener); - - fCodeScanner= new JavaScriptCodeScanner(resourcePool, store); - fMultilineCommentScanner= new JavaScriptCommentScanner(resourcePool, store, ResourceProvider.JAVA_MULTI_LINE_COMMENT); - fSinglelineCommentScanner= new JavaScriptCommentScanner(resourcePool, store, ResourceProvider.JAVA_SINGLE_LINE_COMMENT); - fStringScanner= new SingleTokenJavaScanner(resourcePool, store, ResourceProvider.JAVA_STRING); - fJavaDocScanner= new JavaScriptDocScanner(resourcePool, store); - } - - public ITokenScanner getMultilineCommentScanner() { - return fMultilineCommentScanner; - } - - public ITokenScanner getSinglelineCommentScanner() { - return fSinglelineCommentScanner; - } - - public ITokenScanner getStringScanner() { - return fStringScanner; - } - - public ITokenScanner getJavaDocScanner() { - return fJavaDocScanner; - } - - public ITokenScanner getCodeScanner() { - return fCodeScanner; - } - - /** - * Sets up the Java document partitioner for the given document for the given partitioning. - * - * @param document the document to be set up - * @param partitioning the document partitioning - * @since 3.0 - */ - public void setupJavaDocumentPartitioner(IDocument document, String partitioning) { - IDocumentPartitioner partitioner= createDocumentPartitioner(); - if (document instanceof IDocumentExtension3) { - IDocumentExtension3 extension3= (IDocumentExtension3) document; - extension3.setDocumentPartitioner(partitioning, partitioner); - } else { - document.setDocumentPartitioner(partitioner); - } - partitioner.connect(document); - } - - /** - * Returns a scanner which is configured to scan - * Java-specific partitions, which are multi-line comments, - * Javadoc comments, and regular Java source code. - * - * @return a Java partition scanner - */ - public IPartitionTokenScanner getPartitionScanner() { - return new FastJavaScriptPartitionScanner(); - } - - /** - * Factory method for creating a Java-specific document partitioner - * using this object's partitions scanner. This method is a - * convenience method. - * - * @return a newly created Java document partitioner - */ - public IDocumentPartitioner createDocumentPartitioner() { - return new FastPartitioner(getPartitionScanner(), LEGAL_CONTENT_TYPES); - } - -// /** -// * Adapts the behavior of the contained components to the change -// * encoded in the given event. -// * -// * @param event the event to which to adapt -// * @since 2.0 -// */ -// private void adaptToPreferenceChange(PropertyChangeEvent event) { -// if (fCodeScanner.affectsBehavior(event)) -// fCodeScanner.adaptToPreferenceChange(event); -// if (fMultilineCommentScanner.affectsBehavior(event)) -// fMultilineCommentScanner.adaptToPreferenceChange(event); -// if (fSinglelineCommentScanner.affectsBehavior(event)) -// fSinglelineCommentScanner.adaptToPreferenceChange(event); -// if (fStringScanner.affectsBehavior(event)) -// fStringScanner.adaptToPreferenceChange(event); -// if (fJavaDocScanner.affectsBehavior(event)) -// fJavaDocScanner.adaptToPreferenceChange(event); -// } -} diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptWhitespaceDetector.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptWhitespaceDetector.java deleted file mode 100644 index 793f3054..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptWhitespaceDetector.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - - -import org.eclipse.jface.text.rules.IWhitespaceDetector; - -/** - * A java aware white space detector. - */ -public class JavaScriptWhitespaceDetector implements IWhitespaceDetector { - - /** - * @see IWhitespaceDetector#isWhitespace - */ - @Override - public boolean isWhitespace(char c) { - return Character.isWhitespace(c); - } -} diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptWordDetector.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptWordDetector.java deleted file mode 100644 index 8160ae12..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/JavaScriptWordDetector.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - -import org.eclipse.jface.text.rules.IWordDetector; - -/** - * A Java aware word detector. - */ -public class JavaScriptWordDetector implements IWordDetector { - - /* - * @see IWordDetector#isWordStart - */ - @Override - public boolean isWordStart(char c) { - return Character.isJavaIdentifierStart(c); - } - - /* - * @see IWordDetector#isWordPart - */ - @Override - public boolean isWordPart(char c) { - return Character.isJavaIdentifierPart(c); - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/PreferenceConstants.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/PreferenceConstants.java deleted file mode 100644 index 67f86bb3..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/PreferenceConstants.java +++ /dev/null @@ -1,105 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - -public class PreferenceConstants { - /** - * Preference key suffix for bold text style preference keys. - * - * @since 2.1 - */ - public static final String EDITOR_BOLD_SUFFIX= "_bold"; //$NON-NLS-1$ - - /** - * Preference key suffix for italic text style preference keys. - * - * @since 3.0 - */ - public static final String EDITOR_ITALIC_SUFFIX= "_italic"; //$NON-NLS-1$ - - /** - * Preference key suffix for strikethrough text style preference keys. - * - * @since 3.1 - */ - public static final String EDITOR_STRIKETHROUGH_SUFFIX= "_strikethrough"; //$NON-NLS-1$ - - /** - * Preference key suffix for underline text style preference keys. - * - * @since 3.1 - */ - public static final String EDITOR_UNDERLINE_SUFFIX= "_underline"; //$NON-NLS-1$ - - /** - * A named preference prefix for semantic highlighting preferences. - * - * @since 3.0 - */ - public static final String EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX="semanticHighlighting."; //$NON-NLS-1$ - - /** - * A named preference suffix that controls a semantic highlighting's color. - * <p> - * Value is of type <code>String</code>. A RGB color value encoded as a string - * using class <code>PreferenceConverter</code> - * </p> - * - * @see org.eclipse.jface.resource.StringConverter - * @see org.eclipse.jface.preference.PreferenceConverter - * @since 3.0 - */ - public static final String EDITOR_SEMANTIC_HIGHLIGHTING_COLOR_SUFFIX=".color"; //$NON-NLS-1$ - - /** - * A named preference suffix that controls if semantic highlighting has the text attribute bold. - * <p> - * Value is of type <code>Boolean</code>: <code>true</code> if bold. - * </p> - * - * @since 3.0 - */ - public static final String EDITOR_SEMANTIC_HIGHLIGHTING_BOLD_SUFFIX=".bold"; //$NON-NLS-1$ - - /** - * A named preference suffix that controls if semantic highlighting has the text attribute italic. - * <p> - * Value is of type <code>Boolean</code>: <code>true</code> if italic. - * </p> - * - * @since 3.0 - */ - public static final String EDITOR_SEMANTIC_HIGHLIGHTING_ITALIC_SUFFIX=".italic"; //$NON-NLS-1$ - - /** - * A named preference suffix that controls if semantic highlighting has the text attribute strikethrough. - * <p> - * Value is of type <code>Boolean</code>: <code>true</code> if strikethrough. - * </p> - * - * @since 3.1 - */ - public static final String EDITOR_SEMANTIC_HIGHLIGHTING_STRIKETHROUGH_SUFFIX=".strikethrough"; //$NON-NLS-1$ - - /** - * A named preference suffix that controls if semantic highlighting has the text attribute underline. - * <p> - * Value is of type <code>Boolean</code>: <code>true</code> if underline. - * </p> - * - * @since 3.1 - */ - public static final String EDITOR_SEMANTIC_HIGHLIGHTING_UNDERLINE_SUFFIX=".underline"; //$NON-NLS-1$ - -} diff --git a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/SingleTokenJavaScanner.java b/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/SingleTokenJavaScanner.java deleted file mode 100644 index 5a4e5b2c..00000000 --- a/bundles/org.eclipse.e4.tools.emf.ui.script.js/src/org/eclipse/e4/tools/emf/ui/script/js/text/scanners/SingleTokenJavaScanner.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.e4.tools.emf.ui.script.js.text.scanners; - - -import java.util.List; - -import org.eclipse.e4.tools.services.IResourcePool; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.rules.IRule; - - -/** - * - */ -public final class SingleTokenJavaScanner extends AbstractJavaScanner{ - - - private String[] fProperty; - - public SingleTokenJavaScanner(IResourcePool manager, IPreferenceStore store, String property) { - super(manager, store); - fProperty= new String[] { property }; - initialize(); - } - - /* - * @see AbstractJavaScanner#getTokenProperties() - */ - @Override - protected String[] getTokenProperties() { - return fProperty; - } - - /* - * @see AbstractJavaScanner#createRules() - */ - @Override - protected List<IRule> createRules() { - setDefaultReturnToken(getToken(fProperty[0])); - return null; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.event.spy/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.tools.event.spy/META-INF/MANIFEST.MF index 1d78b2a5..191c1e7f 100644 --- a/bundles/org.eclipse.e4.tools.event.spy/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.e4.tools.event.spy/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Event Spy Bundle-SymbolicName: org.eclipse.e4.tools.event.spy;singleton:=true -Bundle-Version: 0.15.0.qualifier +Bundle-Version: 0.19.0.qualifier Bundle-Vendor: Eclipse Foundation Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, @@ -12,7 +12,6 @@ Require-Bundle: org.eclipse.ui, org.eclipse.e4.ui.model.workbench;bundle-version="1.0.0", org.eclipse.e4.core.services;bundle-version="1.1.0", javax.inject;bundle-version="1.0.0", - org.eclipse.e4.ui.bindings;bundle-version="0.10.100", org.eclipse.core.resources;bundle-version="3.8.100", org.eclipse.jdt.core;bundle-version="3.9.0", org.eclipse.jdt.ui;bundle-version="3.9.0", @@ -21,9 +20,7 @@ Require-Bundle: org.eclipse.ui, org.eclipse.jface.databinding, org.eclipse.core.databinding.observable, org.eclipse.core.databinding.beans, - org.eclipse.core.databinding.property, - org.eclipse.e4.tools.spy, - org.eclipse.e4.ui.di + org.eclipse.e4.tools.spy Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-ActivationPolicy: lazy Import-Package: javax.annotation;version="1.2.0" diff --git a/bundles/org.eclipse.e4.tools.event.spy/pom.xml b/bundles/org.eclipse.e4.tools.event.spy/pom.xml index 8c7fc601..0752b132 100644 --- a/bundles/org.eclipse.e4.tools.event.spy/pom.xml +++ b/bundles/org.eclipse.e4.tools.event.spy/pom.xml @@ -4,13 +4,13 @@ <parent> <groupId>org.eclipse.e4.tools</groupId> <artifactId>e4-tools-aggregator</artifactId> - <version>0.18.0-SNAPSHOT</version> + <version>0.19.0-SNAPSHOT</version> <relativePath>../../</relativePath> </parent> <groupId>org.eclipse.e4</groupId> <artifactId>org.eclipse.e4.tools.event.spy</artifactId> - <version>0.15.0-SNAPSHOT</version> + <version>0.19.0-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/bundles/org.eclipse.e4.tools.model.spy/.classpath b/bundles/org.eclipse.e4.tools.model.spy/.classpath deleted file mode 100644 index e801ebfb..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/bundles/org.eclipse.e4.tools.model.spy/.project b/bundles/org.eclipse.e4.tools.model.spy/.project deleted file mode 100644 index fc7ec625..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/.project +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.e4.tools.model.spy</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ds.core.builder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/bundles/org.eclipse.e4.tools.model.spy/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.e4.tools.model.spy/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/bundles/org.eclipse.e4.tools.model.spy/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.tools.model.spy/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 2f55e9a2..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,315 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 -org.eclipse.jdt.core.compiler.compliance=11 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=11 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=80 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=120 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true -org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true -org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true -org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/bundles/org.eclipse.e4.tools.model.spy/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.e4.tools.model.spy/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4c3dee26..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,62 +0,0 @@ -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile -formatter_settings_version=12 -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_functional_interfaces=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=true -sp_cleanup.format_source_code_changes_only=true -sp_cleanup.insert_inferred_type_arguments=false -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -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 -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_redundant_type_arguments=false -sp_cleanup.remove_trailing_whitespaces=true -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=true -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_anonymous_class_creation=false -sp_cleanup.use_blocks=true -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_lambda=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true -sp_cleanup.use_type_arguments=false diff --git a/bundles/org.eclipse.e4.tools.model.spy/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.tools.model.spy/META-INF/MANIFEST.MF deleted file mode 100644 index d3071bc2..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/META-INF/MANIFEST.MF +++ /dev/null @@ -1,26 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-SymbolicName: org.eclipse.e4.tools.model.spy;singleton:=true -Bundle-Version: 0.12.100.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-11 -Require-Bundle: org.eclipse.e4.ui.services;bundle-version="0.9.1", - org.eclipse.e4.tools.emf.ui;bundle-version="0.9.0", - org.eclipse.emf.edit;bundle-version="2.6.0", - org.eclipse.core.databinding.observable;bundle-version="1.3.0", - org.eclipse.equinox.common;bundle-version="3.6.0", - org.eclipse.e4.ui.model.workbench;bundle-version="0.9.1", - org.eclipse.core.resources;bundle-version="3.6.0", - org.eclipse.e4.core.contexts;bundle-version="0.9.0", - org.eclipse.e4.core.di;bundle-version="0.9.0", - org.eclipse.jface;bundle-version="3.6.0", - org.eclipse.equinox.registry;bundle-version="3.5.0", - org.eclipse.e4.ui.di;bundle-version="0.9.0", - org.eclipse.e4.tools.spy;bundle-version="0.18.0" -Bundle-Vendor: %Bundle-Vendor -Service-Component: OSGI-INF/extensionlookup.xml -Bundle-ActivationPolicy: lazy -Import-Package: javax.annotation;version="1.2.0", - javax.inject;version="1.0.0" -Export-Package: org.eclipse.e4.tools.model.spy;x-internal:=true -Automatic-Module-Name: org.eclipse.e4.tools.model.spy diff --git a/bundles/org.eclipse.e4.tools.model.spy/OSGI-INF/extensionlookup.xml b/bundles/org.eclipse.e4.tools.model.spy/OSGI-INF/extensionlookup.xml deleted file mode 100644 index c2fb74fb..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/OSGI-INF/extensionlookup.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.e4.tools.model.spy"> - <implementation class="org.eclipse.e4.tools.model.spy.RuntimeExtensionLookup"/> - <service> - <provide interface="org.eclipse.e4.tools.emf.ui.common.IExtensionLookup"/> - </service> - <property name="service.ranking" type="Integer" value="0"/> -</scr:component> diff --git a/bundles/org.eclipse.e4.tools.model.spy/OSGI-INF/l10n/bundle.properties b/bundles/org.eclipse.e4.tools.model.spy/OSGI-INF/l10n/bundle.properties deleted file mode 100644 index 564d64d0..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/OSGI-INF/l10n/bundle.properties +++ /dev/null @@ -1,3 +0,0 @@ -#Properties file for org.eclipse.e4.tools.model.spy -Bundle-Name = ModelSpy -Bundle-Vendor = Eclipse.org
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.model.spy/README.md b/bundles/org.eclipse.e4.tools.model.spy/README.md deleted file mode 100644 index fa319782..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/README.md +++ /dev/null @@ -1,14 +0,0 @@ -org.eclipse.e4.tools.model.spy -=================================== - -Registers the e4 application model editor via a processor. See the ModelProcessor class. - -For more information, refer to the [Eclipse e4 wiki page] [1]. - -License -------- - -[Eclipse Public License (EPL) v1.0][2] - -[1]: http://www.eclipse.org/e4/ -[2]: http://wiki.eclipse.org/EPL diff --git a/bundles/org.eclipse.e4.tools.model.spy/about.html b/bundles/org.eclipse.e4.tools.model.spy/about.html deleted file mode 100644 index 82494867..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/about.html +++ /dev/null @@ -1,28 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> -<title>About</title> -</head> -<body lang="EN-US"> -<h2>About This Content</h2> - -<p>December 3, 2009</p> -<h3>License</h3> - -<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. -For purposes of the EPL, "Program" will mean the Content.</p> - -<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> - -</body> -</html>
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.model.spy/build.properties b/bundles/org.eclipse.e4.tools.model.spy/build.properties deleted file mode 100644 index b41fcbec..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - about.html,\ - OSGI-INF/,\ - OSGI-INF/extensionlookup.xml,\ - icons/ -source.. = src/ diff --git a/bundles/org.eclipse.e4.tools.model.spy/forceQualifierUpdate.txt b/bundles/org.eclipse.e4.tools.model.spy/forceQualifierUpdate.txt deleted file mode 100644 index 396f0875..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/forceQualifierUpdate.txt +++ /dev/null @@ -1,2 +0,0 @@ -# To force a version qualifier update add the bug here -Bug 403237 - o.e.e4.tools cannot be build with "mvn clean install" diff --git a/bundles/org.eclipse.e4.tools.model.spy/icons/full/obj16/application_lightning.png b/bundles/org.eclipse.e4.tools.model.spy/icons/full/obj16/application_lightning.png Binary files differdeleted file mode 100644 index 7e91545c..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/icons/full/obj16/application_lightning.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.model.spy/plugin.xml b/bundles/org.eclipse.e4.tools.model.spy/plugin.xml deleted file mode 100644 index 6978ccf2..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/plugin.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.4"?> -<plugin> - <extension - point="org.eclipse.e4.tools.spy.spyPart"> - <spyPart - description="Open the live model spy" - icon="icons/full/obj16/application_lightning.png" - name="Model Spy" - part="org.eclipse.e4.tools.model.spy.ModelSpyPart" - shortcut="M2+M3+F9"> - </spyPart> - </extension> - -</plugin> diff --git a/bundles/org.eclipse.e4.tools.model.spy/pom.xml b/bundles/org.eclipse.e4.tools.model.spy/pom.xml deleted file mode 100644 index 07093aa3..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.eclipse.e4.tools</groupId> - <artifactId>e4-tools-aggregator</artifactId> - <version>0.18.0-SNAPSHOT</version> - <relativePath>../../</relativePath> - </parent> - - <groupId>org.eclipse.e4</groupId> - <artifactId>org.eclipse.e4.tools.model.spy</artifactId> - <version>0.12.100-SNAPSHOT</version> - <packaging>eclipse-plugin</packaging> - -</project> diff --git a/bundles/org.eclipse.e4.tools.model.spy/src/org/eclipse/e4/tools/model/spy/MemoryModelResource.java b/bundles/org.eclipse.e4.tools.model.spy/src/org/eclipse/e4/tools/model/spy/MemoryModelResource.java deleted file mode 100644 index 35c824e8..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/src/org/eclipse/e4/tools/model/spy/MemoryModelResource.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 BestSolution.at and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation - ******************************************************************************/ -package org.eclipse.e4.tools.model.spy; - -import org.eclipse.core.databinding.observable.list.IObservableList; -import org.eclipse.core.databinding.observable.list.WritableList; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.e4.tools.emf.ui.common.IModelResource; -import org.eclipse.e4.ui.model.application.MApplication; -import org.eclipse.emf.common.command.BasicCommandStack; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; - -public class MemoryModelResource implements IModelResource { - private WritableList list = new WritableList<>(); - private EditingDomain editingDomain; - - public MemoryModelResource(MApplication application) { - list.add(application); - BasicCommandStack commandStack = new BasicCommandStack(); - ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory( - ComposedAdapterFactory.Descriptor.Registry.INSTANCE); - adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); - editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack); - } - - @Override - public IObservableList getRoot() { - return list; - } - - @Override - public boolean isSaveable() { - return false; - } - - @Override - public IStatus save() { - return Status.OK_STATUS; - } - - @Override - public EditingDomain getEditingDomain() { - return editingDomain; - } - - @Override - public boolean isDirty() { - return false; - } - - @Override - public void addModelListener(ModelListener listener) { - - } - - @Override - public void removeModelListener(ModelListener listener) { - - } - - public IMarker createMarker() { - return null; - } - - public void clearMarkers() { - - } - - @Override - public void replaceRoot(EObject eobject) { - - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.model.spy/src/org/eclipse/e4/tools/model/spy/ModelSpyPart.java b/bundles/org.eclipse.e4.tools.model.spy/src/org/eclipse/e4/tools/model/spy/ModelSpyPart.java deleted file mode 100644 index abe6a82b..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/src/org/eclipse/e4/tools/model/spy/ModelSpyPart.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 BestSolution.at and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation - ******************************************************************************/ -package org.eclipse.e4.tools.model.spy; - -import javax.inject.Inject; - -import org.eclipse.e4.core.contexts.ContextInjectionFactory; -import org.eclipse.e4.core.contexts.IEclipseContext; -import org.eclipse.e4.tools.emf.ui.common.IModelResource; -import org.eclipse.e4.tools.emf.ui.internal.wbm.ApplicationModelEditor; -import org.eclipse.e4.ui.di.Focus; -import org.eclipse.e4.ui.model.application.MApplication; - -public class ModelSpyPart { - private ApplicationModelEditor instance; - private IEclipseContext childContext; - - @Inject - public ModelSpyPart(IEclipseContext context, MApplication application) { - childContext = context.createChild("EditorContext"); - MemoryModelResource resource = new MemoryModelResource(application); - childContext.set(IModelResource.class, resource); - - instance = ContextInjectionFactory.make(ApplicationModelEditor.class, childContext); - } - - @Focus - void focus() { - ContextInjectionFactory.invoke(instance, Focus.class, childContext); - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.model.spy/src/org/eclipse/e4/tools/model/spy/OpenLiveDialogHandler.java b/bundles/org.eclipse.e4.tools.model.spy/src/org/eclipse/e4/tools/model/spy/OpenLiveDialogHandler.java deleted file mode 100644 index 44941662..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/src/org/eclipse/e4/tools/model/spy/OpenLiveDialogHandler.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 BestSolution.at and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation - ******************************************************************************/ -package org.eclipse.e4.tools.model.spy; - -import javax.inject.Named; - -import org.eclipse.e4.core.contexts.ContextInjectionFactory; -import org.eclipse.e4.core.contexts.IEclipseContext; -import org.eclipse.e4.core.di.annotations.Execute; -import org.eclipse.e4.tools.emf.ui.common.IModelResource; -import org.eclipse.e4.tools.emf.ui.internal.wbm.ApplicationModelEditor; -import org.eclipse.e4.ui.model.application.MApplication; -import org.eclipse.e4.ui.services.IServiceConstants; -import org.eclipse.e4.ui.services.IStylingEngine; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -public class OpenLiveDialogHandler { - private Shell shell; - - public OpenLiveDialogHandler() { - } - - @Execute - public void run(@Named(IServiceConstants.ACTIVE_SHELL) Shell s, MApplication application, IStylingEngine engine) { - if (this.shell == null || this.shell.isDisposed()) { - try { - this.shell = new Shell(s, SWT.SHELL_TRIM); - // FIXME Style - this.shell.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_WHITE)); - this.shell.setBackgroundMode(SWT.INHERIT_DEFAULT); - FillLayout layout = new FillLayout(); - layout.marginHeight = 10; - layout.marginWidth = 10; - this.shell.setLayout(layout); - - final IEclipseContext childContext = application.getContext().createChild("EditorContext"); - MemoryModelResource resource = new MemoryModelResource(application); - childContext.set(IModelResource.class, resource); - childContext.set(Composite.class.getName(), shell); - childContext.set(Shell.class.getName(), shell); - ContextInjectionFactory.make(ApplicationModelEditor.class, childContext); - - // new ApplicationModelEditor(shell, childContext, resource, - // null); - shell.open(); - Display d = shell.getDisplay(); - while (!shell.isDisposed()) { - if (!d.readAndDispatch()) { - d.sleep(); - } - } - childContext.dispose(); - // d.update(); - shell = null; - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/bundles/org.eclipse.e4.tools.model.spy/src/org/eclipse/e4/tools/model/spy/RuntimeExtensionLookup.java b/bundles/org.eclipse.e4.tools.model.spy/src/org/eclipse/e4/tools/model/spy/RuntimeExtensionLookup.java deleted file mode 100644 index 289285f9..00000000 --- a/bundles/org.eclipse.e4.tools.model.spy/src/org/eclipse/e4/tools/model/spy/RuntimeExtensionLookup.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.eclipse.e4.tools.model.spy; - -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.RegistryFactory; -import org.eclipse.e4.tools.emf.ui.common.IExtensionLookup; - -public class RuntimeExtensionLookup implements IExtensionLookup { - - @Override - public IExtension[] findExtensions(String extensionPointId, boolean liveModel) { - IExtensionRegistry registry = RegistryFactory.getRegistry(); - return registry.getExtensionPoint(extensionPointId).getExtensions(); - } - -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/.classpath b/bundles/org.eclipse.e4.tools.preference.spy/.classpath deleted file mode 100644 index e801ebfb..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/bundles/org.eclipse.e4.tools.preference.spy/.project b/bundles/org.eclipse.e4.tools.preference.spy/.project deleted file mode 100644 index 545d2b6f..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.e4.tools.preference.spy</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/bundles/org.eclipse.e4.tools.preference.spy/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.tools.preference.spy/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 2f55e9a2..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,315 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 -org.eclipse.jdt.core.compiler.compliance=11 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=11 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=80 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=120 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true -org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true -org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true -org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/bundles/org.eclipse.e4.tools.preference.spy/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.e4.tools.preference.spy/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 940027d2..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,62 +0,0 @@ -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile -formatter_settings_version=12 -sp_cleanup.add_default_serial_version_id=false -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=false -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_functional_interfaces=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=true -sp_cleanup.format_source_code_changes_only=true -sp_cleanup.insert_inferred_type_arguments=false -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=false -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=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=false -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=false -sp_cleanup.remove_redundant_type_arguments=false -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=false -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=false -sp_cleanup.remove_unused_private_members=true -sp_cleanup.remove_unused_private_methods=false -sp_cleanup.remove_unused_private_types=false -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_anonymous_class_creation=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_lambda=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=false -sp_cleanup.use_type_arguments=false diff --git a/bundles/org.eclipse.e4.tools.preference.spy/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.e4.tools.preference.spy/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index f29e940a..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,3 +0,0 @@ -eclipse.preferences.version=1 -pluginProject.extensions=false -resolve.requirebundle=false diff --git a/bundles/org.eclipse.e4.tools.preference.spy/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.tools.preference.spy/META-INF/MANIFEST.MF deleted file mode 100644 index 4abf6beb..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/META-INF/MANIFEST.MF +++ /dev/null @@ -1,29 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Spy -Bundle-SymbolicName: org.eclipse.e4.tools.preference.spy;singleton:=true -Bundle-Version: 0.2.0.qualifier -Bundle-Activator: org.eclipse.e4.tools.preference.spy.Activator -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.e4.ui.model.workbench;bundle-version="1.1.0", - org.eclipse.e4.core.di;bundle-version="1.4.0", - org.eclipse.e4.core.di.extensions;bundle-version="0.12.0", - org.eclipse.e4.core.services;bundle-version="1.2.0", - org.eclipse.osgi.services;bundle-version="3.4.0", - javax.inject, - org.eclipse.e4.ui.di;bundle-version="1.0.0", - org.eclipse.core.databinding;bundle-version="1.4.1", - org.eclipse.core.databinding.beans;bundle-version="1.2.200", - org.eclipse.core.databinding.observable;bundle-version="1.4.1", - org.eclipse.core.databinding.property;bundle-version="1.4.200", - org.eclipse.jface.databinding;bundle-version="1.6.200", - org.eclipse.e4.ui.services;bundle-version="1.1.0", - org.eclipse.e4.ui.workbench;bundle-version="1.1.0", - org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.e4.tools.spy -Bundle-RequiredExecutionEnvironment: JavaSE-11 -Import-Package: javax.annotation;version="1.2.0" -Bundle-ActivationPolicy: lazy -Automatic-Module-Name: org.eclipse.e4.tools.preference.spy diff --git a/bundles/org.eclipse.e4.tools.preference.spy/build.properties b/bundles/org.eclipse.e4.tools.preference.spy/build.properties deleted file mode 100644 index 2cefd72d..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -output.. = bin/ -bin.includes = plugin.xml,\ - META-INF/,\ - .,\ - icons/,\ - fragment.e4xmi -source.. = src/ diff --git a/bundles/org.eclipse.e4.tools.preference.spy/fragment.e4xmi b/bundles/org.eclipse.e4.tools.preference.spy/fragment.e4xmi deleted file mode 100644 index c6ae35dc..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/fragment.e4xmi +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:application="http://www.eclipse.org/ui/2010/UIModel/application" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/descriptor/basic" xmlns:commands="http://www.eclipse.org/ui/2010/UIModel/application/commands" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_YKjYcGxMEeSQ7v0akw7aRA"> - <fragments xsi:type="fragment:StringModelFragment" xmi:id="_wcDNcGxMEeSQ7v0akw7aRA" featurename="addons" parentElementId="xpath:/"> - <elements xsi:type="application:Addon" xmi:id="_ztg-MGxMEeSQ7v0akw7aRA" elementId="org.eclipse.e4.tools.preference.spy.addon" contributionURI="bundleclass://org.eclipse.e4.tools.preference.spy/org.eclipse.e4.tools.preference.spy.addon.PreferenceSpyAddon"> - <persistedState key="persistState" value="false"/> - </elements> - </fragments> - <fragments xsi:type="fragment:StringModelFragment" xmi:id="_P3fYQGxbEeSQ7v0akw7aRA" featurename="descriptors" parentElementId="xpath:/"> - <elements xsi:type="basic:PartDescriptor" xmi:id="_T4iy4GxbEeSQ7v0akw7aRA" elementId="org.eclipse.e4.tools.preference.spy.parts.PreferenceSpyPart" label="Preference Spy" iconURI="platform:/plugin/org.eclipse.e4.tools.preference.spy/icons/preference_spy.png" category="Eclipse runtime spies" closeable="true" contributionURI="bundleclass://org.eclipse.e4.tools.preference.spy/org.eclipse.e4.tools.preference.spy.parts.PreferenceSpyPart"> - <tags>View</tags> - <tags>Spy</tags> - <tags>categoryTag:Eclipse runtime spies</tags> - <toolbar xmi:id="_z17t0GxhEeSQ7v0akw7aRA" elementId="org.eclipse.e4.tools.preference.spy.toolbar"> - <children xsi:type="menu:ToolControl" xmi:id="_HKPQsIboEeS8O7Wb7Enz2Q" elementId="org.eclipse.e4.tools.preference.spy.toolcontrol.layout" contributionURI="bundleclass://org.eclipse.e4.tools.preference.spy/org.eclipse.e4.tools.preference.spy.handler.ToggleLayoutControl"/> - <children xsi:type="menu:ToolBarSeparator" xmi:id="_BW4yAIboEeS8O7Wb7Enz2Q" elementId="org.eclipse.e4.tools.preference.spy.toolbarseparator.0"/> - <children xsi:type="menu:HandledToolItem" xmi:id="_WhdsMHY7EeSuTdKDH5hMwg" elementId="org.eclipse.e4.tools.preference.spy.handledtoolitem.showall" iconURI="platform:/plugin/org.eclipse.e4.tools.preference.spy/icons/show_all_preferences.png" command="_ufxRsHY2EeSuTdKDH5hMwg"/> - <children xsi:type="menu:ToolControl" xmi:id="_D4kokIVcEeSI3e-Kt-dGSA" elementId="org.eclipse.e4.tools.preference.spy.toolcontrol.trace" contributionURI="bundleclass://org.eclipse.e4.tools.preference.spy/org.eclipse.e4.tools.preference.spy.handler.TogglePreferenceTraceControl"/> - <children xsi:type="menu:ToolBarSeparator" xmi:id="_xSwgEH_hEeSk-4v3KnNHPw" elementId="org.eclipse.e4.tools.preference.spy.toolbarseparator.1"/> - <children xsi:type="menu:HandledToolItem" xmi:id="_zYuuEH_hEeSk-4v3KnNHPw" elementId="org.eclipse.e4.tools.preference.spy.handledtoolitem.expandall" iconURI="platform:/plugin/org.eclipse.e4.tools.preference.spy/icons/expandall.png" command="_4NM_IH_gEeSk-4v3KnNHPw"/> - <children xsi:type="menu:HandledToolItem" xmi:id="_4wyX4H_hEeSk-4v3KnNHPw" elementId="org.eclipse.e4.tools.preference.spy.handledtoolitem.collapseall" iconURI="platform:/plugin/org.eclipse.e4.tools.preference.spy/icons/collapseall.png" command="_68UQwH_gEeSk-4v3KnNHPw"/> - <children xsi:type="menu:ToolBarSeparator" xmi:id="_7dG0MH_hEeSk-4v3KnNHPw" elementId="org.eclipse.e4.tools.preference.spy.toolbarseparator.2"/> - <children xsi:type="menu:HandledToolItem" xmi:id="_A6VYQGxiEeSQ7v0akw7aRA" elementId="org.eclipse.e4.tools.preference.spy.handledtoolitem.removeentry" iconURI="platform:/plugin/org.eclipse.e4.tools.preference.spy/icons/remove_co.png" command="_iGEkYGxiEeSQ7v0akw7aRA"/> - <children xsi:type="menu:HandledToolItem" xmi:id="_Tj_JEGxkEeSQ7v0akw7aRA" elementId="org.eclipse.e4.tools.preference.spy.handledtoolitem.removeall" iconURI="platform:/plugin/org.eclipse.e4.tools.preference.spy/icons/removeall_co.png" command="_eBGTEGxiEeSQ7v0akw7aRA"/> - </toolbar> - </elements> - </fragments> - <fragments xsi:type="fragment:StringModelFragment" xmi:id="_YcT00GxiEeSQ7v0akw7aRA" featurename="commands" parentElementId="xpath:/"> - <elements xsi:type="commands:Command" xmi:id="_eBGTEGxiEeSQ7v0akw7aRA" elementId="org.eclipse.e4.tools.preference.spy.command.removeAll" commandName="Remove All"> - <persistedState key="persistState" value="false"/> - <parameters xmi:id="_ujUuENlxEemSlqvMhebMxQ" elementId="org.eclipse.e4.tools.preference.spy.commandparameter.0" name="Command Parameter 0"/> - </elements> - <elements xsi:type="commands:Command" xmi:id="_iGEkYGxiEeSQ7v0akw7aRA" elementId="org.eclipse.e4.tools.preference.spy.command.removeEntry" commandName="Remove Entry"> - <persistedState key="persistState" value="false"/> - </elements> - <elements xsi:type="commands:Command" xmi:id="_ufxRsHY2EeSuTdKDH5hMwg" elementId="org.eclipse.e4.tools.preference.spy.command.showAllPreferences" commandName="Show All Preferences"> - <persistedState key="persistState" value="false"/> - </elements> - <elements xsi:type="commands:Command" xmi:id="_4NM_IH_gEeSk-4v3KnNHPw" elementId="org.eclipse.e4.tools.preference.spy.command.expandAll" commandName="Expand All"> - <persistedState key="persistState" value="false"/> - </elements> - <elements xsi:type="commands:Command" xmi:id="_68UQwH_gEeSk-4v3KnNHPw" elementId="org.eclipse.e4.tools.preference.spy.command.collapseAll" commandName="Collapse All"> - <persistedState key="persistState" value="false"/> - </elements> - </fragments> - <fragments xsi:type="fragment:StringModelFragment" xmi:id="_k-5ysGxiEeSQ7v0akw7aRA" featurename="handlers" parentElementId="xpath:/"> - <elements xsi:type="commands:Handler" xmi:id="_oq-b0GxiEeSQ7v0akw7aRA" elementId="org.eclipse.e4.tools.preference.spy.handler.removeall" contributionURI="bundleclass://org.eclipse.e4.tools.preference.spy/org.eclipse.e4.tools.preference.spy.handler.RemoveAllHandler" command="_eBGTEGxiEeSQ7v0akw7aRA"> - <persistedState key="persistState" value="false"/> - </elements> - <elements xsi:type="commands:Handler" xmi:id="_xiIpwGxiEeSQ7v0akw7aRA" elementId="org.eclipse.e4.tools.preference.spy.handler.removeentry" contributionURI="bundleclass://org.eclipse.e4.tools.preference.spy/org.eclipse.e4.tools.preference.spy.handler.RemoveEntryHandler" command="_iGEkYGxiEeSQ7v0akw7aRA"> - <persistedState key="persistState" value="false"/> - </elements> - <elements xsi:type="commands:Handler" xmi:id="_zPHVsHY2EeSuTdKDH5hMwg" elementId="org.eclipse.e4.tools.preference.spy.handler.showall" contributionURI="bundleclass://org.eclipse.e4.tools.preference.spy/org.eclipse.e4.tools.preference.spy.handler.ShowAllPreferencesHandler" command="_ufxRsHY2EeSuTdKDH5hMwg"> - <persistedState key="persistState" value="false"/> - </elements> - <elements xsi:type="commands:Handler" xmi:id="_3S1ooH_gEeSk-4v3KnNHPw" elementId="org.eclipse.e4.tools.preference.spy.handler.expandall" contributionURI="bundleclass://org.eclipse.e4.tools.preference.spy/org.eclipse.e4.tools.preference.spy.handler.ExpandAllHandler" command="_4NM_IH_gEeSk-4v3KnNHPw"> - <persistedState key="persistState" value="false"/> - </elements> - <elements xsi:type="commands:Handler" xmi:id="_9SoA0H_gEeSk-4v3KnNHPw" elementId="org.eclipse.e4.tools.preference.spy.handler.collapseall" contributionURI="bundleclass://org.eclipse.e4.tools.preference.spy/org.eclipse.e4.tools.preference.spy.handler.CollapseAllHandler" command="_68UQwH_gEeSk-4v3KnNHPw"> - <persistedState key="persistState" value="false"/> - </elements> - </fragments> -</fragment:ModelFragments> diff --git a/bundles/org.eclipse.e4.tools.preference.spy/icons/collapseall.png b/bundles/org.eclipse.e4.tools.preference.spy/icons/collapseall.png Binary files differdeleted file mode 100644 index a40ba4e1..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/icons/collapseall.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.preference.spy/icons/expandall.png b/bundles/org.eclipse.e4.tools.preference.spy/icons/expandall.png Binary files differdeleted file mode 100644 index fcdfcbd6..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/icons/expandall.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.preference.spy/icons/flatLayout.png b/bundles/org.eclipse.e4.tools.preference.spy/icons/flatLayout.png Binary files differdeleted file mode 100644 index 06750bac..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/icons/flatLayout.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.preference.spy/icons/hierarchicalLayout.png b/bundles/org.eclipse.e4.tools.preference.spy/icons/hierarchicalLayout.png Binary files differdeleted file mode 100644 index ae6d660a..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/icons/hierarchicalLayout.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.preference.spy/icons/preference_spy.png b/bundles/org.eclipse.e4.tools.preference.spy/icons/preference_spy.png Binary files differdeleted file mode 100644 index 42508a4d..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/icons/preference_spy.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.preference.spy/icons/remove_co.png b/bundles/org.eclipse.e4.tools.preference.spy/icons/remove_co.png Binary files differdeleted file mode 100644 index d1cd8b62..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/icons/remove_co.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.preference.spy/icons/removeall_co.png b/bundles/org.eclipse.e4.tools.preference.spy/icons/removeall_co.png Binary files differdeleted file mode 100644 index e968f58e..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/icons/removeall_co.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.preference.spy/icons/show_all_preferences.png b/bundles/org.eclipse.e4.tools.preference.spy/icons/show_all_preferences.png Binary files differdeleted file mode 100644 index c0aa2abb..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/icons/show_all_preferences.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.preference.spy/icons/trace_preferences.png b/bundles/org.eclipse.e4.tools.preference.spy/icons/trace_preferences.png Binary files differdeleted file mode 100644 index 78ef0c90..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/icons/trace_preferences.png +++ /dev/null diff --git a/bundles/org.eclipse.e4.tools.preference.spy/plugin.xml b/bundles/org.eclipse.e4.tools.preference.spy/plugin.xml deleted file mode 100644 index caff1537..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/plugin.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<plugin> - - <extension - id="org.eclipse.e4.tools.preference.spy.fragment" - point="org.eclipse.e4.workbench.model"> - <fragment - uri="fragment.e4xmi"> - </fragment> - </extension> - <extension - point="org.eclipse.ui.preferencePages"> - <page - class="org.eclipse.e4.tools.preference.spy.preferencepage.TracePreferencePage" - id="org.eclipse.e4.tools.preference.spy.tracepreferencespage" - name="Preference Spy"> - </page> - </extension> - <extension - point="org.eclipse.e4.tools.spy.spyPart"> - <spyPart - description="Spy to display preferences" - icon="icons/preference_spy.png" - name="Preference Spy" - part="org.eclipse.e4.tools.preference.spy.parts.PreferenceSpyPart" - shortcut="M2+M3+F11"> - </spyPart> - </extension> - <!--extension - point="org.eclipse.e4.tools.spy.spyPart"> - <spyPart - description="This spy is used to inspect the Eclipse Preferences" - icon="icons/preference_spy.png" - name="Preference Spy" - part="org.eclipse.e4.tools.preference.spy.parts.PreferenceSpyPart" - shortcut="M1 + M2 + M3 + F10"> - </spyPart> - </extension--> - -</plugin> diff --git a/bundles/org.eclipse.e4.tools.preference.spy/pom.xml b/bundles/org.eclipse.e4.tools.preference.spy/pom.xml deleted file mode 100644 index 3a11adae..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.eclipse.e4.tools</groupId> - <artifactId>e4-tools-aggregator</artifactId> - <version>0.18.0-SNAPSHOT</version> - <relativePath>../../</relativePath> - </parent> - - <groupId>org.eclipse.e4</groupId> - <artifactId>org.eclipse.e4.tools.preference.spy</artifactId> - <version>0.2.0-SNAPSHOT</version> - <packaging>eclipse-plugin</packaging> - -</project> diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/Activator.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/Activator.java deleted file mode 100644 index 781b2a4e..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/Activator.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.e4.tools.preference.spy"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/addon/PreferenceSpyAddon.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/addon/PreferenceSpyAddon.java deleted file mode 100644 index a50ae11f..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/addon/PreferenceSpyAddon.java +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.addon; - -import javax.annotation.PostConstruct; -import javax.inject.Inject; - -import org.eclipse.core.internal.preferences.EclipsePreferences; -import org.eclipse.core.runtime.preferences.BundleDefaultsScope; -import org.eclipse.core.runtime.preferences.ConfigurationScope; -import org.eclipse.core.runtime.preferences.DefaultScope; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; -import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; -import org.eclipse.core.runtime.preferences.IPreferenceNodeVisitor; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.e4.core.di.annotations.Optional; -import org.eclipse.e4.core.di.extensions.Preference; -import org.eclipse.e4.core.services.events.IEventBroker; -import org.eclipse.e4.core.services.log.Logger; -import org.eclipse.e4.tools.preference.spy.Activator; -import org.eclipse.e4.tools.preference.spy.constants.PreferenceConstants; -import org.eclipse.e4.tools.preference.spy.constants.PreferenceSpyEventTopics; -import org.eclipse.jface.preference.IPreferenceStore; -import org.osgi.service.prefs.BackingStoreException; - -/** - * This model addon is used to register an IPreferenceChangeListener for all - * {@link EclipsePreferences} and it fires an - * {@link PreferenceSpyEventTopics#PREFERENCESPY_PREFERENCE_CHANGED} event via - * the {@link IEventBroker}.<br/> - * The Object, which is send within the - * {@link PreferenceSpyEventTopics#PREFERENCESPY_PREFERENCE_CHANGED} event is a - * PreferenceChangeEvent. - * - */ -@SuppressWarnings("restriction") -public class PreferenceSpyAddon { - - @Inject - private Logger LOG; - - @Inject - private IEventBroker eventBroker; - - private IEclipsePreferences bundleDefaultsScopePreferences = BundleDefaultsScope.INSTANCE.getNode(""); - private IEclipsePreferences configurationScopePreferences = ConfigurationScope.INSTANCE.getNode(""); - private IEclipsePreferences defaultScopePreferences = DefaultScope.INSTANCE.getNode(""); - private IEclipsePreferences instanceScopePreferences = InstanceScope.INSTANCE.getNode(""); - - private ChangedPreferenceListener preferenceChangedListener = new ChangedPreferenceListener(); - - @Inject - @Optional - public void initialzePreferenceSpy( - @Preference(value = PreferenceConstants.TRACE_PREFERENCES) boolean tracePreferences) { - if (tracePreferences) { - registerVisitors(); - } else { - deregisterVisitors(); - } - } - - private void registerVisitors() { - addPreferenceListener(bundleDefaultsScopePreferences); - addPreferenceListener(configurationScopePreferences); - addPreferenceListener(defaultScopePreferences); - addPreferenceListener(instanceScopePreferences); - } - - private void addPreferenceListener(IEclipsePreferences rootPreference) { - try { - rootPreference.accept(new IPreferenceNodeVisitor() { - @Override - public boolean visit(IEclipsePreferences node) throws BackingStoreException { - node.addPreferenceChangeListener(preferenceChangedListener); - return true; - } - }); - } catch (BackingStoreException e) { - LOG.error(e); - } - } - - private void deregisterVisitors() { - removePreferenceListener(bundleDefaultsScopePreferences); - removePreferenceListener(configurationScopePreferences); - removePreferenceListener(defaultScopePreferences); - removePreferenceListener(instanceScopePreferences); - } - - private void removePreferenceListener(IEclipsePreferences rootPreference) { - try { - rootPreference.accept(new IPreferenceNodeVisitor() { - @Override - public boolean visit(IEclipsePreferences node) throws BackingStoreException { - node.removePreferenceChangeListener(preferenceChangedListener); - return true; - } - }); - } catch (BackingStoreException e) { - LOG.error(e); - } - } - - @PostConstruct - public void initializeDefaultPreferences() { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - store.setDefault(PreferenceConstants.TRACE_PREFERENCES, false); - } - - private final class ChangedPreferenceListener implements IPreferenceChangeListener { - - @Override - public void preferenceChange(PreferenceChangeEvent event) { - eventBroker.post(PreferenceSpyEventTopics.PREFERENCESPY_PREFERENCE_CHANGED, event); - } - } -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/constants/PreferenceConstants.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/constants/PreferenceConstants.java deleted file mode 100644 index b4210490..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/constants/PreferenceConstants.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.constants; - -/** - * Constant definitions for plug-in preferences - */ -public class PreferenceConstants { - - public enum ViewerLayouts { - Flat, Hierarchical; - } - - public static final String TRACE_PREFERENCES = "tracepreferences"; - public static final String HIERARCHICAL_LAYOUT = "hierarchicalLayoutPreference"; - -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/constants/PreferenceSpyEventTopics.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/constants/PreferenceSpyEventTopics.java deleted file mode 100644 index d3b7fe0c..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/constants/PreferenceSpyEventTopics.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.constants; - -public interface PreferenceSpyEventTopics { - - public static final String PREFERENCESPY_PREFERENCE_ENTRIES_DELETE_ALL = "TOPIC_PREFERENCESPY/PREFERENCE_ENTRIES/DELETE_ALL"; - public static final String PREFERENCESPY_PREFERENCE_ENTRIES_DELETE = "TOPIC_PREFERENCESPY/PREFERENCE_ENTRIES/DELETE"; - - public static final String PREFERENCESPY_PREFERENCE_CHANGED = "TOPIC_PREFERENCESPY/PREFERENCE/CHANGED"; - public static final String PREFERENCESPY_PREFERENCE_SHOW = "TOPIC_PREFERENCESPY/PREFERENCE/SHOW"; -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/CollapseAllHandler.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/CollapseAllHandler.java deleted file mode 100644 index 30f28b71..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/CollapseAllHandler.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.handler; - -import org.eclipse.e4.core.di.annotations.Execute; -import org.eclipse.e4.tools.preference.spy.parts.TreeViewerPart; -import org.eclipse.e4.ui.model.application.ui.basic.MPart; - -public class CollapseAllHandler { - - @Execute - public void execute(MPart part) { - Object partImpl = part.getObject(); - if (partImpl instanceof TreeViewerPart) { - ((TreeViewerPart) partImpl).getViewer().collapseAll(); - } - } - -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/ExpandAllHandler.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/ExpandAllHandler.java deleted file mode 100644 index 980797aa..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/ExpandAllHandler.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.handler; - -import org.eclipse.e4.core.di.annotations.Execute; -import org.eclipse.e4.tools.preference.spy.parts.TreeViewerPart; -import org.eclipse.e4.ui.model.application.ui.basic.MPart; - -public class ExpandAllHandler { - - @Execute - public void execute(MPart part) { - Object partImpl = part.getObject(); - if (partImpl instanceof TreeViewerPart) { - ((TreeViewerPart) partImpl).getViewer().expandAll(); - } - } - -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/RemoveAllHandler.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/RemoveAllHandler.java deleted file mode 100644 index bbf0e51f..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/RemoveAllHandler.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.handler; - -import java.util.List; - -import javax.inject.Named; - -import org.eclipse.e4.core.di.annotations.Execute; -import org.eclipse.e4.core.di.annotations.Optional; -import org.eclipse.e4.core.services.events.IEventBroker; -import org.eclipse.e4.tools.preference.spy.constants.PreferenceSpyEventTopics; -import org.eclipse.e4.tools.preference.spy.model.PreferenceEntry; -import org.eclipse.e4.ui.services.IServiceConstants; - -public class RemoveAllHandler { - @Execute - public void execute(IEventBroker eventBroker, - @Optional @Named(IServiceConstants.ACTIVE_SELECTION) List<PreferenceEntry> preferenceEntries) { - eventBroker.post(PreferenceSpyEventTopics.PREFERENCESPY_PREFERENCE_ENTRIES_DELETE_ALL, preferenceEntries); - } - -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/RemoveEntryHandler.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/RemoveEntryHandler.java deleted file mode 100644 index 5c09f5d0..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/RemoveEntryHandler.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.handler; - -import java.util.List; - -import javax.inject.Named; - -import org.eclipse.e4.core.di.annotations.Execute; -import org.eclipse.e4.core.di.annotations.Optional; -import org.eclipse.e4.core.services.events.IEventBroker; -import org.eclipse.e4.tools.preference.spy.constants.PreferenceSpyEventTopics; -import org.eclipse.e4.tools.preference.spy.model.PreferenceEntry; -import org.eclipse.e4.ui.services.IServiceConstants; - -public class RemoveEntryHandler { - @Execute - public void execute(IEventBroker eventBroker, - @Optional @Named(IServiceConstants.ACTIVE_SELECTION) List<PreferenceEntry> preferenceEntries) { - eventBroker.post(PreferenceSpyEventTopics.PREFERENCESPY_PREFERENCE_ENTRIES_DELETE, preferenceEntries); - } - -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/ShowAllPreferencesHandler.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/ShowAllPreferencesHandler.java deleted file mode 100644 index 7e0c5488..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/ShowAllPreferencesHandler.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.handler; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.preferences.BundleDefaultsScope; -import org.eclipse.core.runtime.preferences.ConfigurationScope; -import org.eclipse.core.runtime.preferences.DefaultScope; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.core.runtime.preferences.IPreferenceNodeVisitor; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.e4.core.di.annotations.Execute; -import org.eclipse.e4.core.services.events.IEventBroker; -import org.eclipse.e4.tools.preference.spy.Activator; -import org.eclipse.e4.tools.preference.spy.constants.PreferenceSpyEventTopics; -import org.eclipse.e4.tools.preference.spy.model.PreferenceEntry; -import org.eclipse.e4.tools.preference.spy.model.PreferenceNodeEntry; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.swt.widgets.Shell; -import org.osgi.service.prefs.BackingStoreException; - -public class ShowAllPreferencesHandler { - @Execute - public void execute(Shell shell, IEventBroker eventBroker) { - Map<String, PreferenceNodeEntry> preferenceEntries = new HashMap<String, PreferenceNodeEntry>(); - IEclipsePreferences bundleDefaultsScopePreferences = BundleDefaultsScope.INSTANCE.getNode(""); - IEclipsePreferences configurationScopePreferences = ConfigurationScope.INSTANCE.getNode(""); - IEclipsePreferences defaultScopePreferences = DefaultScope.INSTANCE.getNode(""); - IEclipsePreferences instanceScopePreferences = InstanceScope.INSTANCE.getNode(""); - try { - bundleDefaultsScopePreferences.accept(new PrefereneGatherer(preferenceEntries)); - configurationScopePreferences.accept(new PrefereneGatherer(preferenceEntries)); - defaultScopePreferences.accept(new PrefereneGatherer(preferenceEntries)); - instanceScopePreferences.accept(new PrefereneGatherer(preferenceEntries)); - } catch (BackingStoreException e) { - Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); - ErrorDialog.openError(shell, "BackingStoreException", e.getLocalizedMessage(), status); - } - eventBroker.post(PreferenceSpyEventTopics.PREFERENCESPY_PREFERENCE_SHOW, preferenceEntries.values()); - } - - private class PrefereneGatherer implements IPreferenceNodeVisitor { - - private Map<String, PreferenceNodeEntry> preferenceEntries; - - public PrefereneGatherer(Map<String, PreferenceNodeEntry> preferenceEntries) { - this.preferenceEntries = preferenceEntries; - } - - @Override - public boolean visit(IEclipsePreferences node) throws BackingStoreException { - // only show nodes, which have changed keys - String[] keys = node.keys(); - if (keys.length <= 0) { - return true; - } - PreferenceNodeEntry preferenceNodeEntry = preferenceEntries.get(node.absolutePath()); - if (null == preferenceNodeEntry) { - preferenceNodeEntry = new PreferenceNodeEntry(node.absolutePath()); - preferenceEntries.put(node.absolutePath(), preferenceNodeEntry); - } - for (String key : keys) { - String value = node.get(key, "*default*"); - PreferenceEntry preferenceEntry = new PreferenceEntry(node.absolutePath(), key, value, value); - preferenceNodeEntry.addChildren(preferenceEntry); - } - return true; - } - } - -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/ToggleLayoutControl.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/ToggleLayoutControl.java deleted file mode 100644 index ee4d5739..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/ToggleLayoutControl.java +++ /dev/null @@ -1,114 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.handler; - -import java.net.URL; - -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.inject.Inject; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.e4.core.di.extensions.Preference; -import org.eclipse.e4.core.services.log.Logger; -import org.eclipse.e4.tools.preference.spy.constants.PreferenceConstants; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.resource.LocalResourceManager; -import org.eclipse.jface.resource.ResourceManager; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.ToolBar; -import org.eclipse.swt.widgets.ToolItem; -import org.osgi.framework.Bundle; -import org.osgi.framework.FrameworkUtil; -import org.osgi.service.prefs.BackingStoreException; - -@SuppressWarnings("restriction") -public class ToggleLayoutControl { - - @Inject - Logger LOG; - - private ToolItem toolItem; - private ResourceManager resourceManager; - - @Inject - public void tracePreferenceChanged( - @Preference(value = PreferenceConstants.HIERARCHICAL_LAYOUT) boolean hierarchicalLayoutPreference) { - if (toolItem != null && !toolItem.isDisposed()) { - toolItem.setSelection(hierarchicalLayoutPreference); - toolItem.setImage( - hierarchicalLayoutPreference ? getResourceManager().createImage(getHierarchicalImageDescriptor()) - : getResourceManager().createImage(getFlatImageDescriptor())); - toolItem.setToolTipText( - hierarchicalLayoutPreference ? "Toogle to flat layout" : "Toggle to hierarchical layout"); - } - } - - @PostConstruct - public void createGui(Composite parent, final @Preference IEclipsePreferences preferences, - @Preference(value = PreferenceConstants.HIERARCHICAL_LAYOUT) boolean hierarchicalLayoutPreference) { - ToolBar toolBar = new ToolBar(parent, SWT.NONE); - toolItem = new ToolItem(toolBar, SWT.CHECK); - toolItem.setToolTipText( - hierarchicalLayoutPreference ? "Toogle to flat layout" : "Toggle to hierarchical layout"); - toolItem.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent event) { - Object source = event.getSource(); - if (source instanceof ToolItem) { - preferences.putBoolean(PreferenceConstants.HIERARCHICAL_LAYOUT, ((ToolItem) source).getSelection()); - try { - preferences.flush(); - } catch (BackingStoreException e) { - LOG.error(e); - } - } - } - }); - tracePreferenceChanged(hierarchicalLayoutPreference); - } - - @PreDestroy - public void dispose() { - if (resourceManager != null) { - resourceManager.dispose(); - } - } - - protected ResourceManager getResourceManager() { - if (null == resourceManager) { - resourceManager = new LocalResourceManager(JFaceResources.getResources()); - } - return resourceManager; - } - - protected ImageDescriptor getFlatImageDescriptor() { - Bundle bundle = FrameworkUtil.getBundle(getClass()); - URL url = FileLocator.find(bundle, new Path("icons/flatLayout.png"), null); - return ImageDescriptor.createFromURL(url); - } - - protected ImageDescriptor getHierarchicalImageDescriptor() { - Bundle bundle = FrameworkUtil.getBundle(getClass()); - URL url = FileLocator.find(bundle, new Path("icons/hierarchicalLayout.png"), null); - return ImageDescriptor.createFromURL(url); - } -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/TogglePreferenceTraceControl.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/TogglePreferenceTraceControl.java deleted file mode 100644 index 598b3809..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/handler/TogglePreferenceTraceControl.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.handler; - -import java.net.URL; - -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.inject.Inject; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.e4.core.di.extensions.Preference; -import org.eclipse.e4.core.services.log.Logger; -import org.eclipse.e4.tools.preference.spy.constants.PreferenceConstants; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.resource.LocalResourceManager; -import org.eclipse.jface.resource.ResourceManager; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.ToolBar; -import org.eclipse.swt.widgets.ToolItem; -import org.osgi.framework.Bundle; -import org.osgi.framework.FrameworkUtil; -import org.osgi.service.prefs.BackingStoreException; - -@SuppressWarnings("restriction") -public class TogglePreferenceTraceControl { - - @Inject - Logger LOG; - - private ToolItem toolItem; - private ResourceManager resourceManager; - - @Inject - public void tracePreferenceChanged( - @Preference(value = PreferenceConstants.TRACE_PREFERENCES) boolean tracePreferences) { - if (toolItem != null && !toolItem.isDisposed()) { - toolItem.setSelection(tracePreferences); - } - } - - @PostConstruct - public void createGui(Composite parent, final @Preference IEclipsePreferences preferences, - @Preference(value = PreferenceConstants.TRACE_PREFERENCES) boolean tracePreferences) { - ToolBar toolBar = new ToolBar(parent, SWT.NONE); - toolItem = new ToolItem(toolBar, SWT.CHECK); - toolItem.setSelection(tracePreferences); - toolItem.setToolTipText("Toggle Preference Trace"); - toolItem.setImage(getResourceManager().createImage(getImageDescriptor())); - toolItem.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent event) { - Object source = event.getSource(); - if (source instanceof ToolItem) { - preferences.putBoolean(PreferenceConstants.TRACE_PREFERENCES, ((ToolItem) source).getSelection()); - try { - preferences.flush(); - } catch (BackingStoreException e) { - LOG.error(e); - } - } - } - }); - } - - @PreDestroy - public void dispose() { - if (resourceManager != null) { - resourceManager.dispose(); - } - } - - protected ResourceManager getResourceManager() { - if (null == resourceManager) { - resourceManager = new LocalResourceManager(JFaceResources.getResources()); - } - return resourceManager; - } - - protected ImageDescriptor getImageDescriptor() { - Bundle bundle = FrameworkUtil.getBundle(getClass()); - URL url = FileLocator.find(bundle, new Path("icons/trace_preferences.png"), null); - return ImageDescriptor.createFromURL(url); - } -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/AbstractModelObject.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/AbstractModelObject.java deleted file mode 100644 index 5c203ad5..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/AbstractModelObject.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.model; - -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; - -public abstract class AbstractModelObject { - private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this); - - public void addPropertyChangeListener(PropertyChangeListener listener) { - propertyChangeSupport.addPropertyChangeListener(listener); - } - - public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { - propertyChangeSupport.addPropertyChangeListener(propertyName, listener); - } - - public void removePropertyChangeListener(PropertyChangeListener listener) { - propertyChangeSupport.removePropertyChangeListener(listener); - } - - public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { - propertyChangeSupport.removePropertyChangeListener(propertyName, listener); - } - - protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { - propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue); - } - - protected void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) { - propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue); - } - - protected void firePropertyChange(String propertyName, int oldValue, int newValue) { - propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue); - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/PreferenceEntry.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/PreferenceEntry.java deleted file mode 100644 index d51b5d26..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/PreferenceEntry.java +++ /dev/null @@ -1,180 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.model; - -public class PreferenceEntry extends AbstractModelObject { - - public enum Fields { - nodePath, key, oldValue, newValue; - } - - private PreferenceEntry parent; - - private boolean recentlyChanged; - - private String nodePath; - - private String key; - - private String oldValue; - - private String newValue; - - private long time; - - public PreferenceEntry() { - } - - public PreferenceEntry(String nodePath, String key) { - this.nodePath = nodePath; - this.key = key; - } - - public PreferenceEntry(String nodePath, String key, String oldValue, String newValue) { - this.nodePath = nodePath; - this.key = key; - this.oldValue = oldValue; - this.newValue = newValue; - } - - public PreferenceEntry(PreferenceEntry parent, String nodePath, String key, String oldValue, String newValue) { - this.nodePath = nodePath; - this.key = key; - this.oldValue = oldValue; - this.newValue = newValue; - } - - public PreferenceEntry getParent() { - return parent; - } - - public void setParent(PreferenceEntry parent) { - firePropertyChange("parent", this.parent, this.parent = parent); - } - - public String getNodePath() { - return nodePath; - } - - public void setNodePath(String nodePath) { - firePropertyChange("nodePath", this.nodePath, this.nodePath = nodePath); - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - firePropertyChange("key", this.key, this.key = key); - } - - public String getOldValue() { - return oldValue; - } - - public void setOldValue(String oldValue) { - firePropertyChange("oldValue", this.oldValue, this.oldValue = oldValue); - } - - public String getNewValue() { - return newValue; - } - - public void setNewValue(String newValue) { - firePropertyChange("newValue", this.newValue, this.newValue = newValue); - } - - public boolean isRecentlyChanged() { - return recentlyChanged; - } - - public void setRecentlyChanged(boolean recentlyChanged) { - firePropertyChange("recentlyChanged", this.recentlyChanged, this.recentlyChanged = recentlyChanged); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((key == null) ? 0 : key.hashCode()); - result = prime * result + ((newValue == null) ? 0 : newValue.hashCode()); - result = prime * result + ((nodePath == null) ? 0 : nodePath.hashCode()); - result = prime * result + ((oldValue == null) ? 0 : oldValue.hashCode()); - result = prime * result + ((parent == null) ? 0 : parent.hashCode()); - result = prime * result + (recentlyChanged ? 1231 : 1237); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - PreferenceEntry other = (PreferenceEntry) obj; - if (key == null) { - if (other.key != null) { - return false; - } - } else if (!key.equals(other.key)) { - return false; - } - if (newValue == null) { - if (other.newValue != null) { - return false; - } - } else if (!newValue.equals(other.newValue)) { - return false; - } - if (nodePath == null) { - if (other.nodePath != null) { - return false; - } - } else if (!nodePath.equals(other.nodePath)) { - return false; - } - if (oldValue == null) { - if (other.oldValue != null) { - return false; - } - } else if (!oldValue.equals(other.oldValue)) { - return false; - } - if (parent == null) { - if (other.parent != null) { - return false; - } - } else if (!parent.equals(other.parent)) { - return false; - } - if (recentlyChanged != other.recentlyChanged) { - return false; - } - return true; - } - - public long getTime() { - return time; - } - - public void setTime(long time) { - this.time = time; - } - -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/PreferenceEntryManager.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/PreferenceEntryManager.java deleted file mode 100644 index 0ce979cb..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/PreferenceEntryManager.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.model; - -import java.util.HashMap; -import java.util.Map; - -public class PreferenceEntryManager extends PreferenceNodeEntry { - - private Map<String, PreferenceNodeEntry> recentPreferenceEntries = new HashMap<String, PreferenceNodeEntry>(); - - public PreferenceEntryManager() { - } - - public PreferenceNodeEntry getRecentPreferenceNodeEntry(String nodePath) { - return recentPreferenceEntries.get(nodePath); - } - - public PreferenceNodeEntry removeRecentPreferenceNodeEntry(String nodePath) { - return recentPreferenceEntries.remove(nodePath); - } - - public void clearRecentPreferenceNodeEntry() { - recentPreferenceEntries.clear(); - } - - public void putRecentPreferenceEntry(String nodePath, PreferenceNodeEntry preferenceNodeEntry) { - recentPreferenceEntries.put(nodePath, preferenceNodeEntry); - } - -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/PreferenceEntryPatternFilter.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/PreferenceEntryPatternFilter.java deleted file mode 100644 index 4cdb09bc..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/PreferenceEntryPatternFilter.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.model; - -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.ui.dialogs.PatternFilter; - -public class PreferenceEntryPatternFilter extends PatternFilter { - - public PreferenceEntryPatternFilter() { - super(); - } - - @Override - protected boolean isLeafMatch(Viewer viewer, Object element) { - - if (element instanceof PreferenceEntry) { - PreferenceEntry preferenceEntry = (PreferenceEntry) element; - if (wordMatches(preferenceEntry.getNodePath()) || wordMatches(preferenceEntry.getKey()) - || wordMatches(preferenceEntry.getOldValue()) || wordMatches(preferenceEntry.getNewValue())) { - return true; - } - } - - return super.isLeafMatch(viewer, element); - } - -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/PreferenceNodeEntry.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/PreferenceNodeEntry.java deleted file mode 100644 index 6a579aac..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/model/PreferenceNodeEntry.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.model; - -import java.util.Arrays; -import java.util.Collection; - -import org.eclipse.core.databinding.observable.set.IObservableSet; -import org.eclipse.core.databinding.observable.set.WritableSet; - -public class PreferenceNodeEntry extends PreferenceEntry { - - private IObservableSet preferenceEntries = new WritableSet<>(); - - public PreferenceNodeEntry() { - super(); - } - - public PreferenceNodeEntry(String nodePath) { - super(nodePath, "", "", ""); - } - - public void addChildren(Collection<PreferenceEntry> entries) { - getPreferenceEntries().addAll(entries); - } - - public boolean addChildren(PreferenceEntry... entry) { - return getPreferenceEntries().addAll(Arrays.asList(entry)); - } - - public void removeChildren(Collection<PreferenceEntry> entries) { - getPreferenceEntries().removeAll(entries); - } - - public void removeChildren(PreferenceEntry... entry) { - getPreferenceEntries().removeAll(Arrays.asList(entry)); - } - - public IObservableSet getPreferenceEntries() { - return preferenceEntries; - } - - public void setPreferenceEntries(IObservableSet preferenceEntries) { - this.preferenceEntries = preferenceEntries; - } - -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/PreferenceSpyPart.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/PreferenceSpyPart.java deleted file mode 100644 index 55dc32f3..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/PreferenceSpyPart.java +++ /dev/null @@ -1,230 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.parts; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import javax.annotation.PostConstruct; -import javax.inject.Inject; - -import org.eclipse.core.databinding.beans.typed.BeanProperties; -import org.eclipse.core.databinding.observable.Realm; -import org.eclipse.core.databinding.observable.set.IObservableSet; -import org.eclipse.core.databinding.property.Properties; -import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; -import org.eclipse.e4.core.di.annotations.Optional; -import org.eclipse.e4.core.di.extensions.Preference; -import org.eclipse.e4.tools.preference.spy.constants.PreferenceConstants; -import org.eclipse.e4.tools.preference.spy.constants.PreferenceSpyEventTopics; -import org.eclipse.e4.tools.preference.spy.model.PreferenceEntry; -import org.eclipse.e4.tools.preference.spy.model.PreferenceEntry.Fields; -import org.eclipse.e4.tools.preference.spy.model.PreferenceEntryManager; -import org.eclipse.e4.tools.preference.spy.model.PreferenceEntryPatternFilter; -import org.eclipse.e4.tools.preference.spy.model.PreferenceNodeEntry; -import org.eclipse.e4.tools.preference.spy.parts.viewer.PreferenceEntriesContentProvider; -import org.eclipse.e4.tools.preference.spy.parts.viewer.PreferenceEntryViewerComparator; -import org.eclipse.e4.tools.preference.spy.parts.viewer.PreferenceMapLabelProvider; -import org.eclipse.e4.tools.preference.spy.parts.viewer.PreferenceSpyEditingSupport; -import org.eclipse.e4.ui.di.UIEventTopic; -import org.eclipse.e4.ui.model.application.ui.basic.MWindow; -import org.eclipse.e4.ui.workbench.modeling.EModelService; -import org.eclipse.e4.ui.workbench.modeling.ESelectionService; -import org.eclipse.jface.databinding.swt.DisplayRealm; -import org.eclipse.jface.resource.FontDescriptor; -import org.eclipse.jface.viewers.ColumnLabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.TreeViewerColumn; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.ui.dialogs.FilteredTree; - -public class PreferenceSpyPart implements TreeViewerPart { - - private FilteredTree filteredTree; - private boolean hierarchicalLayoutPreference; - private PreferenceEntryManager preferenceEntryManager; - - @PostConstruct - public void postConstruct(Composite parent, final ESelectionService selectionService, EModelService modelService, - MWindow window) { - - preferenceEntryManager = new PreferenceEntryManager(); - - PreferenceEntryPatternFilter patternFilter = new PreferenceEntryPatternFilter(); - patternFilter.setIncludeLeadingWildcard(true); - filteredTree = new FilteredTree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, patternFilter, - true, true); - - Tree table = filteredTree.getViewer().getTree(); - table.setHeaderVisible(true); - table.setLinesVisible(true); - - filteredTree.getViewer().addSelectionChangedListener(new ISelectionChangedListener() { - - @Override - public void selectionChanged(SelectionChangedEvent event) { - ISelection selection = event.getSelection(); - if (selection instanceof IStructuredSelection) { - @SuppressWarnings("unchecked") - ArrayList<PreferenceEntry> preferenceEntries = new ArrayList<PreferenceEntry>( - ((IStructuredSelection) selection).toList()); - selectionService.setSelection(preferenceEntries); - } - } - }); - - createColumn(Fields.nodePath, "Nodepath", 300); - createColumn(Fields.key, "Key", 300); - createColumn(Fields.oldValue, "Old Value", 150); - createColumn(Fields.newValue, "New Value", 150); - - filteredTree.getViewer().setComparator(new PreferenceEntryViewerComparator()); - - FontDescriptor fontDescriptor = getBoldFontDescriptor(); - - Realm realm = DisplayRealm.getRealm(filteredTree.getViewer().getControl().getDisplay()); - PreferenceEntriesContentProvider contentProvider = new PreferenceEntriesContentProvider( - BeanProperties.set("preferenceEntries", PreferenceNodeEntry.class).setFactory(realm), null); - contentProvider.setHierarchicalLayout(hierarchicalLayoutPreference); - filteredTree.getViewer().setContentProvider(contentProvider); - filteredTree.getViewer().setLabelProvider(new PreferenceMapLabelProvider(fontDescriptor, - Properties.observeEach(contentProvider.getKnownElements(), BeanProperties.values(PreferenceEntry.class, "nodePath", "key", "oldValue", "newValue")))); - filteredTree.getViewer().setInput(preferenceEntryManager); - } - - private FontDescriptor getBoldFontDescriptor() { - Font origFont = filteredTree.getViewer().getControl().getFont(); - FontDescriptor fontDescriptor = FontDescriptor.createFrom(origFont); - return fontDescriptor.setStyle(SWT.BOLD); - } - - private void createColumn(Fields field, String columnName, int width) { - TreeViewerColumn viewerColumn = new TreeViewerColumn(filteredTree.getViewer(), SWT.NONE); - viewerColumn.getColumn().setWidth(width); - viewerColumn.getColumn().setText(columnName); - - viewerColumn.setLabelProvider(new ColumnLabelProvider()); - viewerColumn.setEditingSupport(new PreferenceSpyEditingSupport(filteredTree.getViewer(), field)); - } - - @Inject - public void layoutChanged( - @Preference(value = PreferenceConstants.HIERARCHICAL_LAYOUT) boolean hierarchicalLayoutPreference) { - this.hierarchicalLayoutPreference = hierarchicalLayoutPreference; - if (filteredTree != null && !filteredTree.getViewer().getControl().isDisposed()) { - PreferenceEntriesContentProvider contentProvider = (PreferenceEntriesContentProvider) filteredTree - .getViewer().getContentProvider(); - contentProvider.setHierarchicalLayout(hierarchicalLayoutPreference); - filteredTree.getViewer().refresh(); - } - } - - @Inject - @Optional - public void preferenceChanged( - @UIEventTopic(PreferenceSpyEventTopics.PREFERENCESPY_PREFERENCE_CHANGED) PreferenceChangeEvent event) { - - PreferenceNodeEntry preferenceNodeEntry = preferenceEntryManager - .getRecentPreferenceNodeEntry(event.getNode().absolutePath()); - PreferenceEntry preferenceEntry = new PreferenceEntry(event.getNode().absolutePath(), event.getKey()); - preferenceEntry.setRecentlyChanged(true); - if (null == preferenceNodeEntry) { - preferenceNodeEntry = new PreferenceNodeEntry(event.getNode().absolutePath()); - preferenceNodeEntry.setRecentlyChanged(true); - preferenceNodeEntry.addChildren(preferenceEntry); - preferenceEntry.setParent(preferenceNodeEntry); - preferenceEntryManager.addChildren(preferenceNodeEntry); - filteredTree.getViewer().setInput(preferenceEntryManager); - preferenceEntryManager.putRecentPreferenceEntry(event.getNode().absolutePath(), preferenceNodeEntry); - } else { - preferenceEntry.setParent(preferenceNodeEntry); - PreferenceEntry existingPreferenceEntry = findPreferenceEntry(preferenceEntry); - if (existingPreferenceEntry != null) { - preferenceEntry = existingPreferenceEntry; - } else { - preferenceNodeEntry.addChildren(preferenceEntry); - } - } - - preferenceEntry.setOldValue(String.valueOf(event.getOldValue())); - preferenceEntry.setNewValue(String.valueOf(event.getNewValue())); - long currentTimeMillis = System.currentTimeMillis(); - preferenceEntry.setTime(currentTimeMillis); - preferenceEntry.getParent().setTime(currentTimeMillis); - - filteredTree.getViewer().refresh(); - } - - private PreferenceEntry findPreferenceEntry(PreferenceEntry preferenceEntry) { - PreferenceEntry parent = preferenceEntry.getParent(); - if (parent instanceof PreferenceNodeEntry) { - IObservableSet preferenceEntries = ((PreferenceNodeEntry) parent).getPreferenceEntries(); - for (Object object : preferenceEntries) { - if (object instanceof PreferenceEntry) { - PreferenceEntry existingPreferenceEntry = (PreferenceEntry) object; - if (existingPreferenceEntry.getKey().equals(preferenceEntry.getKey())) { - return existingPreferenceEntry; - } - } - } - } - return null; - } - - @Inject - @Optional - public void preferenceChanged( - @UIEventTopic(PreferenceSpyEventTopics.PREFERENCESPY_PREFERENCE_SHOW) Collection<PreferenceEntry> preferenceEntries) { - preferenceEntryManager.addChildren(preferenceEntries); - filteredTree.getViewer().refresh(); - } - - @Inject - @Optional - public void DeletePreferenceEntries( - @UIEventTopic(PreferenceSpyEventTopics.PREFERENCESPY_PREFERENCE_ENTRIES_DELETE) List<PreferenceEntry> preferenceEntries) { - if (preferenceEntries != null && !preferenceEntries.isEmpty()) { - for (PreferenceEntry preferenceEntry : preferenceEntries) { - preferenceEntryManager.removeChildren(preferenceEntry); - } - preferenceEntryManager.removeChildren(preferenceEntries); - filteredTree.getViewer().refresh(); - } - } - - @Inject - @Optional - public void DeleteAllPreferenceEntries( - @UIEventTopic(PreferenceSpyEventTopics.PREFERENCESPY_PREFERENCE_ENTRIES_DELETE_ALL) List<PreferenceEntry> preferenceEntries) { - if (preferenceEntryManager != null) { - preferenceEntryManager.clearRecentPreferenceNodeEntry(); - preferenceEntryManager.getPreferenceEntries().clear(); - filteredTree.getViewer().refresh(); - } - } - - @Override - public TreeViewer getViewer() { - return filteredTree.getViewer(); - } - -}
\ No newline at end of file diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/TreeViewerPart.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/TreeViewerPart.java deleted file mode 100644 index 066cf033..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/TreeViewerPart.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.parts; - -import org.eclipse.jface.viewers.TreeViewer; - -public interface TreeViewerPart { - - public TreeViewer getViewer(); -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/viewer/PreferenceEntriesContentProvider.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/viewer/PreferenceEntriesContentProvider.java deleted file mode 100644 index da5b2b51..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/viewer/PreferenceEntriesContentProvider.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.parts.viewer; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory; -import org.eclipse.core.databinding.observable.set.IObservableSet; -import org.eclipse.e4.tools.preference.spy.model.PreferenceEntry; -import org.eclipse.e4.tools.preference.spy.model.PreferenceNodeEntry; -import org.eclipse.jface.databinding.viewers.ObservableSetTreeContentProvider; -import org.eclipse.jface.databinding.viewers.TreeStructureAdvisor; - -public class PreferenceEntriesContentProvider extends ObservableSetTreeContentProvider { - - private boolean hierarchicalLayout; - - public PreferenceEntriesContentProvider(IObservableFactory setFactory, TreeStructureAdvisor structureAdvisor) { - super(setFactory, structureAdvisor); - } - - @Override - public Object[] getElements(Object inputElement) { - Object[] children = super.getElements(inputElement); - if (isHierarchicalLayout()) { - return children; - } - - List<PreferenceEntry> childList = new ArrayList<PreferenceEntry>(); - - for (Object object : children) { - getChildren(object, childList); - } - - return childList.toArray(); - } - - private void getChildren(Object element, List<PreferenceEntry> childList) { - if (element instanceof PreferenceNodeEntry) { - IObservableSet preferenceEntries = ((PreferenceNodeEntry) element).getPreferenceEntries(); - for (Object object : preferenceEntries) { - getChildren(object, childList); - } - } else if (element instanceof PreferenceEntry) { - childList.add((PreferenceEntry) element); - } - } - - public boolean isHierarchicalLayout() { - return hierarchicalLayout; - } - - public void setHierarchicalLayout(boolean hierarchicalLayout) { - this.hierarchicalLayout = hierarchicalLayout; - } -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/viewer/PreferenceEntryViewerComparator.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/viewer/PreferenceEntryViewerComparator.java deleted file mode 100644 index 3d4eaaf4..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/viewer/PreferenceEntryViewerComparator.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.parts.viewer; - -import java.util.Comparator; - -import org.eclipse.e4.tools.preference.spy.model.PreferenceEntry; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerComparator; - -public class PreferenceEntryViewerComparator extends ViewerComparator { - - public PreferenceEntryViewerComparator() { - } - - public PreferenceEntryViewerComparator(Comparator<? super String> comparator) { - super(comparator); - } - - @Override - public int compare(Viewer viewer, Object e1, Object e2) { - if (e1 instanceof PreferenceEntry && e2 instanceof PreferenceEntry) { - PreferenceEntry entry1 = (PreferenceEntry) e1; - PreferenceEntry entry2 = (PreferenceEntry) e2; - - long time = entry1.getTime(); - long time2 = entry2.getTime(); - - if (time != 0 && time2 != 0) { - return (int) (time2 - time); - } - } - - return super.compare(viewer, e1, e2); - } - - @Override - public int category(Object element) { - if (element instanceof PreferenceEntry) { - return ((PreferenceEntry) element).isRecentlyChanged() ? 0 : 1; - } - return 2; - } - -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/viewer/PreferenceMapLabelProvider.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/viewer/PreferenceMapLabelProvider.java deleted file mode 100644 index 65b2805c..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/viewer/PreferenceMapLabelProvider.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.parts.viewer; - -import org.eclipse.core.databinding.observable.map.IObservableMap; -import org.eclipse.core.runtime.Assert; -import org.eclipse.e4.tools.preference.spy.model.PreferenceEntry; -import org.eclipse.jface.databinding.viewers.ObservableMapLabelProvider; -import org.eclipse.jface.resource.FontDescriptor; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.resource.LocalResourceManager; -import org.eclipse.jface.resource.ResourceManager; -import org.eclipse.jface.viewers.IFontProvider; -import org.eclipse.swt.graphics.Font; - -public class PreferenceMapLabelProvider extends ObservableMapLabelProvider implements IFontProvider { - - private LocalResourceManager resourceManager; - private FontDescriptor fontDescriptor; - - public PreferenceMapLabelProvider(FontDescriptor fontDescriptor, IObservableMap attributeMap) { - this(fontDescriptor, new IObservableMap[] { attributeMap }); - } - - public PreferenceMapLabelProvider(FontDescriptor fontDescriptor, IObservableMap[] attributeMaps) { - super(attributeMaps); - Assert.isNotNull(fontDescriptor, "<fontDescriptor> must not be null"); - this.fontDescriptor = fontDescriptor; - } - - @Override - public String getColumnText(Object element, int columnIndex) { - String columnText = super.getColumnText(element, columnIndex); - if ("".equals(columnText) && element instanceof PreferenceEntry) { - PreferenceEntry entry = (PreferenceEntry) element; - switch (columnIndex) { - case 1: - columnText = entry.getKey(); - break; - case 2: - columnText = entry.getOldValue(); - break; - case 3: - columnText = entry.getNewValue(); - break; - default: - columnText = entry.getNodePath(); - break; - } - } - return columnText; - } - - @Override - public Font getFont(Object element) { - if (element instanceof PreferenceEntry && ((PreferenceEntry) element).isRecentlyChanged()) { - return getResourceManager().createFont(fontDescriptor); - } - return null; - } - - @Override - public void dispose() { - super.dispose(); - if (resourceManager != null) { - resourceManager.dispose(); - } - } - - protected ResourceManager getResourceManager() { - if (null == resourceManager) { - resourceManager = new LocalResourceManager(JFaceResources.getResources()); - } - return resourceManager; - } -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/viewer/PreferenceSpyEditingSupport.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/viewer/PreferenceSpyEditingSupport.java deleted file mode 100644 index 98a38fcf..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/parts/viewer/PreferenceSpyEditingSupport.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.parts.viewer; - -import org.eclipse.e4.tools.preference.spy.model.PreferenceEntry; -import org.eclipse.e4.tools.preference.spy.model.PreferenceEntry.Fields; -import org.eclipse.jface.viewers.CellEditor; -import org.eclipse.jface.viewers.ColumnViewer; -import org.eclipse.jface.viewers.EditingSupport; -import org.eclipse.jface.viewers.TextCellEditor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; - -public class PreferenceSpyEditingSupport extends EditingSupport { - - private Fields field; - - public PreferenceSpyEditingSupport(ColumnViewer viewer, Fields field) { - super(viewer); - this.field = field; - } - - @Override - protected CellEditor getCellEditor(Object element) { - return new TextCellEditor((Composite) getViewer().getControl(), SWT.READ_ONLY); - } - - @Override - protected boolean canEdit(Object element) { - return true; - } - - @Override - protected Object getValue(Object element) { - String value = null; - if (element instanceof PreferenceEntry) { - PreferenceEntry preferenceEntry = (PreferenceEntry) element; - switch (field) { - case nodePath: - value = preferenceEntry.getNodePath(); - break; - case key: - value = preferenceEntry.getKey(); - break; - case oldValue: - value = preferenceEntry.getOldValue(); - break; - case newValue: - value = preferenceEntry.getNewValue(); - break; - default: - break; - } - } - - return value; - } - - @Override - protected void setValue(Object element, Object value) { - } - -} diff --git a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/preferencepage/TracePreferencePage.java b/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/preferencepage/TracePreferencePage.java deleted file mode 100644 index 79583993..00000000 --- a/bundles/org.eclipse.e4.tools.preference.spy/src/org/eclipse/e4/tools/preference/spy/preferencepage/TracePreferencePage.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 vogella GmbH. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Simon Scholz <simon.scholz@vogella.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.tools.preference.spy.preferencepage; - -import org.eclipse.e4.tools.preference.spy.Activator; -import org.eclipse.e4.tools.preference.spy.constants.PreferenceConstants; -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -public class TracePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { - - public TracePreferencePage() { - super(GRID); - setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setDescription("Settings for the preference spy"); - } - - /** - * Creates the field editors - */ - @Override - public void createFieldEditors() { - addField(new BooleanFieldEditor(PreferenceConstants.TRACE_PREFERENCES, "&Trace preference values ", - getFieldEditorParent())); - addField(new BooleanFieldEditor(PreferenceConstants.HIERARCHICAL_LAYOUT, "&Use hierarchical layout in the tree", - getFieldEditorParent())); - } - - @Override - public void init(IWorkbench workbench) { - } -} diff --git a/bundles/org.eclipse.e4.tools.spy/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.tools.spy/META-INF/MANIFEST.MF index 4bf79162..2f1b32c3 100644 --- a/bundles/org.eclipse.e4.tools.spy/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.e4.tools.spy/META-INF/MANIFEST.MF @@ -2,19 +2,15 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Common for Spies Bundle-SymbolicName: org.eclipse.e4.tools.spy;singleton:=true -Bundle-Version: 0.18.0.qualifier +Bundle-Version: 0.19.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: javax.inject;bundle-version="1.0.0", org.eclipse.e4.ui.model.workbench, - org.eclipse.core.runtime;bundle-version="3.9.0", + org.eclipse.core.runtime;bundle-version="3.24.0", org.eclipse.e4.core.di, org.eclipse.e4.core.services, org.eclipse.e4.ui.workbench, - org.eclipse.e4.ui.services, - org.eclipse.e4.core.contexts, - org.eclipse.e4.ui.di, - org.eclipse.equinox.event -Import-Package: javax.annotation;version="1.2.0" + org.eclipse.e4.ui.di Bundle-Vendor: Eclipse Foundation Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.e4.tools.spy;x-internal:=true diff --git a/bundles/org.eclipse.e4.tools.spy/pom.xml b/bundles/org.eclipse.e4.tools.spy/pom.xml index 546f4fa4..80798e87 100644 --- a/bundles/org.eclipse.e4.tools.spy/pom.xml +++ b/bundles/org.eclipse.e4.tools.spy/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.eclipse.e4.tools</groupId> <artifactId>e4-tools-aggregator</artifactId> - <version>0.18.0-SNAPSHOT</version> + <version>0.19.0-SNAPSHOT</version> <relativePath>../../</relativePath> </parent> |