Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--pom-tests.xml1
-rw-r--r--pom.xml1
-rw-r--r--target_explorer/features/org.eclipse.tcf.te.feature/feature.xml7
-rw-r--r--target_explorer/features/org.eclipse.tcf.te.sdk.feature/feature.xml7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/pom.xml9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.classpath7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.options1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.project39
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.settings/org.eclipse.jdt.core.prefs362
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/META-INF/MANIFEST.MF24
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/build.properties7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/icons/obj16/workingset.gifbin943 -> 0 bytes
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/icons/obj16/workingsets.gifbin333 -> 0 bytes
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/plugin.properties25
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/plugin.xml139
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/pom.xml17
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/CustomizedOrderComparator.java120
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/CustomizedOrderComparatorFactory.java31
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/OthersWorkingSetElementUpdater.java191
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetAdapterFactory.java46
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetComparer.java52
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementAdapter.java62
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementHolder.java179
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementHolderAdapterFactory.java41
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementHolderFactory.java36
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementUpdater.java115
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetFilter.java137
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetViewStateManager.java413
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetViewerSorter.java46
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetsContentProvider.java346
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetsLabelProvider.java44
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/actions/ConfigureWorkingSetAction.java181
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/actions/WorkingSetActionGroup.java234
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/actions/WorkingSetActionProvider.java137
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/activator/UIPlugin.java119
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/dialogs/WorkingSetConfigurationDialog.java598
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/interfaces/IWorkingSetElement.java31
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/interfaces/ImageConsts.java54
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/internal/adapters/AdapterFactory.java58
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/internal/preferences/IPreferenceConsts.java20
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/internal/preferences/PreferencesInitializer.java36
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/nls/Messages.java67
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/nls/Messages.properties46
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/pages/AbstractWorkingSetWizardPage.java535
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/pages/TargetWorkingSetPage.java157
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/META-INF/MANIFEST.MF3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/workingsets/IWorkingSetIDs.java26
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/workingsets/IWorkingSetNameIDs.java25
50 files changed, 1 insertions, 4837 deletions
diff --git a/.gitignore b/.gitignore
index 08970ca27..bf84548db 100644
--- a/.gitignore
+++ b/.gitignore
@@ -147,8 +147,6 @@ tests/plugins/org.eclipse.tcf.debug.test/bin
/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.telnet/bin
/target_explorer/plugins/org.eclipse.tcf.te.ui.views/target
/target_explorer/plugins/org.eclipse.tcf.te.ui.views/bin
-/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/target
-/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/bin
/target_explorer/features/org.eclipse.tcf.te.feature/target
/target_explorer/features/org.eclipse.tcf.te.feature/bin
/target_explorer/features/org.eclipse.tcf.te.cdt.feature/target
diff --git a/pom-tests.xml b/pom-tests.xml
index e6728f71e..276d6f9d4 100644
--- a/pom-tests.xml
+++ b/pom-tests.xml
@@ -41,7 +41,6 @@
<module>target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.ssh</module>
<module>target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.telnet</module>
<module>target_explorer/plugins/org.eclipse.tcf.te.ui.views</module>
- <module>target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets</module>
<module>target_explorer/plugins/org.eclipse.tcf.te.tcf.core</module>
<module>target_explorer/plugins/org.eclipse.tcf.te.tcf.core.model</module>
<module>target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting</module>
diff --git a/pom.xml b/pom.xml
index d21d44700..14eb9547c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -54,7 +54,6 @@
<module>target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.ssh</module>
<module>target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.telnet</module>
<module>target_explorer/plugins/org.eclipse.tcf.te.ui.views</module>
- <module>target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets</module>
<module>target_explorer/plugins/org.eclipse.tcf.te.tcf.core</module>
<module>target_explorer/plugins/org.eclipse.tcf.te.tcf.core.model</module>
<module>target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting</module>
diff --git a/target_explorer/features/org.eclipse.tcf.te.feature/feature.xml b/target_explorer/features/org.eclipse.tcf.te.feature/feature.xml
index 0bfde43a4..9214876f8 100644
--- a/target_explorer/features/org.eclipse.tcf.te.feature/feature.xml
+++ b/target_explorer/features/org.eclipse.tcf.te.feature/feature.xml
@@ -179,13 +179,6 @@
unpack="false"/>
<plugin
- id="org.eclipse.tcf.te.ui.views.workingsets"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
id="com.google.gson"
download-size="0"
install-size="0"
diff --git a/target_explorer/features/org.eclipse.tcf.te.sdk.feature/feature.xml b/target_explorer/features/org.eclipse.tcf.te.sdk.feature/feature.xml
index 08fa067ca..48ea01589 100644
--- a/target_explorer/features/org.eclipse.tcf.te.sdk.feature/feature.xml
+++ b/target_explorer/features/org.eclipse.tcf.te.sdk.feature/feature.xml
@@ -162,13 +162,6 @@
unpack="false"/>
<plugin
- id="org.eclipse.tcf.te.ui.views.workingsets.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
id="com.google.gson.source"
download-size="0"
install-size="0"
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/pom.xml b/target_explorer/plugins/org.eclipse.tcf.te.tests/pom.xml
index 180b5945c..42947eeae 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/pom.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/pom.xml
@@ -441,15 +441,6 @@
</sourcefiles>
</group>
- <group name="org.eclipse.tcf.te.ui.views.workingsets">
- <classfiles>
- <fileset dir="${basedir}/../org.eclipse.tcf.te.ui.views.workingsets/target/classes"/>
- </classfiles>
- <sourcefiles>
- <fileset dir="${basedir}/../org.eclipse.tcf.te.ui.views.workingsets/src"/>
- </sourcefiles>
- </group>
-
</structure>
<html destdir="${project.build.directory}/coverage"
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.classpath b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.classpath
deleted file mode 100644
index 8a8f1668c..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.options b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.options
deleted file mode 100644
index f9d23c944..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.options
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.tcf.te.ui.views.workingsets/debugmode = 0
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.project b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.project
deleted file mode 100644
index a6ea9ba81..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.project
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.tcf.te.ui.views.workingsets</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>1329502108951</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/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.settings/org.eclipse.jdt.core.prefs b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 37e98db4c..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,362 +0,0 @@
-#Thu Feb 02 11:07:44 CET 2012
-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/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.settings/org.eclipse.jdt.ui.prefs b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 5179b21dc..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Thu Feb 02 11:07:44 CET 2012
-eclipse.preferences.version=1
-formatter_profile=_Target Explorer Java STD
-formatter_settings_version=12
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/META-INF/MANIFEST.MF
deleted file mode 100644
index 8562f62b7..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,24 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.tcf.te.ui.views.workingsets;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.tcf.te.ui.views.workingsets.activator.UIPlugin
-Bundle-Vendor: %providerName
-Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
- org.eclipse.ui;bundle-version="3.7.0",
- org.eclipse.ui.navigator;bundle-version="3.5.100",
- org.eclipse.tcf.te.runtime;bundle-version="1.0.0",
- org.eclipse.tcf.te.ui;bundle-version="1.0.0",
- org.eclipse.tcf.te.ui.views;bundle-version="1.0.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ActivationPolicy: lazy
-Bundle-Localization: plugin
-Export-Package: org.eclipse.tcf.te.ui.views.workingsets,
- org.eclipse.tcf.te.ui.views.workingsets.actions,
- org.eclipse.tcf.te.ui.views.workingsets.activator;x-internal:=true,
- org.eclipse.tcf.te.ui.views.workingsets.dialogs,
- org.eclipse.tcf.te.ui.views.workingsets.interfaces,
- org.eclipse.tcf.te.ui.views.workingsets.internal.adapters;x-internal:=true,
- org.eclipse.tcf.te.ui.views.workingsets.nls;x-internal:=true,
- org.eclipse.tcf.te.ui.views.workingsets.pages
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/build.properties b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/build.properties
deleted file mode 100644
index e0b53196d..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.properties,\
- icons/,\
- plugin.xml
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/icons/obj16/workingset.gif b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/icons/obj16/workingset.gif
deleted file mode 100644
index d46c5370d..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/icons/obj16/workingset.gif
+++ /dev/null
Binary files differ
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/icons/obj16/workingsets.gif b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/icons/obj16/workingsets.gif
deleted file mode 100644
index fa8c9f758..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/icons/obj16/workingsets.gif
+++ /dev/null
Binary files differ
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/plugin.properties
deleted file mode 100644
index f85b0ef7b..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/plugin.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-##################################################################################
-# Copyright (c) 2011 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, Working Sets
-providerName = Eclipse.org - TCF
-
-# ***** Common Navigator *****
-
-filters.workingSet.name=Working sets [not visible in UI]
-filters.workingSet.description=Hides unselected working sets [not visible in UI]
-
-workingsets.extension.name=Working Sets
-
-workingset.name=System Management
-workingset.description=System Management working sets.
-
-workingset.others.name=Other
-workingset.others.description=Working set containing all elements not in any group.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/plugin.xml
deleted file mode 100644
index 5a560f0c2..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/plugin.xml
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-
-<!-- Adapter factory contributions -->
- <extension point="org.eclipse.core.runtime.adapters">
- <factory
- adaptableType="org.eclipse.tcf.te.ui.views.internal.View"
- class="org.eclipse.tcf.te.ui.views.workingsets.internal.adapters.AdapterFactory">
- <adapter type="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetViewStateManager"/>
- </factory>
-
- <factory
- adaptableType="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementHolder"
- class="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementHolderAdapterFactory">
- <adapter type="org.eclipse.tcf.te.ui.views.workingsets.interfaces.IWorkingSetElement"/>
- </factory>
- <factory
- adaptableType="org.eclipse.ui.IWorkingSet"
- class="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetAdapterFactory">
- <adapter
- type="org.eclipse.jface.viewers.IElementComparer">
- </adapter>
- </factory>
- </extension>
-
-<!-- Common Navigator contributions -->
- <extension point="org.eclipse.ui.navigator.viewer">
- <viewerContentBinding viewerId="org.eclipse.tcf.te.ui.views.View">
- <includes>
- <contentExtension
- pattern="org.eclipse.tcf.te.ui.views.navigator.content.workingSets">
- </contentExtension>
- <contentExtension pattern="org.eclipse.tcf.te.ui.views.navigator.filters.workingSet"/>
- </includes>
- </viewerContentBinding>
- </extension>
-
-<!-- Working Sets navigator action contributions -->
- <extension point="org.eclipse.ui.navigator.navigatorContent">
- <actionProvider
- class="org.eclipse.tcf.te.ui.views.workingsets.actions.WorkingSetActionProvider"
- id="org.eclipse.tcf.te.ui.views.navigator.actions.WorkingSetActions">
- <enablement>
- <or>
- <adapt type="java.lang.Object" />
- <adapt type="java.util.Collection">
- <count value="0" />
- </adapt>
- </or>
- </enablement>
- </actionProvider>
- </extension>
-
-<!-- Working Sets navigator content contributions -->
- <extension point="org.eclipse.ui.navigator.navigatorContent">
- <commonFilter
- id="org.eclipse.tcf.te.ui.views.navigator.filters.workingSet"
- name="%filters.workingSet.name"
- description="%filters.workingSet.description"
- class="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetFilter"
- activeByDefault="false"
- visibleInUI="false">
- </commonFilter>
-
- <navigatorContent
- activeByDefault="true"
- contentProvider="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetsContentProvider"
- icon="icons/obj16/workingsets.gif"
- id="org.eclipse.tcf.te.ui.views.navigator.content.workingSets"
- labelProvider="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetsLabelProvider"
- name="%workingsets.extension.name"
- priority="higher">
- <triggerPoints>
- <or>
- <instanceof value="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetViewStateManager"/>
- <instanceof value="org.eclipse.ui.IWorkingSet"/>
- <instanceof value="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementHolder"/>
- <instanceof value="org.eclipse.tcf.te.ui.views.interfaces.IRoot" />
- </or>
- </triggerPoints>
- <possibleChildren>
- <or>
- <instanceof value="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetViewStateManager"/>
- <instanceof value="org.eclipse.ui.IWorkingSet"/>
- <instanceof value="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementHolder"/>
- <instanceof
- value="org.eclipse.tcf.te.ui.views.workingsets.interfaces.IWorkingSetElement">
- </instanceof>
- </or>
- </possibleChildren>
- <commonSorter
- class="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetViewerSorter"
- id="org.eclipse.tcf.te.ui.views.navigator.content.workingSets.sorter">
- </commonSorter>
- </navigatorContent>
-
- </extension>
-
-<!-- Working Set contributions -->
- <extension point="org.eclipse.ui.workingSets">
- <workingSet
- description="%workingset.description"
- elementAdapterClass="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementAdapter"
- icon="icons/obj16/workingset.gif"
- id="org.eclipse.tcf.te.ui.views.workingset"
- name="%workingset.name"
- pageClass="org.eclipse.tcf.te.ui.views.workingsets.pages.TargetWorkingSetPage"
- updaterClass="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementUpdater">
- </workingSet>
-
- <workingSet
- description="%workingset.others.description"
- icon="icons/obj16/workingset.gif"
- id="org.eclipse.tcf.te.ui.views.workingset.others"
- name="%workingset.others.name"
- updaterClass="org.eclipse.tcf.te.ui.views.workingsets.OthersWorkingSetElementUpdater">
- </workingSet>
- </extension>
-
-<!-- Element factories -->
- <extension point="org.eclipse.ui.elementFactories">
- <factory
- class="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementHolderFactory"
- id="org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementHolderFactory">
- </factory>
- <factory
- class="org.eclipse.tcf.te.ui.views.workingsets.CustomizedOrderComparatorFactory"
- id="org.eclipse.tcf.te.ui.views.workingsets.CustomizedOrderComparatorFactory">
- </factory>
- </extension>
- <extension
- point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.tcf.te.ui.views.workingsets.internal.preferences.PreferencesInitializer">
- </initializer>
- </extension>
-
-</plugin>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/pom.xml b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/pom.xml
deleted file mode 100644
index 7e5a3a059..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/pom.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?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>tcf-parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <relativePath>../../../pom.xml</relativePath>
- </parent>
-
- <version>1.0.0.qualifier</version>
- <artifactId>org.eclipse.tcf.te.ui.views.workingsets</artifactId>
- <packaging>eclipse-plugin</packaging>
-</project>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/CustomizedOrderComparator.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/CustomizedOrderComparator.java
deleted file mode 100644
index 13ed9becd..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/CustomizedOrderComparator.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.navigator.IMementoAware;
-
-/**
- * <p>
- * The comparator to sort working sets in the order specified by end users.
- * It reads a series of working set names and sort the given list in the order
- * of the working set names.
- * </p>
- */
-public class CustomizedOrderComparator implements Comparator<IWorkingSet>, IMementoAware, IPersistableElement, IAdaptable {
- // The separator delimiter to separate working set names store in the memento file.
- private static final String WORKINGSET_SEPARATOR = "|"; //$NON-NLS-1$
- // The sequence of the sorted working set.
- private static final String ATTR_SEQUENCE = "sequence"; //$NON-NLS-1$
-
- // Working set names which are used to sort working sets.
- private List<String> workingSetNames;
-
- /**
- * Create a comparator instance.
- */
- public CustomizedOrderComparator() {
- }
-
- /**
- * Create a comparator instance using the same order of the
- * specified working set array.
- *
- * @param workingSets The working set array
- */
- public CustomizedOrderComparator(IWorkingSet[] workingSets) {
- workingSetNames = new ArrayList<String>();
- for (IWorkingSet workingSet : workingSets) {
- workingSetNames.add(workingSet.getName());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.navigator.IMementoAware#saveState(org.eclipse.ui.IMemento)
- */
- @Override
- public void saveState(IMemento memento) {
- StringBuilder buf = new StringBuilder();
- for (String name : workingSetNames) {
- buf.append(name + WORKINGSET_SEPARATOR);
- }
- if (buf.length() > 0) buf.deleteCharAt(buf.length() - 1);
- memento.putString(ATTR_SEQUENCE, buf.toString());
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.navigator.IMementoAware#restoreState(org.eclipse.ui.IMemento)
- */
- @Override
- public void restoreState(IMemento aMemento) {
- String wsNames = aMemento.getString(ATTR_SEQUENCE);
- StringTokenizer st = new StringTokenizer(wsNames, WORKINGSET_SEPARATOR);
- workingSetNames = new ArrayList<String>();
- while (st.hasMoreTokens()) {
- workingSetNames.add(st.nextToken());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.IPersistableElement#getFactoryId()
- */
- @Override
- public String getFactoryId() {
- return CustomizedOrderComparatorFactory.FACTORY_ID;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- @Override
- public Object getAdapter(Class adapter) {
- if (adapter == IPersistableElement.class) {
- return this;
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- @Override
- public int compare(IWorkingSet o1, IWorkingSet o2) {
- String id1 = o1.getName();
- String id2 = o2.getName();
- int index1 = workingSetNames.indexOf(id1);
- int index2 = workingSetNames.indexOf(id2);
- if (index1 != -1 && index2 != -1) return index1 > index2 ? 1 : (index1 < index2 ? -1 : 0);
- return 0;
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/CustomizedOrderComparatorFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/CustomizedOrderComparatorFactory.java
deleted file mode 100644
index 44ebd62fc..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/CustomizedOrderComparatorFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.IElementFactory;
-import org.eclipse.ui.IMemento;
-/**
- * The element factory to create a CustomizedOrderComparator from a
- * memento.
- */
-public class CustomizedOrderComparatorFactory implements IElementFactory {
- public static final String FACTORY_ID = "org.eclipse.tcf.te.ui.views.workingsets.CustomizedOrderComparatorFactory"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IElementFactory#createElement(org.eclipse.ui.IMemento)
- */
- @Override
- public IAdaptable createElement(IMemento memento) {
- CustomizedOrderComparator comparator = new CustomizedOrderComparator();
- comparator.restoreState(memento);
- return comparator;
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/OthersWorkingSetElementUpdater.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/OthersWorkingSetElementUpdater.java
deleted file mode 100644
index a5de762b6..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/OthersWorkingSetElementUpdater.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
-import org.eclipse.tcf.te.ui.views.internal.ViewRoot;
-import org.eclipse.tcf.te.ui.views.internal.ViewViewer;
-import org.eclipse.tcf.te.ui.views.workingsets.interfaces.IWorkingSetElement;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.navigator.CommonViewer;
-
-/**
- * "Others" working set element updater.
- */
-public class OthersWorkingSetElementUpdater extends WorkingSetElementUpdater {
- // The reference to the "Others" working set
- private IWorkingSet othersWorkingSet;
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementUpdater#add(org.eclipse.ui.IWorkingSet)
- */
- @Override
- public void add(IWorkingSet workingSet) {
- Assert.isTrue(othersWorkingSet == null);
- othersWorkingSet = workingSet;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementUpdater#remove(org.eclipse.ui.IWorkingSet)
- */
- @Override
- public boolean remove(IWorkingSet workingSet) {
- Assert.isTrue(othersWorkingSet == workingSet);
- othersWorkingSet = null;
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementUpdater#contains(org.eclipse.ui.IWorkingSet)
- */
- @Override
- public boolean contains(IWorkingSet workingSet) {
- return othersWorkingSet == workingSet;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementUpdater#onUpdateWorkingSets(org.eclipse.ui.navigator.CommonViewer, org.eclipse.ui.IWorkingSet[])
- */
- @Override
- protected void onUpdateWorkingSets(CommonViewer viewer, IWorkingSet[] workingsets) {
- Assert.isNotNull(viewer);
- Assert.isNotNull(workingsets);
-
- // The list of elements not be contained by any other working set
- List<WorkingSetElementHolder> otherElements = new ArrayList<WorkingSetElementHolder>();
-
- // Get all (root) elements from the common viewer
- List<Object> objects = new ArrayList<Object>();
- ITreeContentProvider provider = viewer.getNavigatorContentService().createCommonContentProvider();
- Object[] candidates = provider.getElements(ViewRoot.getInstance());
- for (Object candidate : candidates) {
- if (candidate instanceof ICategory) {
- objects.addAll(Arrays.asList(provider.getChildren(candidate)));
- } else {
- objects.add(candidate);
- }
- }
- provider.dispose();
-
- Object[] elements = objects.toArray();
-
- // Get all working sets
- WorkingSetViewStateManager manager = (WorkingSetViewStateManager)Platform.getAdapterManager().getAdapter(viewer.getCommonNavigator(), WorkingSetViewStateManager.class);
- IWorkingSet[] allWorkingSets = manager != null ? manager.getAllWorkingSets() : new IWorkingSet[0];
-
- // Loop the elements and check if they are contained in a working set
- for (Object element : elements) {
- if (!(element instanceof IWorkingSetElement)) continue;
-
- boolean isContained = isContained((IWorkingSetElement)element, allWorkingSets);
- if (!isContained) {
- WorkingSetElementHolder holder = null;
-
- IAdaptable[] wsElements = othersWorkingSet.getElements();
- for (IAdaptable wsElement : wsElements) {
- if (!(wsElement instanceof WorkingSetElementHolder)) continue;
-
- IWorkingSetElement candidate = ((WorkingSetElementHolder)wsElement).getElement();
- String candidateId = ((WorkingSetElementHolder)wsElement).getElementId();
-
- if (element.equals(candidate)) {
- holder = (WorkingSetElementHolder)wsElement;
- break;
- } else if (candidate == null && (((IWorkingSetElement)element).getElementId().equals(candidateId))) {
- holder = (WorkingSetElementHolder)wsElement;
- ((WorkingSetElementHolder)wsElement).setElement((IWorkingSetElement)element);
- break;
- }
- }
-
- if (holder == null) {
- holder = new WorkingSetElementHolder(othersWorkingSet.getName(), ((IWorkingSetElement)element).getElementId());
- holder.setElement((IWorkingSetElement)element);
- }
- otherElements.add(holder);
- }
- }
-
- othersWorkingSet.setElements(otherElements.toArray(new IAdaptable[otherElements.size()]));
-
- // Trigger a view update, but without triggering ourselves again.
- if (viewer instanceof ViewViewer) {
- boolean changed = ((ViewViewer)viewer).setSilentMode(true);
- viewer.refresh();
- if (changed) ((ViewViewer)viewer).setSilentMode(false);
- }
- }
-
- /**
- * Walks over the given working set list and checks if the element is contained in
- * one of them.
- *
- * @param element The element. Must not be <code>null</code>.
- * @param allWorkingSets The list of working sets. Must not be <code>null</code>.
- *
- * @return <code>True</code> if the element is contained in at least one of the given working sets, <code>false</code> otherwise.
- */
- protected boolean isContained(IWorkingSetElement element, IWorkingSet[] allWorkingSets) {
- Assert.isNotNull(element);
- Assert.isNotNull(allWorkingSets);
-
- boolean contained = false;
-
- for (IWorkingSet workingSet : allWorkingSets) {
- if (workingSet.equals(othersWorkingSet)) continue;
- contained = isContained(element, workingSet);
- if (contained) break;
- }
-
- return contained;
- }
-
- /**
- * Checks if the element is contained in the given working set.
- *
- * @param element The element. Must not be <code>null</code>.
- * @param workingSet The working set. Must not be <code>null</code>.
- *
- * @return <code>True</code> if the element is contained in the given working set, <code>false</code> otherwise.
- */
- protected boolean isContained(IWorkingSetElement element, IWorkingSet workingSet) {
- Assert.isNotNull(element);
- Assert.isNotNull(workingSet);
-
- boolean contained = false;
-
- IAdaptable[] wsElements = workingSet.getElements();
- for (IAdaptable wsElement : wsElements) {
- if (!(wsElement instanceof WorkingSetElementHolder)) continue;
-
- IWorkingSetElement candidate = ((WorkingSetElementHolder)wsElement).getElement();
- String candidateId = ((WorkingSetElementHolder)wsElement).getElementId();
-
- if (element.equals(candidate)) {
- contained = true;
- break;
- } else if (candidate == null && element.getElementId().equals(candidateId)) {
- contained = true;
- ((WorkingSetElementHolder)wsElement).setElement(element);
- break;
- }
- }
-
- return contained;
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetAdapterFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetAdapterFactory.java
deleted file mode 100644
index a6a9720df..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetAdapterFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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.views.workingsets;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jface.viewers.IElementComparer;
-import org.eclipse.ui.IWorkingSet;
-
-/**
- * The adapter factory to adapt a working set to IElementComparer, which
- * customize the comparison during restoring expanding state.
- */
-public class WorkingSetAdapterFactory implements IAdapterFactory {
- // The adapter list.
- private static Class<?>[] adapters = {IElementComparer.class};
- // The adapted IElementComparer of a working set.
- private static IElementComparer wsComparer = new WorkingSetComparer();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- @Override
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if(adaptableObject instanceof IWorkingSet && IElementComparer.class.equals(adapterType)) {
- return wsComparer;
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- @Override
- public Class[] getAdapterList() {
- return adapters;
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetComparer.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetComparer.java
deleted file mode 100644
index 249a05b5d..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetComparer.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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.views.workingsets;
-
-import org.eclipse.jface.viewers.IElementComparer;
-import org.eclipse.ui.IWorkingSet;
-
-/**
- * The element comparer implementation of a working set which only
- * compares name and id instead of the default behavior of its equals
- * method, which compares sub working sets as well.
- */
-public class WorkingSetComparer implements IElementComparer {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.IElementComparer#equals(java.lang.Object, java.lang.Object)
- */
- @Override
- public boolean equals(Object a, Object b) {
- if(a instanceof IWorkingSet && b instanceof IWorkingSet) {
- IWorkingSet aws = (IWorkingSet) a;
- IWorkingSet bws = (IWorkingSet) b;
- String aName = aws.getName();
- String aId = aws.getId();
- String bName = bws.getName();
- String bId = bws.getId();
- return _equals(aName, bName) && _equals(aId, bId);
- }
- return _equals(a, b);
- }
-
- private boolean _equals(Object a, Object b) {
- return a == null ? b == null : a.equals(b);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.IElementComparer#hashCode(java.lang.Object)
- */
- @Override
- public int hashCode(Object element) {
- return element == null ? 0 : element.hashCode();
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementAdapter.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementAdapter.java
deleted file mode 100644
index 0df4a4fde..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementAdapter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.tcf.te.ui.views.workingsets.interfaces.IWorkingSetElement;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetElementAdapter;
-
-/**
- * Working set element adapter implementation.
- */
-public class WorkingSetElementAdapter implements IWorkingSetElementAdapter {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkingSetElementAdapter#adaptElements(org.eclipse.ui.IWorkingSet, org.eclipse.core.runtime.IAdaptable[])
- */
- @Override
- public IAdaptable[] adaptElements(IWorkingSet ws, IAdaptable[] elements) {
- List<IAdaptable> adapted = new ArrayList<IAdaptable>();
-
- // All elements of a working set needs to be of type WorkingSetElementHolder
- for (IAdaptable adaptable : elements) {
- if (adaptable instanceof WorkingSetElementHolder) {
- adapted.add(adaptable);
- } else {
- IWorkingSetElement element = null;
- if (adaptable instanceof IWorkingSetElement) {
- element = (IWorkingSetElement) adaptable;
- } else {
- element = (IWorkingSetElement) adaptable.getAdapter(IWorkingSetElement.class);
- }
- // Create the WorkingSetElementHolder for the element
- if (element != null) {
- WorkingSetElementHolder holder = new WorkingSetElementHolder(ws.getName(), element.getElementId());
- holder.setElement(element);
- adapted.add(holder);
- }
- }
- }
-
- return adapted.toArray(new IAdaptable[adapted.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkingSetElementAdapter#dispose()
- */
- @Override
- public void dispose() {
- }
-
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementHolder.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementHolder.java
deleted file mode 100644
index 0407b777f..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementHolder.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.tcf.te.ui.views.interfaces.workingsets.IWorkingSetNameIDs;
-import org.eclipse.tcf.te.ui.views.workingsets.interfaces.IWorkingSetElement;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPersistableElement;
-
-/**
- * A WorkingSetElementHolder is a place holder for an {@link IWorkingSetElement}. It contains the
- * working set element's id and its working set name that it belongs to. A WorkingSetElementHolder
- * can only belong to one working set, while multiple WorkingSetElementHolder which have a same
- * working set element's id. That means a working set element can be added to multiple working sets
- * at the same time.
- * <p>
- * A WorkingSetElementHolder instance can be persisted and restored by an element factory.
- */
-public final class WorkingSetElementHolder extends PlatformObject implements IPersistableElement {
- // The working set element's id.
- private String elementId;
- // The working set's name that it belongs to.
- private String wsName;
- // The working set element
- private IWorkingSetElement element;
-
- /**
- * Create an empty holder.
- */
- public WorkingSetElementHolder() {
- }
-
- /**
- * Create an holder with a specified working set element's id and and a working set name.
- *
- * @param wsName The working set name.
- * @param elementId The working set element's id.
- */
- public WorkingSetElementHolder(String wsName, String elementId) {
- this.elementId = elementId;
- this.wsName = wsName;
- }
-
- /**
- * Set the working set element's id.
- *
- * @param id The working set element's id.
- */
- public void setElementId(String id) {
- this.elementId = id;
- }
-
- /**
- * Get the working set element's id.
- *
- * @return The working set element's id.
- */
- public String getElementId() {
- return elementId;
- }
-
- /**
- * Set the working set's name.
- *
- * @param name The working set name.
- */
- public void setWorkingSetName(String name) {
- this.wsName = name;
- }
-
- /**
- * Get the working set's name.
- *
- * @return The working set's name.
- */
- public String getWorkingSetName() {
- return wsName;
- }
-
- /**
- * Set the working set element.
- *
- * @param element The working set element.
- */
- public void setElement(IWorkingSetElement element) {
- this.element = element;
- }
-
- /**
- * Get the working set element.
- *
- * @return The working set element.
- */
- public IWorkingSetElement getElement() {
- return element;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPersistableElement#getFactoryId()
- */
- @Override
- public String getFactoryId() {
- return "org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementHolderFactory"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
- */
- @Override
- public void saveState(IMemento memento) {
- memento.putString(IWorkingSetNameIDs.FACTORY_ID, getFactoryId());
- memento.putString(IWorkingSetNameIDs.ATTR_ELEMENTID, elementId);
- memento.putString(IWorkingSetNameIDs.ATTR_WORKINGSET_NAME, wsName);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- @Override
- public Object getAdapter(Class adapter) {
- if (IPersistableElement.class.equals(adapter)) {
- return this;
- }
- if (IWorkingSetElement.class.equals(adapter)) {
- return element;
- }
- return super.getAdapter(adapter);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- if (elementId != null) {
- int hash = elementId.hashCode();
- if (wsName != null) {
- hash = hash << 16;
- hash += wsName.hashCode();
- }
- return hash;
- }
- else if (wsName != null) {
- return wsName.hashCode();
- }
-
- return super.hashCode();
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- // Working set element holder are identical if the element id
- // and working set name matches
- if (obj instanceof WorkingSetElementHolder) {
- boolean equal = true;
-
- if (elementId == null) equal &= ((WorkingSetElementHolder)obj).elementId == null;
- else equal &= elementId.equals(((WorkingSetElementHolder)obj).elementId);
-
- if (wsName == null) equal &= ((WorkingSetElementHolder)obj).wsName == null;
- else equal &= wsName.equals(((WorkingSetElementHolder)obj).wsName);
-
- return equal;
- }
-
- return super.equals(obj);
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementHolderAdapterFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementHolderAdapterFactory.java
deleted file mode 100644
index de247bc6b..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementHolderAdapterFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.tcf.te.ui.views.workingsets.interfaces.IWorkingSetElement;
-
-/**
- * The adapter factory to adapt a working set element holder to a working set element.
- */
-@SuppressWarnings("rawtypes")
-public class WorkingSetElementHolderAdapterFactory implements IAdapterFactory {
- // The adapters.
- private Class[] adapters = { IWorkingSetElement.class };
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- @Override
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adaptableObject instanceof WorkingSetElementHolder) {
- return ((WorkingSetElementHolder) adaptableObject).getAdapter(adapterType);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- @Override
- public Class[] getAdapterList() {
- return adapters;
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementHolderFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementHolderFactory.java
deleted file mode 100644
index 049ac8f7e..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementHolderFactory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.tcf.te.ui.views.interfaces.workingsets.IWorkingSetNameIDs;
-import org.eclipse.ui.IElementFactory;
-import org.eclipse.ui.IMemento;
-
-/**
- * A WorkingSetElementHolderFactory is an element factory used to create a working set element
- * holder from a memento element.
- */
-public class WorkingSetElementHolderFactory implements IElementFactory {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IElementFactory#createElement(org.eclipse.ui.IMemento)
- */
- @Override
- public IAdaptable createElement(IMemento memento) {
- WorkingSetElementHolder holder = new WorkingSetElementHolder();
- String elementId = memento.getString(IWorkingSetNameIDs.ATTR_ELEMENTID);
- holder.setElementId(elementId);
- String workingSetName = memento.getString(IWorkingSetNameIDs.ATTR_WORKINGSET_NAME);
- holder.setWorkingSetName(workingSetName);
- return holder;
- }
-
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementUpdater.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementUpdater.java
deleted file mode 100644
index b3a0269ff..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetElementUpdater.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets;
-
-import java.util.ArrayList;
-import java.util.EventObject;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.tcf.te.ui.views.events.ViewerContentChangeEvent;
-import org.eclipse.tcf.te.runtime.events.EventManager;
-import org.eclipse.tcf.te.ui.events.AbstractEventListener;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetUpdater;
-import org.eclipse.ui.navigator.CommonViewer;
-
-/**
- * Working set element updater implementation.
- */
-public class WorkingSetElementUpdater extends AbstractEventListener implements IWorkingSetUpdater, IExecutableExtension {
- // List of working sets managed by this updater
- private final List<IWorkingSet> workingSets = new ArrayList<IWorkingSet>();
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
- */
- @Override
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- // Register ourself as ViewContentChangeEvent listener
- EventManager.getInstance().addEventListener(this, ViewerContentChangeEvent.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkingSetUpdater#add(org.eclipse.ui.IWorkingSet)
- */
- @Override
- public void add(IWorkingSet workingSet) {
- synchronized (workingSets) {
- workingSets.add(workingSet);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkingSetUpdater#remove(org.eclipse.ui.IWorkingSet)
- */
- @Override
- public boolean remove(IWorkingSet workingSet) {
- synchronized (workingSets) {
- return workingSets.remove(workingSet);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkingSetUpdater#contains(org.eclipse.ui.IWorkingSet)
- */
- @Override
- public boolean contains(IWorkingSet workingSet) {
- synchronized (workingSets) {
- return workingSets.contains(workingSet);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkingSetUpdater#dispose()
- */
- @Override
- public void dispose() {
- synchronized (workingSets) {
- workingSets.clear();
- }
-
- // Remove ourself as event listener
- EventManager.getInstance().removeEventListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.events.IEventListener#eventFired(java.util.EventObject)
- */
- @Override
- public void eventFired(EventObject event) {
- if (!(event instanceof ViewerContentChangeEvent) && !(((ViewerContentChangeEvent)event).getSource() instanceof CommonViewer)) {
- return;
- }
-
- // Create a snapshot of the working sets
- final IWorkingSet[] snapshot;
- synchronized (workingSets) {
- snapshot = workingSets.toArray(new IWorkingSet[workingSets.size()]);
- }
-
- // Update the working sets
- onUpdateWorkingSets((CommonViewer)((ViewerContentChangeEvent)event).getSource(), snapshot);
- }
-
- /**
- * Update the managed working sets based on the content of the given viewer.
- *
- * @param viewer The viewer. Must not be <code>null</code>.
- * @param workingsets The working sets. Must not be <code>null</code>.
- */
- protected void onUpdateWorkingSets(CommonViewer viewer, IWorkingSet[] workingsets) {
- Assert.isNotNull(viewer);
- Assert.isNotNull(workingsets);
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetFilter.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetFilter.java
deleted file mode 100644
index 6eee0dd96..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetFilter.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.tcf.te.ui.views.workingsets.interfaces.IWorkingSetElement;
-import org.eclipse.ui.IContainmentAdapter;
-import org.eclipse.ui.IWorkingSet;
-
-/**
- * The working set filter filters elements from a view that are neither a parent nor
- * children of a working set element.
- */
-public class WorkingSetFilter extends ViewerFilter {
- private boolean active = false;
-
- /**
- * Sets the working set filter active or inactive.
- *
- * @param active <code>True</code> to set the filter active, <code>false</code> to set the filter inactive.
- */
- public final void setActive(boolean active) {
- this.active = active;
- }
-
- /**
- * Determines if an element should be filtered out.
- *
- * @see ViewerFilter#select(Viewer, Object, Object)
- */
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- // If the filter is not active, all elements pass
- if (!active) return true;
-
- // If the parent element is a tree path, assume the last element as parent element
- if (parentElement instanceof TreePath) {
- parentElement = ((TreePath)parentElement).getLastSegment();
- }
-
- if (parentElement instanceof IWorkingSet) {
- if (((IWorkingSet)parentElement).isEmpty()) {
- return true;
- }
- if (element != null) {
- return isEnclosed((IWorkingSet)parentElement, element);
- }
- } else if (parentElement instanceof WorkingSetViewStateManager && element instanceof IWorkingSet) {
- List<IWorkingSet> workingSets = Arrays.asList(((WorkingSetViewStateManager)parentElement).getAllWorkingSets());
- return workingSets.contains(element);
- }
- return true;
- }
-
- /**
- * Returns if the given element is enclosed by a working set element.
- * The IContainmentAdapter of each working set element is used for the
- * containment test. If there is no IContainmentAdapter for a working
- * set element, a simple resource based test is used.
- *
- * @param element The element to test for enclosure by a working set element
- * @return true if element is enclosed by a working set element and false otherwise.
- */
- private boolean isEnclosed(IWorkingSet workingSet, Object element) {
- IAdaptable[] workingSetElements = workingSet.getElements();
-
- for (int i = 0; i < workingSetElements.length; i++) {
- IAdaptable workingSetElement = workingSetElements[i];
- IContainmentAdapter containmentAdapter = (IContainmentAdapter) workingSetElement.getAdapter(IContainmentAdapter.class);
-
- // if there is no IContainmentAdapter defined for the working
- // set element type fall back to using resource based
- // containment check
- if (containmentAdapter != null) {
- if (containmentAdapter.contains(workingSetElement, element,
- IContainmentAdapter.CHECK_CONTEXT
- | IContainmentAdapter.CHECK_IF_CHILD
- | IContainmentAdapter.CHECK_IF_ANCESTOR
- | IContainmentAdapter.CHECK_IF_DESCENDANT)) {
- return true;
- }
- } else if (isEnclosedElement(element, workingSetElement)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns if the given element is enclosed by a working set element.
- * A element is enclosed if it is either a parent of a working set
- * element, a child of a working set element or a working set element
- * itself.
- *
- * @param element The element to test for enclosure by a working set element
- * @param workingSetElement The working set element. Must not be <code>null</code>.
- *
- * @return true if element is enclosed by a working set element and false otherwise.
- */
- private boolean isEnclosedElement(Object element, IAdaptable workingSetElement) {
- Assert.isNotNull(workingSetElement);
-
- if (workingSetElement.equals(element)) {
- return true;
- }
-
- if (element instanceof IWorkingSetElement) {
- IWorkingSetElement wsElement = (IWorkingSetElement) element;
- WorkingSetElementHolder holder = (WorkingSetElementHolder) workingSetElement.getAdapter(WorkingSetElementHolder.class);
- if (holder != null) {
- if (wsElement.equals(holder.getElement())) {
- return true;
- }
- if (wsElement.getElementId().equals(holder.getElementId())) {
- holder.setElement(wsElement);
- return true;
- }
- }
- }
-
- return false;
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetViewStateManager.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetViewStateManager.java
deleted file mode 100644
index c13987db4..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetViewStateManager.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.tcf.te.ui.views.interfaces.workingsets.IWorkingSetIDs;
-import org.eclipse.tcf.te.ui.views.interfaces.workingsets.IWorkingSetNameIDs;
-import org.eclipse.tcf.te.ui.views.internal.View;
-import org.eclipse.tcf.te.ui.views.workingsets.activator.UIPlugin;
-import org.eclipse.tcf.te.ui.views.workingsets.nls.Messages;
-import org.eclipse.ui.IElementFactory;
-import org.eclipse.ui.ILocalWorkingSetManager;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.XMLMemento;
-import org.eclipse.ui.navigator.IMementoAware;
-
-/**
- * The WorkingSetViewStateManager is a state manager used to load and save persisted
- * states from external storage and provide runtime access and modification
- * methods.
- */
-public final class WorkingSetViewStateManager implements IMementoAware {
- // The file used to persist the states used in this plugin.
- private static final String STATES_XML = "states.xml"; //$NON-NLS-1$
-
- // The memento element name id's.
-
- /** The root element of working set manager.*/
- private static final String WORKING_SET_MANAGER = "workingSetManager"; //$NON-NLS-1$
- /** The property name used to save the sorting flag of the working sets.*/
- private static final String SORTED_WORKINGSET = "sortedWorkingSet"; //$NON-NLS-1$
- /** The element used to save the order of the working sets specified by end users.*/
- private static final String WORKINGSET_ORDER = "order"; //$NON-NLS-1$
- /** The root element of visible working sets.*/
- private static final String WORKINGSET_VISIBLE = "visibleWorkingSets"; //$NON-NLS-1$
- /** The working set element. */
- private static final String ELEMENT_WORKINGSET = "workingset"; //$NON-NLS-1$
- /** The attribute to store name. */
- private static final String ATTR_NAME = "name"; //$NON-NLS-1$
-
- // The parent view instance.
- /* default */ View view;
- // The working set manager used.
- /* default */ ILocalWorkingSetManager localWorkingSetManager;
- // If the working set is sorted
- private boolean sortedWorkingSet;
- // The working set comparator used to sort the working set in the order specified by end users.
- private CustomizedOrderComparator workingSetComparator;
- // The list of active (checked) working sets
- private List<IWorkingSet> visibleWorkingSets;
-
- // Workbench wide working set manager property change listener
- private IPropertyChangeListener workingSetManagerListener;
-
- /**
- * Constructor.
- *
- * @param view The parent view instance. Must not be <code>null</code>.
- */
- public WorkingSetViewStateManager(View view) {
- Assert.isNotNull(view);
- this.view = view;
-
- IMemento memento = readWorkingSetMemento();
- restoreState(memento);
-
- initializeListener();
- }
-
- /**
- * Returns the parent view instance.
- *
- * @return The parent view instance.
- */
- public View getParentView() {
- return view;
- }
-
- /**
- * Get the current local working set manager used.
- *
- * @return The current local working set manager.
- */
- public ILocalWorkingSetManager getLocalWorkingSetManager() {
- return localWorkingSetManager;
- }
-
- /**
- * Returns the list of all working sets.
- *
- * @return The list of all working sets or an empty list.
- */
- public IWorkingSet[] getAllWorkingSets() {
- List<IWorkingSet> workingSets = new ArrayList<IWorkingSet>();
-
- // Add the workbench wide working sets (target type only)
- IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager();
- IWorkingSet[] candidates = manager.getAllWorkingSets();
- for (IWorkingSet candidate : candidates) {
- if (!candidate.isAggregateWorkingSet() && IWorkingSetIDs.ID_WS_TARGET.equals(candidate.getId())) {
- if (!workingSets.contains(candidate)) {
- workingSets.add(candidate);
- }
- }
- }
- // Add all local working sets
- candidates = localWorkingSetManager.getAllWorkingSets();
- for (IWorkingSet candidate : candidates) {
- if (!workingSets.contains(candidate)) {
- workingSets.add(candidate);
- }
- }
-
- return workingSets.toArray(new IWorkingSet[workingSets.size()]);
- }
-
- /**
- * Get the visible working sets displayed in the working set viewer.
- * @return The visible working sets in a list.
- */
- public List<IWorkingSet> getVisibleWorkingSets() {
- return visibleWorkingSets;
- }
-
- /**
- * Set the visible working sets with a new working set list.
- * @param visibleWorkingSets The new working set list.
- */
- public void setVisibleWorkingSets(List<IWorkingSet> visibleWorkingSets) {
- this.visibleWorkingSets = visibleWorkingSets;
- }
-
- /**
- * If the current working sets are sorted.
- * @return true if they are sorted.
- */
- public boolean isSortedWorkingSet() {
- return sortedWorkingSet;
- }
-
- /**
- * Set the flag if the current working sets are sorted.
- * @param sortedWorkingSet The new value.
- */
- public void setSortedWorkingSet(boolean sortedWorkingSet) {
- this.sortedWorkingSet = sortedWorkingSet;
- }
-
- /**
- * Get the customized ordered comparator. This comparator is
- * used to sort the working sets when users define the order of the working sets.
- * @return The comparator.
- */
- public CustomizedOrderComparator getWorkingSetComparator() {
- return workingSetComparator;
- }
-
- /**
- * Set the new customized ordered working set comparator.
- *
- * @param workingSetComparator The new comparator.
- */
- public void setWorkingSetComparator(CustomizedOrderComparator workingSetComparator) {
- this.workingSetComparator = workingSetComparator;
- }
-
- /**
- * Dispose the working set view state manager.
- */
- public void dispose() {
- XMLMemento memento = XMLMemento.createWriteRoot(WORKING_SET_MANAGER);
- saveState(memento);
- try {
- writeWorkingSetMemento(memento);
- }
- catch (IOException e) {
- if (Platform.inDebugMode()) e.printStackTrace();
- }
- localWorkingSetManager.dispose();
- if (workingSetManagerListener != null) {
- PlatformUI.getWorkbench().getWorkingSetManager().removePropertyChangeListener(workingSetManagerListener);
- workingSetManagerListener = null;
- }
- }
-
- /**
- * Initialize the working set view state manager listeners.
- */
- private void initializeListener() {
- // Listen to changes to the workbench wide working set manager
- // and trigger view updates on changes.
- workingSetManagerListener = new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- if (IWorkingSetManager.CHANGE_WORKING_SET_ADD.equals(event.getProperty())) {
- // A new working set got added to the manager. Newly added
- // working sets are active (checked) by default.
- IWorkingSet workingSet = (IWorkingSet)event.getNewValue();
- if (workingSet != null) {
- List<IWorkingSet> visible = getVisibleWorkingSets();
- if (!visible.contains(workingSet)) {
- visible.add(workingSet);
- }
- }
- }
- else if (IWorkingSetManager.CHANGE_WORKING_SET_REMOVE.equals(event.getProperty())) {
- // A working set got removed. Remove from the list
- // of visible working sets
- IWorkingSet workingSet = (IWorkingSet)event.getOldValue();
- if (workingSet != null) {
- List<IWorkingSet> visible = getVisibleWorkingSets();
- if (visible.contains(workingSet)) {
- visible.remove(workingSet);
- }
- }
- }
-
- if (view != null && view.getCommonViewer() != null) {
- view.getCommonViewer().refresh();
- }
- }
- };
- PlatformUI.getWorkbench().getWorkingSetManager().addPropertyChangeListener(workingSetManagerListener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.IMementoAware#restoreState(org.eclipse.ui.IMemento)
- */
- @Override
- public void restoreState(IMemento memento) {
- Boolean bool = memento.getBoolean(SORTED_WORKINGSET);
- sortedWorkingSet = bool != null && bool.booleanValue();
- if (!sortedWorkingSet) {
- restoreWorkingSetOrder(memento);
- }
-
- // The local working set manager contains only automatic generated
- // working sets. Do not restore anything from the memento
- localWorkingSetManager = PlatformUI.getWorkbench().createLocalWorkingSetManager();
- // Restore the local automatic working sets
- restoreLocalWorkingSets();
-
- // Restore the active (checked) working sets
- restoreVisibleWorkingSet(memento);
- }
-
- /**
- * Restore the local automatic working sets.
- */
- private void restoreLocalWorkingSets() {
- Assert.isNotNull(localWorkingSetManager);
- // Create the "Others" working set if not restored from the memento
- IWorkingSet others = localWorkingSetManager.getWorkingSet(Messages.ViewStateManager_others_name);
- if (others == null) {
- others = localWorkingSetManager.createWorkingSet(Messages.ViewStateManager_others_name, new IAdaptable[0]);
- others.setId(IWorkingSetIDs.ID_WS_OTHERS);
- localWorkingSetManager.addWorkingSet(others);
- } else {
- others.setId(IWorkingSetIDs.ID_WS_OTHERS);
- }
- }
-
- /**
- * Restore the visible working sets from the specified memento element.
- * @param memento The element.
- */
- private void restoreVisibleWorkingSet(IMemento memento) {
- IMemento vwsMemento = memento.getChild(WORKINGSET_VISIBLE);
- visibleWorkingSets = new ArrayList<IWorkingSet>();
- if (vwsMemento != null) {
- IMemento[] children = vwsMemento.getChildren(ELEMENT_WORKINGSET);
- if (children != null && children.length > 0) {
- IWorkingSet[] allWorkingSets = getAllWorkingSets();
- for (IMemento child : children) {
- String wsName = child.getString(ATTR_NAME);
- for (IWorkingSet workingSet : allWorkingSets) {
- if (wsName.equals(workingSet.getName())) {
- visibleWorkingSets.add(workingSet);
- }
- }
- }
- }
- } else {
- IWorkingSet[] workingSets = getAllWorkingSets();
- for (IWorkingSet workingSet : workingSets) {
- visibleWorkingSets.add(workingSet);
- }
- }
- }
-
- /**
- * Restore the order of working sets specified in the memento element.
- * @param memento The element.
- */
- private void restoreWorkingSetOrder(IMemento memento) {
- IMemento child = memento.getChild(WORKINGSET_ORDER);
- if (child != null) {
- String factoryId = child.getString(IWorkingSetNameIDs.FACTORY_ID);
- IElementFactory factory = PlatformUI.getWorkbench().getElementFactory(factoryId);
- IAdaptable adaptable = factory.createElement(child);
- IPersistableElement element = (IPersistableElement) adaptable.getAdapter(IPersistableElement.class);
- if (element instanceof CustomizedOrderComparator) {
- workingSetComparator = (CustomizedOrderComparator) element;
- }
- }
- }
-
- /**
- * Save the states to the specified memento element.
- */
- @Override
- public void saveState(IMemento memento) {
- memento.putBoolean(SORTED_WORKINGSET, sortedWorkingSet);
- if (!sortedWorkingSet) {
- if (workingSetComparator != null) {
- IMemento child = memento.createChild(WORKINGSET_ORDER);
- child.putString(IWorkingSetNameIDs.FACTORY_ID, workingSetComparator.getFactoryId());
- workingSetComparator.saveState(child);
- }
- }
- IMemento vwsMemento = memento.createChild(WORKINGSET_VISIBLE);
- for (IWorkingSet workingSet : visibleWorkingSets) {
- IMemento child = vwsMemento.createChild(ELEMENT_WORKINGSET);
- child.putString(ATTR_NAME, workingSet.getName());
- }
- }
-
- /**
- * Returns the file used as the persistence store, or <code>null</code> if
- * there is no available file.
- *
- * @return the file used as the persistence store, or <code>null</code>
- */
- private File getStateFile() {
- try {
- IPath path = UIPlugin.getDefault().getStateLocation();
- path = path.append(STATES_XML);
- return path.toFile();
- }catch (IllegalStateException e) {
- // An RCP workspace-less environment (-data @none)
- File root = new File(System.getProperty("user.home"), ".tcf"); //$NON-NLS-1$ //$NON-NLS-2$
- File ws = new File(root, "ws"); //$NON-NLS-1$
- return new File(ws, STATES_XML);
- }
- }
-
- /**
- * Read the working set memento element from the state file.
- * @return The working set memento.
- */
- private IMemento readWorkingSetMemento() {
- File stateFile = getStateFile();
- if (stateFile != null && stateFile.exists()) {
- BufferedReader reader = null;
- try {
- FileInputStream input = new FileInputStream(stateFile);
- reader = new BufferedReader(new InputStreamReader(input, "utf-8")); //$NON-NLS-1$
- IMemento memento = XMLMemento.createReadRoot(reader);
- return memento;
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- if (reader != null) {
- try {
- reader.close();
- } catch (Exception e) {
- }
- }
- }
- }
- return XMLMemento.createWriteRoot(WORKING_SET_MANAGER);
- }
-
- /**
- * Write working set memento to the state file.
- * @param memento The working set memento.
- * @throws IOException thrown when writing fails.
- */
- private void writeWorkingSetMemento(XMLMemento memento) throws IOException {
- File stateFile = getStateFile();
- FileOutputStream stream = new FileOutputStream(stateFile);
- OutputStreamWriter writer = new OutputStreamWriter(stream, "utf-8"); //$NON-NLS-1$
- memento.save(writer);
- writer.close();
- }
-
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetViewerSorter.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetViewerSorter.java
deleted file mode 100644
index 6f7b28b1e..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetViewerSorter.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.tcf.te.ui.trees.TreeViewerSorter;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.internal.WorkingSetComparator;
-import org.eclipse.ui.navigator.CommonViewer;
-
-/**
- * Working set viewer sorter implementation.
- */
-@SuppressWarnings("restriction")
-public class WorkingSetViewerSorter extends TreeViewerSorter {
- private final WorkingSetComparator wsComparator = new WorkingSetComparator();
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.trees.TreeViewerSorter#doCompare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object, java.lang.String, int, int)
- */
- @Override
- protected int doCompare(Viewer viewer, Object node1, Object node2, String sortColumn, int index, int inverter) {
- if (node1 instanceof IWorkingSet && node2 instanceof IWorkingSet) {
- WorkingSetViewStateManager manager = null;
- if (viewer instanceof CommonViewer && ((CommonViewer)viewer).getCommonNavigator() != null) {
- manager = (WorkingSetViewStateManager)Platform.getAdapterManager().getAdapter(((CommonViewer)viewer).getCommonNavigator(), WorkingSetViewStateManager.class);
- }
- if (manager != null) {
- if (manager.isSortedWorkingSet()) return wsComparator.compare(node1, node2);
- CustomizedOrderComparator comparator = manager.getWorkingSetComparator();
- if (comparator != null) return comparator.compare((IWorkingSet)node1, (IWorkingSet)node2);
- }
-
- }
- return super.doCompare(viewer, node1, node2, sortColumn, index, inverter);
- }
-
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetsContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetsContentProvider.java
deleted file mode 100644
index 4d0277d66..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetsContentProvider.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.tcf.te.runtime.events.EventManager;
-import org.eclipse.tcf.te.ui.views.events.ViewerContentChangeEvent;
-import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.tcf.te.ui.views.interfaces.workingsets.IWorkingSetIDs;
-import org.eclipse.tcf.te.ui.views.internal.ViewRoot;
-import org.eclipse.tcf.te.ui.views.workingsets.activator.UIPlugin;
-import org.eclipse.tcf.te.ui.views.workingsets.interfaces.IWorkingSetElement;
-import org.eclipse.tcf.te.ui.views.workingsets.nls.Messages;
-import org.eclipse.ui.ILocalWorkingSetManager;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.navigator.NavigatorContentService;
-import org.eclipse.ui.internal.navigator.NavigatorFilterService;
-import org.eclipse.ui.navigator.CommonNavigator;
-import org.eclipse.ui.navigator.CommonViewer;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonContentProvider;
-import org.eclipse.ui.navigator.IExtensionStateModel;
-import org.eclipse.ui.navigator.INavigatorFilterService;
-
-/**
- * Provides children and parents for IWorkingSets.
- * <p>
- * Copied and adapted from <code>org.eclipse.ui.internal.navigator.workingsets.WorkingSetContentProvider</code>.
- */
-@SuppressWarnings("restriction")
-public class WorkingSetsContentProvider implements ICommonContentProvider {
-
- /**
- * The extension id for the WorkingSet extension.
- */
- public static final String EXTENSION_ID = "org.eclipse.tcf.te.ui.views.navigator.content.workingSets"; //$NON-NLS-1$
-
- /**
- * A key used by the Extension State Model to keep track of whether top level Working Sets or
- * Elements should be shown in the viewer.
- */
- public static final String SHOW_TOP_LEVEL_WORKING_SETS = EXTENSION_ID + ".showTopLevelWorkingSets"; //$NON-NLS-1$
-
- /**
- * Working set filter extension id.
- */
- private static final String WORKING_SET_FILTER_ID = "org.eclipse.tcf.te.ui.views.navigator.filters.workingSet"; //$NON-NLS-1$
-
- /**
- * Child elements returned by this content provider in case there
- * are no children.
- */
- private static final Object[] NO_CHILDREN = new Object[0];
-
- // The common navigator working set content extension state model.
- private IExtensionStateModel extensionStateModel;
- // The parent viewer object
- private CommonViewer viewer;
- // The working set filter instance
- private WorkingSetFilter filter;
-
- /**
- * The root mode listener listens to property changes of the working set content
- * extension state model to update the viewer root mode if the user changes the
- * top level element type.
- */
- private IPropertyChangeListener rootModeListener = new IPropertyChangeListener() {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- @SuppressWarnings("synthetic-access")
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- if (SHOW_TOP_LEVEL_WORKING_SETS.equals(event.getProperty())) {
- updateRootMode(true);
- }
- }
- };
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.ICommonContentProvider#init(org.eclipse.ui.navigator.ICommonContentExtensionSite)
- */
- @Override
- public void init(ICommonContentExtensionSite config) {
- NavigatorContentService cs = (NavigatorContentService) config.getService();
- if (!(cs.getViewer() instanceof CommonViewer)) return;
-
- viewer = (CommonViewer) cs.getViewer();
-
- // Get the filter service to activate the working set viewer filter
- INavigatorFilterService filterService = cs.getFilterService();
- // The working set filter should be among the visible filters
- ViewerFilter[] filters = filterService.getVisibleFilters(false);
- for (ViewerFilter candidate : filters) {
- if (candidate instanceof WorkingSetFilter) {
- filter = (WorkingSetFilter)candidate;
- }
- }
-
- if (filter != null && !filterService.isActive(WORKING_SET_FILTER_ID)) {
- if (filterService instanceof NavigatorFilterService) {
- NavigatorFilterService navFilterService = (NavigatorFilterService)filterService;
- navFilterService.addActiveFilterIds(new String[] { WORKING_SET_FILTER_ID });
- navFilterService.updateViewer();
- }
- }
- else if (filter == null) {
- IStatus status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(),
- "Required filter " + WORKING_SET_FILTER_ID //$NON-NLS-1$
- + " is not present. Working set support will not function correctly."); //$NON-NLS-1$
- UIPlugin.getDefault().getLog().log(status);
- }
-
- extensionStateModel = config.getExtensionStateModel();
- extensionStateModel.addPropertyChangeListener(rootModeListener);
-
- updateRootMode(false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.IMementoAware#restoreState(org.eclipse.ui.IMemento)
- */
- @Override
- public void restoreState(IMemento memento) {
- // Determine the view local working set manager instance
- WorkingSetViewStateManager mng = (WorkingSetViewStateManager)Platform.getAdapterManager().getAdapter(viewer.getCommonNavigator(), WorkingSetViewStateManager.class);
- ILocalWorkingSetManager manager = mng != null ? mng.getLocalWorkingSetManager() : null;
-
- // Recreate the local automatic working sets
- if (manager != null) {
- // Create the "Others" working set if not restored from the memento
- IWorkingSet others = manager.getWorkingSet(Messages.ViewStateManager_others_name);
- if (others == null) {
- others = manager.createWorkingSet(Messages.ViewStateManager_others_name, new IAdaptable[0]);
- others.setId(IWorkingSetIDs.ID_WS_OTHERS);
- manager.addWorkingSet(others);
- } else {
- others.setId(IWorkingSetIDs.ID_WS_OTHERS);
- }
- }
-
- // Trigger an update of the "Others" working set
- ViewerContentChangeEvent event = new ViewerContentChangeEvent(viewer, ViewerContentChangeEvent.REFRESH);
- EventManager.getInstance().fireEvent(event);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.IMementoAware#saveState(org.eclipse.ui.IMemento)
- */
- @Override
- public void saveState(IMemento memento) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
- @Override
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof IWorkingSet) {
- // Return the working set elements
- return getWorkingSetElements((IWorkingSet)parentElement);
- }
- else if (parentElement instanceof WorkingSetViewStateManager) {
- List<IWorkingSet> workingSets = ((WorkingSetViewStateManager)parentElement).getVisibleWorkingSets();
- if (workingSets != null && !workingSets.isEmpty()) {
- return workingSets.toArray();
- }
- }
-
- return NO_CHILDREN;
- }
-
- /* default */ IAdaptable[] getWorkingSetElements(IWorkingSet workingSet) {
- Assert.isNotNull(workingSet);
- List<IAdaptable> elements = new ArrayList<IAdaptable>();
- for (IAdaptable candidate : workingSet.getElements()) {
- if (candidate instanceof WorkingSetElementHolder) {
- WorkingSetElementHolder holder = (WorkingSetElementHolder)candidate;
- IWorkingSetElement element = holder.getElement();
- // If the element is null, try to look up the element through the content provider
- if (element == null) {
- List<Object> elementCandidates = new ArrayList<Object>();
- ITreeContentProvider provider = (ITreeContentProvider)viewer.getContentProvider();
- Object[] viewElements = provider.getElements(ViewRoot.getInstance());
- for (Object viewElement : viewElements) {
- if (viewElement instanceof ICategory) {
- elementCandidates.addAll(Arrays.asList(provider.getChildren(viewElement)));
- } else {
- elementCandidates.add(viewElement);
- }
- }
- provider.dispose();
-
- for (Object elementCandidate : elementCandidates) {
- if (elementCandidate instanceof IWorkingSetElement && ((IWorkingSetElement)elementCandidate).getElementId().equals(holder.getElementId())) {
- holder.setElement((IWorkingSetElement)elementCandidate);
- element = holder.getElement();
- break;
- }
- }
- }
- if (element != null) elements.add(element);
- } else {
- elements.add(candidate);
- }
- }
- return elements.toArray(new IAdaptable[elements.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
- @Override
- public Object getParent(Object element) {
- CommonNavigator navigator = viewer != null ? viewer.getCommonNavigator() : null;
- WorkingSetViewStateManager manager = navigator != null ? (WorkingSetViewStateManager)Platform.getAdapterManager().getAdapter(navigator, WorkingSetViewStateManager.class) : null;
-
- if (element instanceof IWorkingSet) {
- List<IWorkingSet> allWorkingSets = manager != null ? Arrays.asList(manager.getAllWorkingSets()) : new ArrayList<IWorkingSet>();
- if (allWorkingSets.contains(element)) {
- return manager;
- }
- }
- else if (element instanceof WorkingSetElementHolder) {
- String wsName = ((WorkingSetElementHolder)element).getWorkingSetName();
- if (wsName != null) {
- IWorkingSet ws = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(wsName);
- if (ws == null && manager != null) {
- ws = manager.getLocalWorkingSetManager().getWorkingSet(wsName);
- }
- return ws;
- }
- }
- else if (element instanceof IWorkingSetElement) {
- if (navigator != null) {
- if (navigator.getRootMode() == IUIConstants.MODE_WORKING_SETS) {
- IWorkingSet[] workingSets = PlatformUI.getWorkbench().getWorkingSetManager().getAllWorkingSets();
- List<IWorkingSet> list = new ArrayList<IWorkingSet>();
- list.addAll(Arrays.asList(workingSets));
- ILocalWorkingSetManager wsManager = manager != null ? manager.getLocalWorkingSetManager() : null;
- workingSets = wsManager != null ? wsManager.getAllWorkingSets() : new IWorkingSet[0];
- list.addAll(Arrays.asList(workingSets));
- for (IWorkingSet workingSet : list) {
- IAdaptable[] wsElements = getWorkingSetElements(workingSet);
- for (IAdaptable wsElement : wsElements) {
- if (wsElement == element) return workingSet;
- }
- }
- }
- }
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- @Override
- public boolean hasChildren(Object element) {
- if (element instanceof IWorkingSet) {
- return ((IWorkingSet)element).getElements().length > 0;
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
- */
- @Override
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- @Override
- public void dispose() {
- if (extensionStateModel != null) extensionStateModel.removePropertyChangeListener(rootModeListener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- /**
- * Update the common navigator root mode.
- */
- private void updateRootMode(boolean updateInput) {
- CommonNavigator navigator = viewer.getCommonNavigator();
- if (navigator == null) return;
-
- Object newInput;
- boolean filterActive;
- if (extensionStateModel.getBooleanProperty(SHOW_TOP_LEVEL_WORKING_SETS)) {
- navigator.setRootMode(IUIConstants.MODE_WORKING_SETS);
- newInput = Platform.getAdapterManager().getAdapter(navigator, WorkingSetViewStateManager.class);
- filterActive = true;
- }
- else {
- navigator.setRootMode(IUIConstants.MODE_NORMAL);
- newInput = ViewRoot.getInstance();
- filterActive = false;
- }
-
- if (updateInput && !newInput.equals(viewer.getInput())) {
- viewer.setInput(newInput);
- }
- setFilterActive(filterActive);
- }
-
- /**
- * Update the working set viewer filter active state.
- */
- private void setFilterActive(boolean active) {
- if (filter != null) filter.setActive(active);
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetsLabelProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetsLabelProvider.java
deleted file mode 100644
index de1b75a74..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/WorkingSetsLabelProvider.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * Provides a text label and icon for Working Sets.
- * <p>
- * Copied and adapted from <code>org.eclipse.ui.internal.navigator.workingsets.WorkingSetLabelProvider</code>.
- */
-public class WorkingSetsLabelProvider extends LabelProvider {
-
- private WorkbenchLabelProvider labelProvider = new WorkbenchLabelProvider();
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- @Override
- public Image getImage(Object element) {
- if (element instanceof IWorkingSet) return labelProvider.getImage(element);
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- @Override
- public String getText(Object element) {
- if (element instanceof IWorkingSet) return ((IWorkingSet) element).getLabel();
- return null;
- }
-
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/actions/ConfigureWorkingSetAction.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/actions/ConfigureWorkingSetAction.java
deleted file mode 100644
index 345194c5c..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/actions/ConfigureWorkingSetAction.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets.actions;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.tcf.te.ui.views.interfaces.workingsets.IWorkingSetIDs;
-import org.eclipse.tcf.te.ui.views.workingsets.CustomizedOrderComparator;
-import org.eclipse.tcf.te.ui.views.workingsets.WorkingSetViewStateManager;
-import org.eclipse.tcf.te.ui.views.workingsets.dialogs.WorkingSetConfigurationDialog;
-import org.eclipse.tcf.te.ui.views.workingsets.nls.Messages;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.navigator.CommonViewer;
-
-/**
- * Configure working sets action implementation.
- */
-public class ConfigureWorkingSetAction extends Action {
- // The parent viewer instance.
- private StructuredViewer viewer;
-
- /**
- * Constructor.
- *
- * @param view The parent viewer instance. Must not be <code>null</code>.
- */
- public ConfigureWorkingSetAction(StructuredViewer viewer) {
- super(Messages.ConfigureWorkingSetAction_text);
- setToolTipText(Messages.ConfigureWorkingSetAction_toolTip);
-
- Assert.isNotNull(viewer);
- this.viewer = viewer;
- }
-
- /**
- * Duplicate the specified working sets and return a working set list for editing.
- *
- * @param workingSets The working sets
- * @return A duplication list of the working sets.
- */
- private List<IWorkingSet> duplicate(IWorkingSet[] workingSets) {
- IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
- List<IWorkingSet> result = new ArrayList<IWorkingSet>();
- for (IWorkingSet workingSet : workingSets) {
- // Local automatic working sets are not editable
- // -> no need to create a duplicate
- if (isLocalWorkingSet(workingSet)) {
- result.add(workingSet);
- } else {
- IWorkingSet newWorkingSet = workingSetManager.createWorkingSet(workingSet.getName(), workingSet.getElements());
- newWorkingSet.setId(workingSet.getId());
- result.add(newWorkingSet);
- }
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- @Override
- public void run() {
- // Get the view working set state manager
- WorkingSetViewStateManager manager = (WorkingSetViewStateManager)Platform.getAdapterManager().getAdapter(((CommonViewer)viewer).getCommonNavigator(), WorkingSetViewStateManager.class);
- // Get the workbench wide working set manager
- IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
-
- // Get all working sets (both local and workbench wide, target explorer type only)
- IWorkingSet[] allWorkingSets = manager.getAllWorkingSets();
- // Create working copies of the (sorted) working sets
- List<IWorkingSet> workingSets = duplicate(allWorkingSets);
-
- // Determine the active (checked) working sets
- List<IWorkingSet> visibleWorkingSets = manager.getVisibleWorkingSets();
- IWorkingSet[] activeWorkingSets = visibleWorkingSets.toArray(new IWorkingSet[visibleWorkingSets.size()]);
-
- // Sort the working sets if necessary
- boolean sortedWorkingSets = manager.isSortedWorkingSet();
- if (!sortedWorkingSets) {
- Comparator<IWorkingSet> workingSetComparator = manager.getWorkingSetComparator();
- if (workingSetComparator != null) Collections.sort(workingSets, workingSetComparator);
- }
-
- // Create the working set configuration dialog
- WorkingSetConfigurationDialog dialog = new WorkingSetConfigurationDialog(workingSetManager,
- viewer.getControl().getShell(),
- workingSets.toArray(new IWorkingSet[workingSets.size()]),
- sortedWorkingSets);
- // Set the active working sets
- dialog.setSelection(activeWorkingSets);
- // And open the dialog
- if (dialog.open() == IDialogConstants.OK_ID) {
- // Remember the current list of recently used working sets
- IWorkingSet[] mruWorkingSets = workingSetManager.getRecentWorkingSets();
- // Remove the old working set instances (non-local only)
- for (IWorkingSet workingSet : allWorkingSets) {
- if (!isLocalWorkingSet(workingSet)) {
- workingSetManager.removeWorkingSet(workingSet);
- }
- }
- // Get the new working set list from the dialog
- allWorkingSets = dialog.getAllWorkingSets();
- // And add the working sets back to the manager (non-local only)
- for (IWorkingSet workingSet : allWorkingSets) {
- if (!isLocalWorkingSet(workingSet)) {
- workingSetManager.addWorkingSet(workingSet);
- }
- // If the working set existed in the recently used working set list,
- // restore it
- if (exists(workingSet.getName(), mruWorkingSets)) {
- workingSetManager.addRecentWorkingSet(workingSet);
- }
- }
-
- // Update the sorted state
- sortedWorkingSets = dialog.isSortingEnabled();
- manager.setSortedWorkingSet(sortedWorkingSets);
- if (!sortedWorkingSets) {
- CustomizedOrderComparator comparator = new CustomizedOrderComparator(allWorkingSets);
- manager.setWorkingSetComparator(comparator);
- }
-
- // Update the active (checked) working set list
- IWorkingSet[] selection = dialog.getSelection();
- List<IWorkingSet> list = new ArrayList<IWorkingSet>(Arrays.asList(selection));
- manager.setVisibleWorkingSets(list);
-
- // Trigger a viewer refresh to reflect the changes
- viewer.refresh();
- }
- }
-
- /**
- * Determine if the given working set is a local working set and therefore
- * managed by the local working set manager.
- *
- * @param workingSet The working set. Must not be <code>null</code>.
- * @return <code>True</code> if the working set is a local working set, <code>false</code> otherwise.
- */
- private boolean isLocalWorkingSet(IWorkingSet workingSet) {
- Assert.isNotNull(workingSet);
-
- boolean isLocal = IWorkingSetIDs.ID_WS_OTHERS.equals(workingSet.getId());
-
- return isLocal;
- }
-
- /**
- * Judge if the working set with the specified name exists in the working set array.
- *
- * @param wsname The name of the working set.
- * @param workingSets The working set array to be searched.
- * @return true if a working set with the specified name exists.
- */
- private boolean exists(String wsname, IWorkingSet[] workingSets) {
- for (IWorkingSet workingSet : workingSets) {
- if (wsname.equals(workingSet.getName())) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/actions/WorkingSetActionGroup.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/actions/WorkingSetActionGroup.java
deleted file mode 100644
index 918a7e490..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/actions/WorkingSetActionGroup.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ContributionItem;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.tcf.te.ui.views.workingsets.WorkingSetsContentProvider;
-import org.eclipse.tcf.te.ui.views.workingsets.activator.UIPlugin;
-import org.eclipse.tcf.te.ui.views.workingsets.interfaces.ImageConsts;
-import org.eclipse.tcf.te.ui.views.workingsets.nls.Messages;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.ui.navigator.CommonViewer;
-import org.eclipse.ui.navigator.IExtensionStateModel;
-
-/**
- * Provides the radio buttons at the top of the view menu that control the root of the Target
- * Explorer, which is either working sets or targets. When the state is changed through the
- * actions, the WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS property in the extension
- * state model is updated.
- *
- * This is installed by the WorkingSetActionProvider.
- *
- * <p>
- * Copied and adapted from <code>org.eclipse.ui.internal.navigator.resources.actions.WorkingSetRootModeActionGroup</code>.
- */
-public class WorkingSetActionGroup extends ActionGroup {
- private static final String WS_GROUP = "group.ws"; //$NON-NLS-1$
-
- /* default */ IExtensionStateModel stateModel;
- /* default */ StructuredViewer viewer;
-
- private boolean hasContributedToViewMenu = false;
- private IAction workingSetsAction = null;
- private IAction elementsAction = null;
- /* default */ IAction[] actions;
- /* default */ int currentSelection;
- /* default */ MenuItem[] items;
-
- /**
- * Toggle action switching the top elements between working sets and elements.
- */
- private class TopLevelContentAction extends Action {
- // If true, the action does enable working set top elements.
- private final boolean showWorkingSets;
-
- /**
- * Constructor
- *
- * @param showWorkingSets If <code>true</code>, the action does enable working sets as top level elements,
- * <code>false</code> to disable working sets as top level elements.
- */
- public TopLevelContentAction(boolean toGroupWorkingSets) {
- super("", AS_RADIO_BUTTON); //$NON-NLS-1$
- showWorkingSets = toGroupWorkingSets;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- @SuppressWarnings("restriction")
- @Override
- public void run() {
- boolean isShowTopLevelWorkingSets = stateModel.getBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS);
- if (isShowTopLevelWorkingSets != showWorkingSets) {
- // Toggle the "show working set top level elements" property.
- //
- // This will trigger the WorkingSetsContentProvider property change listener
- // to update the view root mode.
- stateModel.setBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS, showWorkingSets);
-
- // Disable the viewer redraw, refresh the viewer, reset
- // the frame list and enable redraw finally.
- viewer.getControl().setRedraw(false);
- try {
- viewer.refresh();
- if (viewer instanceof CommonViewer) {
- ((CommonViewer)viewer).getFrameList().reset();
- }
- }
- finally {
- viewer.getControl().setRedraw(true);
- }
- }
- }
- }
-
- /**
- * Create an action group that will listen to the stateModel and update the structuredViewer
- * when necessary.
- *
- * @param viewer
- * @param stateModel
- */
- public WorkingSetActionGroup(StructuredViewer viewer, IExtensionStateModel stateModel) {
- super();
- this.viewer = viewer;
- this.stateModel = stateModel;
- }
-
- /* (non-Javadoc)
- * @see ActionGroup#fillActionBars(IActionBars)
- */
- @Override
- public void fillActionBars(IActionBars actionBars) {
- if (hasContributedToViewMenu) return;
- IMenuManager topLevelSubMenu = new MenuManager(Messages.WorkingSetActionGroup_Top_Level_Element);
- addActions(topLevelSubMenu);
-
- IMenuManager manager = actionBars.getMenuManager();
- manager.insertBefore(IWorkbenchActionConstants.MB_ADDITIONS, new GroupMarker(WS_GROUP));
- manager.appendToGroup(WS_GROUP, topLevelSubMenu);
- manager.appendToGroup(WS_GROUP, new Separator());
- manager.appendToGroup(WS_GROUP, new ConfigureWorkingSetAction(viewer));
- hasContributedToViewMenu = true;
- }
-
- /**
- * Adds the actions to the given menu manager.
- */
- protected void addActions(IMenuManager viewMenu) {
- if (actions == null) actions = createActions();
-
- viewMenu.add(new Separator());
- items = new MenuItem[actions.length];
-
- for (int i = 0; i < actions.length; i++) {
- final int j = i;
-
- viewMenu.add(new ContributionItem() {
-
- @Override
- public void fill(Menu menu, int index) {
-
- int style = SWT.CHECK;
- if ((actions[j].getStyle() & IAction.AS_RADIO_BUTTON) != 0) style = SWT.RADIO;
-
- final MenuItem mi = new MenuItem(menu, style, index);
- items[j] = mi;
- mi.setText(actions[j].getText());
- mi.setSelection(currentSelection == j);
- mi.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (currentSelection == j) {
- items[currentSelection].setSelection(true);
- return;
- }
- actions[j].run();
-
- // Update checked state
- items[currentSelection].setSelection(false);
- currentSelection = j;
- items[currentSelection].setSelection(true);
- }
-
- });
-
- }
-
- @Override
- public boolean isDynamic() {
- return false;
- }
- });
- }
- }
-
- @SuppressWarnings("restriction")
- private IAction[] createActions() {
-
- elementsAction = new TopLevelContentAction(false);
- elementsAction.setText(Messages.WorkingSetActionGroup_Elements);
- elementsAction.setImageDescriptor(org.eclipse.tcf.te.ui.views.activator.UIPlugin.getImageDescriptor(org.eclipse.tcf.te.ui.views.interfaces.ImageConsts.VIEW));
-
- workingSetsAction = new TopLevelContentAction(true);
- workingSetsAction.setText(Messages.WorkingSetActionGroup_Working_Set);
- workingSetsAction.setImageDescriptor(UIPlugin.getImageDescriptor(ImageConsts.WORKING_SETS));
-
- return new IAction[] { elementsAction, workingSetsAction };
- }
-
- /**
- * Toggle whether top level working sets should be displayed as a group or collapse to just show
- * their contents.
- *
- * @param showTopLevelWorkingSets
- */
- public void setShowTopLevelWorkingSets(boolean showTopLevelWorkingSets) {
- if (actions == null) actions = createActions();
-
- currentSelection = showTopLevelWorkingSets ? 1 : 0;
- workingSetsAction.setChecked(showTopLevelWorkingSets);
- elementsAction.setChecked(!showTopLevelWorkingSets);
-
- if (items != null) {
- for (int i = 0; i < items.length; i++) {
- if (items[i] != null && actions[i] != null) {
- items[i].setSelection(actions[i].isChecked());
- }
- }
- }
- if (stateModel != null) {
- stateModel.setBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS, showTopLevelWorkingSets);
- }
- }
-
- /**
- * @param stateModel
- */
- public void setStateModel(IExtensionStateModel stateModel) {
- this.stateModel = stateModel;
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/actions/WorkingSetActionProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/actions/WorkingSetActionProvider.java
deleted file mode 100644
index 0f92a14fc..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/actions/WorkingSetActionProvider.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets.actions;
-
-import org.eclipse.tcf.te.ui.views.interfaces.IPersistableExpandingState;
-import org.eclipse.tcf.te.ui.views.workingsets.WorkingSetsContentProvider;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.CommonActionProvider;
-import org.eclipse.ui.navigator.CommonViewer;
-import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.IExtensionActivationListener;
-import org.eclipse.ui.navigator.IExtensionStateModel;
-import org.eclipse.ui.navigator.INavigatorContentService;
-
-/**
- * Working set action provider implementation.
- */
-public class WorkingSetActionProvider extends CommonActionProvider {
- // Mark if the contribution items have been added to the menu
- private boolean contributedToViewMenu = false;
-
- /* default */ CommonViewer viewer;
- /* default */ INavigatorContentService contentService;
- /* default */ WorkingSetActionGroup workingSetActionGroup;
- /* default */ IExtensionStateModel extensionStateModel;
-
- private IExtensionActivationListener activationListener = new IExtensionActivationListener() {
-
- @Override
- public void onExtensionActivation(String viewerId, String[] extensionIds, boolean isActive) {
-
- for (int i = 0; i < extensionIds.length; i++) {
- if (WorkingSetsContentProvider.EXTENSION_ID.equals(extensionIds[i])) {
- if (isActive) {
- extensionStateModel = contentService.findStateModel(WorkingSetsContentProvider.EXTENSION_ID);
- workingSetActionGroup.setStateModel(extensionStateModel);
- } else {
- workingSetActionGroup.setShowTopLevelWorkingSets(false);
- }
- }
- }
- }
-
- };
-
- @Override
- public void init(ICommonActionExtensionSite site) {
- viewer = (CommonViewer) site.getStructuredViewer();
- contentService = site.getContentService();
-
- extensionStateModel = contentService.findStateModel(WorkingSetsContentProvider.EXTENSION_ID);
-
- workingSetActionGroup = new WorkingSetActionGroup(viewer, extensionStateModel);
-
- contentService.getActivationService().addExtensionActivationListener(activationListener);
- }
-
- @Override
- public void restoreState(final IMemento memento) {
- super.restoreState(memento);
-
- // Need to run this asynchronous to avoid being reentered when processing a selection change
- viewer.getControl().getShell().getDisplay().asyncExec(new Runnable() {
- @Override
- public void run() {
- boolean showWorkingSets = true;
- if (memento != null) {
- Integer showWorkingSetsInt = memento.getInteger(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS);
- showWorkingSets = showWorkingSetsInt == null || showWorkingSetsInt.intValue() == 1;
- extensionStateModel.setBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS, showWorkingSets);
- workingSetActionGroup.setShowTopLevelWorkingSets(showWorkingSets);
- // Restore the expanded state only after the working set mode is set!
- IPersistableExpandingState state = (IPersistableExpandingState)viewer.getCommonNavigator().getAdapter(IPersistableExpandingState.class);
- if(state != null) {
- state.restoreExpandingState(memento);
- }
- } else {
- showWorkingSets = false;
-
- extensionStateModel.setBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS, showWorkingSets);
- workingSetActionGroup.setShowTopLevelWorkingSets(showWorkingSets);
- }
- }
- });
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonActionProvider#saveState(org.eclipse.ui.IMemento)
- */
- @Override
- public void saveState(IMemento memento) {
- super.saveState(memento);
-
- if (memento != null) {
- int showWorkingSets = extensionStateModel.getBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS) ? 1 : 0;
- memento.putInteger(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS, showWorkingSets);
- // Save the expanding state of the common viewer.
- IPersistableExpandingState state = (IPersistableExpandingState)viewer.getCommonNavigator().getAdapter(IPersistableExpandingState.class);
- if (state != null) {
- state.saveExpandingState(memento);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars)
- */
- @Override
- public void fillActionBars(IActionBars actionBars) {
- if (!contributedToViewMenu) {
- try {
- super.fillActionBars(actionBars);
- workingSetActionGroup.fillActionBars(actionBars);
- } finally {
- contributedToViewMenu = true;
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.ActionGroup#dispose()
- */
- @Override
- public void dispose() {
- super.dispose();
- workingSetActionGroup.dispose();
- contentService.getActivationService().removeExtensionActivationListener(activationListener);
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/activator/UIPlugin.java
deleted file mode 100644
index d8e25304d..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/activator/UIPlugin.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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.views.workingsets.activator;
-
-import java.net.URL;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.tcf.te.runtime.tracing.TraceHandler;
-import org.eclipse.tcf.te.ui.views.workingsets.interfaces.ImageConsts;
-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 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 plugin.
- */
- public static String getUniqueIdentifier() {
- if (getDefault() != null && getDefault().getBundle() != null) {
- return getDefault().getBundle().getSymbolicName();
- }
- return null;
- }
-
- /**
- * 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;
- traceHandler = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
- */
- @Override
- protected void initializeImageRegistry(ImageRegistry registry) {
- URL url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OBJ + "workingset.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.WORKING_SET, ImageDescriptor.createFromURL(url));
- url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OBJ + "workingsets.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.WORKING_SETS, ImageDescriptor.createFromURL(url));
- }
-
- /**
- * 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/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/dialogs/WorkingSetConfigurationDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/dialogs/WorkingSetConfigurationDialog.java
deleted file mode 100644
index 744aeca87..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/dialogs/WorkingSetConfigurationDialog.java
+++ /dev/null
@@ -1,598 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets.dialogs;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.tcf.te.ui.views.interfaces.workingsets.IWorkingSetIDs;
-import org.eclipse.tcf.te.ui.views.workingsets.nls.Messages;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.dialogs.IWorkingSetEditWizard;
-import org.eclipse.ui.dialogs.IWorkingSetNewWizard;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.internal.WorkingSetComparator;
-
-/**
- * The working set configuration dialog used to edit the working set content and order.
- *
- * <p>
- * Copied and adapted from <code>org.eclipse.cdt.internal.ui.WorkingSetConfigurationDialog</code>.
- */
-@SuppressWarnings("restriction")
-public class WorkingSetConfigurationDialog extends SelectionDialog {
-
- private static class WorkingSetLabelProvider extends LabelProvider {
- private Map<ImageDescriptor, Image> fIcons;
-
- public WorkingSetLabelProvider() {
- fIcons = new Hashtable<ImageDescriptor, Image>();
- }
-
- @Override
- public void dispose() {
- Iterator<Image> iterator = fIcons.values().iterator();
- while (iterator.hasNext()) {
- Image icon = iterator.next();
- icon.dispose();
- }
- super.dispose();
- }
-
- @Override
- public Image getImage(Object object) {
- Assert.isTrue(object instanceof IWorkingSet);
- IWorkingSet workingSet = (IWorkingSet) object;
- ImageDescriptor imageDescriptor = workingSet.getImageDescriptor();
- if (imageDescriptor == null) return null;
- Image icon = fIcons.get(imageDescriptor);
- if (icon == null) {
- icon = imageDescriptor.createImage();
- fIcons.put(imageDescriptor, icon);
- }
- return icon;
- }
-
- @Override
- public String getText(Object object) {
- Assert.isTrue(object instanceof IWorkingSet);
- IWorkingSet workingSet = (IWorkingSet) object;
- return workingSet.getName();
- }
- }
-
- List<IWorkingSet> fAllWorkingSets;
- CheckboxTableViewer fTableViewer;
-
- Button fNewButton;
- Button fEditButton;
- Button fRemoveButton;
- Button fUpButton;
- Button fDownButton;
- Button fSelectAll;
- Button fDeselectAll;
- IWorkingSetManager workingSetManager;
- /**
- * Sort working sets button.
- *
- * @since 3.5
- */
- Button fSortWorkingSet;
-
- IWorkingSet[] fResult;
-
- int nextButtonId = IDialogConstants.CLIENT_ID + 1;
-
- /**
- * Value of sorted state of working sets.
- *
- * @since 3.5
- */
- boolean fIsSortingEnabled;
-
- /**
- * The working set comparator.
- *
- * @since 3.5
- */
- WorkingSetComparator fComparator;
-
- public WorkingSetConfigurationDialog(IWorkingSetManager workingSetManager, Shell parentShell, IWorkingSet[] allWorkingSets, boolean isSortingEnabled) {
- super(parentShell);
- this.workingSetManager = workingSetManager;
- setTitle(Messages.WorkingSetConfigurationDialog_title);
- setMessage(Messages.WorkingSetConfigurationDialog_message);
- fAllWorkingSets = new ArrayList<IWorkingSet>(allWorkingSets.length);
- for (int i = 0; i < allWorkingSets.length; i++) {
- fAllWorkingSets.add(allWorkingSets[i]);
- }
- fIsSortingEnabled = isSortingEnabled;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- }
-
- /**
- * Returns the selected working sets
- *
- * @return the selected working sets
- */
- public IWorkingSet[] getSelection() {
- return fResult;
- }
-
- /**
- * Sets the initial selection
- *
- * @param workingSets the initial selection
- */
- public void setSelection(IWorkingSet[] workingSets) {
- fResult = workingSets;
- setInitialSelections(workingSets);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Control createContents(Composite parent) {
- Control control = super.createContents(parent);
- setInitialSelection();
- updateButtonAvailability();
- return control;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
-
- createMessageArea(composite);
- Composite inner = new Composite(composite, SWT.NONE);
- inner.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- inner.setLayout(layout);
- createTableViewer(inner);
- createOrderButtons(inner);
- createModifyButtons(composite);
- if (fIsSortingEnabled) {
- fTableViewer.setComparator(new ViewerComparator(getComparator()) {
- /*
- * @see ViewerComparator#compare(Viewer, Object, Object)
- * @since 3.5
- */
- @Override
- public int compare(Viewer viewer, Object e1, Object e2) {
- return getComparator().compare(e1, e2);
- }
- });
- }
- fTableViewer.setInput(fAllWorkingSets);
- applyDialogFont(composite);
-
- return composite;
- }
-
- private void createTableViewer(Composite parent) {
- fTableViewer = CheckboxTableViewer.newCheckList(parent, SWT.BORDER | SWT.MULTI);
- fTableViewer.addCheckStateListener(new ICheckStateListener() {
- @Override
- public void checkStateChanged(CheckStateChangedEvent event) {
- updateButtonAvailability();
- }
- });
- GridData data = new GridData(GridData.FILL_BOTH);
- data.heightHint = convertHeightInCharsToPixels(20);
- data.widthHint = convertWidthInCharsToPixels(50);
- fTableViewer.getTable().setLayoutData(data);
-
- fTableViewer.setLabelProvider(new WorkingSetLabelProvider());
- fTableViewer.setContentProvider(new ArrayContentProvider());
- fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- handleSelectionChanged();
- }
- });
- fTableViewer.addDoubleClickListener(new IDoubleClickListener() {
- @Override
- public void doubleClick(DoubleClickEvent event) {
- if (fEditButton.isEnabled()) editSelectedWorkingSet();
- }
- });
- }
-
- private void createModifyButtons(Composite composite) {
- Composite buttonComposite = new Composite(composite, SWT.RIGHT);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- buttonComposite.setLayout(layout);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL);
- data.grabExcessHorizontalSpace = true;
- composite.setData(data);
-
- fNewButton = createButton(buttonComposite, nextButtonId++, Messages.WorkingSetConfigurationDialog_new_label, false);
- fNewButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- createWorkingSet();
- }
- });
-
- fEditButton = createButton(buttonComposite, nextButtonId++, Messages.WorkingSetConfigurationDialog_edit_label, false);
- fEditButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- editSelectedWorkingSet();
- }
- });
-
- fRemoveButton = createButton(buttonComposite, nextButtonId++, Messages.WorkingSetConfigurationDialog_remove_label, false);
- fRemoveButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- removeSelectedWorkingSets();
- }
- });
- }
-
- private void createOrderButtons(Composite parent) {
- Composite buttons = new Composite(parent, SWT.NONE);
- buttons.setLayoutData(new GridData(GridData.FILL_VERTICAL));
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- buttons.setLayout(layout);
-
- fUpButton = new Button(buttons, SWT.PUSH);
- fUpButton.setText(Messages.WorkingSetConfigurationDialog_up_label);
- setButtonLayoutData(fUpButton);
- fUpButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- moveUp(((IStructuredSelection) fTableViewer.getSelection()).toList());
- }
- });
-
- fDownButton = new Button(buttons, SWT.PUSH);
- fDownButton.setText(Messages.WorkingSetConfigurationDialog_down_label);
- setButtonLayoutData(fDownButton);
- fDownButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- moveDown(((IStructuredSelection) fTableViewer.getSelection()).toList());
- }
- });
-
- fSelectAll = new Button(buttons, SWT.PUSH);
- fSelectAll.setText(Messages.WorkingSetConfigurationDialog_selectAll_label);
- setButtonLayoutData(fSelectAll);
- fSelectAll.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectAll();
- }
- });
-
- fDeselectAll = new Button(buttons, SWT.PUSH);
- fDeselectAll.setText(Messages.WorkingSetConfigurationDialog_deselectAll_label);
- setButtonLayoutData(fDeselectAll);
- fDeselectAll.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- deselectAll();
- }
- });
- /**
- * A check box that has persistence to sort the working sets alphabetically in the
- * WorkingSetConfigurationDialog. It restores the unsorted order of the working sets when
- * unchecked.
- *
- * @since 3.5
- */
- fSortWorkingSet = new Button(parent, SWT.CHECK);
- fSortWorkingSet.setText(Messages.WorkingSetConfigurationDialog_sort_working_sets);
- fSortWorkingSet.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, true, false));
- fSortWorkingSet.setSelection(fIsSortingEnabled);
- fSortWorkingSet.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- fIsSortingEnabled = fSortWorkingSet.getSelection();
- if (fIsSortingEnabled) {
- fTableViewer.setComparator(new ViewerComparator(getComparator()) {
- /*
- * @see ViewerComparator#compare(Viewer, Object, Object)
- * @since 3.5
- */
- @Override
- public int compare(Viewer viewer, Object e1, Object e2) {
- return getComparator().compare(e1, e2);
- }
- });
- }
- else {
- fTableViewer.setComparator(null);
- }
- updateButtonAvailability();
- }
- });
- }
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("unchecked")
- @Override
- protected void okPressed() {
- List<IWorkingSet> newResult = getResultWorkingSets();
- fResult = newResult.toArray(new IWorkingSet[newResult.size()]);
- if (fIsSortingEnabled) {
- Collections.sort(fAllWorkingSets, getComparator());
- }
- setResult(newResult);
- super.okPressed();
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- private List<IWorkingSet> getResultWorkingSets() {
- Object[] checked = fTableViewer.getCheckedElements();
- return new ArrayList(Arrays.asList(checked));
- }
-
- private void setInitialSelection() {
- List<Object[]> selections = getInitialElementSelections();
- if (!selections.isEmpty()) {
- fTableViewer.setCheckedElements(selections.toArray());
- }
- }
-
- void createWorkingSet() {
- IWorkingSetNewWizard wizard = workingSetManager.createWorkingSetNewWizard(new String[] { IWorkingSetIDs.ID_WS_TARGET });
- // the wizard can't be null since we have at least the Java working set.
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- if (dialog.open() == Window.OK) {
- IWorkingSet workingSet = wizard.getSelection();
- fAllWorkingSets.add(workingSet);
- fTableViewer.add(workingSet);
- fTableViewer.setSelection(new StructuredSelection(workingSet), true);
- fTableViewer.setChecked(workingSet, true);
- }
- }
-
- void editSelectedWorkingSet() {
- IWorkingSet editWorkingSet = (IWorkingSet) ((IStructuredSelection) fTableViewer
- .getSelection()).getFirstElement();
- IWorkingSetEditWizard wizard = workingSetManager.createWorkingSetEditWizard(editWorkingSet);
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- if (dialog.open() == Window.OK) {
- editWorkingSet = wizard.getSelection();
- if (fIsSortingEnabled) fTableViewer.refresh();
- else fTableViewer.update(editWorkingSet, null);
-
- // make sure ok button is enabled when the selected working set
- // is edited. Fixes bug 33386.
- updateButtonAvailability();
- }
- }
-
- /**
- * Called when the selection has changed.
- */
- void handleSelectionChanged() {
- updateButtonAvailability();
- }
-
- /**
- * Removes the selected working sets from the workbench.
- */
- void removeSelectedWorkingSets() {
- ISelection selection = fTableViewer.getSelection();
- if (selection instanceof IStructuredSelection) {
- Iterator<?> iter = ((IStructuredSelection) selection).iterator();
- while (iter.hasNext()) {
- IWorkingSet workingSet = (IWorkingSet) iter.next();
- fAllWorkingSets.remove(workingSet);
- }
- fTableViewer.remove(((IStructuredSelection) selection).toArray());
- }
- }
-
- /**
- * Updates the modify buttons' enabled state based on the current seleciton.
- */
- void updateButtonAvailability() {
- IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
- boolean hasSelection = !selection.isEmpty();
- boolean hasSingleSelection = selection.size() == 1;
-
- fRemoveButton.setEnabled(hasSelection && areAllEditable(selection));
- fEditButton.setEnabled(hasSingleSelection && ((IWorkingSet) selection.getFirstElement())
- .isEditable());
- if (fUpButton != null) {
- fUpButton.setEnabled(canMoveUp());
- }
- if (fDownButton != null) {
- fDownButton.setEnabled(canMoveDown());
- }
- }
-
- private boolean areAllEditable(IStructuredSelection selection) {
- for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
- IWorkingSet workingSet = (IWorkingSet) iter.next();
- if (!workingSet.isEditable()) return false;
- }
- return true;
- }
-
- void moveUp(List<IWorkingSet> toMoveUp) {
- if (toMoveUp.size() > 0) {
- setElements(moveUp(fAllWorkingSets, toMoveUp));
- fTableViewer.reveal(toMoveUp.get(0));
- }
- }
-
- void moveDown(List<IWorkingSet> toMoveDown) {
- if (toMoveDown.size() > 0) {
- setElements(reverse(moveUp(reverse(fAllWorkingSets), toMoveDown)));
- fTableViewer.reveal(toMoveDown.get(toMoveDown.size() - 1));
- }
- }
-
- private void setElements(List<IWorkingSet> elements) {
- fAllWorkingSets = elements;
- fTableViewer.setInput(fAllWorkingSets);
- updateButtonAvailability();
- }
-
- private List<IWorkingSet> moveUp(List<IWorkingSet> elements, List<IWorkingSet> move) {
- int nElements = elements.size();
- List<IWorkingSet> res = new ArrayList<IWorkingSet>(nElements);
- IWorkingSet floating = null;
- for (int i = 0; i < nElements; i++) {
- IWorkingSet curr = elements.get(i);
- if (move.contains(curr)) {
- res.add(curr);
- }
- else {
- if (floating != null) {
- res.add(floating);
- }
- floating = curr;
- }
- }
- if (floating != null) {
- res.add(floating);
- }
- return res;
- }
-
- private List<IWorkingSet> reverse(List<IWorkingSet> p) {
- List<IWorkingSet> reverse = new ArrayList<IWorkingSet>(p.size());
- for (int i = p.size() - 1; i >= 0; i--) {
- reverse.add(p.get(i));
- }
- return reverse;
- }
-
- private boolean canMoveUp() {
- if (!fIsSortingEnabled) {
- int[] indc = fTableViewer.getTable().getSelectionIndices();
- for (int i = 0; i < indc.length; i++) {
- if (indc[i] != i) {
- return true;
- }
- }
- }
- return false;
- }
-
- private boolean canMoveDown() {
- if (!fIsSortingEnabled) {
- int[] indc = fTableViewer.getTable().getSelectionIndices();
- int k = fAllWorkingSets.size() - 1;
- for (int i = indc.length - 1; i >= 0; i--, k--) {
- if (indc[i] != k) {
- return true;
- }
- }
- }
- return false;
- }
-
- // ---- select / deselect --------------------------------------------------
-
- void selectAll() {
- fTableViewer.setAllChecked(true);
- }
-
- void deselectAll() {
- fTableViewer.setAllChecked(false);
- }
-
- /**
- * Returns whether sorting is enabled for working sets.
- *
- * @return <code>true</code> if sorting is enabled, <code>false</code> otherwise
- * @since 3.5
- */
- public boolean isSortingEnabled() {
- return fIsSortingEnabled;
- }
-
- /**
- * Returns the working set comparator.
- *
- * @return the working set comparator
- * @since 3.5
- */
- WorkingSetComparator getComparator() {
- if (fComparator == null) {
- fComparator = new WorkingSetComparator();
- }
- return fComparator;
- }
-
- /**
- * Returns all the working sets.
- *
- * @return all the working sets
- * @since 3.7
- */
- public IWorkingSet[] getAllWorkingSets() {
- return fAllWorkingSets.toArray(new IWorkingSet[fAllWorkingSets.size()]);
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/interfaces/IWorkingSetElement.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/interfaces/IWorkingSetElement.java
deleted file mode 100644
index f06834c47..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/interfaces/IWorkingSetElement.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.workingsets.interfaces;
-
-import org.eclipse.core.runtime.IAdaptable;
-
-/**
- * Interface to be implemented by root elements contributed to the
- * Target Explorer tree view which can be added to a working set as
- * root element.
- */
-public interface IWorkingSetElement extends IAdaptable {
-
- /**
- * Returns the working set element id.
- * <p>
- * The working set element id must be unique and persisted through out multiple session. This id
- * is used to identify the working set element at restarting the Target Explorer after a session
- * shutdown.
- *
- * @return The working set element id.
- */
- public String getElementId();
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/interfaces/ImageConsts.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/interfaces/ImageConsts.java
deleted file mode 100644
index 18050cb85..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/interfaces/ImageConsts.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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.views.workingsets.interfaces;
-
-/**
- * Image registry constants.
- */
-public interface ImageConsts {
-
- // ***** The directory structure constants *****
-
- /**
- * The root directory where to load the images from, relative to
- * the bundle directory.
- */
- public final static String IMAGE_DIR_ROOT = "icons/"; //$NON-NLS-1$
-
- /**
- * The directory where to load view related images from, relative to
- * the image root directory.
- */
- public final static String IMAGE_DIR_EVIEW = "eview16/"; //$NON-NLS-1$
-
- /**
- * The directory where to load enabled toolbar images from,
- * relative to the image root directory.
- */
- public final static String IMAGE_DIR_ETOOL = "etool16/"; //$NON-NLS-1$
-
- /**
- * The directory where to load model object images from,
- * relative to the image root directory.
- */
- public final static String IMAGE_DIR_OBJ = "obj16/"; //$NON-NLS-1$
-
- // ***** The image constants *****
-
- /**
- * The key to access the working sets image.
- */
- public static final String WORKING_SETS = "WorkingSets"; //$NON-NLS-1$
-
- /**
- * The key to access the working set image.
- */
- public static final String WORKING_SET = "WorkingSet"; //$NON-NLS-1$
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/internal/adapters/AdapterFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/internal/adapters/AdapterFactory.java
deleted file mode 100644
index 879618b71..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/internal/adapters/AdapterFactory.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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.views.workingsets.internal.adapters;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.tcf.te.ui.views.internal.View;
-import org.eclipse.tcf.te.ui.views.workingsets.WorkingSetViewStateManager;
-
-/**
- * Adapter factory implementation.
- */
-public class AdapterFactory implements IAdapterFactory {
- // Maintain a map of view state manager adapters per view instance
- /* default */ Map<View, WorkingSetViewStateManager> adapters = new HashMap<View, WorkingSetViewStateManager>();
-
- private static final Class<?>[] CLASSES = new Class[] {
- WorkingSetViewStateManager.class
- };
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- @Override
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adaptableObject instanceof View) {
- if (WorkingSetViewStateManager.class.equals(adapterType)) {
- // Lookup the adapter
- WorkingSetViewStateManager adapter = adapters.get(adaptableObject);
- // No adapter yet -> create a new one for this view
- if (adapter == null) {
- adapter = new WorkingSetViewStateManager((View)adaptableObject);
- adapters.put((View)adaptableObject, adapter);
- }
- return adapter;
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- @Override
- public Class[] getAdapterList() {
- return CLASSES;
- }
-
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/internal/preferences/IPreferenceConsts.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/internal/preferences/IPreferenceConsts.java
deleted file mode 100644
index 93a2c4ec8..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/internal/preferences/IPreferenceConsts.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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.views.workingsets.internal.preferences;
-
-/**
- * The constants for the preferences used in working sets support.
- */
-public interface IPreferenceConsts {
- /**
- * Preference key to access the flag to hide working sets content extension.
- */
- public static final String PREF_HIDE_WORKING_SETS_EXTENSION = "org.eclipse.tcf.te.ui.views.navigator.content.workingSets.hide"; //$NON-NLS-1$
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/internal/preferences/PreferencesInitializer.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/internal/preferences/PreferencesInitializer.java
deleted file mode 100644
index 075e11d59..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/internal/preferences/PreferencesInitializer.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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.views.workingsets.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.tcf.te.ui.views.workingsets.activator.UIPlugin;
-
-
-/**
- * The bundle's preference initializer implementation.
- */
-public class PreferencesInitializer extends AbstractPreferenceInitializer implements IPreferenceConsts {
- /**
- * Constructor.
- */
- public PreferencesInitializer() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- @Override
- public void initializeDefaultPreferences() {
- IPreferenceStore preferenceStore = UIPlugin.getDefault().getPreferenceStore();
- preferenceStore.setDefault(PREF_HIDE_WORKING_SETS_EXTENSION, true);
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/nls/Messages.java
deleted file mode 100644
index a63c0d532..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/nls/Messages.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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.views.workingsets.nls;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Target Explorer UI plugin 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.views.workingsets.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 WorkingSetActionProvider_multipleWorkingSets;
-
- public static String WorkingSetActionGroup_Top_Level_Element;
- public static String WorkingSetActionGroup_Elements;
- public static String WorkingSetActionGroup_Working_Set;
-
- public static String ViewStateManager_others_name;
-
- public static String ConfigureWorkingSetAction_text;
- public static String ConfigureWorkingSetAction_toolTip;
-
- public static String TargetWorkingSetPage_workingSet_name;
- public static String TargetWorkingSetPage_workspace_content;
- public static String TargetWorkingSetPage_add_button;
- public static String TargetWorkingSetPage_addAll_button;
- public static String TargetWorkingSetPage_remove_button;
- public static String TargetWorkingSetPage_removeAll_button;
- public static String TargetWorkingSetPage_workingSet_content;
- public static String TargetWorkingSetPage_warning_nameWhitespace;
- public static String TargetWorkingSetPage_warning_nameMustNotBeEmpty;
- public static String TargetWorkingSetPage_warning_workingSetExists;
- public static String TargetWorkingSetPage_warning_resourceMustBeChecked;
- public static String TargetWorkingSetPage_title;
- public static String TargetWorkingSetPage_workingSet_description;
-
- public static String WorkingSetConfigurationDialog_down_label;
- public static String WorkingSetConfigurationDialog_up_label;
- public static String WorkingSetConfigurationDialog_title;
- public static String WorkingSetConfigurationDialog_selectAll_label;
- public static String WorkingSetConfigurationDialog_edit_label;
- public static String WorkingSetConfigurationDialog_message;
- public static String WorkingSetConfigurationDialog_deselectAll_label;
- public static String WorkingSetConfigurationDialog_new_label;
- public static String WorkingSetConfigurationDialog_sort_working_sets;
- public static String WorkingSetConfigurationDialog_remove_label;
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/nls/Messages.properties
deleted file mode 100644
index 902172968..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/nls/Messages.properties
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# org.eclipse.tcf.te.ui.views
-# Externalized Strings.
-#
-
-# ***** Action Provider *****
-
-WorkingSetActionProvider_multipleWorkingSets=Multiple Working Sets
-
-WorkingSetActionGroup_Top_Level_Element=&Top Level Elements
-WorkingSetActionGroup_Elements=Elements
-WorkingSetActionGroup_Working_Set=Working Sets
-
-ViewStateManager_others_name=Other
-
-ConfigureWorkingSetAction_text=Configure Working Sets...
-ConfigureWorkingSetAction_toolTip=Configure Working Sets...
-
-# ***** Command Handler *****
-
-# ***** Wizard and Dialog Pages *****
-
-TargetWorkingSetPage_warning_nameMustNotBeEmpty=The name must not be empty.
-TargetWorkingSetPage_workingSet_name=&Working set name\:
-TargetWorkingSetPage_workingSet_description=Enter a working set name and select the working set elements.
-TargetWorkingSetPage_removeAll_button=\ <- R&emove All
-TargetWorkingSetPage_remove_button=<- &Remove
-TargetWorkingSetPage_workspace_content=A&vailable targets\:
-TargetWorkingSetPage_workingSet_content=Working set &content\:
-TargetWorkingSetPage_add_button=&Add ->
-TargetWorkingSetPage_warning_workingSetExists=A working set with that name already exists.
-TargetWorkingSetPage_warning_resourceMustBeChecked=No resources selected.
-TargetWorkingSetPage_addAll_button=A&dd All ->
-TargetWorkingSetPage_title=Target Working Set
-TargetWorkingSetPage_warning_nameWhitespace=The name must not have leading or trailing whitespace.
-
-WorkingSetConfigurationDialog_down_label=&Down
-WorkingSetConfigurationDialog_up_label=&Up
-WorkingSetConfigurationDialog_title=Configure Working Sets
-WorkingSetConfigurationDialog_selectAll_label=Select &All
-WorkingSetConfigurationDialog_edit_label=&Edit...
-WorkingSetConfigurationDialog_message=Select and sort &working sets visible in System Management\:
-WorkingSetConfigurationDialog_deselectAll_label=Dese&lect All
-WorkingSetConfigurationDialog_new_label=&New...
-WorkingSetConfigurationDialog_sort_working_sets=&Sort working sets
-WorkingSetConfigurationDialog_remove_label=&Remove
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/pages/AbstractWorkingSetWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/pages/AbstractWorkingSetWizardPage.java
deleted file mode 100644
index 61a953aa5..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/pages/AbstractWorkingSetWizardPage.java
+++ /dev/null
@@ -1,535 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * William Chen (Wind River) [354578] Add support for working sets
- *******************************************************************************/
-package org.eclipse.tcf.te.ui.views.workingsets.pages;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-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.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementHolder;
-import org.eclipse.tcf.te.ui.views.workingsets.interfaces.IWorkingSetElement;
-import org.eclipse.tcf.te.ui.views.workingsets.nls.Messages;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.IWorkingSetPage;
-
-/**
- * A tree viewer on the left is used to show the workspace content, a table viewer on the right is
- * used to show the working set content. Buttons to move content from right to left and vice versa
- * are available between the two viewers. A text field allows to set/change the working sets name.
- * <p>
- * Copied and adapted from <code>org.eclipse.jdt.internal.ui.workingsets.AbstractWorkingSetWizardPage</code>.
- */
-public abstract class AbstractWorkingSetWizardPage extends WizardPage implements IWorkingSetPage {
-
- final class AddedElementsFilter extends ViewerFilter {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- return !selectedElements.contains(element);
- }
-
- }
-
- /* default */ Text workingSetNameControl;
- /* default */ TreeViewer tree;
- /* default */ TableViewer table;
- /* default */ ITreeContentProvider treeContentProvider;
-
- /* default */ boolean firstCheck;
- /* default */ final HashSet<Object> selectedElements;
- /* default */ IWorkingSet workingSet;
-
- /**
- * Constructor.
- *
- * @param pageName
- * @param title
- * @param titleImage
- */
- protected AbstractWorkingSetWizardPage(String pageName, String title, ImageDescriptor titleImage) {
- super(pageName, title, titleImage);
-
- selectedElements = new HashSet<Object>();
- firstCheck = true;
- }
-
- /**
- * Returns the page id as specified in the extension point.
- *
- * @return the page id
- */
- protected abstract String getPageId();
-
- /**
- * Configure the tree viewer used on the left side of the dialog.
- *
- * Implementors must set:
- * <ul>
- * <li>The content provider</li>
- * <li>The label provider</li>
- * <li>The viewers input</li>
- * </ul>
- * They may also set:
- * <ul>
- * <li>The viewer comparator</li>
- * <li>Any viewer filter</li>
- * <li>The selection</li>
- * </ul>
- *
- * @param tree
- * the tree to configure
- */
- protected abstract void configureTree(TreeViewer tree);
-
- /**
- * Configure the table viewer used on the right side of the dialog.
- *
- * Implementors must set:
- * <ul>
- * <li>The label provider</li>
- * </ul>
- * They may also set:
- * <ul>
- * <li>The viewer comparator</li>
- * </ul>
- * They must not set:
- * <ul>
- * <li>The viewers content provider</li>
- * <li>The viewers input</li>
- * <li>Any viewer filter</li>
- * </ul>
- *
- * @param table
- * the table to configure
- */
- protected abstract void configureTable(TableViewer table);
-
- /**
- * Returns the elements which are shown in the table initially. Return an
- * empty array if the table should be empty. The given working set is the
- * working set which will be configured by this dialog, or <b>null</b> if it
- * does not yet exist.
- *
- * @param workingSet
- * the working set to configure or <b>null</b> if not yet exist
- * @return the elements to show in the table
- */
- protected abstract Object[] getInitialWorkingSetElements(IWorkingSet workingSet);
-
- /*
- * @see
- * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
- * .Composite)
- */
- @Override
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
-
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- setControl(composite);
-
- Label label = new Label(composite, SWT.WRAP);
- label.setText(Messages.TargetWorkingSetPage_workingSet_name);
- GridData gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
- label.setLayoutData(gd);
-
- workingSetNameControl = new Text(composite, SWT.SINGLE | SWT.BORDER);
- workingSetNameControl.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
- workingSetNameControl.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- validateInput();
- }
- });
-
- Composite leftCenterRightComposite = new Composite(composite, SWT.NONE);
- GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- gridData.heightHint = convertHeightInCharsToPixels(20);
- leftCenterRightComposite.setLayoutData(gridData);
- GridLayout gridLayout = new GridLayout(3, false);
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- leftCenterRightComposite.setLayout(gridLayout);
-
- Composite leftComposite = new Composite(leftCenterRightComposite, SWT.NONE);
- gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- gridData.widthHint = convertWidthInCharsToPixels(40);
- leftComposite.setLayoutData(gridData);
- gridLayout = new GridLayout(1, false);
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- leftComposite.setLayout(gridLayout);
-
- Composite centerComposite = new Composite(leftCenterRightComposite, SWT.NONE);
- gridLayout = new GridLayout(1, false);
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- centerComposite.setLayout(gridLayout);
- centerComposite.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false, false));
-
- Composite rightComposite = new Composite(leftCenterRightComposite, SWT.NONE);
- gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- gridData.widthHint = convertWidthInCharsToPixels(40);
- rightComposite.setLayoutData(gridData);
- gridLayout = new GridLayout(1, false);
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- rightComposite.setLayout(gridLayout);
-
- createTree(leftComposite);
- createTable(rightComposite);
-
- if (workingSet != null)
- workingSetNameControl.setText(workingSet.getName());
-
- initializeSelectedElements();
- validateInput();
-
- table.setInput(selectedElements);
- table.refresh(true);
- tree.refresh(true);
-
- createButtonBar(centerComposite);
-
- workingSetNameControl.setFocus();
- workingSetNameControl.setSelection(0, workingSetNameControl.getText().length());
-
- Dialog.applyDialogFont(composite);
- }
-
- private void createTree(Composite parent) {
-
- Label label = new Label(parent, SWT.NONE);
- label.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, false, false));
- label.setText(Messages.TargetWorkingSetPage_workspace_content);
-
- tree = new TreeViewer(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
- tree.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- tree.addFilter(new AddedElementsFilter());
- tree.setUseHashlookup(true);
-
- configureTree(tree);
-
- treeContentProvider = (ITreeContentProvider) tree.getContentProvider();
- }
-
- private void createButtonBar(Composite parent) {
- Label spacer = new Label(parent, SWT.NONE);
- spacer.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
- final Button addButton = new Button(parent, SWT.PUSH);
- addButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- addButton.setText(Messages.TargetWorkingSetPage_add_button);
- addButton.setEnabled(!tree.getSelection().isEmpty());
-
- final Button addAllButton = new Button(parent, SWT.PUSH);
- addAllButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- addAllButton.setText(Messages.TargetWorkingSetPage_addAll_button);
- addAllButton.setEnabled(tree.getTree().getItems().length > 0);
-
- final Button removeButton = new Button(parent, SWT.PUSH);
- removeButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- removeButton.setText(Messages.TargetWorkingSetPage_remove_button);
- removeButton.setEnabled(!table.getSelection().isEmpty());
-
- final Button removeAllButton = new Button(parent, SWT.PUSH);
- removeAllButton.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false, false));
- removeAllButton.setText(Messages.TargetWorkingSetPage_removeAll_button);
- removeAllButton.setEnabled(!selectedElements.isEmpty());
-
- tree.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- addButton.setEnabled(!event.getSelection().isEmpty());
- }
- });
-
- addButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- addTreeSelection();
-
- removeAllButton.setEnabled(true);
- addAllButton.setEnabled(tree.getTree().getItems().length > 0);
- }
- });
-
- tree.addDoubleClickListener(new IDoubleClickListener() {
- @Override
- public void doubleClick(DoubleClickEvent event) {
- addTreeSelection();
-
- removeAllButton.setEnabled(true);
- addAllButton.setEnabled(tree.getTree().getItems().length > 0);
- }
- });
-
- table.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- removeButton.setEnabled(!event.getSelection().isEmpty());
- }
- });
-
- removeButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- removeTableSelection();
-
- addAllButton.setEnabled(true);
- removeAllButton.setEnabled(!selectedElements.isEmpty());
- }
- });
-
- table.addDoubleClickListener(new IDoubleClickListener() {
- @Override
- public void doubleClick(DoubleClickEvent event) {
- removeTableSelection();
-
- addAllButton.setEnabled(true);
- removeAllButton.setEnabled(!selectedElements.isEmpty());
- }
- });
-
- addAllButton.addSelectionListener(new SelectionAdapter() {
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected(SelectionEvent e) {
- TreeItem[] items = tree.getTree().getItems();
- for (int i = 0; i < items.length; i++) {
- selectedElements.add(items[i].getData());
- }
- table.refresh();
- tree.refresh();
-
- addAllButton.setEnabled(false);
- removeAllButton.setEnabled(true);
- }
- });
-
- removeAllButton.addSelectionListener(new SelectionAdapter() {
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectedElements.clear();
-
- table.refresh();
- tree.refresh();
-
- removeAllButton.setEnabled(false);
- addAllButton.setEnabled(true);
- }
- });
-
- }
-
- /**
- * Moves selected elements in the tree into the table
- */
- void addTreeSelection() {
- IStructuredSelection selection = (IStructuredSelection) tree.getSelection();
- selectedElements.addAll(selection.toList());
- Object[] selectedElements = selection.toArray();
- table.add(selectedElements);
- tree.remove(selectedElements);
- table.setSelection(selection);
- table.getControl().setFocus();
- validateInput();
- }
-
- /**
- * Moves the selected elements in the table into the tree
- */
- void removeTableSelection() {
- IStructuredSelection selection = (IStructuredSelection) table.getSelection();
- selectedElements.removeAll(selection.toList());
- Object[] selectedElements = selection.toArray();
- table.remove(selectedElements);
- try {
- tree.getTree().setRedraw(false);
- for (int i = 0; i < selectedElements.length; i++) {
- tree.refresh(treeContentProvider.getParent(selectedElements[i]), true);
- }
- } finally {
- tree.getTree().setRedraw(true);
- }
- tree.setSelection(selection);
- tree.getControl().setFocus();
- validateInput();
- }
-
- private void createTable(Composite parent) {
- Label label = new Label(parent, SWT.WRAP);
- label.setText(Messages.TargetWorkingSetPage_workingSet_content);
- label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
- table = new TableViewer(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
-
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- table.getControl().setLayoutData(gd);
-
- table.setUseHashlookup(true);
-
- configureTable(table);
-
- table.setContentProvider(new IStructuredContentProvider() {
-
- @Override
- public Object[] getElements(Object inputElement) {
- return selectedElements.toArray();
- }
-
- @Override
- public void dispose() {
- }
-
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- });
- }
-
- /*
- * Implements method from IWorkingSetPage
- */
- @Override
- public IWorkingSet getSelection() {
- return workingSet;
- }
-
- /*
- * Implements method from IWorkingSetPage
- */
- @Override
- public void setSelection(IWorkingSet workingSet) {
- Assert.isNotNull(workingSet, "Working set must not be null"); //$NON-NLS-1$
- this.workingSet = workingSet;
- if (getContainer() != null && getShell() != null && workingSetNameControl != null) {
- firstCheck = false;
- workingSetNameControl.setText(workingSet.getName());
- initializeSelectedElements();
- validateInput();
- }
- }
-
- /*
- * Implements method from IWorkingSetPage
- */
- @Override
- public void finish() {
- String workingSetName = workingSetNameControl.getText();
-
- List<IAdaptable> elements = new ArrayList<IAdaptable>();
- for (Object candidate : selectedElements) {
- if (candidate instanceof IWorkingSetElement) {
- WorkingSetElementHolder holder = new WorkingSetElementHolder(workingSetName, ((IWorkingSetElement)candidate).getElementId());
- holder.setElement((IWorkingSetElement)candidate);
- elements.add(holder);
- }
- }
-
- if (workingSet == null) {
- IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
- workingSet = workingSetManager.createWorkingSet(workingSetName, elements.toArray(new IAdaptable[elements.size()]));
- workingSet.setId(getPageId());
- } else {
- workingSet.setName(workingSetName);
- workingSet.setElements(elements.toArray(new IAdaptable[elements.size()]));
- }
- }
-
- void validateInput() {
- String errorMessage = null;
- String infoMessage = null;
- String newText = workingSetNameControl.getText();
-
- if (newText.equals(newText.trim()) == false)
- errorMessage = Messages.TargetWorkingSetPage_warning_nameWhitespace;
- if (newText.equals("")) { //$NON-NLS-1$
- if (firstCheck) {
- setPageComplete(false);
- firstCheck = false;
- return;
- }
- errorMessage = Messages.TargetWorkingSetPage_warning_nameMustNotBeEmpty;
- }
-
- firstCheck = false;
-
- if (errorMessage == null && (workingSet == null || newText.equals(workingSet.getName()) == false)) {
- IWorkingSet[] workingSets = PlatformUI.getWorkbench().getWorkingSetManager().getAllWorkingSets();
- for (int i = 0; i < workingSets.length; i++) {
- if (newText.equals(workingSets[i].getName())) {
- errorMessage = Messages.TargetWorkingSetPage_warning_workingSetExists;
- }
- }
- }
-
- if (!hasSelectedElement())
- infoMessage = Messages.TargetWorkingSetPage_warning_resourceMustBeChecked;
-
- setMessage(infoMessage, INFORMATION);
- setErrorMessage(errorMessage);
- setPageComplete(errorMessage == null);
- }
-
- private boolean hasSelectedElement() {
- return !selectedElements.isEmpty();
- }
-
- private void initializeSelectedElements() {
- selectedElements.addAll(Arrays.asList(getInitialWorkingSetElements(workingSet)));
- }
-
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/pages/TargetWorkingSetPage.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/pages/TargetWorkingSetPage.java
deleted file mode 100644
index 28822ef65..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views.workingsets/src/org/eclipse/tcf/te/ui/views/workingsets/pages/TargetWorkingSetPage.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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:
- * William Chen (Wind River) [354578] Add support for working sets
- *******************************************************************************/
-package org.eclipse.tcf.te.ui.views.workingsets.pages;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.tcf.te.ui.trees.TreeArrayContentProvider;
-import org.eclipse.tcf.te.ui.views.ViewsUtil;
-import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.tcf.te.ui.views.internal.ViewRoot;
-import org.eclipse.tcf.te.ui.views.workingsets.WorkingSetElementHolder;
-import org.eclipse.tcf.te.ui.views.workingsets.activator.UIPlugin;
-import org.eclipse.tcf.te.ui.views.workingsets.interfaces.IWorkingSetElement;
-import org.eclipse.tcf.te.ui.views.workingsets.interfaces.ImageConsts;
-import org.eclipse.tcf.te.ui.views.workingsets.nls.Messages;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.navigator.CommonNavigator;
-import org.eclipse.ui.navigator.INavigatorContentService;
-
-/**
- * A target working set page is a wizard page used to configure a custom defined
- * working set. This wizard is used in the configure working set action to edit
- * the working sets used in the working set viewer.
- */
-public class TargetWorkingSetPage extends AbstractWorkingSetWizardPage {
- // The target explorer view content service (Never dispose it in here!)
- private INavigatorContentService contentService;
- // The initial selection
- private IStructuredSelection initialSelection;
-
- /**
- * Default constructor.
- */
- public TargetWorkingSetPage() {
- super("targetWorkingSetPage", Messages.TargetWorkingSetPage_title, UIPlugin.getImageDescriptor(ImageConsts.WORKING_SET)); //$NON-NLS-1$
- setDescription(Messages.TargetWorkingSetPage_workingSet_description);
- }
-
- /**
- * Set the initial selection.
- * @param selection The initial selection
- */
- public void setInitialSelection(IStructuredSelection selection) {
- initialSelection = selection;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.ui.internal.workingsets.AbstractWorkingSetWizardPage#getPageId()
- */
- @Override
- protected String getPageId() {
- return "org.eclipse.tcf.te.tcf.ui.TargetWorkingSetPage"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.ui.internal.workingsets.AbstractWorkingSetWizardPage#configureTree(org.eclipse.jface.viewers.TreeViewer)
- */
- @Override
- protected void configureTree(TreeViewer tree) {
- // Get the content service from the Target Explorer view.
- IWorkbenchPart part = ViewsUtil.getPart(IUIConstants.ID_EXPLORER);
- if (part instanceof CommonNavigator) {
- contentService = ((CommonNavigator)part).getNavigatorContentService();
-
- tree.setContentProvider(TreeArrayContentProvider.getInstance());
- tree.setLabelProvider(contentService.createCommonLabelProvider());
-
- // Filter out everything not implementing IWorkingSetElement
- tree.addFilter(new ViewerFilter() {
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- return element instanceof IWorkingSetElement;
- }
- });
-
- // Determine the tree input. For working sets, we drop the category nodes and
- // present a plain list.
- List<Object> objects = new ArrayList<Object>();
- ITreeContentProvider provider = contentService.createCommonContentProvider();
- Object[] candidates = provider.getElements(ViewRoot.getInstance());
- for (Object candidate : candidates) {
- if (candidate instanceof ICategory) {
- objects.addAll(Arrays.asList(provider.getChildren(candidate)));
- } else {
- objects.add(candidate);
- }
- }
- provider.dispose();
-
- // Initialize the tree input
- tree.setInput(objects.toArray());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.ui.internal.workingsets.AbstractWorkingSetWizardPage#configureTable(org.eclipse.jface.viewers.TableViewer)
- */
- @Override
- protected void configureTable(TableViewer table) {
- table.setLabelProvider(contentService.createCommonLabelProvider());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.ui.internal.workingsets.AbstractWorkingSetWizardPage#getInitialWorkingSetElements(org.eclipse.ui.IWorkingSet)
- */
- @Override
- protected Object[] getInitialWorkingSetElements(IWorkingSet workingSet) {
- Object[] elements;
- if (workingSet == null) {
- if (initialSelection == null)
- return new IAdaptable[0];
- elements = initialSelection.toArray();
- } else {
- List<IWorkingSetElement> result = new ArrayList<IWorkingSetElement>();
- for (IAdaptable adaptable : workingSet.getElements()) {
- if (!(adaptable instanceof WorkingSetElementHolder)) continue;
- WorkingSetElementHolder holder = (WorkingSetElementHolder) adaptable;
- Assert.isNotNull(holder);
- IWorkingSetElement element = holder.getElement();
- // If the element is null, try to look up the element through the content provider
- if (element == null) {
- ITreeContentProvider contentProvider = (ITreeContentProvider)tree.getContentProvider();
- for (Object candidate : contentProvider.getElements(tree.getInput())) {
- if (candidate instanceof IWorkingSetElement && ((IWorkingSetElement)candidate).getElementId().equals(holder.getElementId())) {
- holder.setElement((IWorkingSetElement)candidate);
- element = holder.getElement();
- break;
- }
- }
- }
-
- if (element != null) result.add(element);
- }
- elements = result.toArray();
- }
- return elements;
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/META-INF/MANIFEST.MF
index 34a134b03..8ab1dc6f2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/META-INF/MANIFEST.MF
@@ -35,8 +35,7 @@ Export-Package: org.eclipse.tcf.te.ui.views,
org.eclipse.tcf.te.ui.views.interfaces.categories,
org.eclipse.tcf.te.ui.views.interfaces.handler,
org.eclipse.tcf.te.ui.views.interfaces.tracing;x-internal:=true,
- org.eclipse.tcf.te.ui.views.interfaces.workingsets,
- org.eclipse.tcf.te.ui.views.internal;x-friends:="org.eclipse.tcf.te.ui.views.workingsets,org.eclipse.tcf.te.launch.ui",
+ org.eclipse.tcf.te.ui.views.internal;x-friends:="org.eclipse.tcf.te.launch.ui",
org.eclipse.tcf.te.ui.views.internal.categories;x-internal:=true,
org.eclipse.tcf.te.ui.views.internal.preferences;x-internal:=true,
org.eclipse.tcf.te.ui.views.listeners,
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/workingsets/IWorkingSetIDs.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/workingsets/IWorkingSetIDs.java
deleted file mode 100644
index cae4ef41c..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/workingsets/IWorkingSetIDs.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.interfaces.workingsets;
-
-/**
- * Working set ID constants.
- */
-public interface IWorkingSetIDs {
-
- /**
- * Working set id.
- */
- public final static String ID_WS_TARGET = "org.eclipse.tcf.te.ui.views.workingset"; //$NON-NLS-1$
-
- /**
- * "Others" working set id.
- */
- public final static String ID_WS_OTHERS = "org.eclipse.tcf.te.ui.views.workingset.others"; //$NON-NLS-1$
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/workingsets/IWorkingSetNameIDs.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/workingsets/IWorkingSetNameIDs.java
deleted file mode 100644
index 677c693ce..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/workingsets/IWorkingSetNameIDs.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.views.interfaces.workingsets;
-
-/**
- * Name and IDs used by the working set implementation.
- */
-public interface IWorkingSetNameIDs {
-
- /** The element factory id.*/
- String FACTORY_ID = "factoryId"; //$NON-NLS-1$
-
- /** The attribute to store the working set element's id. */
- String ATTR_ELEMENTID = "elementId"; //$NON-NLS-1$
-
- /** The attribute to store the working set's name. */
- String ATTR_WORKINGSET_NAME = "workingSetName"; //$NON-NLS-1$
-}

Back to the top