diff options
author | Markus Duft | 2017-03-23 09:52:25 +0000 |
---|---|---|
committer | Lars Vogel | 2021-09-17 13:24:27 +0000 |
commit | 668dec82d39508beaca5749d0704e981fc15154d (patch) | |
tree | 7f4bba9bd2ce88bb0a2853cba7fdb312cec521cf | |
parent | 83e9cdec747e42701cacdab6e308f4253cc4998d (diff) | |
download | eclipse.platform.debug-668dec82d39508beaca5749d0704e981fc15154d.tar.gz eclipse.platform.debug-668dec82d39508beaca5749d0704e981fc15154d.tar.xz eclipse.platform.debug-668dec82d39508beaca5749d0704e981fc15154d.zip |
Bug: 513735 - Initial contribution of launch configuration view
The initial contribution contains a direct port of the current state of
the com.wamas.ide.launchview plugin in https://github.com/mduft/lcdsl
Change-Id: I793c9e6fd9ed59b6c590017e4c8a779d99c483ce
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.debug/+/93689
Tested-by: Platform Bot <platform-bot@eclipse.org>
Reviewed-by: Lars Vogel <Lars.Vogel@vogella.com>
64 files changed, 2959 insertions, 1 deletions
diff --git a/org.eclipse.debug.ui.launchview/.classpath b/org.eclipse.debug.ui.launchview/.classpath new file mode 100644 index 000000000..e801ebfb4 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/org.eclipse.debug.ui.launchview/.project b/org.eclipse.debug.ui.launchview/.project new file mode 100644 index 000000000..e0baa5074 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/.project @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.debug.ui.launchview</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.jdt.core.javanature</nature> + <nature>org.eclipse.pde.PluginNature</nature> + </natures> +</projectDescription> diff --git a/org.eclipse.debug.ui.launchview/.settings/org.eclipse.core.resources.prefs b/org.eclipse.debug.ui.launchview/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..b7aa6e61b --- /dev/null +++ b/org.eclipse.debug.ui.launchview/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//ui/org/eclipse/debug/internal/ui/elements/adapters/Messages.properties=8859_1 +encoding//ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties=8859_1 +encoding/<project>=UTF-8 diff --git a/org.eclipse.debug.ui.launchview/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.debug.ui.launchview/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 000000000..5a0ad22d2 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.debug.ui.launchview/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.debug.ui.launchview/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..2d85a380f --- /dev/null +++ b/org.eclipse.debug.ui.launchview/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,439 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=clean +org.eclipse.jdt.core.builder.duplicateResourceTask=warning +org.eclipse.jdt.core.builder.invalidClasspath=abort +org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch +org.eclipse.jdt.core.circularClasspath=error +org.eclipse.jdt.core.classpath.exclusionPatterns=enabled +org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning +org.eclipse.jdt.core.compiler.problem.fallthroughCase=error +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning +org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private +org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=error +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=warning +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled +org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,HIGH,HIGH +org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,EXPERIMENTAL,CONTEXTLAUNCHING +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=0 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=0 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=32 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=0 +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=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=0 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=0 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=0 +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_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=true +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=do not 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=true +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_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=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_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_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=80 +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.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error diff --git a/org.eclipse.debug.ui.launchview/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.debug.ui.launchview/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..c0ff1c129 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,114 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_Platform Debug Cleanups +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_Platform Debug Formatting +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=true +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +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 diff --git a/org.eclipse.debug.ui.launchview/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.debug.ui.launchview/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 000000000..3cf0ccb6b --- /dev/null +++ b/org.eclipse.debug.ui.launchview/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error +ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error +ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error +ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +FIELD_ELEMENT_TYPE_ADDED_VALUE=Error +FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error +FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Warning +ILLEGAL_IMPLEMENT=Warning +ILLEGAL_INSTANTIATE=Warning +ILLEGAL_OVERRIDE=Warning +ILLEGAL_REFERENCE=Warning +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_JAVADOC_TAG=Warning +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +MISSING_EE_DESCRIPTIONS=Warning +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning +automatically_removed_unused_problem_filters=false +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Error +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/org.eclipse.debug.ui.launchview/.settings/org.eclipse.pde.ds.annotations.prefs b/org.eclipse.debug.ui.launchview/.settings/org.eclipse.pde.ds.annotations.prefs new file mode 100644 index 000000000..960a807c0 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/.settings/org.eclipse.pde.ds.annotations.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +enabled=true +generateBundleActivationPolicyLazy=true +path=OSGI-INF +validationErrorLevel=error +validationErrorLevel.missingImplicitUnbindMethod=error diff --git a/org.eclipse.debug.ui.launchview/.settings/org.eclipse.pde.prefs b/org.eclipse.debug.ui.launchview/.settings/org.eclipse.pde.prefs new file mode 100644 index 000000000..56e42fa48 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/.settings/org.eclipse.pde.prefs @@ -0,0 +1,36 @@ +compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=1
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=2
+compilers.p.discouraged-class=1
+compilers.p.illegal-att-value=0
+compilers.p.internal=1
+compilers.p.matching-pom-version=0
+compilers.p.missing-packages=0
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=0
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=1
+compilers.p.unknown-element=2
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.p.unused-element-or-attribute=1
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/org.eclipse.debug.ui.launchview/META-INF/MANIFEST.MF b/org.eclipse.debug.ui.launchview/META-INF/MANIFEST.MF new file mode 100644 index 000000000..1f37a466d --- /dev/null +++ b/org.eclipse.debug.ui.launchview/META-INF/MANIFEST.MF @@ -0,0 +1,28 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.debug.ui.launchview;singleton:=true +Bundle-Version: 1.0.2.qualifier +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.e4.ui.model.workbench, + org.eclipse.debug.core, + org.eclipse.debug.ui, + org.eclipse.osgi.services, + org.eclipse.e4.core.di.annotations, + org.eclipse.e4.ui.di, + org.eclipse.e4.ui.services +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Import-Package: javax.annotation;version="1.0.0";resolution:=optional, + javax.inject;version="1.0.0" +Bundle-ActivationPolicy: lazy +Service-Component: OSGI-INF/org.eclipse.debug.ui.launchview.internal.model.LaunchViewModel.xml, + OSGI-INF/org.eclipse.debug.ui.launchview.internal.impl.DebugCoreProvider.xml +Export-Package: org.eclipse.debug.ui.launchview.internal;x-internal:=true, + org.eclipse.debug.ui.launchview.internal.impl;x-internal:=true, + org.eclipse.debug.ui.launchview.internal.launcher, + org.eclipse.debug.ui.launchview.internal.model;x-internal:=true, + org.eclipse.debug.ui.launchview.internal.services, + org.eclipse.debug.ui.launchview.internal.view;x-internal:=true diff --git a/org.eclipse.debug.ui.launchview/OSGI-INF/org.eclipse.debug.ui.launchview.internal.impl.DebugCoreProvider.xml b/org.eclipse.debug.ui.launchview/OSGI-INF/org.eclipse.debug.ui.launchview.internal.impl.DebugCoreProvider.xml new file mode 100644 index 000000000..c95bd5ae8 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/OSGI-INF/org.eclipse.debug.ui.launchview.internal.impl.DebugCoreProvider.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="createService" deactivate="destroyService" name="org.eclipse.debug.ui.launchview.internal.impl.DebugCoreProvider"> + <service> + <provide interface="org.eclipse.debug.ui.launchview.internal.services.ILaunchObjectProvider"/> + </service> + <implementation class="org.eclipse.debug.ui.launchview.internal.impl.DebugCoreProvider"/> +</scr:component>
\ No newline at end of file diff --git a/org.eclipse.debug.ui.launchview/OSGI-INF/org.eclipse.debug.ui.launchview.internal.model.LaunchViewModel.xml b/org.eclipse.debug.ui.launchview/OSGI-INF/org.eclipse.debug.ui.launchview.internal.model.LaunchViewModel.xml new file mode 100644 index 000000000..290833cc6 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/OSGI-INF/org.eclipse.debug.ui.launchview.internal.model.LaunchViewModel.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.2.0" activate="activate" deactivate="deactivate" immediate="true" name="org.eclipse.debug.ui.launchview.internal.model.LaunchViewModel"> + <service> + <provide interface="org.eclipse.debug.ui.launchview.internal.services.LaunchModel"/> + </service> + <reference bind="addLaunchObjectProvider" cardinality="0..n" interface="org.eclipse.debug.ui.launchview.internal.services.ILaunchObjectProvider" name="LaunchObjectProvider" policy="dynamic" policy-option="greedy" unbind="removeLaunchObjectProvider"/> + <reference bind="setWorkbench" cardinality="1..1" interface="org.eclipse.ui.IWorkbench" name="Workbench" policy="static" unbind="unsetWorkbench"/> + <implementation class="org.eclipse.debug.ui.launchview.internal.model.LaunchViewModel"/> +</scr:component>
\ No newline at end of file diff --git a/org.eclipse.debug.ui.launchview/build.properties b/org.eclipse.debug.ui.launchview/build.properties new file mode 100644 index 000000000..7950831e8 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/build.properties @@ -0,0 +1,8 @@ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + OSGI-INF/,\ + icons/,\ + plugin.properties +source.. = src/ diff --git a/org.eclipse.debug.ui.launchview/icons/coverage.png b/org.eclipse.debug.ui.launchview/icons/coverage.png Binary files differnew file mode 100644 index 000000000..503c96ab8 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/coverage.png diff --git a/org.eclipse.debug.ui.launchview/icons/debug_exc.png b/org.eclipse.debug.ui.launchview/icons/debug_exc.png Binary files differnew file mode 100644 index 000000000..6bd3c425f --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/debug_exc.png diff --git a/org.eclipse.debug.ui.launchview/icons/debug_exc@2x.png b/org.eclipse.debug.ui.launchview/icons/debug_exc@2x.png Binary files differnew file mode 100644 index 000000000..2a3ccdca5 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/debug_exc@2x.png diff --git a/org.eclipse.debug.ui.launchview/icons/edit_template.png b/org.eclipse.debug.ui.launchview/icons/edit_template.png Binary files differnew file mode 100644 index 000000000..d87238840 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/edit_template.png diff --git a/org.eclipse.debug.ui.launchview/icons/edit_template@2x.png b/org.eclipse.debug.ui.launchview/icons/edit_template@2x.png Binary files differnew file mode 100644 index 000000000..b1c1d8501 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/edit_template@2x.png diff --git a/org.eclipse.debug.ui.launchview/icons/favorite_star.png b/org.eclipse.debug.ui.launchview/icons/favorite_star.png Binary files differnew file mode 100644 index 000000000..75c9d4a1b --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/favorite_star.png diff --git a/org.eclipse.debug.ui.launchview/icons/profile_exc.png b/org.eclipse.debug.ui.launchview/icons/profile_exc.png Binary files differnew file mode 100644 index 000000000..d2971fac4 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/profile_exc.png diff --git a/org.eclipse.debug.ui.launchview/icons/profile_exc@2x.png b/org.eclipse.debug.ui.launchview/icons/profile_exc@2x.png Binary files differnew file mode 100644 index 000000000..8a6257ced --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/profile_exc@2x.png diff --git a/org.eclipse.debug.ui.launchview/icons/refresh.png b/org.eclipse.debug.ui.launchview/icons/refresh.png Binary files differnew file mode 100644 index 000000000..d608a5587 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/refresh.png diff --git a/org.eclipse.debug.ui.launchview/icons/refresh@2x.png b/org.eclipse.debug.ui.launchview/icons/refresh@2x.png Binary files differnew file mode 100644 index 000000000..e81514787 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/refresh@2x.png diff --git a/org.eclipse.debug.ui.launchview/icons/remove_exc.png b/org.eclipse.debug.ui.launchview/icons/remove_exc.png Binary files differnew file mode 100644 index 000000000..3f119f9e3 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/remove_exc.png diff --git a/org.eclipse.debug.ui.launchview/icons/remove_exc@2x.png b/org.eclipse.debug.ui.launchview/icons/remove_exc@2x.png Binary files differnew file mode 100644 index 000000000..bc0c8d90d --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/remove_exc@2x.png diff --git a/org.eclipse.debug.ui.launchview/icons/run_co.png b/org.eclipse.debug.ui.launchview/icons/run_co.png Binary files differnew file mode 100644 index 000000000..18fdb33bd --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/run_co.png diff --git a/org.eclipse.debug.ui.launchview/icons/run_co@2x.png b/org.eclipse.debug.ui.launchview/icons/run_co@2x.png Binary files differnew file mode 100644 index 000000000..2caa8c083 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/run_co@2x.png diff --git a/org.eclipse.debug.ui.launchview/icons/run_exc.png b/org.eclipse.debug.ui.launchview/icons/run_exc.png Binary files differnew file mode 100644 index 000000000..08571c1f2 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/run_exc.png diff --git a/org.eclipse.debug.ui.launchview/icons/run_exc@2x.png b/org.eclipse.debug.ui.launchview/icons/run_exc@2x.png Binary files differnew file mode 100644 index 000000000..156df21c3 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/run_exc@2x.png diff --git a/org.eclipse.debug.ui.launchview/icons/term_restart.png b/org.eclipse.debug.ui.launchview/icons/term_restart.png Binary files differnew file mode 100644 index 000000000..08917c61a --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/term_restart.png diff --git a/org.eclipse.debug.ui.launchview/icons/term_restart@2x.png b/org.eclipse.debug.ui.launchview/icons/term_restart@2x.png Binary files differnew file mode 100644 index 000000000..ae6f399d7 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/term_restart@2x.png diff --git a/org.eclipse.debug.ui.launchview/icons/terminate_all_co.png b/org.eclipse.debug.ui.launchview/icons/terminate_all_co.png Binary files differnew file mode 100644 index 000000000..6e8acdcb0 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/terminate_all_co.png diff --git a/org.eclipse.debug.ui.launchview/icons/terminate_all_co@2x.png b/org.eclipse.debug.ui.launchview/icons/terminate_all_co@2x.png Binary files differnew file mode 100644 index 000000000..ee6373a66 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/terminate_all_co@2x.png diff --git a/org.eclipse.debug.ui.launchview/icons/terminate_co.png b/org.eclipse.debug.ui.launchview/icons/terminate_co.png Binary files differnew file mode 100644 index 000000000..3544673b6 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/terminate_co.png diff --git a/org.eclipse.debug.ui.launchview/icons/terminate_co@2x.png b/org.eclipse.debug.ui.launchview/icons/terminate_co@2x.png Binary files differnew file mode 100644 index 000000000..b605e00f4 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/icons/terminate_co@2x.png diff --git a/org.eclipse.debug.ui.launchview/plugin.properties b/org.eclipse.debug.ui.launchview/plugin.properties new file mode 100644 index 000000000..33d856aac --- /dev/null +++ b/org.eclipse.debug.ui.launchview/plugin.properties @@ -0,0 +1,19 @@ +############################################################################### +# Copyright (c) 2000, 2019 SSI Schaefer IT Solutions 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: +# SSI Schaefer IT Solutions GmbH - initial API and implementation +############################################################################### + + +pluginName=Debug UI Launch Configuration View +providerName=Eclipse.org + +LaunchView.name=Launch Configurations diff --git a/org.eclipse.debug.ui.launchview/plugin.xml b/org.eclipse.debug.ui.launchview/plugin.xml new file mode 100644 index 000000000..4ea04991b --- /dev/null +++ b/org.eclipse.debug.ui.launchview/plugin.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<plugin> + <extension + point="org.eclipse.ui.views"> + <e4view + category="org.eclipse.debug.ui" + class="org.eclipse.debug.ui.launchview.internal.view.LaunchViewImpl" + icon="$nl$/icons/run_exc.png" + id="org.eclipse.debug.ui.launchView" + name="%LaunchView.name" + restorable="true"> + </e4view> + </extension> +</plugin> diff --git a/org.eclipse.debug.ui.launchview/pom.xml b/org.eclipse.debug.ui.launchview/pom.xml new file mode 100644 index 000000000..f20100742 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/pom.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (c) 2012, 2017 SSI Schaefer IT Solutions GmbH and others. + All rights reserved. This program and the accompanying materials + are made available under the terms of the Eclipse Distribution License v1.0 + which accompanies this distribution, and is available at + http://www.eclipse.org/org/documents/edl-v10.php + + Contributors: + Markus Duft - initial implementation +--> +<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> + <artifactId>eclipse.platform.debug</artifactId> + <groupId>eclipse.platform.debug</groupId> + <version>4.22.0-SNAPSHOT</version> + </parent> + + <properties> + <skipAPIAnalysis>true</skipAPIAnalysis> + <code.ignoredWarnings>-warn:+resource,-deprecation,unavoidableGenericProblems</code.ignoredWarnings> + </properties> + + <groupId>org.eclipse.debug</groupId> + <artifactId>org.eclipse.debug.ui.launchview</artifactId> + <version>1.0.2-SNAPSHOT</version> + <packaging>eclipse-plugin</packaging> +</project> diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/FileLogger.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/FileLogger.java new file mode 100644 index 000000000..36ae0c538 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/FileLogger.java @@ -0,0 +1,60 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal; + +import java.io.BufferedWriter; +import java.io.Closeable; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.debug.core.IStreamListener; +import org.eclipse.debug.core.model.IProcess; +import org.eclipse.debug.core.model.IStreamMonitor; +import org.eclipse.osgi.util.NLS; + +/** + * Logger that can be attached to a {@linkplain IProcess} and that writes the + * output to a file. + * <p> + * Please note that it is the responsibility of the caller to close the logger + * if it is not used any more. + * </p> + */ +public class FileLogger implements IStreamListener, Closeable { + + private final BufferedWriter writer; + + /** Creates a new logger that writes to the given file */ + public FileLogger(File file) throws IOException { + writer = new BufferedWriter(new FileWriter(file)); + } + + @Override + public void streamAppended(String text, IStreamMonitor monitor) { + try { + writer.write(text); + writer.flush(); + } catch (Exception ex) { + Platform.getLog(this.getClass()).warn(NLS.bind(LaunchViewMessages.FileLogger_FailedAppend, text), ex); + } + } + + @Override + public void close() throws IOException { + writer.close(); + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/LaunchViewBundleInfo.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/LaunchViewBundleInfo.java new file mode 100644 index 000000000..c12a4c421 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/LaunchViewBundleInfo.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal; + +public interface LaunchViewBundleInfo { + + // The plug-in ID + static final String PLUGIN_ID = "org.eclipse.debug.ui.launchview"; //$NON-NLS-1$ + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/LaunchViewMessages.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/LaunchViewMessages.java new file mode 100644 index 000000000..60c0a3637 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/LaunchViewMessages.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal; + +import org.eclipse.osgi.util.NLS; + +public class LaunchViewMessages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.debug.ui.launchview.internal.messages"; //$NON-NLS-1$ + + public static String DebugCoreLaunchObject_CannotGetType; + public static String DebugCoreLaunchObject_CannotRelaunch; + public static String DebugCoreLaunchObject_CannotTerminate; + public static String DebugCoreLaunchObject_Terminate; + public static String DebugCoreProvider_cannotFetchError; + public static String DebugCoreProvider_delete; + public static String DebugCoreProvider_deleteHint; + public static String DebugCoreProvider_FailedLookup; + public static String EditAction_Edit; + public static String FileLogger_FailedAppend; + public static String LaunchAction_FailedFetchLaunchDelegates; + public static String LaunchObject_ErrorNoId; + public static String LaunchObjectFavoriteContainerModel_Favorites; + public static String LaunchView_Refresh; + public static String LaunchView_Reset; + public static String LaunchView_TerminateAll; + public static String RelaunchAction_TerminateRelaunch; + public static String StandaloneLaunchConfigExecutor_FailedLaunching; + public static String StandaloneLaunchConfigExecutor_Launch; + public static String StandaloneLaunchConfigExecutor_Launching; + public static String StandaloneLaunchConfigExecutor_Timeout; + public static String StandaloneLaunchConfigExecutor_Waiting; + public static String TerminateAction_Terminate; + + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, LaunchViewMessages.class); + } + + private LaunchViewMessages() { + } +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/SpecificLaunchListener.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/SpecificLaunchListener.java new file mode 100644 index 000000000..20d9cf695 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/SpecificLaunchListener.java @@ -0,0 +1,98 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal; + +import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchesListener2; +import org.eclipse.debug.core.model.IProcess; + +/** + * Wrapper around {@link ILaunchesListener2} which unwraps to a single specific + * {@link ILaunch} matching the given {@link ILaunchConfiguration} + */ +public abstract class SpecificLaunchListener implements ILaunchesListener2 { + + private interface ILaunchMethod { + + public void theMethod(ILaunch launch); + } + + private final ILaunchConfiguration config; + + public SpecificLaunchListener(ILaunchConfiguration config) { + this.config = config; + } + + private boolean matches(ILaunch launch) { + // this can happen if re-generating a running launch configuration + if (launch == null || launch.getLaunchConfiguration() == null) { + return false; + } + + return launch.getLaunchConfiguration().contentsEqual(this.config); + } + + private void runIfMatches(ILaunch[] launches, ILaunchMethod handle) { + for (ILaunch l : launches) { + if (matches(l)) { + handle.theMethod(l); + } + } + } + + @Override + public void launchesRemoved(ILaunch[] launches) { + runIfMatches(launches, this::launchRemoved); + } + + @Override + public void launchesAdded(ILaunch[] launches) { + runIfMatches(launches, this::launchAdded); + } + + @Override + public void launchesChanged(ILaunch[] launches) { + runIfMatches(launches, this::launchChanged); + } + + @Override + public void launchesTerminated(ILaunch[] launches) { + runIfMatches(launches, this::launchTerminated); + } + + public void launchRemoved(@SuppressWarnings("unused") ILaunch launch) { + // default: nothing + } + + public void launchAdded(@SuppressWarnings("unused") ILaunch launch) { + // default: nothing + } + + /** + * Called whenever a launch changes. Adding an {@link IProcess} to the + * {@link ILaunch} is a change. + */ + public void launchChanged(@SuppressWarnings("unused") ILaunch launch) { + // default: nothing + } + + /** + * Called whenever the launch is terminated. + */ + public void launchTerminated(@SuppressWarnings("unused") ILaunch launch) { + // default: nothing + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/StreamHelper.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/StreamHelper.java new file mode 100644 index 000000000..8adc1749b --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/StreamHelper.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal; + +import java.io.Closeable; + +/** + * Provides static helpers to work with streams + */ +public class StreamHelper { + + /** + * Unconditionally close a <code>Closeable</code> without throwing any + * exception. + * + * @param closeable the object to close, may be null or already closed + */ + public static void closeQuietly(Closeable closeable) { + if (closeable == null) { + return; + } + try { + closeable.close(); + } catch (Exception e) { + // ignore + } + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/impl/DebugCoreLaunchObject.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/impl/DebugCoreLaunchObject.java new file mode 100644 index 000000000..a2afee7af --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/impl/DebugCoreLaunchObject.java @@ -0,0 +1,167 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.impl; + +import java.util.Collections; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.debug.core.DebugException; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.debug.ui.DebugUITools; +import org.eclipse.debug.ui.IDebugUIConstants; +import org.eclipse.debug.ui.launchview.internal.LaunchViewBundleInfo; +import org.eclipse.debug.ui.launchview.internal.LaunchViewMessages; +import org.eclipse.debug.ui.launchview.internal.launcher.StandaloneLaunchConfigExecutor; +import org.eclipse.debug.ui.launchview.internal.services.ILaunchObject; +import org.eclipse.jface.viewers.StyledString; +import org.eclipse.osgi.util.NLS; +import org.eclipse.ui.PlatformUI; + +public class DebugCoreLaunchObject implements ILaunchObject, Comparable<ILaunchObject> { + + private final ILaunchConfiguration config; + + public DebugCoreLaunchObject(ILaunchConfiguration config) { + this.config = config; + } + + @Override + public String getId() { + return config.getName(); + } + + @Override + public StyledString getLabel() { + return new StyledString(config.getName()); + } + + @Override + public ILaunchConfigurationType getType() { + try { + return config.getType(); + } catch (CoreException e) { + Platform.getLog(this.getClass()).error(NLS.bind(LaunchViewMessages.DebugCoreLaunchObject_CannotGetType, config.getName()), e); + } + return null; + } + + @Override + public void launch(ILaunchMode mode) { + StandaloneLaunchConfigExecutor.launchProcess(config, mode.getIdentifier(), true, false, null); + } + + @Override + public boolean canTerminate() { + ILaunch launch = findLaunch(config.getName()); + if (launch != null && launch.canTerminate()) { + return true; + } + return false; + } + + @Override + public void terminate() { + // DON'T use Eclipse' mechanism - it's a little broken if shutdown of + // the processes takes longer than a few seconds. + // Instead we start a job that tries to terminate processes. If the job + // itself is stopped, we give up like Eclipse does. + ILaunch launch = findLaunch(config.getName()); + if (launch != null && launch.canTerminate()) { + Job terminateJob = new Job(NLS.bind(LaunchViewMessages.DebugCoreLaunchObject_Terminate, config.getName())) { + + @Override + protected IStatus run(IProgressMonitor monitor) { + if (!launch.isTerminated()) { + try { + launch.terminate(); + } catch (DebugException e) { + // could not terminate - but we cannot do anything + // anyway... :( + return new Status(IStatus.WARNING, LaunchViewBundleInfo.PLUGIN_ID, NLS.bind(LaunchViewMessages.DebugCoreLaunchObject_CannotTerminate, config.getName())); + } + } + return Status.OK_STATUS; + } + }; + + terminateJob.setUser(true); + terminateJob.schedule(); + } + } + + @Override + public void relaunch() { + ILaunch launch = findLaunch(getId()); + String launchMode = launch.getLaunchMode(); + try { + launch.terminate(); + StandaloneLaunchConfigExecutor.launchProcess(config, launchMode, true, false, null); + } catch (Exception e) { + throw new RuntimeException(NLS.bind(LaunchViewMessages.DebugCoreLaunchObject_CannotRelaunch, config.getName()), e); + } + } + + public static ILaunch findLaunch(String name) { + for (ILaunch l : DebugPlugin.getDefault().getLaunchManager().getLaunches()) { + if (l.getLaunchConfiguration() == null || l.isTerminated()) { + continue; + } + if (l.getLaunchConfiguration().getName().equals(name)) { + return l; + } + } + return null; + } + + @Override + public void edit() { + // TODO: This uses "debug" mode ALWAYS as the Eclipse infrastructure + // requires a group to be given. This covers most launch configurations + // as most of them support debug, whereas e.g. "Remote Java Application" + // does not support "run". + DebugUITools.openLaunchConfigurationDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), config, DebugUITools.getLaunchGroup(config, "debug").getIdentifier(), null); //$NON-NLS-1$ + } + + @Override + public boolean isFavorite() { + try { + return !config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, Collections.emptyList()).isEmpty(); + } catch (CoreException e) { + return false; // oups + } + } + + @Override + public int compareTo(ILaunchObject o) { + if (getId() == null) { + Platform.getLog(this.getClass()).warn(NLS.bind(LaunchViewMessages.LaunchObject_ErrorNoId, this), null); + if (o.getId() == null) { + return 0; + } + return 1; + } + + return getId().compareTo(o.getId()); + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/impl/DebugCoreProvider.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/impl/DebugCoreProvider.java new file mode 100644 index 000000000..4b025e602 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/impl/DebugCoreProvider.java @@ -0,0 +1,155 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.impl; + +import java.util.Arrays; +import java.util.Collections; +import java.util.Set; +import java.util.TreeSet; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationListener; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.debug.core.ILaunchesListener2; +import org.eclipse.debug.ui.launchview.internal.LaunchViewBundleInfo; +import org.eclipse.debug.ui.launchview.internal.LaunchViewMessages; +import org.eclipse.debug.ui.launchview.internal.services.AbstractLaunchObjectProvider; +import org.eclipse.debug.ui.launchview.internal.services.ILaunchObject; +import org.eclipse.debug.ui.launchview.internal.services.ILaunchObjectProvider; +import org.eclipse.e4.core.di.annotations.CanExecute; +import org.eclipse.e4.core.di.annotations.Execute; +import org.eclipse.e4.ui.model.application.ui.menu.MDirectMenuItem; +import org.eclipse.e4.ui.model.application.ui.menu.MMenu; +import org.eclipse.e4.ui.model.application.ui.menu.MMenuFactory; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; + +@Component(service = ILaunchObjectProvider.class) +public class DebugCoreProvider extends AbstractLaunchObjectProvider implements ILaunchObjectProvider, ILaunchConfigurationListener, ILaunchesListener2 { + + private final ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); + + @Activate + public void createService() { + DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(this); + DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this); + } + + @Deactivate + public void destroyService() { + DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(this); + DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this); + } + + @Override + public Set<ILaunchObject> getLaunchObjects() { + try { + return Arrays.stream(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations()).map(DebugCoreLaunchObject::new).collect(Collectors.toCollection(TreeSet::new)); + } catch (CoreException e) { + org.eclipse.core.runtime.Platform.getLog(this.getClass()).error(LaunchViewMessages.DebugCoreProvider_FailedLookup, e); + return Collections.emptySet(); + } + } + + @Override + public void launchConfigurationAdded(ILaunchConfiguration configuration) { + fireUpdate(); + } + + @Override + public void launchConfigurationChanged(ILaunchConfiguration configuration) { + fireUpdate(); + } + + @Override + public void launchConfigurationRemoved(ILaunchConfiguration configuration) { + fireUpdate(); + } + + @Override + public int getPriority() { + return 0; + } + + @Override + public void launchesRemoved(ILaunch[] launches) { + } + + @Override + public void launchesAdded(ILaunch[] launches) { + } + + @Override + public void launchesChanged(ILaunch[] launches) { + fireUpdate(); // process added, thus can terminate + } + + @Override + public void launchesTerminated(ILaunch[] launches) { + fireUpdate(); + } + + @Override + public void contributeViewMenu(Supplier<Set<ILaunchObject>> selected, MMenu menu) { + // nothing to contribute for now... + } + + @Override + public void contributeContextMenu(Supplier<Set<ILaunchObject>> selected, MMenu menu) { + MDirectMenuItem cleanup = MMenuFactory.INSTANCE.createDirectMenuItem(); + cleanup.setLabel(LaunchViewMessages.DebugCoreProvider_delete); + cleanup.setTooltip(LaunchViewMessages.DebugCoreProvider_deleteHint); + cleanup.setIconURI("platform:/plugin/" + LaunchViewBundleInfo.PLUGIN_ID + "/icons/remove_exc.png"); //$NON-NLS-1$ //$NON-NLS-2$ + cleanup.setObject(new Object() { + + @Execute + public void cleanup() throws CoreException { + for (ILaunchObject e : selected.get()) { + findLaunchConfiguration(e.getType(), e.getId()).delete(); + } + + fireUpdate(); + } + + @CanExecute + public boolean isEnabled() { + return selected.get().stream().allMatch(e -> e instanceof DebugCoreLaunchObject && findLaunchConfiguration(e.getType(), e.getId()) != null); + } + }); + + menu.getChildren().add(MMenuFactory.INSTANCE.createMenuSeparator()); + menu.getChildren().add(cleanup); + } + + ILaunchConfiguration findLaunchConfiguration(ILaunchConfigurationType type, String name) { + try { + for (ILaunchConfiguration config : manager.getLaunchConfigurations(type)) { + if (config.getName().equals(name)) { + return config; + } + } + return null; + } catch (Exception e) { + throw new RuntimeException(LaunchViewMessages.DebugCoreProvider_cannotFetchError, e); + } + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/launcher/StandaloneLaunchConfigExecutor.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/launcher/StandaloneLaunchConfigExecutor.java new file mode 100644 index 000000000..ac4700d6e --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/launcher/StandaloneLaunchConfigExecutor.java @@ -0,0 +1,218 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.launcher; + +import java.io.File; +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.debug.core.model.IProcess; +import org.eclipse.debug.ui.launchview.internal.FileLogger; +import org.eclipse.debug.ui.launchview.internal.LaunchViewMessages; +import org.eclipse.debug.ui.launchview.internal.SpecificLaunchListener; +import org.eclipse.debug.ui.launchview.internal.StreamHelper; +import org.eclipse.osgi.util.NLS; + +/** + * Wraps launching a certain ILaunchConfiguration into a job + */ +public class StandaloneLaunchConfigExecutor { + + /** + * Starts a launch configuration. The return value is only valid if wait is + * <code>true</code> + * + * @param launchConf the launch configuration + * @param mode the launch mode to use. + * @param build whether to perform a build before launch + * @param wait whether to wait for completion + * @param logFile an optional {@link File} to write console output to. May + * be <code>null</code>. + * @return process exit value if wait is <code>true</code>, always 0 if wait + * is <code>false</code>. -1 in case waiting was interrupted. + */ + public static int launchProcess(ILaunchConfiguration launchConf, String mode, boolean build, boolean wait, File logFile) { + StandaloneLauncherJob launch = new StandaloneLauncherJob(launchConf, mode, build, wait, logFile); + + launch.setPriority(Job.SHORT); + launch.schedule(); + if (wait) { + try { + launch.join(); + } catch (InterruptedException e) { + return -1; + } + } + + // when waiting this is the real result, when not it's initialized to 0 + return launch.getProcessResult(); + } + + /** + * Launches the specified configuration and optionally waits until the end + * of execution. + * + * @param launchConfig launch configuration + * @param mode the mode in which to launch + * @param monitor progress monitor (only for cancellation) + * @param timeout timeout in milliseconds (optional; {@code <=0} means no + * timeout) + * @param logFile log file where console output is redirected (optional; + * {@code null} means no log file) + * @return the resulting launch + */ + @SuppressWarnings("resource") + private static ILaunch launch(final ILaunchConfiguration launchConfig, final String mode, final IProgressMonitor monitor, final long timeout, final File logFile, boolean build, boolean wait) throws Exception { + final FileLogger logger; + if (logFile != null) { + logger = new FileLogger(logFile); + } else { + logger = null; + } + + Object lock = new Object(); + ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); + launchManager.addLaunchListener(new SpecificLaunchListener(launchConfig) { + + private final Set<IProcess> attached = new HashSet<>(); + + @Override + public void launchChanged(ILaunch launch) { + if (logger == null) { + return; + } + + for (IProcess p : launch.getProcesses()) { + if (!attached.contains(p)) { + p.getStreamsProxy().getOutputStreamMonitor().addListener(logger); + p.getStreamsProxy().getErrorStreamMonitor().addListener(logger); + + attached.add(p); + } + } + } + + @Override + public void launchTerminated(ILaunch l) { + // found it. make sure that the streams are closed. + StreamHelper.closeQuietly(logger); + launchManager.removeLaunchListener(this); + + synchronized (lock) { + lock.notifyAll(); + } + } + }); + + final ILaunch launch = launchConfig.launch(mode, monitor, build, true); + monitor.subTask(LaunchViewMessages.StandaloneLaunchConfigExecutor_Waiting); + + if (wait) { + long timeRunning = 0; + while (launch.hasChildren() && !launch.isTerminated()) { + if (monitor.isCanceled()) { + launch.terminate(); + } + if (timeout > 0 && timeRunning > timeout) { + launch.terminate(); + StreamHelper.closeQuietly(logger); + throw new InterruptedException(NLS.bind(LaunchViewMessages.StandaloneLaunchConfigExecutor_Timeout, timeout)); + } + synchronized (lock) { + lock.wait(500); + } + timeRunning += 500; + } + } + return launch; + } + + /** + * Job that launches a {@link LaunchConfig} in the background. + */ + private static class StandaloneLauncherJob extends Job { + + private final ILaunchConfiguration config; + + private int result = 0; + private final String mode; + private final boolean build; + private final boolean wait; + + private final File logFile; + + /** + * Creates a new {@link StandaloneLauncherJob} to monitor an await + * launching of {@link ILaunchConfiguration}s + * + * @param config the {@link ILaunchConfiguration} to start + * @param mode the mode in which to launch + * @param build whether to build before launch + * @param wait whether to keep the job alive until the associated + * {@link ILaunch} terminates. + * @param logFile an optional {@link File} to write console output to. + * May be <code>null</code>. + */ + StandaloneLauncherJob(ILaunchConfiguration config, String mode, boolean build, boolean wait, File logFile) { + super(NLS.bind(LaunchViewMessages.StandaloneLaunchConfigExecutor_Launch, config.getName())); + this.config = config; + this.build = build; + this.wait = wait; + this.logFile = logFile; + this.mode = mode; + } + + int getProcessResult() { + return result; + } + + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + monitor.beginTask(NLS.bind(LaunchViewMessages.StandaloneLaunchConfigExecutor_Launching, config.getName()), IProgressMonitor.UNKNOWN); + + ILaunch launch = launch(config, mode, monitor, 0, logFile, build, wait); + + if (wait) { + IProcess[] ps = launch.getProcesses(); + + // in our scenarios it NEVER happens that there is more than + // one process + for (IProcess p : ps) { + if (p.getExitValue() != 0) { + result = p.getExitValue(); + } + } + } + } catch (Exception e) { + Platform.getLog(this.getClass()).error(NLS.bind(LaunchViewMessages.StandaloneLaunchConfigExecutor_FailedLaunching, config.getName()), e); + } finally { + monitor.done(); + } + + // always return OK, to avoid error messages + return Status.OK_STATUS; + } + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/messages.properties b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/messages.properties new file mode 100644 index 000000000..a11779190 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/messages.properties @@ -0,0 +1,37 @@ +############################################################################### +# Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: +# SSI Schaefer IT Solutions GmbH +############################################################################### + +DebugCoreLaunchObject_CannotGetType=Cannot get type of {0} +DebugCoreLaunchObject_CannotRelaunch=Cannot relaunch {0} +DebugCoreLaunchObject_CannotTerminate=Cannot terminate {0} +DebugCoreLaunchObject_Terminate=Terminate {0} +DebugCoreProvider_cannotFetchError=Cannot fetch existing launch configurations +DebugCoreProvider_delete=Remove +DebugCoreProvider_deleteHint=Deletes the selected launch configuration +DebugCoreProvider_FailedLookup=Cannot fetch launch configurations from Eclipse. +EditAction_Edit=Edit... +FileLogger_FailedAppend=Failed to append '{0}' to log file. +LaunchAction_FailedFetchLaunchDelegates=Problem retreiving launch delegates +LaunchObject_ErrorNoId=LaunchObject with null id: {0} +LaunchObjectFavoriteContainerModel_Favorites=Favorites +LaunchView_Refresh=Refresh +LaunchView_Reset=Reset +LaunchView_TerminateAll=Terminate All +RelaunchAction_TerminateRelaunch=Terminate && Relaunch +StandaloneLaunchConfigExecutor_FailedLaunching=Failed launching {0} +StandaloneLaunchConfigExecutor_Launch=Launch {0} +StandaloneLaunchConfigExecutor_Launching=Launching {0} +StandaloneLaunchConfigExecutor_Timeout=execution exceeded maximum time of {0} ms +StandaloneLaunchConfigExecutor_Waiting=waiting for processes... +TerminateAction_Terminate=Terminate diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/model/LaunchObjectContainerModel.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/model/LaunchObjectContainerModel.java new file mode 100644 index 000000000..ce419c510 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/model/LaunchObjectContainerModel.java @@ -0,0 +1,69 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.model; + +import java.util.Set; +import java.util.TreeSet; + +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.internal.ui.DebugPluginImages; +import org.eclipse.swt.graphics.Image; + +public class LaunchObjectContainerModel extends LaunchObjectModel { + + private final Set<LaunchObjectModel> children = new TreeSet<>((a, b) -> { + if (a instanceof LaunchObjectFavoriteContainerModel) { + return -1; + } else if (b instanceof LaunchObjectFavoriteContainerModel) { + return 1; + } + + return a.getLabel().getString().compareTo(b.getLabel().getString()); + }); + private final ILaunchConfigurationType type; + + LaunchObjectContainerModel() { + this(null, null); + } + + LaunchObjectContainerModel(ILaunchConfigurationType type) { + super(type.getName(), type.getIdentifier(), DebugPluginImages.getImage(type.getIdentifier())); + this.type = type; + } + + protected LaunchObjectContainerModel(String id, Image image) { + super(id, null, image); + this.type = null; + } + + public void addChild(LaunchObjectModel model) { + children.add(model); + } + + public Set<LaunchObjectModel> getChildren() { + return children; + } + + public LaunchObjectContainerModel getContainerFor(LaunchObjectModel m) { + for (LaunchObjectModel child : children) { + if (child instanceof LaunchObjectContainerModel) { + if (m.getObject().getType().equals(((LaunchObjectContainerModel) child).type)) { + return (LaunchObjectContainerModel) child; + } + } + } + return null; + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/model/LaunchObjectFavoriteContainerModel.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/model/LaunchObjectFavoriteContainerModel.java new file mode 100644 index 000000000..a62cb06b1 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/model/LaunchObjectFavoriteContainerModel.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.model; + +import org.eclipse.debug.ui.launchview.internal.LaunchViewBundleInfo; +import org.eclipse.debug.ui.launchview.internal.LaunchViewMessages; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +public class LaunchObjectFavoriteContainerModel extends LaunchObjectContainerModel { + + private static final Image FAV_ICON = AbstractUIPlugin.imageDescriptorFromPlugin(LaunchViewBundleInfo.PLUGIN_ID, "icons/favorite_star.png") //$NON-NLS-1$ + .createImage(); + + public LaunchObjectFavoriteContainerModel() { + super(LaunchViewMessages.LaunchObjectFavoriteContainerModel_Favorites, FAV_ICON); + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/model/LaunchObjectModel.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/model/LaunchObjectModel.java new file mode 100644 index 000000000..80bf5d21a --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/model/LaunchObjectModel.java @@ -0,0 +1,101 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.model; + +import org.eclipse.debug.ui.launchview.internal.services.ILaunchObject; +import org.eclipse.jface.viewers.StyledString; +import org.eclipse.swt.graphics.Image; + +public class LaunchObjectModel implements Comparable<LaunchObjectModel> { + + private final String id; + private final Image image; + + private final ILaunchObject object; + private final String internalId; + + LaunchObjectModel(ILaunchObject obj) { + this.id = obj.getId(); + this.internalId = obj.getId(); + this.image = obj.getImage(); + this.object = obj; + } + + LaunchObjectModel(String id, String internalId, Image image) { + this.id = id; + this.internalId = internalId; + this.image = image; + this.object = null; + } + + public StyledString getLabel() { + if (object == null) { + return new StyledString(id); + } + return object.getLabel(); + } + + public Image getImage() { + return image; + } + + public ILaunchObject getObject() { + return object; + } + + @Override + public String toString() { + return uniqueId() + "(" + getObject() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ + } + + @Override + public int compareTo(LaunchObjectModel o) { + return uniqueId().compareTo(o.uniqueId()); + } + + public String uniqueId() { + if (id == null && internalId == null) { + return "root"; //$NON-NLS-1$ + } else if (internalId != null) { + return internalId; + } else if (object == null || object.getType() == null) { + return id; + } + return object.getType().getIdentifier() + "." + id; //$NON-NLS-1$ + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + (uniqueId().hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + LaunchObjectModel other = (LaunchObjectModel) obj; + return uniqueId().equals(other.uniqueId()); + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/model/LaunchViewModel.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/model/LaunchViewModel.java new file mode 100644 index 000000000..4f2fb9251 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/model/LaunchViewModel.java @@ -0,0 +1,135 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; +import java.util.stream.Collectors; + +import org.eclipse.debug.ui.launchview.internal.services.ILaunchObjectProvider; +import org.eclipse.debug.ui.launchview.internal.services.LaunchModel; +import org.eclipse.ui.IWorkbench; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.component.annotations.ReferencePolicy; +import org.osgi.service.component.annotations.ReferencePolicyOption; + +@Component(immediate = true) +public class LaunchViewModel implements LaunchModel { + + public Set<ILaunchObjectProvider> providers = new TreeSet<>((a, b) -> { + int x = Integer.compare(b.getPriority(), a.getPriority()); + if (x == 0) { + x = a.getClass().getName().compareTo(b.getClass().getName()); + } + return x; + }); + private static LaunchViewModel service; + + private final List<Runnable> updateListeners = new ArrayList<>(); + private final Runnable providerUpdateListener = () -> fireUpdate(); + + public Set<ILaunchObjectProvider> getProviders() { + return providers; + } + + @Override + public LaunchObjectContainerModel getModel() { + LaunchObjectContainerModel root = new LaunchObjectContainerModel(); + + // find all objects from services, sorted by prio (highest prio first). + Set<LaunchObjectModel> allObjects = providers.stream().map(p -> p.getLaunchObjects()).flatMap(o -> o.stream().map(LaunchObjectModel::new)).collect(Collectors.toCollection(TreeSet::new)); + + // create favorite container + LaunchObjectFavoriteContainerModel favorites = new LaunchObjectFavoriteContainerModel(); + root.addChild(favorites); + + // create all required type containers + allObjects.stream().map(o -> o.getObject().getType()).distinct().map(LaunchObjectContainerModel::new).forEach(root::addChild); + + // create all nodes + allObjects.stream().forEach(m -> { + LaunchObjectContainerModel container = root.getContainerFor(m); + if (container == null) { + return; + } + container.addChild(m); + if (m.getObject() != null && m.getObject().isFavorite()) { + favorites.addChild(m); + } + }); + + // this is the root :) + return root; + } + + @Reference(service = ILaunchObjectProvider.class, cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY) + public void addLaunchObjectProvider(ILaunchObjectProvider svc) { + providers.add(svc); + svc.addUpdateListener(providerUpdateListener); + + fireUpdate(); + } + + public void removeLaunchObjectProvider(ILaunchObjectProvider svc) { + providers.remove(svc); + svc.removeUpdateListener(providerUpdateListener); + + fireUpdate(); + } + + @Reference(service = IWorkbench.class, cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.STATIC, unbind = "unsetWorkbench") + public void setWorkbench(@SuppressWarnings("unused") IWorkbench svc) { + // this reference is just a marker to control startup order. + // this is required, otherwise this service activates so early, that the + // prompt for the workspace location is no longer shown (as the location + // is accessed indirectly before the prompt, which initializes it to a + // default). + } + + public void unsetWorkbench(@SuppressWarnings("unused") IWorkbench svc) { + } + + @Activate + public void activate() { + service = this; + } + + @Deactivate + public void deactivate() { + service = null; + } + + public void addUpdateListener(Runnable r) { + updateListeners.add(r); + } + + public void removeUpdateListener(Runnable r) { + updateListeners.remove(r); + } + + private void fireUpdate() { + updateListeners.forEach(Runnable::run); + } + + public static LaunchViewModel getService() { + return service; + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/services/AbstractLaunchObjectProvider.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/services/AbstractLaunchObjectProvider.java new file mode 100644 index 000000000..af1e6c31b --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/services/AbstractLaunchObjectProvider.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.services; + +import java.util.ArrayList; +import java.util.List; + +/** + * Base class for {@link ILaunchObjectProvider} implementations which require + * listeners to be notified on updates. + */ +public abstract class AbstractLaunchObjectProvider implements ILaunchObjectProvider { + + private final List<Runnable> updateListeners = new ArrayList<>(); + + @Override + public void addUpdateListener(Runnable r) { + updateListeners.add(r); + } + + @Override + public void removeUpdateListener(Runnable r) { + updateListeners.remove(r); + } + + protected void fireUpdate() { + // prevent multiple updates in short row somehow? + updateListeners.forEach(Runnable::run); + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/services/ILaunchObject.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/services/ILaunchObject.java new file mode 100644 index 000000000..279323fca --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/services/ILaunchObject.java @@ -0,0 +1,89 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.services; + +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.debug.internal.ui.DebugPluginImages; +import org.eclipse.jface.viewers.StyledString; +import org.eclipse.swt.graphics.Image; + +/** + * A {@link ILaunchObject} describes a single launch-able "thing". + */ +public interface ILaunchObject extends Comparable<ILaunchObject> { + + /** + * @return the unique ID of the {@link ILaunchObject}. + */ + public String getId(); + + /** + * @return a label for display purposes. + */ + public StyledString getLabel(); + + /** + * @return an image, usually derived from the type of the launch + */ + default public Image getImage() { + if (getType() == null) { + return null; + } + return DebugPluginImages.getImage(getType().getIdentifier()); + } + + /** + * @return the underlying {@link ILaunchConfigurationType} of the launch + */ + public ILaunchConfigurationType getType(); + + /** + * Launch the {@link ILaunchObject} in the specified mode. + * + * @param mode in which mode to launch + */ + public void launch(ILaunchMode mode); + + /** + * @return whether this {@link ILaunchObject} supports termination by the + * user. + */ + public boolean canTerminate(); + + /** + * Terminates any running instance of this {@link ILaunchObject}. + */ + public void terminate(); + + /** + * First terminates and then launches this {@link ILaunchObject} if it is + * running already. + */ + public void relaunch(); + + /** + * Triggers custom editing UI logic for the {@link ILaunchObject}. Might open + * an editor, or a dialog, or do something completely different depending on + * the implementation. + */ + public void edit(); + + /** + * @return whether this {@link ILaunchObject} should be displayed in the + * favorite container of the view. + */ + public boolean isFavorite(); + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/services/ILaunchObjectProvider.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/services/ILaunchObjectProvider.java new file mode 100644 index 000000000..70e78ff61 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/services/ILaunchObjectProvider.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.services; + +import java.util.Set; +import java.util.function.Supplier; + +import org.eclipse.debug.ui.launchview.internal.view.LaunchViewImpl; +import org.eclipse.e4.ui.model.application.ui.menu.MMenu; + +/** + * Provides different {@link ILaunchObject} implementations to the view for + * display. Also allows some interaction with the view by means of an update + * listener and menu contributions. + */ +public interface ILaunchObjectProvider { + + /** + * @return all {@link ILaunchObject}s that this provider contributes to the + * view + */ + public Set<? extends ILaunchObject> getLaunchObjects(); + + /** + * @param r register a {@link Runnable} that should be notified whenever the + * provider's state changed. The view will react with refreshing + * it's in-memory models. + */ + public void addUpdateListener(Runnable r); + + /** + * @param r a previously registered update listener {@link Runnable}. + */ + public void removeUpdateListener(Runnable r); + + /** + * @return the priority of the provider. The default (debug.core) provider + * has priority 0. A higher priority means that + * {@link ILaunchObject}s with the same type and id will take + * precedence. This allows to provide {@link ILaunchObject}s that + * will generate {@link ILaunchObject}s in lower priority providers. + */ + public int getPriority(); + + /** + * @param selected supplier for selected elements in the view. + * @param menu the view's menu where items can be contributed. + */ + public void contributeViewMenu(Supplier<Set<ILaunchObject>> selected, MMenu menu); + + /** + * Contribute per-item context menu items here. Use + * {@link LaunchViewImpl#getSelectedElements()} to retrieve selected + * elements during CanExecute and Execute methods of menu items. + * + * @param selected supplier for selected elements in the view. + * @param menu the context menu applied to items in the tree. + */ + public void contributeContextMenu(Supplier<Set<ILaunchObject>> selected, MMenu menu); + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/services/LaunchModel.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/services/LaunchModel.java new file mode 100644 index 000000000..89d979a3b --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/services/LaunchModel.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.services; + +import org.eclipse.debug.ui.launchview.internal.model.LaunchObjectContainerModel; + +/** + * Service which controls the lifecycle of the model which the view is based on. + */ +public interface LaunchModel { + + /** + * @return the current model. Never <code>null</code>. Always created from + * the current state. + */ + public LaunchObjectContainerModel getModel(); + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/EditAction.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/EditAction.java new file mode 100644 index 000000000..3b08bd01a --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/EditAction.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.view; + +import org.eclipse.debug.ui.launchview.internal.LaunchViewBundleInfo; +import org.eclipse.debug.ui.launchview.internal.LaunchViewMessages; +import org.eclipse.e4.core.di.annotations.CanExecute; +import org.eclipse.e4.core.di.annotations.Execute; +import org.eclipse.e4.ui.model.application.ui.menu.MDirectMenuItem; +import org.eclipse.e4.ui.model.application.ui.menu.MMenuFactory; +import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem; + +public class EditAction { + + private LaunchViewImpl view; + + public EditAction(LaunchViewImpl view) { + this.view = view; + } + + public MMenuItem asMMenuItem() { + MDirectMenuItem item = MMenuFactory.INSTANCE.createDirectMenuItem(); + item.setLabel(LaunchViewMessages.EditAction_Edit); + item.setObject(this); + item.setIconURI("platform:/plugin/" + LaunchViewBundleInfo.PLUGIN_ID + "/icons/edit_template.png"); //$NON-NLS-1$ //$NON-NLS-2$ + return item; + } + + @CanExecute + public boolean isEnabled() { + return view.get().size() == 1; + } + + @Execute + public void run() { + view.get().iterator().next().edit(); + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchAction.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchAction.java new file mode 100644 index 000000000..71b24f36f --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchAction.java @@ -0,0 +1,95 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.view; + +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.Platform; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.debug.ui.launchview.internal.LaunchViewBundleInfo; +import org.eclipse.debug.ui.launchview.internal.LaunchViewMessages; +import org.eclipse.debug.ui.launchview.internal.services.ILaunchObject; +import org.eclipse.e4.core.di.annotations.CanExecute; +import org.eclipse.e4.core.di.annotations.Execute; +import org.eclipse.e4.ui.model.application.ui.menu.MDirectMenuItem; +import org.eclipse.e4.ui.model.application.ui.menu.MMenuFactory; +import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem; + +public class LaunchAction { + + private static final Map<String, String> COMMON_MODE_ICONS; + + static { + COMMON_MODE_ICONS = new TreeMap<>(); + COMMON_MODE_ICONS.put("run", "icons/run_exc.png"); //$NON-NLS-1$//$NON-NLS-2$ + COMMON_MODE_ICONS.put("debug", "icons/debug_exc.png"); //$NON-NLS-1$ //$NON-NLS-2$ + COMMON_MODE_ICONS.put("profile", "icons/profile_exc.png"); //$NON-NLS-1$ //$NON-NLS-2$ + COMMON_MODE_ICONS.put("coverage", "icons/coverage.png"); //$NON-NLS-1$ //$NON-NLS-2$ + } + + private final ILaunchMode mode; + private LaunchViewImpl view; + + public LaunchAction(ILaunchMode mode, LaunchViewImpl view) { + this.mode = mode; + this.view = view; + } + + public MMenuItem asMMenuItem() { + MDirectMenuItem item = MMenuFactory.INSTANCE.createDirectMenuItem(); + item.setLabel(mode.getLabel()); + item.setObject(this); + + if (COMMON_MODE_ICONS.containsKey(mode.getIdentifier())) { + item.setIconURI("platform:/plugin/" + LaunchViewBundleInfo.PLUGIN_ID + "/" + COMMON_MODE_ICONS.get(mode.getIdentifier())); //$NON-NLS-1$ //$NON-NLS-2$ + } + + return item; + } + + @CanExecute + public boolean isEnabled() { + return view.get().stream().allMatch((m) -> { + try { + return m.getType().getDelegates(Collections.singleton(mode.getIdentifier())).length > 0; + } catch (CoreException e) { + Platform.getLog(this.getClass()).warn(LaunchViewMessages.LaunchAction_FailedFetchLaunchDelegates, e); + return false; + } + }); + } + + @Execute + public void run() { + Set<ILaunchObject> objects = view.get(); + for (ILaunchObject m : objects) { + m.launch(mode); + + if (objects.size() > 1) { + // PDE has a nasty bug. If launching too fast, it tries to + // overwrite the last configurations platform.xml + try { + Thread.sleep(2_000); + } catch (InterruptedException ie) { + // ignored + } + } + } + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchViewContentProvider.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchViewContentProvider.java new file mode 100644 index 000000000..d426a71ae --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchViewContentProvider.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.view; + +import org.eclipse.debug.ui.launchview.internal.model.LaunchObjectContainerModel; +import org.eclipse.jface.viewers.ITreeContentProvider; + +public class LaunchViewContentProvider implements ITreeContentProvider { + + @Override + public Object[] getElements(Object inputElement) { + return getChildren(inputElement); + } + + @Override + public Object[] getChildren(Object parentElement) { + if (parentElement instanceof LaunchObjectContainerModel) { + return ((LaunchObjectContainerModel) parentElement).getChildren().toArray(); + } + + return null; + } + + @Override + public Object getParent(Object element) { + return null; + } + + @Override + public boolean hasChildren(Object element) { + return (element instanceof LaunchObjectContainerModel && !((LaunchObjectContainerModel) element).getChildren().isEmpty()); + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchViewImpl.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchViewImpl.java new file mode 100644 index 000000000..ba4b19762 --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchViewImpl.java @@ -0,0 +1,321 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.view; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.TreeSet; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.inject.Inject; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchMode; +import org.eclipse.debug.ui.launchview.internal.LaunchViewBundleInfo; +import org.eclipse.debug.ui.launchview.internal.LaunchViewMessages; +import org.eclipse.debug.ui.launchview.internal.model.LaunchObjectContainerModel; +import org.eclipse.debug.ui.launchview.internal.model.LaunchObjectFavoriteContainerModel; +import org.eclipse.debug.ui.launchview.internal.model.LaunchObjectModel; +import org.eclipse.debug.ui.launchview.internal.model.LaunchViewModel; +import org.eclipse.debug.ui.launchview.internal.services.ILaunchObject; +import org.eclipse.e4.core.di.annotations.Execute; +import org.eclipse.e4.ui.di.Focus; +import org.eclipse.e4.ui.model.application.ui.basic.MPart; +import org.eclipse.e4.ui.model.application.ui.menu.MDirectMenuItem; +import org.eclipse.e4.ui.model.application.ui.menu.MMenu; +import org.eclipse.e4.ui.model.application.ui.menu.MMenuFactory; +import org.eclipse.e4.ui.model.application.ui.menu.MPopupMenu; +import org.eclipse.e4.ui.services.EMenuService; +import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ITreeSelection; +import org.eclipse.jface.viewers.TreePath; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.dialogs.FilteredTree; +import org.eclipse.ui.dialogs.PatternFilter; + +public class LaunchViewImpl implements Supplier<Set<ILaunchObject>> { + + private static final String CONTEXT_MENU_ID = "LaunchViewContextMenu"; //$NON-NLS-1$ + + private LaunchViewModel model; + private final Runnable reset = () -> queueReset(); + private final Job resetJob; + private FilteredTree tree; + + @Inject + EMenuService menuService; + + public LaunchViewImpl() { + resetJob = new Job(LaunchViewMessages.LaunchView_Reset) { + + @Override + protected IStatus run(IProgressMonitor monitor) { + reset(); + return Status.OK_STATUS; + } + }; + + resetJob.setSystem(true); + } + + @PostConstruct + public void createView(Composite parent, MPart part) { + model = LaunchViewModel.getService(); + model.addUpdateListener(reset); + + tree = new FilteredTree(parent, SWT.BORDER | SWT.MULTI, new PatternFilter() { + + @Override + public void setPattern(String pattern) { + if (pattern != null && !pattern.isEmpty() && pattern.indexOf("*") != 0 && pattern.indexOf("?") != 0 //$NON-NLS-1$ //$NON-NLS-2$ + && pattern.indexOf(".") != 0) { //$NON-NLS-1$ + super.setPattern("*" + pattern); //$NON-NLS-1$ + } else { + super.setPattern(pattern); + } + } + + @Override + protected boolean isLeafMatch(Viewer viewer, Object element) { + if (!(element instanceof LaunchObjectModel) || element instanceof LaunchObjectContainerModel) { + return false; + } + String txt = ((LaunchObjectModel) element).getLabel().toString(); + return wordMatches(txt); + } + }, true); + tree.getViewer().setContentProvider(new LaunchViewContentProvider()); + tree.getViewer().setLabelProvider(new DelegatingStyledCellLabelProvider(new LaunchViewLabelProvider())); + tree.getViewer().getTree().setLayout(new GridLayout()); + tree.getViewer().getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + createMenus(part); + + tree.getViewer().addDoubleClickListener((e) -> { + ITreeSelection selection = tree.getViewer().getStructuredSelection(); + if (selection.isEmpty()) { + return; + } + + for (Object selected : selection.toList()) { + if (selected instanceof LaunchObjectContainerModel) { + tree.getViewer().setExpandedState(selected, !tree.getViewer().getExpandedState(selected)); + return; // only supported for single element double-click + } + } + + new LaunchAction(DebugPlugin.getDefault().getLaunchManager().getLaunchMode("run"), LaunchViewImpl.this).run(); //$NON-NLS-1$ + }); + + reset(); + } + + @Focus + public void onFocus() { + tree.getViewer().getControl().setFocus(); + } + + private void createMenus(MPart part) { + part.getMenus().clear(); // clear persisted state + + // View menu + MMenu viewMenu = MMenuFactory.INSTANCE.createMenu(); + viewMenu.setElementId("menu:" + part.getElementId()); //$NON-NLS-1$ + viewMenu.getTags().add("ViewMenu"); //$NON-NLS-1$ + + MDirectMenuItem refresh = MMenuFactory.INSTANCE.createDirectMenuItem(); + refresh.setLabel(LaunchViewMessages.LaunchView_Refresh); + refresh.setIconURI("platform:/plugin/" + LaunchViewBundleInfo.PLUGIN_ID + "/icons/refresh.png"); //$NON-NLS-1$ //$NON-NLS-2$ + refresh.setObject(new RefreshHandler()); + + MDirectMenuItem terminateAll = MMenuFactory.INSTANCE.createDirectMenuItem(); + terminateAll.setLabel(LaunchViewMessages.LaunchView_TerminateAll); + terminateAll.setIconURI("platform:/plugin/" + LaunchViewBundleInfo.PLUGIN_ID + "/icons/terminate_all_co.png"); //$NON-NLS-1$ //$NON-NLS-2$ + terminateAll.setObject(new TerminateAllHandler()); + + viewMenu.getChildren().add(refresh); + viewMenu.getChildren().add(MMenuFactory.INSTANCE.createMenuSeparator()); + viewMenu.getChildren().add(terminateAll); + + // contributions from providers + model.getProviders().forEach(p -> p.contributeViewMenu(this, viewMenu)); + + part.getMenus().add(viewMenu); + + // Context menu + MPopupMenu ctxMenu = MMenuFactory.INSTANCE.createPopupMenu(); + ctxMenu.setElementId(CONTEXT_MENU_ID); + + // one menu item for each mode that launches all selected + for (ILaunchMode mode : getPreSortedLaunchModes()) { + ctxMenu.getChildren().add(new LaunchAction(mode, this).asMMenuItem()); + } + + ctxMenu.getChildren().add(MMenuFactory.INSTANCE.createMenuSeparator()); + ctxMenu.getChildren().add(new RelaunchAction(this).asMMenuItem()); + ctxMenu.getChildren().add(new TerminateAction(this).asMMenuItem()); + ctxMenu.getChildren().add(MMenuFactory.INSTANCE.createMenuSeparator()); + ctxMenu.getChildren().add(new EditAction(this).asMMenuItem()); + + // contributions from providers + model.getProviders().forEach(p -> p.contributeContextMenu(this, ctxMenu)); + + part.getMenus().add(ctxMenu); + + menuService.registerContextMenu(tree.getViewer().getControl(), CONTEXT_MENU_ID); + } + + private List<ILaunchMode> getPreSortedLaunchModes() { + List<ILaunchMode> modes = new ArrayList<>(); + + ILaunchMode run = null; + ILaunchMode debug = null; + ILaunchMode profile = null; + ILaunchMode coverage = null; + + ILaunchMode[] launchModes = DebugPlugin.getDefault().getLaunchManager().getLaunchModes(); + List<ILaunchMode> others = new ArrayList<>(); + + for (ILaunchMode m : launchModes) { + switch (m.getIdentifier()) { + case "run": //$NON-NLS-1$ + run = m; + break; + case "debug": //$NON-NLS-1$ + debug = m; + break; + case "profile": //$NON-NLS-1$ + profile = m; + break; + case "coverage": //$NON-NLS-1$ + coverage = m; + break; + default: + others.add(m); + } + } + + if (run != null) { + modes.add(run); + } + if (debug != null) { + modes.add(debug); + } + if (coverage != null) { + modes.add(coverage); + } + if (profile != null) { + modes.add(profile); + } + modes.addAll(others); + return modes; + } + + private void queueReset() { + resetJob.cancel(); + resetJob.schedule(100); + } + + @Override + public Set<ILaunchObject> get() { + ISelection selection = tree.getViewer().getSelection(); + IStructuredSelection structuredSelection = (IStructuredSelection) selection; + if (structuredSelection.isEmpty()) { + return Collections.emptySet(); + } + + Set<LaunchObjectModel> elements = new TreeSet<>(); + // expand selection if containers are selected + for (Object selected : structuredSelection.toList()) { + if (selected instanceof LaunchObjectContainerModel) { + elements.addAll(((LaunchObjectContainerModel) selected).getChildren()); + } else if (selected instanceof LaunchObjectModel) { + elements.add((LaunchObjectModel) selected); + } + } + + return elements.stream().map(m -> m.getObject()).filter(Objects::nonNull).collect(Collectors.toCollection(TreeSet::new)); + } + + private synchronized void reset() { + tree.getDisplay().syncExec(() -> { + tree.getViewer().getTree().setRedraw(false); + try { + TreePath[] exp = tree.getViewer().getExpandedTreePaths(); + tree.getViewer().setInput(model.getModel()); + tree.getViewer().setExpandedTreePaths(exp); + } finally { + tree.getViewer().getTree().setRedraw(true); + } + }); + } + + @PreDestroy + public void destroy() { + model.removeUpdateListener(reset); + } + + private final class RefreshHandler { + + @Execute + public void handle() { + reset(); + } + } + + private final class TerminateAllHandler { + + @Execute + public void handle() { + LaunchObjectContainerModel root = (LaunchObjectContainerModel) tree.getViewer().getInput(); + if (root == null) { + return; + } + + for (LaunchObjectModel container : root.getChildren()) { + if (container instanceof LaunchObjectFavoriteContainerModel) { + continue; + } + + if (container instanceof LaunchObjectContainerModel) { + for (LaunchObjectModel m : ((LaunchObjectContainerModel) container).getChildren()) { + if (m.getObject() == null) { + continue; + } + + if (m.getObject().canTerminate()) { + m.getObject().terminate(); + } + } + } + } + } + } + +}
\ No newline at end of file diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchViewLabelProvider.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchViewLabelProvider.java new file mode 100644 index 000000000..4d8b1759e --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchViewLabelProvider.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.view; + +import org.eclipse.debug.ui.launchview.internal.LaunchViewBundleInfo; +import org.eclipse.debug.ui.launchview.internal.model.LaunchObjectModel; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.jface.viewers.BaseLabelProvider; +import org.eclipse.jface.viewers.DecorationOverlayIcon; +import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; +import org.eclipse.jface.viewers.IDecoration; +import org.eclipse.jface.viewers.StyledString; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +public class LaunchViewLabelProvider extends BaseLabelProvider implements IStyledLabelProvider { + + private static final ImageDescriptor ICON_RUNNING = AbstractUIPlugin.imageDescriptorFromPlugin(LaunchViewBundleInfo.PLUGIN_ID, "icons/run_co.png"); //$NON-NLS-1$ + + private final ImageRegistry perConfig = new ImageRegistry(); + + @Override + public StyledString getStyledText(Object element) { + if (element instanceof LaunchObjectModel) { + return ((LaunchObjectModel) element).getLabel(); + } + + return null; + } + + @Override + public Image getImage(Object element) { + if (element instanceof LaunchObjectModel) { + LaunchObjectModel obj = (LaunchObjectModel) element; + if (obj.getObject() != null && obj.getObject().canTerminate()) { + return getCachedRunningImage(obj); + } + + return obj.getImage(); + } + + return null; + } + + private Image getCachedRunningImage(LaunchObjectModel obj) { + Image img = perConfig.get(obj.getObject().getId()); + if (img == null) { + img = new DecorationOverlayIcon(obj.getImage(), ICON_RUNNING, IDecoration.TOP_LEFT).createImage(); + perConfig.put(obj.getObject().getId(), img); + } + return img; + } + + @Override + public void dispose() { + perConfig.dispose(); + super.dispose(); + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/RelaunchAction.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/RelaunchAction.java new file mode 100644 index 000000000..8268ae14c --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/RelaunchAction.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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: + * SSI Schaefer IT Solutions GmbH + *******************************************************************************/ +package org.eclipse.debug.ui.launchview.internal.view; + +import org.eclipse.debug.ui.launchview.internal.LaunchViewBundleInfo; +import org.eclipse.debug.ui.launchview.internal.LaunchViewMessages; +import org.eclipse.e4.core.di.annotations.CanExecute; +import org.eclipse.e4.core.di.annotations.Execute; +import org.eclipse.e4.ui.model.application.ui.menu.MDirectMenuItem; +import org.eclipse.e4.ui.model.application.ui.menu.MMenuFactory; +import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem; + +public class RelaunchAction { + + private LaunchViewImpl view; + + public RelaunchAction(LaunchViewImpl view) { + this.view = view; + } + + public MMenuItem asMMenuItem() { + MDirectMenuItem item = MMenuFactory.INSTANCE.createDirectMenuItem(); + item.setLabel(LaunchViewMessages.RelaunchAction_TerminateRelaunch); + item.setEnabled(isEnabled()); + item.setObject(this); + + item.setIconURI("platform:/plugin/" + LaunchViewBundleInfo.PLUGIN_ID + "/icons/term_restart.png"); //$NON-NLS-1$ //$NON-NLS-2$ + + return item; + } + + @CanExecute + public boolean isEnabled() { + return view.get().stream().allMatch(m -> m.canTerminate()); + } + + @Execute + public void run() { + view.get().stream().forEach(m -> m.relaunch()); + } + +} diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/TerminateAction.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/TerminateAction.java new file mode 100644 index 000000000..50cb02f0b --- /dev/null +++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/TerminateAction.java @@ -0,0 +1,53 @@ +/*******************************************************************************
+ * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions 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:
+ * SSI Schaefer IT Solutions GmbH
+ *******************************************************************************/
+package org.eclipse.debug.ui.launchview.internal.view;
+
+import org.eclipse.debug.ui.launchview.internal.LaunchViewBundleInfo;
+import org.eclipse.debug.ui.launchview.internal.LaunchViewMessages;
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.ui.menu.MDirectMenuItem;
+import org.eclipse.e4.ui.model.application.ui.menu.MMenuFactory;
+import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem;
+
+public class TerminateAction {
+
+ private LaunchViewImpl view;
+
+ public TerminateAction(LaunchViewImpl view) {
+ this.view = view;
+ }
+
+ public MMenuItem asMMenuItem() {
+ MDirectMenuItem item = MMenuFactory.INSTANCE.createDirectMenuItem();
+ item.setLabel(LaunchViewMessages.TerminateAction_Terminate);
+ item.setEnabled(isEnabled());
+ item.setObject(this);
+
+ item.setIconURI("platform:/plugin/" + LaunchViewBundleInfo.PLUGIN_ID + "/icons/terminate_co.png"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ return item;
+ }
+
+ @CanExecute
+ public boolean isEnabled() {
+ return view.get().stream().allMatch(m -> m.canTerminate());
+ }
+
+ @Execute
+ public void run() {
+ view.get().forEach(e -> e.terminate());
+ }
+
+}
diff --git a/org.eclipse.debug.ui/META-INF/MANIFEST.MF b/org.eclipse.debug.ui/META-INF/MANIFEST.MF index 2859e4c5a..810369221 100644 --- a/org.eclipse.debug.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.debug.ui/META-INF/MANIFEST.MF @@ -12,7 +12,8 @@ Export-Package: org.eclipse.debug.internal.ui; org.eclipse.jdt.debug.tests, org.eclipse.debug.tests, org.eclipse.debug.examples.ui, - org.eclipse.debug.examples.mixedmode", + org.eclipse.debug.examples.mixedmode, + org.eclipse.debug.ui.launchview", org.eclipse.debug.internal.ui.actions;x-internal:=true, org.eclipse.debug.internal.ui.actions.breakpointGroups;x-internal:=true, org.eclipse.debug.internal.ui.actions.breakpointSortBy;x-internal:=true, @@ -60,6 +60,7 @@ <module>org.eclipse.debug.examples.ui</module> <module>org.eclipse.debug.tests</module> <module>org.eclipse.debug.ui</module> + <module>org.eclipse.debug.ui.launchview</module> <module>org.eclipse.ui.console</module> <module>org.eclipse.ui.externaltools</module> <module>org.eclipse.unittest.ui</module> |