Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'terminals/plugins/org.eclipse.tcf.te.ui.terminals.local')
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.classpath7
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.options1
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.project39
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.settings/org.eclipse.jdt.core.prefs362
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.settings/org.eclipse.jdt.ui.prefs56
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.settings/org.eclipse.pde.prefs32
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/META-INF/MANIFEST.MF29
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/META-INF/p2.inf82
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/about.html28
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/build.properties17
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/contexts.xml6
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/icons/eview16/terminal_view.gifbin0 -> 938 bytes
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/plugin.properties23
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/plugin.xml130
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/pom.xml17
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/activator/UIPlugin.java127
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/controls/LocalWizardConfigurationPanel.java195
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/help/IContextHelpIds.java29
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalLauncherDelegate.java374
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalLauncherHandler.java60
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalMementoHandler.java40
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/nls/Messages.java58
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/nls/Messages.properties38
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/DynamicContributionItems.java129
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/ExternalExecutablesDialog.java460
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/ExternalExecutablesInitializer.java88
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/ExternalExecutablesManager.java181
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/interfaces/IExternalExecutablesProperties.java41
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/interfaces/IPreferenceKeys.java40
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/preferences/PreferencePage.java490
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/preferences/PreferencesInitializer.java37
31 files changed, 3216 insertions, 0 deletions
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.classpath b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.classpath
new file mode 100644
index 000000000..ad32c83a7
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.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-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.options b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.options
new file mode 100644
index 000000000..b39673418
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.options
@@ -0,0 +1 @@
+org.eclipse.tcf.te.ui.terminals.local/debugmode = 0
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.project b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.project
new file mode 100644
index 000000000..f86fbb751
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.project
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.tcf.te.ui.terminals.local</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+ <filteredResources>
+ <filter>
+ <id>0</id>
+ <name></name>
+ <type>10</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-target</arguments>
+ </matcher>
+ </filter>
+ </filteredResources>
+</projectDescription>
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.settings/org.eclipse.jdt.core.prefs b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..24dad4464
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,362 @@
+#Tue Oct 11 11:53:38 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+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.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+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=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+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=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+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.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+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_binary_expression=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=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_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=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+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=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_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=100
+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=4
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_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_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_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_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_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_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_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=true
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.lineSplit=100
+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=true
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.settings/org.eclipse.jdt.ui.prefs b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..88bb9570e
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,56 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Target Explorer Java STD
+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_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=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_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_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=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/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.settings/org.eclipse.pde.prefs b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.settings/org.eclipse.pde.prefs
new file mode 100644
index 000000000..cf80c8bc5
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,32 @@
+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=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=1
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/META-INF/MANIFEST.MF b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..a389bc2fc
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/META-INF/MANIFEST.MF
@@ -0,0 +1,29 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.tcf.te.ui.terminals.local;singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Activator: org.eclipse.tcf.te.ui.terminals.local.activator.UIPlugin
+Bundle-Vendor: %providerName
+Import-Package: org.eclipse.cdt.utils.pty;mandatory:=native
+Require-Bundle: org.eclipse.cdt.core;bundle-version="5.6";resolution:=optional,
+ org.eclipse.core.expressions;bundle-version="3.4.400",
+ org.eclipse.core.resources;bundle-version="3.8.1";resolution:=optional,
+ org.eclipse.core.runtime;bundle-version="3.8.0",
+ org.eclipse.tcf.te.core.terminals;bundle-version="1.3.0",
+ org.eclipse.tcf.te.ui.terminals;bundle-version="1.3.0",
+ org.eclipse.tcf.te.ui.terminals.process;bundle-version="1.3.0",
+ org.eclipse.tm.terminal;bundle-version="3.2.300",
+ org.eclipse.ui;bundle-version="3.8.0",
+ org.eclipse.ui.forms;bundle-version="3.5.200"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Export-Package: org.eclipse.tcf.te.ui.terminals.local.activator;x-internal:=true,
+ org.eclipse.tcf.te.ui.terminals.local.controls,
+ org.eclipse.tcf.te.ui.terminals.local.help,
+ org.eclipse.tcf.te.ui.terminals.local.launcher,
+ org.eclipse.tcf.te.ui.terminals.local.nls;x-internal:=true,
+ org.eclipse.tcf.te.ui.terminals.local.showin,
+ org.eclipse.tcf.te.ui.terminals.local.showin.interfaces,
+ org.eclipse.tcf.te.ui.terminals.local.showin.preferences
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/META-INF/p2.inf b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/META-INF/p2.inf
new file mode 100644
index 000000000..9bd5194fa
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/META-INF/p2.inf
@@ -0,0 +1,82 @@
+###############################################################################
+# Copyright (c) 2014 Wind River Systems, Inc. and others. All rights reserved.
+# This program and the accompanying materials are made available under the terms
+# of the Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+
+# Most of the dependencies exposed here are actually covered in the feature.xml
+# This file ensures that the current bundle has all it needs, even if installed
+# without the enclosing org.eclipse.tcf.te.terminals.feature .
+# See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=435150 .
+
+# 1. Make the optional cdt.core dependency non-greedy: Use (or update to proper
+# version!) when installed, but do not install automatically since the newer
+# org.eclipse.cdt.core.native can satisfy the dependency better. We use this
+# trick since CDT 8.3 had no version on export-package yet but we do want
+# a version constraint.
+requires.0.namespace = org.eclipse.equinox.p2.iu
+requires.0.name = org.eclipse.cdt.core
+#requires.0.range = [5.6, 6.0)
+requires.0.greedy = false
+requires.0.optional = true
+
+#requires.1.namespace = org.eclipse.equinox.p2.iu
+#requires.1.name = org.eclipse.cdt.core.native
+#requires.1.range = [5.6, 6.0)
+#requires.1.greedy = true
+#requires.1.optional = true
+
+# 2. Add the required fragments for local terminal support with proper version.
+requires.2.namespace = org.eclipse.equinox.p2.iu
+requires.2.name = org.eclipse.cdt.core.aix
+#requires.2.range = [5.3, 6.0)
+requires.2.filter = (osgi.os=aix)
+
+requires.3.namespace = org.eclipse.equinox.p2.iu
+requires.3.name = org.eclipse.cdt.core.linux
+#requires.3.range = [5.2, 6.0)
+requires.3.filter = (osgi.os=linux)
+
+requires.4.namespace = org.eclipse.equinox.p2.iu
+requires.4.name = org.eclipse.cdt.core.linux.ppc64
+#requires.4.range = [5.1, 6.0)
+requires.4.filter = (&(osgi.os=linux)(osgi.arch=ppc64))
+
+requires.5.namespace = org.eclipse.equinox.p2.iu
+requires.5.name = org.eclipse.cdt.core.linux.x86
+#requires.5.range = [5.2, 6.0)
+requires.5.filter = (&(osgi.os=linux)(osgi.arch=x86))
+
+requires.6.namespace = org.eclipse.equinox.p2.iu
+requires.6.name = org.eclipse.cdt.core.linux.x86_64
+#requires.6.range = [5.2, 6.0)
+requires.6.filter = (&(osgi.os=linux)(osgi.arch=x86_64))
+
+requires.7.namespace = org.eclipse.equinox.p2.iu
+requires.7.name = org.eclipse.cdt.core.macosx
+#requires.7.range = [5.2, 6.0)
+requires.7.filter = (osgi.os=macosx)
+
+requires.8.namespace = org.eclipse.equinox.p2.iu
+requires.8.name = org.eclipse.cdt.core.solaris
+#requires.8.range = [5.2, 6.0)
+requires.8.filter = (&(osgi.os=solaris)(osgi.arch=sparc))
+
+requires.9.namespace = org.eclipse.equinox.p2.iu
+requires.9.name = org.eclipse.cdt.core.win32
+#requires.9.range = [5.3, 6.0)
+requires.9.filter = (osgi.os=win32)
+
+requires.10.namespace = org.eclipse.equinox.p2.iu
+requires.10.name = org.eclipse.cdt.core.win32.x86
+#requires.10.range = [5.2, 6.0)
+requires.10.filter = (&(osgi.os=win32)(osgi.arch=x86))
+
+requires.11.namespace = org.eclipse.equinox.p2.iu
+requires.11.name = org.eclipse.cdt.core.win32.x86_64
+#requires.11.range = [5.2, 6.0)
+requires.11.filter = (&(osgi.os=win32)(osgi.arch=x86_64))
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/about.html b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/about.html
new file mode 100644
index 000000000..0f07cf034
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>May 24, 2012</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/build.properties b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/build.properties
new file mode 100644
index 000000000..a17f48f74
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/build.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2012, 2014 Wind River Systems, Inc. and others. All rights reserved.
+# This program and the accompanying materials are made available under the terms
+# of the Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html,\
+ icons/
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/contexts.xml b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/contexts.xml
new file mode 100644
index 000000000..2dbe1516c
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/contexts.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<contexts>
+ <context id="ExternalExecutablesDialog">
+ <description>Add or modify an external executable added to the 'Show In' context menu.</description>
+ </context>
+</contexts>
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/icons/eview16/terminal_view.gif b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/icons/eview16/terminal_view.gif
new file mode 100644
index 000000000..bbb6a9e15
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/icons/eview16/terminal_view.gif
Binary files differ
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/plugin.properties b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/plugin.properties
new file mode 100644
index 000000000..2219f89d7
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/plugin.properties
@@ -0,0 +1,23 @@
+##################################################################################
+# Copyright (c) 2011, 2015 Wind River Systems, Inc. and others. All rights reserved.
+# This program and the accompanying materials are made available under the terms
+# of the Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+pluginName = Target Explorer, Terminals Local Connector
+providerName = Eclipse.org - Target Explorer
+
+# ----- Commands and Menu contributions -----
+LocalLauncherDelegate.label=Local Terminal
+
+command.launch.name=Open Local Terminal on Selection
+
+menu.showIn.localterminal.label = Terminals
+
+# ----- Preference Pages -----
+
+preference.page.name=Terminals
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/plugin.xml b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/plugin.xml
new file mode 100644
index 000000000..22e2af1c2
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/plugin.xml
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+<!-- Terminal connector contributions -->
+<!-- uses process connector -->
+ <extension point="org.eclipse.tm.terminal.terminalConnectors">
+ <connector
+ class="org.eclipse.tcf.te.ui.terminals.process.ProcessConnector"
+ hidden="true"
+ id="org.eclipse.tcf.te.ui.terminals.local.LocalConnector"
+ name="%TerminalConnector.local"/>
+ </extension>
+
+<!-- Terminals launcher delegate contributions -->
+ <extension point="org.eclipse.tcf.te.ui.terminals.launcherDelegates">
+ <delegate
+ class="org.eclipse.tcf.te.ui.terminals.local.launcher.LocalLauncherDelegate"
+ id="org.eclipse.tcf.te.ui.terminals.local.launcher.local"
+ label="%LocalLauncherDelegate.label">
+ </delegate>
+ </extension>
+
+<!-- Menu contributions -->
+ <extension point="org.eclipse.ui.menus">
+ <!-- Project Explorer "Show In" contribution -->
+ <menuContribution locationURI="popup:org.eclipse.tcf.te.ui.terminals.ProjectExplorer.menu.showIn?after=additions">
+ <command
+ commandId="org.eclipse.tcf.te.ui.terminals.local.command.launch"
+ id="org.eclipse.tcf.te.ui.terminals.local.commands.showin.launch"
+ label="%menu.showIn.localterminal.label"
+ style="push">
+ <visibleWhen checkEnabled="false">
+ <with variable="selection">
+ <iterate operator="and" ifEmpty="false">
+ <adapt type="org.eclipse.core.resources.IResource">
+ <not>
+ <!-- The JDT Project Explorer contributions are adding the "Navigate -> Show In" quick menu.
+ See o.e.jdt.internal.ui.navigator.JavaNavigatorActionProvider -->
+ <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.jdt.core.javanature" />
+ </not>
+ </adapt>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <dynamic
+ class="org.eclipse.tcf.te.ui.terminals.local.showin.DynamicContributionItems"
+ id="org.eclipse.tcf.te.ui.terminals.local.LocalLauncherDynamicContributionItems">
+ <visibleWhen checkEnabled="false">
+ <with variable="selection">
+ <iterate operator="and" ifEmpty="false">
+ <adapt type="org.eclipse.core.resources.IResource">
+ <not>
+ <!-- The JDT Project Explorer contributions are adding the "Navigate -> Show In" quick menu.
+ See o.e.jdt.internal.ui.navigator.JavaNavigatorActionProvider -->
+ <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.jdt.core.javanature" />
+ </not>
+ </adapt>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </dynamic>
+ </menuContribution>
+ </extension>
+
+<!-- Command contributions -->
+ <extension point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.tcf.te.ui.commands.category"
+ helpContextId="org.eclipse.tcf.te.ui.terminals.local.command_Launch"
+ id="org.eclipse.tcf.te.ui.terminals.local.command.launch"
+ name="%command.launch.name">
+ </command>
+ </extension>
+
+ <extension point="org.eclipse.ui.commandImages">
+ <image
+ commandId="org.eclipse.tcf.te.ui.terminals.local.command.launch"
+ icon="icons/eview16/terminal_view.gif">
+ </image>
+ </extension>
+
+<!-- Key bindings -->
+ <extension point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.eclipse.tcf.te.ui.terminals.local.command.launch"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="CTRL+M3+T"/> <!-- Bug 435111: Don't use M1 since COMMAND+Option T already taken on Mac -->
+ </extension>
+
+<!-- Handler contributions -->
+ <extension point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.tcf.te.ui.terminals.local.launcher.LocalLauncherHandler"
+ commandId="org.eclipse.tcf.te.ui.terminals.local.command.launch">
+ </handler>
+ </extension>
+
+<!-- Preference page contributions -->
+ <extension point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.eclipse.tcf.te.ui.preferences.general"
+ class="org.eclipse.tcf.te.ui.terminals.local.showin.preferences.PreferencePage"
+ id="org.eclipse.tcf.te.ui.terminals.local.showin.preferences"
+ name="%preference.page.name">
+ </page>
+ </extension>
+
+<!-- Preferences contributions -->
+ <extension point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.eclipse.tcf.te.ui.terminals.local.showin.preferences.PreferencesInitializer">
+ </initializer>
+ </extension>
+
+<!-- Startup contributions -->
+ <extension point="org.eclipse.ui.startup">
+ <startup class="org.eclipse.tcf.te.ui.terminals.local.showin.ExternalExecutablesInitializer"/>
+ </extension>
+
+<!-- Help Context contributions -->
+ <extension point="org.eclipse.help.contexts">
+ <contexts
+ file="contexts.xml">
+ </contexts>
+ </extension>
+
+</plugin>
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/pom.xml b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/pom.xml
new file mode 100644
index 000000000..144c83e1f
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/pom.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.tcf</groupId>
+ <artifactId>org.eclipse.tcf.maven-build</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ <relativePath>../../../admin/pom-build.xml</relativePath>
+ </parent>
+
+ <version>1.3.0.qualifier</version>
+ <artifactId>org.eclipse.tcf.te.ui.terminals.local</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/activator/UIPlugin.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/activator/UIPlugin.java
new file mode 100644
index 000000000..80de64f1c
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/activator/UIPlugin.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2012 - 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.activator;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.tcf.te.core.terminals.preferences.ScopedEclipsePreferences;
+import org.eclipse.tcf.te.core.terminals.tracing.TraceHandler;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class UIPlugin extends AbstractUIPlugin {
+ // The shared instance
+ private static UIPlugin plugin;
+ // The scoped preferences instance
+ private static volatile ScopedEclipsePreferences scopedPreferences;
+ // The trace handler instance
+ private static volatile TraceHandler traceHandler;
+
+ /**
+ * The constructor
+ */
+ public UIPlugin() {
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static UIPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plug-in.
+ */
+ public static String getUniqueIdentifier() {
+ if (getDefault() != null && getDefault().getBundle() != null) {
+ return getDefault().getBundle().getSymbolicName();
+ }
+ return "org.eclipse.tcf.te.ui.terminals.local"; //$NON-NLS-1$
+ }
+
+ /**
+ * Return the scoped preferences for this plug-in.
+ */
+ public static ScopedEclipsePreferences getScopedPreferences() {
+ if (scopedPreferences == null) {
+ scopedPreferences = new ScopedEclipsePreferences(getUniqueIdentifier());
+ }
+ return scopedPreferences;
+ }
+
+ /**
+ * Returns the bundles trace handler.
+ *
+ * @return The bundles trace handler.
+ */
+ public static TraceHandler getTraceHandler() {
+ if (traceHandler == null) {
+ traceHandler = new TraceHandler(getUniqueIdentifier());
+ }
+ return traceHandler;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ scopedPreferences = null;
+ traceHandler = null;
+ super.stop(context);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
+ */
+ @Override
+ protected void initializeImageRegistry(ImageRegistry registry) {
+ super.initializeImageRegistry(registry);
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the <code>Image</code> object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The <code>Image</code> object instance or <code>null</code>.
+ */
+ public static Image getImage(String key) {
+ return getDefault().getImageRegistry().get(key);
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the <code>ImageDescriptor</code> object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The <code>ImageDescriptor</code> object instance or <code>null</code>.
+ */
+ public static ImageDescriptor getImageDescriptor(String key) {
+ return getDefault().getImageRegistry().getDescriptor(key);
+ }
+}
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/controls/LocalWizardConfigurationPanel.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/controls/LocalWizardConfigurationPanel.java
new file mode 100644
index 000000000..37b0b12b2
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/controls/LocalWizardConfigurationPanel.java
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.controls;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+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.swt.widgets.Label;
+import org.eclipse.tcf.te.core.terminals.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tcf.te.ui.terminals.interfaces.IConfigurationPanelContainer;
+import org.eclipse.tcf.te.ui.terminals.panels.AbstractExtendedConfigurationPanel;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchEncoding;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.osgi.framework.Bundle;
+
+/**
+ * Serial wizard configuration panel implementation.
+ */
+public class LocalWizardConfigurationPanel extends AbstractExtendedConfigurationPanel {
+
+ private Object resource;
+
+ /**
+ * Constructor.
+ *
+ * @param container The configuration panel container or <code>null</code>.
+ */
+ public LocalWizardConfigurationPanel(IConfigurationPanelContainer container) {
+ super(container);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.interfaces.IWizardConfigurationPanel#setupPanel(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
+ */
+ @Override
+ public void setupPanel(Composite parent, FormToolkit toolkit) {
+ Composite panel = new Composite(parent, SWT.NONE);
+ panel.setLayout(new GridLayout());
+ panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ // Create the encoding selection combo
+ createEncodingUI(panel, false);
+
+ // Set the default encoding:
+ // Default UTF-8 on Mac or Windows for Local, Preferences:Platform encoding otherwise
+ if (Platform.OS_MACOSX.equals(Platform.getOS()) || Platform.OS_WIN32.equals(Platform.getOS())) {
+ setEncoding("UTF-8"); //$NON-NLS-1$
+ } else {
+ String encoding = WorkbenchEncoding.getWorkbenchDefaultEncoding();
+ if (encoding != null && !"".equals(encoding)) setEncoding(encoding); //$NON-NLS-1$
+ }
+
+ // Fill the rest of the panel with a label to be able to
+ // set a height and width hint for the dialog
+ Label label = new Label(panel, SWT.HORIZONTAL);
+ GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ layoutData.widthHint = 300;
+ layoutData.heightHint = 80;
+ label.setLayoutData(layoutData);
+
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.ACTIVE)) {
+ resource = getSelectionResource();
+ }
+
+ setControl(panel);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.panels.AbstractConfigurationPanel#setupData(java.util.Map)
+ */
+ @Override
+ public void setupData(Map<String, Object> data) {
+ if (data == null) return;
+
+ String value = (String)data.get(ITerminalsConnectorConstants.PROP_ENCODING);
+ if (value != null) setEncoding(value);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.panels.AbstractConfigurationPanel#extractData(java.util.Map)
+ */
+ @Override
+ public void extractData(Map<String, Object> data) {
+ // set the terminal connector id for local terminal
+ data.put(ITerminalsConnectorConstants.PROP_TERMINAL_CONNECTOR_ID, "org.eclipse.tcf.te.ui.terminals.local.LocalConnector"); //$NON-NLS-1$
+
+ // Store the encoding
+ data.put(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
+
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.ACTIVE)) {
+ // if we have a IResource selection use the location for working directory
+ if (resource instanceof org.eclipse.core.resources.IResource){
+ String dir = ((org.eclipse.core.resources.IResource)resource).getProject().getLocation().toString();
+ data.put(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR, dir);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.panels.AbstractConfigurationPanel#fillSettingsForHost(java.lang.String)
+ */
+ @Override
+ protected void fillSettingsForHost(String host){
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.panels.AbstractConfigurationPanel#saveSettingsForHost(boolean)
+ */
+ @Override
+ protected void saveSettingsForHost(boolean add){
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#isValid()
+ */
+ @Override
+ public boolean isValid(){
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.panels.AbstractConfigurationPanel#doSaveWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doSaveWidgetValues(IDialogSettings settings, String idPrefix) {
+ // Save the encodings widget values
+ doSaveEncodingsWidgetValues(settings, idPrefix);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.panels.AbstractConfigurationPanel#doRestoreWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doRestoreWidgetValues(IDialogSettings settings, String idPrefix) {
+ // Restore the encodings widget values
+ doRestoreEncodingsWidgetValues(settings, idPrefix);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.panels.AbstractConfigurationPanel#getHostFromSettings()
+ */
+ @Override
+ protected String getHostFromSettings() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.panels.AbstractConfigurationPanel#isWithHostList()
+ */
+ @Override
+ public boolean isWithHostList() {
+ return false;
+ }
+
+ /**
+ * Returns the IResource from the current selection
+ *
+ * @return the IResource, or <code>null</code>.
+ */
+ private org.eclipse.core.resources.IResource getSelectionResource() {
+ ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
+ ISelection selection = selectionService != null ? selectionService.getSelection() : StructuredSelection.EMPTY;
+
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ Object element = ((IStructuredSelection) selection).getFirstElement();
+ if (element instanceof org.eclipse.core.resources.IResource){
+ return ((org.eclipse.core.resources.IResource)element);
+ }
+ if (element instanceof IAdaptable) {
+ return (org.eclipse.core.resources.IResource) ((IAdaptable) element).getAdapter(org.eclipse.core.resources.IResource.class);
+ }
+ }
+ return null;
+ }
+}
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/help/IContextHelpIds.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/help/IContextHelpIds.java
new file mode 100644
index 000000000..5f7b41081
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/help/IContextHelpIds.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.help;
+
+import org.eclipse.tcf.te.ui.terminals.local.activator.UIPlugin;
+
+
+/**
+ * UI Context help id definitions.
+ */
+public interface IContextHelpIds {
+
+ /**
+ * UI plug-in common context help id prefix.
+ */
+ public final static String PREFIX = UIPlugin.getUniqueIdentifier() + "."; //$NON-NLS-1$
+
+ /**
+ * External executables dialog.
+ */
+ public final static String EXTERNAL_EXECUTABLES_DIALOG = PREFIX + "ExternalExecutablesDialog"; //$NON-NLS-1$
+}
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalLauncherDelegate.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalLauncherDelegate.java
new file mode 100644
index 000000000..a6b30a607
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalLauncherDelegate.java
@@ -0,0 +1,374 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.launcher;
+
+import java.io.File;
+import java.net.InetAddress;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.cdt.utils.pty.PTY;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.URIUtil;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.tcf.te.core.terminals.TerminalServiceFactory;
+import org.eclipse.tcf.te.core.terminals.interfaces.ITerminalService;
+import org.eclipse.tcf.te.core.terminals.interfaces.ITerminalService.Done;
+import org.eclipse.tcf.te.core.terminals.interfaces.ITerminalServiceOutputStreamMonitorListener;
+import org.eclipse.tcf.te.core.terminals.interfaces.constants.ILineSeparatorConstants;
+import org.eclipse.tcf.te.core.terminals.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tcf.te.ui.terminals.interfaces.IConfigurationPanel;
+import org.eclipse.tcf.te.ui.terminals.interfaces.IConfigurationPanelContainer;
+import org.eclipse.tcf.te.ui.terminals.interfaces.IMementoHandler;
+import org.eclipse.tcf.te.ui.terminals.internal.SettingsStore;
+import org.eclipse.tcf.te.ui.terminals.launcher.AbstractLauncherDelegate;
+import org.eclipse.tcf.te.ui.terminals.local.activator.UIPlugin;
+import org.eclipse.tcf.te.ui.terminals.local.controls.LocalWizardConfigurationPanel;
+import org.eclipse.tcf.te.ui.terminals.local.showin.interfaces.IPreferenceKeys;
+import org.eclipse.tcf.te.ui.terminals.process.ProcessSettings;
+import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
+import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector;
+import org.eclipse.tm.internal.terminal.provisional.api.TerminalConnectorExtension;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchEncoding;
+import org.osgi.framework.Bundle;
+
+/**
+ * Serial launcher delegate implementation.
+ */
+@SuppressWarnings("restriction")
+public class LocalLauncherDelegate extends AbstractLauncherDelegate {
+
+ private final IMementoHandler mementoHandler = new LocalMementoHandler();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate#needsUserConfiguration()
+ */
+ @Override
+ public boolean needsUserConfiguration() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate#getPanel(org.eclipse.tcf.te.ui.terminals.interfaces.IConfigurationPanelContainer)
+ */
+ @Override
+ public IConfigurationPanel getPanel(IConfigurationPanelContainer container) {
+ return new LocalWizardConfigurationPanel(container);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate#execute(java.util.Map, org.eclipse.tcf.te.core.terminals.interfaces.ITerminalService.Done)
+ */
+ @Override
+ public void execute(Map<String, Object> properties, Done done) {
+ Assert.isNotNull(properties);
+
+ // Set the terminal tab title
+ String terminalTitle = getTerminalTitle(properties);
+ if (terminalTitle != null) {
+ properties.put(ITerminalsConnectorConstants.PROP_TITLE, terminalTitle);
+ }
+
+ // If not configured, set the default encodings for the local terminal
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_ENCODING)) {
+ String encoding = null;
+ // Set the default encoding:
+ // Default UTF-8 on Mac or Windows for Local, Preferences:Platform encoding otherwise
+ if (Platform.OS_MACOSX.equals(Platform.getOS()) || Platform.OS_WIN32.equals(Platform.getOS())) {
+ encoding = "UTF-8"; //$NON-NLS-1$
+ } else {
+ encoding = WorkbenchEncoding.getWorkbenchDefaultEncoding();
+ }
+ if (encoding != null && !"".equals(encoding)) properties.put(ITerminalsConnectorConstants.PROP_ENCODING, encoding); //$NON-NLS-1$
+ }
+
+ // For local terminals, force a new terminal tab each time it is launched,
+ // if not set otherwise from outside
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_FORCE_NEW)) {
+ properties.put(ITerminalsConnectorConstants.PROP_FORCE_NEW, Boolean.TRUE);
+ }
+
+ // Initialize the local terminal working directory.
+ // By default, start the local terminal in the users home directory
+ String initialCwd = UIPlugin.getScopedPreferences().getString(IPreferenceKeys.PREF_LOCAL_TERMINAL_INITIAL_CWD);
+ String cwd = null;
+ if (initialCwd == null || IPreferenceKeys.PREF_INITIAL_CWD_USER_HOME.equals(initialCwd) || "".equals(initialCwd.trim())) { //$NON-NLS-1$
+ cwd = System.getProperty("user.home"); //$NON-NLS-1$
+ } else if (IPreferenceKeys.PREF_INITIAL_CWD_ECLIPSE_HOME.equals(initialCwd)) {
+ String eclipseHomeLocation = System.getProperty("eclipse.home.location"); //$NON-NLS-1$
+ if (eclipseHomeLocation != null) {
+ try {
+ URI uri = URIUtil.fromString(eclipseHomeLocation);
+ File f = URIUtil.toFile(uri);
+ cwd = f.getAbsolutePath();
+ } catch (URISyntaxException ex) { /* ignored on purpose */ }
+ }
+ } else if (IPreferenceKeys.PREF_INITIAL_CWD_ECLIPSE_WS.equals(initialCwd)) {
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.ACTIVE)) {
+ if (org.eclipse.core.resources.ResourcesPlugin.getWorkspace() != null
+ && org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot() != null
+ && org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getLocation() != null) {
+ cwd = org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString();
+ }
+ }
+ } else {
+ IPath p = new Path(initialCwd);
+ if (p.toFile().canRead() && p.toFile().isDirectory()) {
+ cwd = p.toOSString();
+ }
+ }
+
+ if (cwd != null && !"".equals(cwd)) { //$NON-NLS-1$
+ properties.put(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR, cwd);
+ }
+
+ // If the current selection resolved to an folder, default the working directory
+ // to that folder and update the terminal title
+ ISelectionService service = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
+ if ((service != null && service.getSelection() != null) || properties.containsKey(ITerminalsConnectorConstants.PROP_SELECTION)) {
+ ISelection selection = (ISelection)properties.get(ITerminalsConnectorConstants.PROP_SELECTION);
+ if (selection == null) selection = service.getSelection();
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ String dir = null;
+ Iterator<?> iter = ((IStructuredSelection)selection).iterator();
+ while (iter.hasNext()) {
+ Object element = iter.next();
+
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.ACTIVE)) {
+ // If the element is not an IResource, try to adapt to IResource
+ if (!(element instanceof org.eclipse.core.resources.IResource)) {
+ Object adapted = element instanceof IAdaptable ? ((IAdaptable)element).getAdapter(org.eclipse.core.resources.IResource.class) : null;
+ if (adapted == null) adapted = Platform.getAdapterManager().getAdapter(element, org.eclipse.core.resources.IResource.class);
+ if (adapted != null) element = adapted;
+ }
+
+ if (element instanceof org.eclipse.core.resources.IResource && ((org.eclipse.core.resources.IResource)element).exists()) {
+ IPath location = ((org.eclipse.core.resources.IResource)element).getLocation();
+ if (location == null) continue;
+ if (location.toFile().isFile()) location = location.removeLastSegments(1);
+ if (location.toFile().isDirectory() && location.toFile().canRead()) {
+ dir = location.toFile().getAbsolutePath();
+ break;
+ }
+ }
+ }
+ }
+ if (dir != null) {
+ properties.put(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR, dir);
+
+ String basename = new Path(dir).lastSegment();
+ properties.put(ITerminalsConnectorConstants.PROP_TITLE, basename + " (" + terminalTitle + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+
+ // Get the terminal service
+ ITerminalService terminal = TerminalServiceFactory.getService();
+ // If not available, we cannot fulfill this request
+ if (terminal != null) {
+ terminal.openConsole(properties, done);
+ }
+ }
+
+ /**
+ * Returns the terminal title string.
+ * <p>
+ * The default implementation constructs a title like &quot;Serial &lt;port&gt; (Start time) &quot;.
+ *
+ * @return The terminal title string or <code>null</code>.
+ */
+ private String getTerminalTitle(Map<String, Object> properties) {
+ try {
+ String hostname = InetAddress.getLocalHost().getHostName();
+ if (hostname != null && !"".equals(hostname.trim())) { //$NON-NLS-1$
+ return hostname;
+ }
+ } catch (UnknownHostException e) { /* ignored on purpose */ }
+ return "Local"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (IMementoHandler.class.equals(adapter)) {
+ return mementoHandler;
+ }
+ return super.getAdapter(adapter);
+ }
+
+ /**
+ * Returns the default shell to launch. Looks at the environment
+ * variable "SHELL" first before assuming some default default values.
+ *
+ * @return The default shell to launch.
+ */
+ private final File defaultShell() {
+ String shell = null;
+ if (Platform.OS_WIN32.equals(Platform.getOS())) {
+ if (System.getenv("ComSpec") != null && !"".equals(System.getenv("ComSpec").trim())) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ shell = System.getenv("ComSpec").trim(); //$NON-NLS-1$
+ } else {
+ shell = "cmd.exe"; //$NON-NLS-1$
+ }
+ }
+ if (shell == null) {
+ if (System.getenv("SHELL") != null && !"".equals(System.getenv("SHELL").trim())) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ shell = System.getenv("SHELL").trim(); //$NON-NLS-1$
+ } else {
+ shell = "/bin/sh"; //$NON-NLS-1$
+ }
+ }
+
+ return new File(shell);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate#createTerminalConnector(java.util.Map)
+ */
+ @Override
+ public ITerminalConnector createTerminalConnector(Map<String, Object> properties) {
+ Assert.isNotNull(properties);
+
+ // Check for the terminal connector id
+ String connectorId = (String)properties.get(ITerminalsConnectorConstants.PROP_TERMINAL_CONNECTOR_ID);
+ if (connectorId == null) connectorId = "org.eclipse.tcf.te.ui.terminals.local.LocalConnector"; //$NON-NLS-1$
+
+ // Extract the process properties using defaults
+ String image;
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_PROCESS_PATH)
+ || properties.get(ITerminalsConnectorConstants.PROP_PROCESS_PATH) == null) {
+ File defaultShell = defaultShell();
+ image = defaultShell.isAbsolute() ? defaultShell.getAbsolutePath() : defaultShell.getPath();
+ } else {
+ image = (String)properties.get(ITerminalsConnectorConstants.PROP_PROCESS_PATH);
+ }
+
+ // Determine if a PTY will be used
+ boolean isUsingPTY = (properties.get(ITerminalsConnectorConstants.PROP_PROCESS_OBJ) == null && PTY.isSupported(PTY.Mode.TERMINAL))
+ || properties.get(ITerminalsConnectorConstants.PROP_PTY_OBJ) instanceof PTY;
+
+ boolean localEcho = false;
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_LOCAL_ECHO)
+ || !(properties.get(ITerminalsConnectorConstants.PROP_LOCAL_ECHO) instanceof Boolean)) {
+ // On Windows, turn on local echo by default if no PTY is used (bug 433645)
+ if (Platform.OS_WIN32.equals(Platform.getOS())) {
+ localEcho = !isUsingPTY;
+ }
+ } else {
+ localEcho = ((Boolean)properties.get(ITerminalsConnectorConstants.PROP_LOCAL_ECHO)).booleanValue();
+ }
+
+ String lineSeparator = null;
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR)
+ || !(properties.get(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR) instanceof String)) {
+ // No line separator will be set if a PTY is used
+ if (!isUsingPTY) {
+ lineSeparator = Platform.OS_WIN32.equals(Platform.getOS()) ? ILineSeparatorConstants.LINE_SEPARATOR_CRLF : ILineSeparatorConstants.LINE_SEPARATOR_LF;
+ }
+ } else {
+ lineSeparator = (String)properties.get(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR);
+ }
+
+ String arguments = (String)properties.get(ITerminalsConnectorConstants.PROP_PROCESS_ARGS);
+ Process process = (Process)properties.get(ITerminalsConnectorConstants.PROP_PROCESS_OBJ);
+ PTY pty = (PTY)properties.get(ITerminalsConnectorConstants.PROP_PTY_OBJ);
+ ITerminalServiceOutputStreamMonitorListener[] stdoutListeners = (ITerminalServiceOutputStreamMonitorListener[])properties.get(ITerminalsConnectorConstants.PROP_STDOUT_LISTENERS);
+ ITerminalServiceOutputStreamMonitorListener[] stderrListeners = (ITerminalServiceOutputStreamMonitorListener[])properties.get(ITerminalsConnectorConstants.PROP_STDERR_LISTENERS);
+ String workingDir = (String)properties.get(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR);
+
+ String[] envp = null;
+ if (properties.containsKey(ITerminalsConnectorConstants.PROP_PROCESS_ENVIRONMENT) &&
+ properties.get(ITerminalsConnectorConstants.PROP_PROCESS_ENVIRONMENT) != null &&
+ properties.get(ITerminalsConnectorConstants.PROP_PROCESS_ENVIRONMENT) instanceof String[]){
+ envp = (String[])properties.get(ITerminalsConnectorConstants.PROP_PROCESS_ENVIRONMENT);
+ }
+
+ // Set the ECLIPSE_HOME and ECLIPSE_WORKSPACE environment variables
+ List<String> envpList = new ArrayList<String>();
+ if (envp != null) envpList.addAll(Arrays.asList(envp));
+
+ // ECLIPSE_HOME
+ String eclipseHomeLocation = System.getProperty("eclipse.home.location"); //$NON-NLS-1$
+ if (eclipseHomeLocation != null) {
+ try {
+ URI uri = URIUtil.fromString(eclipseHomeLocation);
+ File f = URIUtil.toFile(uri);
+ envpList.add("ECLIPSE_HOME=" + f.getAbsolutePath()); //$NON-NLS-1$
+ } catch (URISyntaxException e) { /* ignored on purpose */ }
+ }
+
+ // ECLIPSE_WORKSPACE
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.ACTIVE)) {
+ if (org.eclipse.core.resources.ResourcesPlugin.getWorkspace() != null
+ && org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot() != null
+ && org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getLocation() != null) {
+ envpList.add("ECLIPSE_WORKSPACE=" + org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString()); //$NON-NLS-1$
+ }
+ }
+
+ // Convert back into a string array
+ envp = envpList.toArray(new String[envpList.size()]);
+
+ Assert.isTrue(image != null || process != null);
+
+ // Construct the terminal settings store
+ ISettingsStore store = new SettingsStore();
+
+ // Construct the process settings
+ ProcessSettings processSettings = new ProcessSettings();
+ processSettings.setImage(image);
+ processSettings.setArguments(arguments);
+ processSettings.setProcess(process);
+ processSettings.setPTY(pty);
+ processSettings.setLocalEcho(localEcho);
+ processSettings.setLineSeparator(lineSeparator);
+ processSettings.setStdOutListeners(stdoutListeners);
+ processSettings.setStdErrListeners(stderrListeners);
+ processSettings.setWorkingDir(workingDir);
+ processSettings.setEnvironment(envp);
+
+ if (properties.containsKey(ITerminalsConnectorConstants.PROP_PROCESS_MERGE_ENVIRONMENT)) {
+ Object value = properties.get(ITerminalsConnectorConstants.PROP_PROCESS_MERGE_ENVIRONMENT);
+ processSettings.setMergeWithNativeEnvironment(value instanceof Boolean ? ((Boolean)value).booleanValue() : false);
+ }
+
+ // And save the settings to the store
+ processSettings.save(store);
+
+ // Construct the terminal connector instance
+ ITerminalConnector connector = TerminalConnectorExtension.makeTerminalConnector(connectorId);
+ if (connector != null) {
+ // Apply default settings
+ connector.makeSettingsPage();
+ // And load the real settings
+ connector.load(store);
+ }
+
+ return connector;
+ }
+}
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalLauncherHandler.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalLauncherHandler.java
new file mode 100644
index 000000000..00525774d
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalLauncherHandler.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.launcher;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.tcf.te.core.terminals.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate;
+import org.eclipse.tcf.te.ui.terminals.launcher.LauncherDelegateManager;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Local terminal launcher handler implementation.
+ */
+public class LocalLauncherHandler extends AbstractHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ // Get the current selection
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+
+ // Get all applicable launcher delegates for the current selection
+ ILauncherDelegate[] delegates = LauncherDelegateManager.getInstance().getApplicableLauncherDelegates(selection);
+ // Find the local terminal launcher delegate
+ ILauncherDelegate delegate = null;
+ for (ILauncherDelegate candidate : delegates) {
+ if ("org.eclipse.tcf.te.ui.terminals.local.launcher.local".equals(candidate.getId())) { //$NON-NLS-1$
+ delegate = candidate;
+ break;
+ }
+ }
+
+ // Launch the local terminal
+ if (delegate != null) {
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(ITerminalsConnectorConstants.PROP_DELEGATE_ID, delegate.getId());
+ properties.put(ITerminalsConnectorConstants.PROP_SELECTION, selection);
+
+ delegate.execute(properties, null);
+ }
+
+ return null;
+ }
+
+}
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalMementoHandler.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalMementoHandler.java
new file mode 100644
index 000000000..f4cbb513e
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalMementoHandler.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.launcher;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tcf.te.ui.terminals.interfaces.IMementoHandler;
+import org.eclipse.ui.IMemento;
+
+/**
+ * SSH terminal connection memento handler implementation.
+ */
+public class LocalMementoHandler implements IMementoHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.interfaces.IMementoHandler#saveState(org.eclipse.ui.IMemento, java.util.Map)
+ */
+ @Override
+ public void saveState(IMemento memento, Map<String, Object> properties) {
+ Assert.isNotNull(memento);
+ Assert.isNotNull(properties);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.interfaces.IMementoHandler#restoreState(org.eclipse.ui.IMemento, java.util.Map)
+ */
+ @Override
+ public void restoreState(IMemento memento, Map<String, Object> properties) {
+ Assert.isNotNull(memento);
+ Assert.isNotNull(properties);
+ }
+}
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/nls/Messages.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/nls/Messages.java
new file mode 100644
index 000000000..5052f96cf
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/nls/Messages.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.nls;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Process terminal connector plug-in externalized strings management.
+ */
+public class Messages extends NLS {
+
+ // The plug-in resource bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tcf.te.ui.terminals.local.nls.Messages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
+ static {
+ // Load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ // **** Declare externalized string id's down here *****
+
+ public static String ProcessConnector_error_creatingProcess;
+
+ public static String PreferencePage_label;
+ public static String PreferencePage_executables_label;
+ public static String PreferencePage_executables_column_name_label;
+ public static String PreferencePage_executables_column_path_label;
+ public static String PreferencePage_executables_button_add_label;
+ public static String PreferencePage_executables_button_edit_label;
+ public static String PreferencePage_executables_button_remove_label;
+ public static String PreferencePage_workingDir_label;
+ public static String PreferencePage_workingDir_userhome_label;
+ public static String PreferencePage_workingDir_eclipsehome_label;
+ public static String PreferencePage_workingDir_eclipsews_label;
+ public static String PreferencePage_workingDir_button_browse;
+ public static String PreferencePage_workingDir_note_label;
+ public static String PreferencePage_workingDir_note_text;
+
+ public static String ExternalExecutablesDialog_title_add;
+ public static String ExternalExecutablesDialog_title_edit;
+ public static String ExternalExecutablesDialog_button_add;
+ public static String ExternalExecutablesDialog_button_browse;
+ public static String ExternalExecutablesDialog_field_path;
+ public static String ExternalExecutablesDialog_field_name;
+ public static String ExternalExecutablesDialog_field_args;
+ public static String ExternalExecutablesDialog_field_icon;
+ public static String ExternalExecutablesDialog_field_translate;
+}
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/nls/Messages.properties b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/nls/Messages.properties
new file mode 100644
index 000000000..626196402
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/nls/Messages.properties
@@ -0,0 +1,38 @@
+###############################################################################
+# Copyright (c) 2012 - 2015 Wind River Systems, Inc. and others. All rights reserved.
+# This program and the accompanying materials are made available under the terms
+# of the Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+
+ProcessConnector_error_creatingProcess=Exception when creating process. Possibly caused by: {0}
+
+ExternalExecutablesDialog_title_add=Add External Executable
+ExternalExecutablesDialog_title_edit=Edit External Executable
+ExternalExecutablesDialog_button_add=Add
+ExternalExecutablesDialog_button_browse=Browse...
+ExternalExecutablesDialog_field_path=Path:
+ExternalExecutablesDialog_field_name=Name:
+ExternalExecutablesDialog_field_args=Arguments:
+ExternalExecutablesDialog_field_icon=Icon:
+ExternalExecutablesDialog_field_translate=Translate Backslashes on Paste
+
+# ***** Preference Pages *****
+
+PreferencePage_label=General settings for Terminals:
+PreferencePage_executables_label="Show In ..." Custom Entries
+PreferencePage_executables_column_name_label=Name
+PreferencePage_executables_column_path_label=Path
+PreferencePage_executables_button_add_label=Add...
+PreferencePage_executables_button_edit_label=Edit...
+PreferencePage_executables_button_remove_label=Remove
+PreferencePage_workingDir_label=Local Terminal Initial Working Directory
+PreferencePage_workingDir_userhome_label=User home
+PreferencePage_workingDir_eclipsehome_label=Eclipse home
+PreferencePage_workingDir_eclipsews_label=Eclipse workspace
+PreferencePage_workingDir_button_browse=Browse...
+PreferencePage_workingDir_note_label=Note:
+PreferencePage_workingDir_note_text=The chosen initial working directory might be overwritten by the current selection of the active view.
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/DynamicContributionItems.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/DynamicContributionItems.java
new file mode 100644
index 000000000..6be5842e9
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/DynamicContributionItems.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.showin;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.tcf.te.core.terminals.interfaces.constants.ITerminalsConnectorConstants;
+import org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate;
+import org.eclipse.tcf.te.ui.terminals.launcher.LauncherDelegateManager;
+import org.eclipse.tcf.te.ui.terminals.local.showin.interfaces.IExternalExecutablesProperties;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.CompoundContributionItem;
+import org.eclipse.ui.menus.IWorkbenchContribution;
+import org.eclipse.ui.services.IServiceLocator;
+
+/**
+ * Dynamic "Show In" contribution items implementation.
+ */
+public class DynamicContributionItems extends CompoundContributionItem implements IWorkbenchContribution {
+ // Service locator to located the handler service.
+ protected IServiceLocator serviceLocator;
+ // Reference to the local terminal launcher delegate
+ /* default */ ILauncherDelegate delegate;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.menus.IWorkbenchContribution#initialize(org.eclipse.ui.services.IServiceLocator)
+ */
+ @Override
+ public void initialize(IServiceLocator serviceLocator) {
+ this.serviceLocator = serviceLocator;
+
+ // Get the local terminal launcher delegate
+ delegate = LauncherDelegateManager.getInstance().getLauncherDelegate("org.eclipse.tcf.te.ui.terminals.local.launcher.local", false); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
+ */
+ @Override
+ protected IContributionItem[] getContributionItems() {
+ List<IContributionItem> items = new ArrayList<IContributionItem>();
+
+ if (delegate != null) {
+ List<Map<String, String>> l = ExternalExecutablesManager.load();
+ if (l != null && !l.isEmpty()) {
+ for (Map<String, String> executableData : l) {
+ String name = executableData.get(IExternalExecutablesProperties.PROP_NAME);
+ String path = executableData.get(IExternalExecutablesProperties.PROP_PATH);
+ String args = executableData.get(IExternalExecutablesProperties.PROP_ARGS);
+ String icon = executableData.get(IExternalExecutablesProperties.PROP_ICON);
+
+ String strTranslate = executableData.get(IExternalExecutablesProperties.PROP_TRANSLATE);
+ boolean translate = strTranslate != null ? Boolean.parseBoolean(strTranslate) : false;
+
+ if (name != null && !"".equals(name) && path != null && !"".equals(path)) { //$NON-NLS-1$ //$NON-NLS-2$
+ IAction action = createAction(name, path, args, translate);
+
+ ImageData id = icon != null ? ExternalExecutablesManager.loadImage(icon) : null;
+ if (id != null) {
+ ImageDescriptor desc = ImageDescriptor.createFromImageData(id);
+ if (desc != null) action.setImageDescriptor(desc);
+ }
+
+ IContributionItem item = new ActionContributionItem(action);
+ items.add(item);
+ }
+ }
+ }
+ }
+
+ return items.toArray(new IContributionItem[items.size()]);
+ }
+
+ /**
+ * Creates the action to execute.
+ *
+ * @param label The label. Must not be <code>null</code>.
+ * @param path The executable path. Must not be <code>null</code>.
+ * @param args The executable arguments or <code>null</code>.
+ * @param translate Translate backslashes.
+ *
+ * @return The action to execute.
+ */
+ protected IAction createAction(final String label, final String path, final String args, final boolean translate) {
+ Assert.isNotNull(label);
+ Assert.isNotNull(path);
+
+ IAction action = new Action(label) {
+ @Override
+ public void run() {
+ Assert.isNotNull(delegate);
+
+ ISelectionService service = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
+ ISelection selection = service != null ? service.getSelection() : null;
+ if (selection != null && selection.isEmpty()) selection = null;
+
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(ITerminalsConnectorConstants.PROP_DELEGATE_ID, delegate.getId());
+ if (selection != null) properties.put(ITerminalsConnectorConstants.PROP_SELECTION, selection);
+ properties.put(ITerminalsConnectorConstants.PROP_PROCESS_PATH, path);
+ if (args != null) properties.put(ITerminalsConnectorConstants.PROP_PROCESS_ARGS, args);
+ properties.put(ITerminalsConnectorConstants.PROP_TRANSLATE_BACKSLASHES_ON_PASTE, Boolean.valueOf(translate));
+
+ delegate.execute(properties, null);
+ }
+ };
+
+ return action;
+ }
+}
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/ExternalExecutablesDialog.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/ExternalExecutablesDialog.java
new file mode 100644
index 000000000..99aa5b100
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/ExternalExecutablesDialog.java
@@ -0,0 +1,460 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.showin;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.TrayDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.tcf.te.ui.terminals.local.help.IContextHelpIds;
+import org.eclipse.tcf.te.ui.terminals.local.nls.Messages;
+import org.eclipse.tcf.te.ui.terminals.local.showin.interfaces.IExternalExecutablesProperties;
+import org.eclipse.ui.PlatformUI;
+import org.osgi.framework.Bundle;
+
+/**
+ * External executables dialog implementation.
+ */
+public class ExternalExecutablesDialog extends TrayDialog {
+ private String contextHelpId = null;
+ private final boolean edit;
+
+ private Text name;
+ /* default */ Text path;
+ private Text args;
+ /* default */ Text icon;
+ private Button translate;
+
+ /* default */ String last_filter_path = null;
+ /* default */ String last_filter_icon = null;
+
+ private Map<String, String> executableData;
+
+ /**
+ * Constructor.
+ *
+ * @param shell The parent shell or <code>null</code>.
+ */
+ public ExternalExecutablesDialog(Shell shell, boolean edit) {
+ super(shell);
+ this.edit = edit;
+
+ this.contextHelpId = IContextHelpIds.EXTERNAL_EXECUTABLES_DIALOG;
+ setHelpAvailable(true);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected final Control createDialogArea(Composite parent) {
+ if (contextHelpId != null) {
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, contextHelpId);
+ }
+
+ // Let the super implementation create the dialog area control
+ Control control = super.createDialogArea(parent);
+ // Setup the inner panel as scrollable composite
+ if (control instanceof Composite) {
+ ScrolledComposite sc = new ScrolledComposite((Composite)control, SWT.V_SCROLL);
+
+ GridLayout layout = new GridLayout(1, true);
+ layout.marginHeight = 0; layout.marginWidth = 0;
+ layout.verticalSpacing = 0; layout.horizontalSpacing = 0;
+
+ sc.setLayout(layout);
+ sc.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+
+ sc.setExpandHorizontal(true);
+ sc.setExpandVertical(true);
+
+ Composite composite = new Composite(sc, SWT.NONE);
+ composite.setLayout(new GridLayout());
+
+ // Setup the dialog area content
+ createDialogAreaContent(composite);
+
+ sc.setContent(composite);
+ sc.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+
+ // Return the scrolled composite as new dialog area control
+ control = sc;
+ }
+
+ return control;
+ }
+
+ /**
+ * Creates the dialog area content.
+ *
+ * @param parent The parent composite. Must not be <code>null</code>.
+ */
+ protected void createDialogAreaContent(Composite parent) {
+ Assert.isNotNull(parent);
+
+ setDialogTitle(edit ? Messages.ExternalExecutablesDialog_title_edit : Messages.ExternalExecutablesDialog_title_add);
+
+ Composite panel = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout(2, false);
+ layout.marginHeight = 0; layout.marginWidth = 0;
+ panel.setLayout(layout);
+ GridData layoutData = new GridData(SWT.FILL, SWT.CENTER, true, true);
+ layoutData.widthHint = convertWidthInCharsToPixels(50);
+ panel.setLayoutData(layoutData);
+
+ Label label = new Label(panel, SWT.HORIZONTAL);
+ label.setText(Messages.ExternalExecutablesDialog_field_name);
+ layoutData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
+ label.setLayoutData(layoutData);
+
+ name = new Text(panel, SWT.HORIZONTAL | SWT.SINGLE | SWT.BORDER);
+ layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ layoutData.widthHint = convertWidthInCharsToPixels(30);
+ name.setLayoutData(layoutData);
+ name.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ });
+
+ label = new Label(panel, SWT.HORIZONTAL);
+ label.setText(Messages.ExternalExecutablesDialog_field_path);
+ layoutData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
+ label.setLayoutData(layoutData);
+
+ Composite panel2 = new Composite(panel, SWT.NONE);
+ layout = new GridLayout(2, false);
+ layout.marginHeight = 0; layout.marginWidth = 0;
+ panel2.setLayout(layout);
+ layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ panel2.setLayoutData(layoutData);
+
+ path = new Text(panel2, SWT.HORIZONTAL | SWT.SINGLE | SWT.BORDER);
+ layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ layoutData.widthHint = convertWidthInCharsToPixels(30);
+ path.setLayoutData(layoutData);
+ path.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ });
+
+ Button button = new Button(panel2, SWT.PUSH);
+ button.setText(Messages.ExternalExecutablesDialog_button_browse);
+ layoutData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
+ layoutData.widthHint = convertWidthInCharsToPixels(10);
+ button.setLayoutData(layoutData);
+ button.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
+
+ String selectedFile = path.getText();
+ if (selectedFile != null && selectedFile.trim().length() > 0) {
+ IPath filePath = new Path(selectedFile);
+ // If the selected file points to an directory, use the directory as is
+ IPath filterPath = filePath.toFile().isDirectory() ? filePath : filePath.removeLastSegments(1);
+ while (filterPath != null && filterPath.segmentCount() > 1 && !filterPath.toFile().exists()) {
+ filterPath = filterPath.removeLastSegments(1);
+ }
+ String filterFileName = filePath.toFile().isDirectory() || !filePath.toFile().exists() ? null : filePath.lastSegment();
+
+ if (filterPath != null && !filterPath.isEmpty()) dialog.setFilterPath(filterPath.toString());
+ if (filterFileName != null) dialog.setFileName(filterFileName);
+ } else {
+ String workspace = null;
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.ACTIVE)) {
+ workspace = org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString();
+ }
+
+ String filterPath = last_filter_path != null ? last_filter_path : workspace;
+ dialog.setFilterPath(filterPath);
+ }
+
+ selectedFile = dialog.open();
+ if (selectedFile != null) {
+ last_filter_path = dialog.getFilterPath();
+ path.setText(selectedFile);
+ }
+ }
+ });
+
+ label = new Label(panel, SWT.HORIZONTAL);
+ label.setText(Messages.ExternalExecutablesDialog_field_args);
+ layoutData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
+ label.setLayoutData(layoutData);
+
+ args = new Text(panel, SWT.HORIZONTAL | SWT.SINGLE | SWT.BORDER);
+ layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ layoutData.widthHint = convertWidthInCharsToPixels(30);
+ args.setLayoutData(layoutData);
+ args.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ });
+
+ label = new Label(panel, SWT.HORIZONTAL);
+ label.setText(Messages.ExternalExecutablesDialog_field_icon);
+ layoutData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
+ label.setLayoutData(layoutData);
+
+ panel2 = new Composite(panel, SWT.NONE);
+ layout = new GridLayout(2, false);
+ layout.marginHeight = 0; layout.marginWidth = 0;
+ panel2.setLayout(layout);
+ layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ panel2.setLayoutData(layoutData);
+
+ icon = new Text(panel2, SWT.HORIZONTAL | SWT.SINGLE | SWT.BORDER);
+ layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ layoutData.widthHint = convertWidthInCharsToPixels(30);
+ icon.setLayoutData(layoutData);
+ icon.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ });
+
+ button = new Button(panel2, SWT.PUSH);
+ button.setText(Messages.ExternalExecutablesDialog_button_browse);
+ layoutData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
+ layoutData.widthHint = convertWidthInCharsToPixels(10);
+ button.setLayoutData(layoutData);
+ button.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
+
+ String selectedFile = icon.getText();
+ if (selectedFile != null && selectedFile.trim().length() > 0) {
+ IPath filePath = new Path(selectedFile);
+ // If the selected file points to an directory, use the directory as is
+ IPath filterPath = filePath.toFile().isDirectory() ? filePath : filePath.removeLastSegments(1);
+ while (filterPath != null && filterPath.segmentCount() > 1 && !filterPath.toFile().exists()) {
+ filterPath = filterPath.removeLastSegments(1);
+ }
+ String filterFileName = filePath.toFile().isDirectory() || !filePath.toFile().exists() ? null : filePath.lastSegment();
+
+ if (filterPath != null && !filterPath.isEmpty()) dialog.setFilterPath(filterPath.toString());
+ if (filterFileName != null) dialog.setFileName(filterFileName);
+ } else {
+ String workspace = null;
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.ACTIVE)) {
+ workspace = org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString();
+ }
+
+ String filterPath = last_filter_icon != null ? last_filter_icon : workspace;
+ dialog.setFilterPath(filterPath);
+ }
+
+ selectedFile = dialog.open();
+ if (selectedFile != null) {
+ last_filter_icon = dialog.getFilterPath();
+ icon.setText(selectedFile);
+ }
+ }
+ });
+
+ translate = new Button(panel, SWT.CHECK);
+ translate.setText(Messages.ExternalExecutablesDialog_field_translate);
+ layoutData = new GridData(SWT.FILL, SWT.TOP, true, false);
+ layoutData.horizontalSpan = 2;
+ translate.setLayoutData(layoutData);
+ translate.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ validate();
+ }
+ });
+
+ if (executableData != null) {
+ String value = executableData.get(IExternalExecutablesProperties.PROP_NAME);
+ name.setText(value != null && !"".equals(value.trim()) ? value : ""); //$NON-NLS-1$ //$NON-NLS-2$
+ value = executableData.get(IExternalExecutablesProperties.PROP_PATH);
+ path.setText(value != null && !"".equals(value.trim()) ? value : ""); //$NON-NLS-1$ //$NON-NLS-2$
+ value = executableData.get(IExternalExecutablesProperties.PROP_ARGS);
+ args.setText(value != null && !"".equals(value.trim()) ? value : ""); //$NON-NLS-1$ //$NON-NLS-2$
+ value = executableData.get(IExternalExecutablesProperties.PROP_ICON);
+ icon.setText(value != null && !"".equals(value.trim()) ? value : ""); //$NON-NLS-1$ //$NON-NLS-2$
+ value = executableData.get(IExternalExecutablesProperties.PROP_TRANSLATE);
+ translate.setSelection(value != null ? Boolean.parseBoolean(value) : false);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.TrayDialog#createButtonBar(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createButtonBar(Composite parent) {
+ Control control = super.createButtonBar(parent);
+ validate();
+ return control;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createButton(org.eclipse.swt.widgets.Composite, int, java.lang.String, boolean)
+ */
+ @Override
+ protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
+ if (IDialogConstants.OK_ID == id && !edit) {
+ label = Messages.ExternalExecutablesDialog_button_add;
+ }
+ return super.createButton(parent, id, label, defaultButton);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.jface.dialogs.CustomTrayDialog#okPressed()
+ */
+ @Override
+ protected void okPressed() {
+ if (name != null && path != null) {
+ // Extract the executable properties
+ if (executableData == null) executableData = new HashMap<String, String>();
+
+ String value = name.getText();
+ if (value != null && !"".equals(value.trim())) { //$NON-NLS-1$
+ executableData.put(IExternalExecutablesProperties.PROP_NAME, value);
+ } else {
+ executableData.remove(IExternalExecutablesProperties.PROP_NAME);
+ }
+
+ value = path.getText();
+ if (value != null && !"".equals(value.trim())) { //$NON-NLS-1$
+ executableData.put(IExternalExecutablesProperties.PROP_PATH, value);
+ } else {
+ executableData.remove(IExternalExecutablesProperties.PROP_PATH);
+ }
+
+ value = args.getText();
+ if (value != null && !"".equals(value.trim())) { //$NON-NLS-1$
+ executableData.put(IExternalExecutablesProperties.PROP_ARGS, value);
+ } else {
+ executableData.remove(IExternalExecutablesProperties.PROP_ARGS);
+ }
+
+ value = icon.getText();
+ if (value != null && !"".equals(value.trim())) { //$NON-NLS-1$
+ executableData.put(IExternalExecutablesProperties.PROP_ICON, value);
+ } else {
+ executableData.remove(IExternalExecutablesProperties.PROP_ICON);
+ }
+
+ if (translate.getSelection()) {
+ executableData.put(IExternalExecutablesProperties.PROP_TRANSLATE, Boolean.TRUE.toString());
+ } else {
+ executableData.remove(IExternalExecutablesProperties.PROP_TRANSLATE);
+ }
+ } else {
+ executableData = null;
+ }
+ super.okPressed();
+ }
+
+ @Override
+ protected void cancelPressed() {
+ // If the user pressed cancel, the dialog needs to return null
+ executableData = null;
+ super.cancelPressed();
+ }
+
+ /**
+ * Returns the executable properties the user entered.
+ *
+ * @return The executable properties or <code>null</code>.
+ */
+ public Map<String, String> getExecutableData() {
+ return executableData;
+ }
+
+ /**
+ * Set or reset the executable properties. This method has effect
+ * only if called before opening the dialog.
+ *
+ * @param data The executable properties or <code>null</code>.
+ */
+ public void setExecutableData(Map<String, String> data) {
+ if (data == null) {
+ executableData = data;
+ } else {
+ executableData = new HashMap<String, String>(data);
+ }
+ }
+
+ /**
+ * Validate the dialog.
+ */
+ public void validate() {
+ boolean valid = true;
+
+ if (name != null && !name.isDisposed()) {
+ valid = !"".equals(name.getText()); //$NON-NLS-1$
+ }
+
+ if (path != null && !path.isDisposed()) {
+ String value = path.getText();
+ if (!"".equals(value)) { //$NON-NLS-1$
+ File f = new File(value);
+ valid |= f.isAbsolute() && f.canRead();
+ } else {
+ valid = false;
+ }
+ }
+
+ if (icon != null && !icon.isDisposed()) {
+ String value = icon.getText();
+ if (!"".equals(value)) { //$NON-NLS-1$
+ File f = new File(value);
+ valid |= f.isAbsolute() && f.canRead();
+ }
+ }
+
+ Button okButton = getButton(IDialogConstants.OK_ID);
+ if (okButton != null) okButton.setEnabled(valid);
+ }
+
+ /**
+ * Sets the title for this dialog.
+ *
+ * @param title The title.
+ */
+ public void setDialogTitle(String title) {
+ if (getShell() != null && !getShell().isDisposed()) {
+ getShell().setText(title);
+ }
+ }
+}
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/ExternalExecutablesInitializer.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/ExternalExecutablesInitializer.java
new file mode 100644
index 000000000..1bcca4a52
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/ExternalExecutablesInitializer.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.showin;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.tcf.te.ui.terminals.local.showin.interfaces.IExternalExecutablesProperties;
+import org.eclipse.ui.IStartup;
+
+/**
+ * External executables data initializer.
+ */
+public class ExternalExecutablesInitializer implements IStartup {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IStartup#earlyStartup()
+ */
+ @Override
+ public void earlyStartup() {
+ // On Windows, initialize the "Git Bash" custom "Show In" menu entry
+ if (Platform.OS_WIN32.equals(Platform.getOS())) {
+ String gitPath = null;
+ String iconPath = null;
+
+ String path = System.getenv("PATH"); //$NON-NLS-1$
+ if (path != null) {
+ StringTokenizer tokenizer = new StringTokenizer(path, ";"); //$NON-NLS-1$
+ while (tokenizer.hasMoreTokens()) {
+ String token = tokenizer.nextToken();
+ File f = new File(token, "git.exe"); //$NON-NLS-1$
+ if (f.canRead()) {
+ File f2 = new File(f.getParentFile().getParentFile(), "bin/sh.exe"); //$NON-NLS-1$
+ if (f2.canExecute()) {
+ gitPath = f2.getAbsolutePath();
+ }
+
+ f2 = new File(f.getParentFile().getParentFile(), "etc/git.ico"); //$NON-NLS-1$
+ if (f2.canRead()) {
+ iconPath = f2.getAbsolutePath();
+ }
+
+ break;
+ }
+ }
+ }
+
+ if (gitPath != null) {
+ // Load the configured external executables
+ List<Map<String, String>> l = ExternalExecutablesManager.load();
+ if (l == null) l = new ArrayList<Map<String, String>>();
+ // Find a entry labeled "Git Bash"
+ Map<String, String> m = null;
+ for (Map<String, String> candidate : l) {
+ String name = candidate.get(IExternalExecutablesProperties.PROP_NAME);
+ if ("Git Bash".equals(name)) { //$NON-NLS-1$
+ m = candidate;
+ break;
+ }
+ }
+
+ if (m == null) {
+ m = new HashMap<String, String>();
+ m.put(IExternalExecutablesProperties.PROP_NAME, "Git Bash"); //$NON-NLS-1$
+ m.put(IExternalExecutablesProperties.PROP_PATH, gitPath);
+ m.put(IExternalExecutablesProperties.PROP_ARGS, "--login -i"); //$NON-NLS-1$
+ if (iconPath != null) m.put(IExternalExecutablesProperties.PROP_ICON, iconPath);
+ m.put(IExternalExecutablesProperties.PROP_TRANSLATE, Boolean.TRUE.toString());
+
+ l.add(m);
+ ExternalExecutablesManager.save(l);
+ }
+ }
+ }
+ }
+}
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/ExternalExecutablesManager.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/ExternalExecutablesManager.java
new file mode 100644
index 000000000..1e797d92f
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/ExternalExecutablesManager.java
@@ -0,0 +1,181 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.showin;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.tcf.te.ui.terminals.local.activator.UIPlugin;
+
+/**
+ * External executables manager implementation.
+ */
+public class ExternalExecutablesManager {
+
+ /**
+ * Loads the list of all saved external executables.
+ *
+ * @return The list of all saved external executables or <code>null</code>.
+ */
+ public static List<Map<String, String>> load() {
+ List<Map<String, String>> l = new ArrayList<Map<String, String>>();
+
+ IPath stateLocation = UIPlugin.getDefault().getStateLocation();
+ if (stateLocation != null) {
+ File f = stateLocation.append(".executables/data.properties").toFile(); //$NON-NLS-1$
+ if (f.canRead()) {
+ FileReader r = null;
+
+ try {
+ Properties data = new Properties();
+ r= new FileReader(f);
+ data.load(r);
+
+ Map<Integer, Map<String, String>> c = new HashMap<Integer, Map<String, String>>();
+ for (String name : data.stringPropertyNames()) {
+ if (name == null || name.indexOf('.') == -1) continue;
+ int ix = name.indexOf('.');
+ String n = name.substring(0, ix);
+ String k = (ix + 1) < name.length() ? name.substring(ix + 1) : null;
+ if (n == null || k == null) continue;
+
+ Integer i = null;
+ try { i = Integer.decode(n); } catch (NumberFormatException e) { /* ignored on purpose */ }
+ if (i == null) continue;
+
+ Map<String, String> m = c.get(i);
+ if (m == null) {
+ m = new HashMap<String, String>();
+ c.put(i, m);
+ }
+ Assert.isNotNull(m);
+
+ m.put(k, data.getProperty(name));
+ }
+
+ List<Integer> k = new ArrayList<Integer>(c.keySet());
+ Collections.sort(k);
+ for (Integer i : k) {
+ Map<String, String> m = c.get(i);
+ if (m != null && !m.isEmpty()) l.add(m);
+ }
+ } catch (Exception e) {
+ if (Platform.inDebugMode()) {
+ e.printStackTrace();
+ }
+ } finally {
+ if (r != null) try { r.close(); } catch (IOException e) { /* ignored on purpose */ }
+ }
+ }
+ }
+
+ return l;
+ }
+
+ /**
+ * Saves the list of external executables.
+ *
+ * @param l The list of external executables or <code>null</code>.
+ */
+ public static void save(List<Map<String, String>> l) {
+ IPath stateLocation = UIPlugin.getDefault().getStateLocation();
+ if (stateLocation != null) {
+ File f = stateLocation.append(".executables/data.properties").toFile(); //$NON-NLS-1$
+ if (f.isFile() && (l == null || l.isEmpty())) {
+ @SuppressWarnings("unused")
+ boolean s = f.delete();
+ } else {
+ FileWriter w = null;
+
+ try {
+ Properties data = new Properties();
+ for (int i = 0; i < l.size(); i++) {
+ Map<String, String> m = l.get(i);
+ for (Entry<String, String> e : m.entrySet()) {
+ String key = Integer.toString(i) + "." + e.getKey(); //$NON-NLS-1$
+ data.setProperty(key, e.getValue());
+ }
+ }
+
+ if (!f.exists()) {
+ @SuppressWarnings("unused")
+ boolean s = f.getParentFile().mkdirs();
+ s = f.createNewFile();
+ }
+ w = new FileWriter(f);
+ data.store(w, null);
+ } catch (Exception e) {
+ if (Platform.inDebugMode()) {
+ e.printStackTrace();
+ }
+ } finally {
+ if (w != null) {
+ try {
+ w.flush();
+ w.close();
+ } catch (IOException e) {
+ /* ignored on purpose */
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Loads the image data suitable for showing an icon in a menu
+ * (16 x 16, 8bit depth) from the given file.
+ *
+ * @param path The image file path. Must not be <code>null</code>.
+ * @return The image data or <code>null</code>.
+ */
+ public static ImageData loadImage(String path) {
+ Assert.isNotNull(path);
+
+ ImageData id = null;
+
+ ImageLoader loader = new ImageLoader();
+ ImageData[] data = loader.load(path);
+
+ if (data != null) {
+ for (ImageData d : data) {
+ if (d.height == 16 && d.width == 16) {
+ if (id == null || id.height != 16 && id.width != 16) {
+ id = d;
+ } else if (d.depth < id.depth && d.depth >= 8){
+ id = d;
+ }
+ } else {
+ if (id == null) {
+ id = d;
+ } else if (id.height != 16 && d.height < id.height && id.width != 16 && d.width < id.width) {
+ id = d;
+ }
+ }
+ }
+ }
+
+ return id;
+ }
+}
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/interfaces/IExternalExecutablesProperties.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/interfaces/IExternalExecutablesProperties.java
new file mode 100644
index 000000000..daf625d04
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/interfaces/IExternalExecutablesProperties.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.showin.interfaces;
+
+/**
+ * External executables data property names.
+ */
+public interface IExternalExecutablesProperties {
+
+ /**
+ * The name/label of the external executable.
+ */
+ public final String PROP_NAME = "Name"; //$NON-NLS-1$
+
+ /**
+ * The absolute path of the external executable.
+ */
+ public final String PROP_PATH = "Path"; //$NON-NLS-1$
+
+ /**
+ * The arguments to pass to the external executable.
+ */
+ public final String PROP_ARGS = "Args"; //$NON-NLS-1$
+
+ /**
+ * The absolute path to the icon representing the external executable.
+ */
+ public final String PROP_ICON = "Icon"; //$NON-NLS-1$
+
+ /**
+ * If set, backslashes are translated to forward slashes on paste.
+ */
+ public final String PROP_TRANSLATE = "Translate"; //$NON-NLS-1$
+}
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/interfaces/IPreferenceKeys.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/interfaces/IPreferenceKeys.java
new file mode 100644
index 000000000..6bf6c3444
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/interfaces/IPreferenceKeys.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.showin.interfaces;
+
+/**
+ * Terminals plug-in preference key definitions.
+ */
+public interface IPreferenceKeys {
+ /**
+ * Preference keys family prefix.
+ */
+ public final String PREF_TERMINAL = "terminals"; //$NON-NLS-1$
+
+ /**
+ * Preference key: Remove terminated terminals when a new terminal is created.
+ */
+ public final String PREF_LOCAL_TERMINAL_INITIAL_CWD = PREF_TERMINAL + ".localTerminalInitialCwd"; //$NON-NLS-1$
+
+ /**
+ * Preference value: Local terminal initial working directory is "User home"
+ */
+ public final String PREF_INITIAL_CWD_USER_HOME = "userhome"; //$NON-NLS-1$
+
+ /**
+ * Preference value: Local terminal initial working directory is "Eclipse home"
+ */
+ public final String PREF_INITIAL_CWD_ECLIPSE_HOME = "eclipsehome"; //$NON-NLS-1$
+
+ /**
+ * Preference value: Local terminal initial working directory is "Eclipse workspace"
+ */
+ public final String PREF_INITIAL_CWD_ECLIPSE_WS = "eclipsews"; //$NON-NLS-1$
+}
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/preferences/PreferencePage.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/preferences/PreferencePage.java
new file mode 100644
index 000000000..9b4470a86
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/preferences/PreferencePage.java
@@ -0,0 +1,490 @@
+/*******************************************************************************
+ * Copyright (c) 2014 - 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.showin.preferences;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.URIUtil;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.tcf.te.ui.terminals.controls.NoteCompositeHelper;
+import org.eclipse.tcf.te.ui.terminals.local.activator.UIPlugin;
+import org.eclipse.tcf.te.ui.terminals.local.nls.Messages;
+import org.eclipse.tcf.te.ui.terminals.local.showin.ExternalExecutablesDialog;
+import org.eclipse.tcf.te.ui.terminals.local.showin.ExternalExecutablesManager;
+import org.eclipse.tcf.te.ui.terminals.local.showin.interfaces.IExternalExecutablesProperties;
+import org.eclipse.tcf.te.ui.terminals.local.showin.interfaces.IPreferenceKeys;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.osgi.framework.Bundle;
+
+/**
+ * Terminals top preference page implementation.
+ */
+public class PreferencePage extends org.eclipse.jface.preference.PreferencePage implements IWorkbenchPreferencePage {
+ /* default */ TableViewer viewer;
+ private Button addButton;
+ private Button editButton;
+ private Button removeButton;
+ /* default */ Combo workingDir;
+ private Button browseButton;
+
+ /* default */ final List<Map<String, String>> executables = new ArrayList<Map<String, String>>();
+ /* default */ final Map<String, Image> images = new HashMap<String, Image>();
+
+ /* default */ static final Object[] NO_ELEMENTS = new Object[0];
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ @Override
+ public void init(IWorkbench workbench) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createContents(final Composite parent) {
+ final GC gc = new GC(parent);
+ gc.setFont(JFaceResources.getDialogFont());
+
+ Composite panel = new Composite(parent, SWT.NONE);
+ panel.setLayout(new GridLayout());
+ GridData layoutData = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
+ panel.setLayoutData(layoutData);
+
+ Label label = new Label(panel, SWT.HORIZONTAL);
+ label.setText(Messages.PreferencePage_label);
+ label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Group group = new Group(panel, SWT.NONE);
+ group.setText(Messages.PreferencePage_workingDir_label);
+ group.setLayout(new GridLayout(2, false));
+ group.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
+
+ workingDir = new Combo(group, SWT.DROP_DOWN);
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.ACTIVE)) {
+ workingDir.setItems(new String[] { Messages.PreferencePage_workingDir_userhome_label, Messages.PreferencePage_workingDir_eclipsehome_label, Messages.PreferencePage_workingDir_eclipsews_label });
+ } else {
+ workingDir.setItems(new String[] { Messages.PreferencePage_workingDir_userhome_label, Messages.PreferencePage_workingDir_eclipsehome_label });
+ }
+ workingDir.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ workingDir.select(0);
+
+ browseButton = new Button(group, SWT.PUSH);
+ browseButton.setText(Messages.PreferencePage_workingDir_button_browse);
+ layoutData = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ layoutData.widthHint = Dialog.convertWidthInCharsToPixels(gc.getFontMetrics(), 10);
+ browseButton.setLayoutData(layoutData);
+ browseButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ IPath uh = null;
+ IPath eh = null;
+ IPath ew = null;
+
+ // HOME
+ String home = System.getProperty("user.home"); //$NON-NLS-1$
+ if (home != null && !"".equals(home)) uh = new Path(home); //$NON-NLS-1$
+
+ // ECLIPSE_HOME
+ String eclipseHomeLocation = System.getProperty("eclipse.home.location"); //$NON-NLS-1$
+ if (eclipseHomeLocation != null) {
+ try {
+ URI uri = URIUtil.fromString(eclipseHomeLocation);
+ File f = URIUtil.toFile(uri);
+ eh = new Path(f.getAbsolutePath());
+ } catch (URISyntaxException ex) { /* ignored on purpose */ }
+ }
+
+ // ECLIPSE_WORKSPACE
+ Bundle bundle = Platform.getBundle("org.eclipse.core.resources"); //$NON-NLS-1$
+ if (bundle != null && (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.ACTIVE)) {
+ if (org.eclipse.core.resources.ResourcesPlugin.getWorkspace() != null
+ && org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot() != null
+ && org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getLocation() != null) {
+ ew = org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot().getLocation();
+ }
+ }
+
+ DirectoryDialog dialog = new DirectoryDialog(parent.getShell(), SWT.OPEN);
+
+ // Determine the filter path
+ String text = workingDir.getText();
+ if (Messages.PreferencePage_workingDir_userhome_label.equals(text)) {
+ dialog.setFilterPath(uh.toOSString());
+ } else if (Messages.PreferencePage_workingDir_eclipsehome_label.equals(text)) {
+ dialog.setFilterPath(eh.toOSString());
+ } else if (Messages.PreferencePage_workingDir_eclipsews_label.equals(text)) {
+ dialog.setFilterPath(ew.toOSString());
+ } else if (text != null && !"".equals(text.trim())) { //$NON-NLS-1$
+ dialog.setFilterPath(text.trim());
+ }
+
+ String selected = dialog.open();
+ if (selected != null) {
+ IPath sp = new Path(selected);
+
+ if (uh.equals(sp)) {
+ workingDir.select(0);
+ } else if (eh.equals(sp)) {
+ workingDir.select(1);
+ } else if (ew.equals(sp)) {
+ workingDir.select(2);
+ } else {
+ workingDir.setText(sp.toOSString());
+ }
+ }
+ }
+ });
+
+ String initialCwd = UIPlugin.getScopedPreferences().getString(IPreferenceKeys.PREF_LOCAL_TERMINAL_INITIAL_CWD);
+ if (initialCwd == null || IPreferenceKeys.PREF_INITIAL_CWD_USER_HOME.equals(initialCwd) || "".equals(initialCwd.trim())) { //$NON-NLS-1$
+ workingDir.select(0);
+ } else if (IPreferenceKeys.PREF_INITIAL_CWD_ECLIPSE_HOME.equals(initialCwd)) {
+ workingDir.select(1);
+ } else if (IPreferenceKeys.PREF_INITIAL_CWD_ECLIPSE_WS.equals(initialCwd)) {
+ workingDir.select(2);
+ } else {
+ workingDir.setText(new Path(initialCwd).toOSString());
+ }
+
+ NoteCompositeHelper.createNoteComposite(group.getFont(), group, Messages.PreferencePage_workingDir_note_label, Messages.PreferencePage_workingDir_note_text);
+
+ group = new Group(panel, SWT.NONE);
+ group.setText(Messages.PreferencePage_executables_label);
+ group.setLayout(new GridLayout(2, false));
+ group.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
+
+ viewer = new TableViewer(group, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
+
+ Table table = viewer.getTable();
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ TableColumn column = new TableColumn(table, SWT.LEFT);
+ column.setText(Messages.PreferencePage_executables_column_name_label);
+ column = new TableColumn(table, SWT.LEFT);
+ column.setText(Messages.PreferencePage_executables_column_path_label);
+
+ ColumnViewerToolTipSupport.enableFor(viewer);
+
+ TableLayout tableLayout = new TableLayout();
+ tableLayout.addColumnData(new ColumnWeightData(35));
+ tableLayout.addColumnData(new ColumnWeightData(65));
+ table.setLayout(tableLayout);
+
+ layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ layoutData.heightHint = Dialog.convertHeightInCharsToPixels(gc.getFontMetrics(), 10);
+ table.setLayoutData(layoutData);
+
+ Composite buttonsPanel = new Composite(group, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 0; layout.marginWidth = 0;
+ buttonsPanel.setLayout(layout);
+ buttonsPanel.setLayoutData(new GridData(SWT.LEAD, SWT.BEGINNING, false, false));
+
+ addButton = new Button(buttonsPanel, SWT.PUSH);
+ addButton.setText(Messages.PreferencePage_executables_button_add_label);
+ layoutData = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ layoutData.widthHint = Dialog.convertWidthInCharsToPixels(gc.getFontMetrics(), 10);
+ addButton.setLayoutData(layoutData);
+ addButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ ExternalExecutablesDialog dialog = new ExternalExecutablesDialog(PreferencePage.this.getShell(), false);
+ if (dialog.open() == Window.OK) {
+ // Get the executable properties and add it to the the list
+ Map<String, String> executableData = dialog.getExecutableData();
+ if (executableData != null && !executables.contains(executableData)) {
+ executables.add(executableData);
+ viewer.refresh();
+ }
+ }
+ }
+ });
+
+ editButton = new Button(buttonsPanel, SWT.PUSH);
+ editButton.setText(Messages.PreferencePage_executables_button_edit_label);
+ layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ layoutData.widthHint = Dialog.convertWidthInCharsToPixels(gc.getFontMetrics(), 10);
+ editButton.setLayoutData(layoutData);
+ editButton.addSelectionListener(new SelectionAdapter() {
+ @SuppressWarnings("unchecked")
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ ISelection s = viewer.getSelection();
+ if (s instanceof IStructuredSelection && !s.isEmpty()) {
+ Object element = ((IStructuredSelection)s).getFirstElement();
+ if (element instanceof Map) {
+ final Map<String, String> m = (Map<String, String>)element;
+ ExternalExecutablesDialog dialog = new ExternalExecutablesDialog(PreferencePage.this.getShell(), true);
+ dialog.setExecutableData(m);
+ if (dialog.open() == Window.OK) {
+ Map<String, String> executableData = dialog.getExecutableData();
+ if (executableData != null) {
+ m.clear();
+ m.putAll(executableData);
+ viewer.refresh();
+ }
+ }
+ }
+ }
+ }
+ });
+
+ removeButton = new Button(buttonsPanel, SWT.PUSH);
+ removeButton.setText(Messages.PreferencePage_executables_button_remove_label);
+ layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ layoutData.widthHint = Dialog.convertWidthInCharsToPixels(gc.getFontMetrics(), 10);
+ removeButton.setLayoutData(layoutData);
+ removeButton.addSelectionListener(new SelectionAdapter() {
+ @SuppressWarnings("unchecked")
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ ISelection s = viewer.getSelection();
+ if (s instanceof IStructuredSelection && !s.isEmpty()) {
+ Iterator<?> iterator = ((IStructuredSelection)s).iterator();
+ while (iterator.hasNext()) {
+ Object element = iterator.next();
+ if (element instanceof Map) {
+ Map<String, Object> m = (Map<String, Object>)element;
+ executables.remove(m);
+ }
+ viewer.refresh();
+ }
+ }
+ }
+ });
+
+ viewer.setContentProvider(new IStructuredContentProvider() {
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof List && !((List<?>)inputElement).isEmpty()) {
+ return ((List<?>)inputElement).toArray();
+ }
+ return NO_ELEMENTS;
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ @Override
+ public void dispose() {
+ }
+ });
+
+ viewer.setLabelProvider(new ITableLabelProvider() {
+ @SuppressWarnings("unchecked")
+ @Override
+ public String getColumnText(Object element, int columnIndex) {
+ if (element instanceof Map) {
+ Map<String, Object> m = (Map<String, Object>)element;
+
+ switch (columnIndex) {
+ case 0:
+ return (String)m.get(IExternalExecutablesProperties.PROP_NAME);
+ case 1:
+ return (String)m.get(IExternalExecutablesProperties.PROP_PATH);
+ }
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Image getColumnImage(Object element, int columnIndex) {
+ Image i = null;
+
+ if (element instanceof Map) {
+ switch (columnIndex) {
+ case 0:
+ Map<String, Object> m = (Map<String, Object>)element;
+ String icon = (String) m.get(IExternalExecutablesProperties.PROP_ICON);
+ if (icon != null) {
+ i = images.get(icon);
+ if (i == null) {
+ ImageData id = ExternalExecutablesManager.loadImage(icon);
+ if (id != null) {
+ ImageDescriptor d = ImageDescriptor.createFromImageData(id);
+ if (d != null) i = d.createImage();
+ if (i != null) images.put(icon, i);
+ }
+ }
+ }
+ break;
+ case 1:
+ break;
+ }
+ }
+
+ return i;
+ }
+
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+ }
+ });
+
+ List<Map<String, String>> l = ExternalExecutablesManager.load();
+ if (l != null) executables.addAll(l);
+
+ viewer.setInput(executables);
+
+ viewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateButtons();
+ }
+ });
+
+ updateButtons();
+
+ gc.dispose();
+
+ return panel;
+ }
+
+ /**
+ * Updates the button states.
+ */
+ protected void updateButtons() {
+ if (viewer != null) {
+ addButton.setEnabled(true);
+
+ ISelection selection = viewer.getSelection();
+
+ boolean hasSelection = selection != null && !selection.isEmpty();
+ int count = selection instanceof IStructuredSelection ? ((IStructuredSelection)selection).size() : 0;
+
+ editButton.setEnabled(hasSelection && count == 1);
+ removeButton.setEnabled(hasSelection && count > 0);
+ } else {
+ addButton.setEnabled(false);
+ editButton.setEnabled(false);
+ removeButton.setEnabled(false);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+ */
+ @Override
+ protected void performDefaults() {
+ String initialCwd = UIPlugin.getScopedPreferences().getDefaultString(IPreferenceKeys.PREF_LOCAL_TERMINAL_INITIAL_CWD);
+ if (initialCwd == null || IPreferenceKeys.PREF_INITIAL_CWD_USER_HOME.equals(initialCwd) || "".equals(initialCwd.trim())) { //$NON-NLS-1$
+ workingDir.select(0);
+ } else if (IPreferenceKeys.PREF_INITIAL_CWD_ECLIPSE_HOME.equals(initialCwd)) {
+ workingDir.select(1);
+ } else if (IPreferenceKeys.PREF_INITIAL_CWD_ECLIPSE_WS.equals(initialCwd)) {
+ workingDir.select(2);
+ } else {
+ workingDir.setText(new Path(initialCwd).toOSString());
+ }
+
+ executables.clear();
+ List<Map<String, String>> l = ExternalExecutablesManager.load();
+ if (l != null) executables.addAll(l);
+ viewer.refresh();
+
+ super.performDefaults();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#performOk()
+ */
+ @Override
+ public boolean performOk() {
+ String text = workingDir.getText();
+ if (text == null || Messages.PreferencePage_workingDir_userhome_label.equals(text) || "".equals(text.trim())) { //$NON-NLS-1$
+ UIPlugin.getScopedPreferences().putString(IPreferenceKeys.PREF_LOCAL_TERMINAL_INITIAL_CWD, null);
+ } else if (Messages.PreferencePage_workingDir_eclipsehome_label.equals(text)) {
+ UIPlugin.getScopedPreferences().putString(IPreferenceKeys.PREF_LOCAL_TERMINAL_INITIAL_CWD, IPreferenceKeys.PREF_INITIAL_CWD_ECLIPSE_HOME);
+ } else if (Messages.PreferencePage_workingDir_eclipsews_label.equals(text)) {
+ UIPlugin.getScopedPreferences().putString(IPreferenceKeys.PREF_LOCAL_TERMINAL_INITIAL_CWD, IPreferenceKeys.PREF_INITIAL_CWD_ECLIPSE_WS);
+ } else {
+ IPath p = new Path(text.trim());
+ UIPlugin.getScopedPreferences().putString(IPreferenceKeys.PREF_LOCAL_TERMINAL_INITIAL_CWD, p.toFile().canRead() && p.toFile().isDirectory() ? p.toString() : null);
+ }
+
+ ExternalExecutablesManager.save(executables);
+
+ return super.performOk();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.DialogPage#dispose()
+ */
+ @Override
+ public void dispose() {
+ for (Image i : images.values()) {
+ i.dispose();
+ }
+ images.clear();
+ super.dispose();
+ }
+}
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/preferences/PreferencesInitializer.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/preferences/PreferencesInitializer.java
new file mode 100644
index 000000000..11d7d9d1b
--- /dev/null
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/preferences/PreferencesInitializer.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.terminals.local.showin.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.tcf.te.core.terminals.preferences.ScopedEclipsePreferences;
+import org.eclipse.tcf.te.ui.terminals.local.activator.UIPlugin;
+import org.eclipse.tcf.te.ui.terminals.local.showin.interfaces.IPreferenceKeys;
+
+/**
+ * Terminals default preferences initializer.
+ */
+public class PreferencesInitializer extends AbstractPreferenceInitializer {
+
+ /**
+ * Constructor.
+ */
+ public PreferencesInitializer() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ @Override
+ public void initializeDefaultPreferences() {
+ ScopedEclipsePreferences prefs = UIPlugin.getScopedPreferences();
+
+ prefs.putDefaultString(IPreferenceKeys.PREF_LOCAL_TERMINAL_INITIAL_CWD, IPreferenceKeys.PREF_INITIAL_CWD_USER_HOME);
+ }
+}

Back to the top