summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorTobias Schwarz2012-04-03 06:10:22 (EDT)
committer Uwe Stieber2012-04-03 06:10:22 (EDT)
commit2ec926c3b0baf3ef2a8ab3d4d29249c7e2c6158c (patch)
treefcc287a1c7d3b83048d8400546704cb839e5f1c6
parent6283a4cd9d4b7f3fd8a096261f3bd47fef5faa83 (diff)
downloadorg.eclipse.tcf-2ec926c3b0baf3ef2a8ab3d4d29249c7e2c6158c.zip
org.eclipse.tcf-2ec926c3b0baf3ef2a8ab3d4d29249c7e2c6158c.tar.gz
org.eclipse.tcf-2ec926c3b0baf3ef2a8ab3d4d29249c7e2c6158c.tar.bz2
Target Explorer: CHANGE persistence to GSON
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/plugin.xml72
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/internal/GsonFileTransferItemPersistenceDelegate.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/FileTransferItemToStringPersistenceDelegate.java)8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/internal/GsonReferencedProjectItemPersistenceDelegate.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/ReferencedProjectItemToStringPersistenceDelegate.java)8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/META-INF/MANIFEST.MF71
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.java13
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.properties12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/LaunchConfigurationTabGroup.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/ContextSelectorControl.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/selector/ContextSelectorControl.java)2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorControl.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/selector/LaunchContextSelectorControl.java)8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorSection.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/selector/LaunchContextSelectorSection.java)4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorTab.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/selector/LaunchContextSelectorTab.java)2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/projects/ReferencedProjectsSection.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/projects/ReferencedProjectsSection.java)4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/projects/ReferencedProjetcsTab.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/projects/ReferencedProjetcsTab.java)4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.rcp.application/bin/.project28
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.rcp/bin/.project28
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/META-INF/MANIFEST.MF37
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/AbstractGsonMapPersistenceDelegate.java247
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/AbstractPropertiesPersistenceDelegate.java101
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/AbstractPropertiesToURIPersistenceDelegate.java335
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml72
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java11
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties11
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTab.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/FileTransferSection.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml35
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/AbstractPropertiesToStringPersistenceDelegate.java115
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/GsonPeerPersistenceDelegate.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/PeerToStringPersistenceDelegate.java)7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/PeerToURIPersistenceDelegate.java89
29 files changed, 494 insertions, 852 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/plugin.xml
index 037f629..3b8add1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/plugin.xml
@@ -43,4 +43,76 @@
</step>
</extension>
+<!-- Persistence delegate contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.persistence.delegates">
+ <delegate
+ id="org.eclipse.tcf.te.launch.core.persistence.gson.fileTransferItem"
+ class="org.eclipse.tcf.te.launch.core.internal.GsonFileTransferItemPersistenceDelegate">
+ </delegate>
+ <delegate
+ id="org.eclipse.tcf.te.launch.core.persistence.gson.referencedProjectItem"
+ class="org.eclipse.tcf.te.launch.core.internal.GsonReferencedProjectItemPersistenceDelegate">
+ </delegate>
+ </extension>
+
+<!-- Persistence delegate bindings contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.persistence.bindings">
+ <binding
+ delegateId="org.eclipse.tcf.te.launch.core.persistence.gson.fileTransferItem"
+ id="org.eclipse.tcf.te.launch.core.binding.gson.fileTransferItem">
+ <enablement>
+ <with variable="container">
+ <or>
+ <instanceof value="java.lang.String"/>
+ <and>
+ <instanceof value="java.lang.Class"/>
+ <with variable="containerClass">
+ <equals value="java.lang.String"/>
+ </with>
+ </and>
+ </or>
+ </with>
+ <with variable="context">
+ <or>
+ <instanceof value="org.eclipse.tcf.te.launch.core.interfaces.IFileTransferItem"/>
+ <and>
+ <instanceof value="java.lang.Class"/>
+ <with variable="contextClass">
+ <equals value="org.eclipse.tcf.te.launch.core.interfaces.IFileTransferItem"/>
+ </with>
+ </and>
+ </or>
+ </with>
+ </enablement>
+ </binding>
+ <binding
+ delegateId="org.eclipse.tcf.te.launch.core.persistence.gson.referencedProjectItem"
+ id="org.eclipse.tcf.te.launch.core.binding.gson.referencedProjectItem">
+ <enablement>
+ <with variable="container">
+ <or>
+ <instanceof value="java.lang.String"/>
+ <and>
+ <instanceof value="java.lang.Class"/>
+ <with variable="containerClass">
+ <equals value="java.lang.String"/>
+ </with>
+ </and>
+ </or>
+ </with>
+ <with variable="context">
+ <or>
+ <instanceof value="org.eclipse.tcf.te.launch.core.interfaces.IReferencedProjectItem"/>
+ <and>
+ <instanceof value="java.lang.Class"/>
+ <with variable="contextClass">
+ <equals value="org.eclipse.tcf.te.launch.core.interfaces.IReferencedProjectItem"/>
+ </with>
+ </and>
+ </or>
+ </with>
+ </enablement>
+ </binding>
+ </extension>
+
</plugin>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/FileTransferItemToStringPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/internal/GsonFileTransferItemPersistenceDelegate.java
index 57af629..0bcfbe7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/FileTransferItemToStringPersistenceDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/internal/GsonFileTransferItemPersistenceDelegate.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.core.internal;
+package org.eclipse.tcf.te.launch.core.internal;
import java.io.IOException;
import java.util.HashMap;
@@ -15,17 +15,17 @@ import java.util.Map;
import org.eclipse.tcf.te.launch.core.interfaces.IFileTransferItem;
import org.eclipse.tcf.te.launch.core.persistence.filetransfer.FileTransferItem;
-import org.eclipse.tcf.te.tcf.locator.persistence.AbstractPropertiesToStringPersistenceDelegate;
+import org.eclipse.tcf.te.runtime.persistence.AbstractGsonMapPersistenceDelegate;
/**
* File transfer item to string delegate implementation.
*/
-public class FileTransferItemToStringPersistenceDelegate extends AbstractPropertiesToStringPersistenceDelegate {
+public class GsonFileTransferItemPersistenceDelegate extends AbstractGsonMapPersistenceDelegate {
/**
* Constructor.
*/
- public FileTransferItemToStringPersistenceDelegate() {
+ public GsonFileTransferItemPersistenceDelegate() {
super();
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/ReferencedProjectItemToStringPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/internal/GsonReferencedProjectItemPersistenceDelegate.java
index f5c8ef9..be03f0a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/ReferencedProjectItemToStringPersistenceDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/internal/GsonReferencedProjectItemPersistenceDelegate.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.core.internal;
+package org.eclipse.tcf.te.launch.core.internal;
import java.io.IOException;
import java.util.HashMap;
@@ -15,17 +15,17 @@ import java.util.Map;
import org.eclipse.tcf.te.launch.core.interfaces.IReferencedProjectItem;
import org.eclipse.tcf.te.launch.core.persistence.projects.ReferencedProjectItem;
-import org.eclipse.tcf.te.tcf.locator.persistence.AbstractPropertiesToStringPersistenceDelegate;
+import org.eclipse.tcf.te.runtime.persistence.AbstractGsonMapPersistenceDelegate;
/**
* Referenced project item to string delegate implementation.
*/
-public class ReferencedProjectItemToStringPersistenceDelegate extends AbstractPropertiesToStringPersistenceDelegate {
+public class GsonReferencedProjectItemPersistenceDelegate extends AbstractGsonMapPersistenceDelegate {
/**
* Constructor.
*/
- public ReferencedProjectItemToStringPersistenceDelegate() {
+ public GsonReferencedProjectItemPersistenceDelegate() {
super();
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/META-INF/MANIFEST.MF
index 226a225..b45fade 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/META-INF/MANIFEST.MF
@@ -1,35 +1,36 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.tcf.te.launch.ui;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.tcf.te.launch.ui.activator.UIPlugin
-Bundle-Vendor: %providerName
-Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
- org.eclipse.core.expressions;bundle-version="3.4.300",
- org.eclipse.debug.core;bundle-version="3.7.0",
- org.eclipse.debug.ui;bundle-version="3.7.101",
- org.eclipse.ui;bundle-version="3.7.0",
- org.eclipse.ui.forms;bundle-version="3.5.100",
- org.eclipse.ui.navigator;bundle-version="3.5.100",
- org.eclipse.tcf.te.runtime;bundle-version="1.0.0",
- org.eclipse.tcf.te.runtime.model;bundle-version="1.0.0",
- org.eclipse.tcf.te.runtime.services;bundle-version="1.0.0",
- org.eclipse.tcf.te.runtime.stepper;bundle-version="1.0.0",
- org.eclipse.tcf.te.core.cdt;bundle-version="1.0.0",
- org.eclipse.tcf.te.launch.core;bundle-version="1.0.0",
- org.eclipse.tcf.te.ui.controls;bundle-version="1.0.0",
- org.eclipse.tcf.te.ui.forms;bundle-version="1.0.0",
- org.eclipse.tcf.te.ui.swt;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.launch.ui.activator;x-internal:=true,
- org.eclipse.tcf.te.launch.ui.help,
- org.eclipse.tcf.te.launch.ui.interfaces,
- org.eclipse.tcf.te.launch.ui.internal;x-internal:=true,
- org.eclipse.tcf.te.launch.ui.nls;x-internal:=true,
- org.eclipse.tcf.te.launch.ui.selection,
- org.eclipse.tcf.te.launch.ui.tabs,
- org.eclipse.tcf.te.launch.ui.tabs.selector
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.tcf.te.launch.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.tcf.te.launch.ui.activator.UIPlugin
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.core.expressions;bundle-version="3.4.300",
+ org.eclipse.debug.core;bundle-version="3.7.0",
+ org.eclipse.debug.ui;bundle-version="3.7.101",
+ org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.ui.forms;bundle-version="3.5.100",
+ org.eclipse.ui.navigator;bundle-version="3.5.100",
+ org.eclipse.tcf.te.runtime;bundle-version="1.0.0",
+ org.eclipse.tcf.te.runtime.model;bundle-version="1.0.0",
+ org.eclipse.tcf.te.runtime.services;bundle-version="1.0.0",
+ org.eclipse.tcf.te.runtime.stepper;bundle-version="1.0.0",
+ org.eclipse.tcf.te.core.cdt;bundle-version="1.0.0",
+ org.eclipse.tcf.te.launch.core;bundle-version="1.0.0",
+ org.eclipse.tcf.te.ui.controls;bundle-version="1.0.0",
+ org.eclipse.tcf.te.ui.forms;bundle-version="1.0.0",
+ org.eclipse.tcf.te.ui.swt;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.launch.ui.activator;x-internal:=true,
+ org.eclipse.tcf.te.launch.ui.help,
+ org.eclipse.tcf.te.launch.ui.interfaces,
+ org.eclipse.tcf.te.launch.ui.internal;x-internal:=true,
+ org.eclipse.tcf.te.launch.ui.nls;x-internal:=true,
+ org.eclipse.tcf.te.launch.ui.selection,
+ org.eclipse.tcf.te.launch.ui.tabs,
+ org.eclipse.tcf.te.launch.ui.tabs.launchcontext,
+ org.eclipse.tcf.te.launch.ui.tabs.projects
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.java
index 26d42ff..c81160b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.java
@@ -79,4 +79,17 @@ public class Messages extends NLS {
public static String RemoteContextSelectorControl_error_noContextSelected_single;
public static String RemoteContextSelectorControl_error_noContextSelected_multi;
+
+ public static String ReferencedProjectsTab_name;
+
+ public static String ReferencedProjectsSection_title;
+ public static String ReferencedProjectsSection_description;
+ public static String ReferencedProjectsSection_project_column;
+ public static String ReferencedProjectsSection_add_button;
+ public static String ReferencedProjectsSection_delete_button;
+ public static String ReferencedProjectsSection_up_button;
+ public static String ReferencedProjectsSection_down_button;
+ public static String ReferencedProjectsSection_addDialog_message;
+
+
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.properties
index 47b8837..40774a4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.properties
@@ -13,3 +13,15 @@ ContextSelectorSection_title=Remote Context
RemoteContextSelectorControl_error_noContextSelected_single=Please select a remote context.
RemoteContextSelectorControl_error_noContextSelected_multi=Please select one or more remote contexts.
+
+ReferencedProjectsTab_name = Referenced Projects
+
+ReferencedProjectsSection_title = Referenced Projects
+ReferencedProjectsSection_description = Referenced Projects
+ReferencedProjectsSection_project_column = Project
+ReferencedProjectsSection_add_button = Add
+ReferencedProjectsSection_delete_button = Delete
+ReferencedProjectsSection_up_button = Up
+ReferencedProjectsSection_down_button = Down
+ReferencedProjectsSection_addDialog_message = Select projects that should be built before launch.
+
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/LaunchConfigurationTabGroup.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/LaunchConfigurationTabGroup.java
index 0cfb14e..84a7362 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/LaunchConfigurationTabGroup.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/LaunchConfigurationTabGroup.java
@@ -15,7 +15,7 @@ import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.tcf.te.launch.ui.tabs.selector.LaunchContextSelectorTab;
+import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.LaunchContextSelectorTab;
/**
* Default launch configuration tab group implementation.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/selector/ContextSelectorControl.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/ContextSelectorControl.java
index 2201106..c81ba7d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/selector/ContextSelectorControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/ContextSelectorControl.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.launch.ui.tabs.selector;
+package org.eclipse.tcf.te.launch.ui.tabs.launchcontext;
import java.util.ArrayList;
import java.util.Arrays;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/selector/LaunchContextSelectorControl.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorControl.java
index 2985c78..f54fa7b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/selector/LaunchContextSelectorControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorControl.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.launch.ui.tabs.selector;
+package org.eclipse.tcf.te.launch.ui.tabs.launchcontext;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.dialogs.IDialogPage;
@@ -55,7 +55,7 @@ public class LaunchContextSelectorControl extends ContextSelectorControl {
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.selector.ContextSelectorControl#initializeProperties(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.ContextSelectorControl#initializeProperties(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
*/
@Override
protected void initializeProperties(IPropertiesContainer properties) {
@@ -85,7 +85,7 @@ public class LaunchContextSelectorControl extends ContextSelectorControl {
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.selector.ContextSelectorControl#createTreeViewerControl(org.eclipse.swt.widgets.Composite)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.ContextSelectorControl#createTreeViewerControl(org.eclipse.swt.widgets.Composite)
*/
@Override
protected TreeViewer createTreeViewerControl(Composite parent) {
@@ -97,7 +97,7 @@ public class LaunchContextSelectorControl extends ContextSelectorControl {
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.selector.ContextSelectorControl#getTreeViewerStyle()
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.ContextSelectorControl#getTreeViewerStyle()
*/
@Override
protected int getTreeViewerStyle() {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/selector/LaunchContextSelectorSection.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorSection.java
index 99341d6..819eaa1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/selector/LaunchContextSelectorSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorSection.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.launch.ui.tabs.selector;
+package org.eclipse.tcf.te.launch.ui.tabs.launchcontext;
import java.util.ArrayList;
import java.util.List;
@@ -101,7 +101,7 @@ public class LaunchContextSelectorSection extends AbstractSection implements ILa
// Create the section sub controls
selector = new LaunchContextSelectorControl(null) {
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.selector.LaunchContextSelectorControl#onModelNodeCheckStateChanged(org.eclipse.tcf.te.runtime.model.interfaces.IModelNode, boolean)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.LaunchContextSelectorControl#onModelNodeCheckStateChanged(org.eclipse.tcf.te.runtime.model.interfaces.IModelNode, boolean)
*/
@Override
protected void onModelNodeCheckStateChanged(IModelNode node, boolean checked) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/selector/LaunchContextSelectorTab.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorTab.java
index 5bf16c7..e20ba81 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/selector/LaunchContextSelectorTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorTab.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.launch.ui.tabs.selector;
+package org.eclipse.tcf.te.launch.ui.tabs.launchcontext;
import org.eclipse.core.runtime.Assert;
import org.eclipse.swt.SWT;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/projects/ReferencedProjectsSection.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/projects/ReferencedProjectsSection.java
index a6e6961..2ce55e2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/projects/ReferencedProjectsSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/projects/ReferencedProjectsSection.java
@@ -8,7 +8,7 @@
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.ui.remote.app.projects;
+package org.eclipse.tcf.te.launch.ui.tabs.projects;
import java.util.ArrayList;
import java.util.Arrays;
@@ -58,7 +58,7 @@ import org.eclipse.tcf.te.launch.core.persistence.projects.ReferencedProjectItem
import org.eclipse.tcf.te.launch.core.persistence.projects.ReferencedProjectItemValidator;
import org.eclipse.tcf.te.launch.core.persistence.projects.ReferencedProjectsPersistenceDelegate;
import org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart;
-import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
+import org.eclipse.tcf.te.launch.ui.nls.Messages;
import org.eclipse.tcf.te.ui.forms.parts.AbstractTableSection;
import org.eclipse.tcf.te.ui.swt.listener.AbstractDecorationCellPaintListener;
import org.eclipse.ui.dialogs.ListSelectionDialog;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/projects/ReferencedProjetcsTab.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/projects/ReferencedProjetcsTab.java
index 9c86abb..d09b2dd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/projects/ReferencedProjetcsTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/projects/ReferencedProjetcsTab.java
@@ -7,14 +7,14 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.ui.remote.app.projects;
+package org.eclipse.tcf.te.launch.ui.tabs.projects;
import org.eclipse.core.runtime.Assert;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.launch.ui.nls.Messages;
import org.eclipse.tcf.te.launch.ui.tabs.AbstractFormsLaunchConfigurationTab;
-import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
import org.eclipse.ui.forms.widgets.TableWrapData;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.rcp.application/bin/.project b/target_explorer/plugins/org.eclipse.tcf.te.rcp.application/bin/.project
new file mode 100644
index 0000000..2118081
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.rcp.application/bin/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.tcf.te.rcp.application</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.rcp/bin/.project b/target_explorer/plugins/org.eclipse.tcf.te.rcp/bin/.project
new file mode 100644
index 0000000..0073454
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.rcp/bin/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.tcf.te.rcp</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/META-INF/MANIFEST.MF
index 278123e..d3d21f9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/META-INF/MANIFEST.MF
@@ -1,18 +1,19 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.tcf.te.runtime.persistence;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.tcf.te.runtime.persistence.activator.CoreBundleActivator
-Bundle-Vendor: %providerName
-Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
- org.eclipse.tcf.te.runtime;bundle-version="1.0.0",
- org.eclipse.tcf.te.runtime.services;bundle-version="1.0.0",
- org.eclipse.core.expressions;bundle-version="3.4.300"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ActivationPolicy: lazy
-Bundle-Localization: plugin
-Export-Package: org.eclipse.tcf.te.runtime.persistence,
- org.eclipse.tcf.te.runtime.persistence.activator;x-internal:=true,
- org.eclipse.tcf.te.runtime.persistence.interfaces,
- org.eclipse.tcf.te.runtime.persistence.services
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.tcf.te.runtime.persistence;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.tcf.te.runtime.persistence.activator.CoreBundleActivator
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.tcf.te.runtime;bundle-version="1.0.0",
+ org.eclipse.tcf.te.runtime.services;bundle-version="1.0.0",
+ org.eclipse.core.expressions;bundle-version="3.4.300",
+ com.google.gson;bundle-version="2.1.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Export-Package: org.eclipse.tcf.te.runtime.persistence,
+ org.eclipse.tcf.te.runtime.persistence.activator;x-internal:=true,
+ org.eclipse.tcf.te.runtime.persistence.interfaces,
+ org.eclipse.tcf.te.runtime.persistence.services
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/AbstractGsonMapPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/AbstractGsonMapPersistenceDelegate.java
new file mode 100644
index 0000000..8c702f2
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/AbstractGsonMapPersistenceDelegate.java
@@ -0,0 +1,247 @@
+/*******************************************************************************
+ * 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.runtime.persistence;
+
+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.net.URI;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.tcf.te.runtime.extensions.ExecutableExtension;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate;
+import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+
+/**
+ * AbstractGsonMapPersistenceDelegate
+ */
+public abstract class AbstractGsonMapPersistenceDelegate extends ExecutableExtension implements IPersistenceDelegate {
+
+ private final String defaultFileExtension;
+
+ /**
+ * Constructor.
+ */
+ public AbstractGsonMapPersistenceDelegate() {
+ this("ini"); //$NON-NLS-1$
+ }
+
+ /**
+ * Constructor.
+ */
+ public AbstractGsonMapPersistenceDelegate(String defaultFileExtension) {
+ super();
+ Assert.isNotNull(defaultFileExtension);
+ this.defaultFileExtension = defaultFileExtension;
+ }
+
+ /**
+ * Return the default file extension if container is an URI.
+ */
+ protected String getDefaultFileExtension() {
+ return defaultFileExtension;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate#write(java.lang.Object, java.lang.Object, java.lang.String)
+ */
+ @Override
+ public Object write(Object context, Object container, String key) throws IOException {
+ Assert.isNotNull(context);
+ Assert.isNotNull(container);
+
+ if (container instanceof URI) {
+ URI uri = (URI)container;
+
+ // Only "file:" URIs are supported
+ if (!"file".equalsIgnoreCase(uri.getScheme())) { //$NON-NLS-1$
+ throw new IOException("Unsupported URI schema '" + uri.getScheme() + "'"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ // Create the file object from the given URI
+ File file = new File(uri.normalize());
+
+ // The file must be absolute
+ if (!file.isAbsolute()) {
+ throw new IOException("URI must denote an absolute file path."); //$NON-NLS-1$
+ }
+
+ // If the file defaultFileExtension is no set, default to "properties"
+ IPath path = new Path(file.getCanonicalPath());
+ if (path.getFileExtension() == null) {
+ file = path.addFileExtension(getDefaultFileExtension()).toFile();
+ }
+
+ JsonWriter writer = new JsonWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8")); //$NON-NLS-1$
+ Gson gson = new GsonBuilder().setPrettyPrinting().create();
+ gson.toJson(toMap(context), Map.class, writer);
+ writer.close();
+ }
+ else if (container instanceof String || String.class.equals(container)) {
+ Gson gson = new GsonBuilder().create();
+ container = gson.toJson(toMap(context));
+ }
+
+ return container;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate#read(java.lang.Object, java.lang.Object, java.lang.String)
+ */
+ @Override
+ public Object read(Object context, Object container, String key) throws IOException {
+ Assert.isNotNull(container);
+
+ Gson gson = new GsonBuilder().create();
+ Map<String, Object> data = null;
+
+ if (container instanceof URI) {
+ URI uri = (URI)container;
+
+ // Only "file:" URIs are supported
+ if (!"file".equalsIgnoreCase(uri.getScheme())) { //$NON-NLS-1$
+ throw new IOException("Unsupported URI schema '" + uri.getScheme() + "'"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ // Create the file object from the given URI
+ File file = new File(uri.normalize());
+
+ // The file must be absolute
+ if (!file.isAbsolute()) {
+ throw new IOException("URI must denote an absolute file path."); //$NON-NLS-1$
+ }
+
+ JsonReader reader = new JsonReader(new InputStreamReader(new FileInputStream(file), "UTF-8")); //$NON-NLS-1$
+ data = gson.fromJson(reader, Map.class);
+ reader.close();
+ }
+ else if (container instanceof String) {
+ data = gson.fromJson((String)container, Map.class);
+ }
+
+ return data != null ? fromMap(data, context) : context;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate#delete(java.lang.Object, java.lang.Object, java.lang.String)
+ */
+ @Override
+ public boolean delete(Object context, Object container, String key) throws IOException {
+ Assert.isNotNull(container);
+
+ if (container instanceof URI) {
+ URI uri = (URI)container;
+
+ // Only "file:" URIs are supported
+ if (!"file".equalsIgnoreCase(uri.getScheme())) { //$NON-NLS-1$
+ throw new IOException("Unsupported URI schema '" + uri.getScheme() + "'"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ // Create the file object from the given URI
+ File file = new File(uri.normalize());
+
+ // The file must be absolute
+ if (!file.isAbsolute()) {
+ throw new IOException("URI must denote an absolute file path."); //$NON-NLS-1$
+ }
+
+ // If the file defaultFileExtension is no set, default to "properties"
+ IPath path = new Path(file.getCanonicalPath());
+ if (path.getFileExtension() == null) {
+ file = path.addFileExtension(getDefaultFileExtension()).toFile();
+ }
+
+ return file.delete();
+ }
+
+ return false;
+ }
+
+ /**
+ * Convert the given context to map.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @return Map representing the context.
+ *
+ * @throws IOException
+ */
+ @SuppressWarnings("unchecked")
+ protected Map<String, Object> toMap(final Object context) throws IOException {
+ Map<String, Object> result = new HashMap<String,Object>();
+
+ Map<String,Object> attrs = null;
+ if (context instanceof Map) {
+ attrs = (Map<String, Object>)context;
+ }
+ else if (context instanceof IPropertiesContainer) {
+ IPropertiesContainer container = (IPropertiesContainer)context;
+ attrs = new HashMap<String,Object>(container.getProperties());
+ }
+
+ if (attrs != null) {
+ for (String key : attrs.keySet()) {
+ if (!key.endsWith(".transient")) { //$NON-NLS-1$
+ result.put(key, attrs.get(key));
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Convert a map into the needed context object.
+ *
+ * @param map The map representing the context. Must not be <code>null</code>.
+ * @param context The context to put the map values in or <code>null</code>.
+ * @return The context object.
+ *
+ * @throws IOException
+ */
+ protected Object fromMap(Map<String,Object> map, Object context) throws IOException {
+ if (context == null || Map.class.equals(context.getClass())) {
+ return map;
+ }
+ else if (context instanceof Map) {
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ Map<String,Object> newMap = new HashMap<String, Object>((Map)context);
+ newMap.putAll(map);
+ return newMap;
+ }
+ else if (IPropertiesContainer.class.equals(context.getClass())) {
+ IPropertiesContainer container = new PropertiesContainer();
+ container.setProperties(map);
+
+ return container;
+ }
+ else if (context instanceof IPropertiesContainer) {
+ IPropertiesContainer container = (IPropertiesContainer)context;
+ container.setProperties(map);
+
+ return container;
+ }
+
+ return null;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/AbstractPropertiesPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/AbstractPropertiesPersistenceDelegate.java
deleted file mode 100644
index c7aaa58..0000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/AbstractPropertiesPersistenceDelegate.java
+++ /dev/null
@@ -1,101 +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.runtime.persistence;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.tcf.te.runtime.extensions.ExecutableExtension;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate;
-import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
-
-/**
- * Abstract persistence delegate implementation.
- */
-public abstract class AbstractPropertiesPersistenceDelegate extends ExecutableExtension implements IPersistenceDelegate {
-
- public final static String CORE_SECTION_NAME = "core"; //$NON-NLS-1$
-
- /**
- * Constructor.
- */
- public AbstractPropertiesPersistenceDelegate() {
- super();
- }
-
- /**
- * Convert the given context to map.
- *
- * @param context The context. Must not be <code>null</code>.
- * @return Map representing the context.
- *
- * @throws IOException
- */
- @SuppressWarnings("unchecked")
- protected Map<String, Object> toMap(final Object context) throws IOException {
- Map<String, Object> result = new HashMap<String,Object>();
-
- Map<String,Object> attrs = null;
- if (context instanceof Map) {
- attrs = (Map<String, Object>)context;
- }
- else if (context instanceof IPropertiesContainer) {
- IPropertiesContainer container = (IPropertiesContainer)context;
- attrs = new HashMap<String,Object>(container.getProperties());
- }
-
- if (attrs != null) {
- for (String key : attrs.keySet()) {
- if (!key.endsWith(".transient")) { //$NON-NLS-1$
- result.put(key, attrs.get(key));
- }
- }
- }
-
- return result;
- }
-
- /**
- * Convert a map into the needed context object.
- *
- * @param map The map representing the context. Must not be <code>null</code>.
- * @param context The context to put the map values in or <code>null</code>.
- * @return The context object.
- *
- * @throws IOException
- */
- protected Object fromMap(Map<String,Object> map, Object context) throws IOException {
- if (context == null || Map.class.equals(context.getClass())) {
- return map;
- }
- else if (context instanceof Map) {
- @SuppressWarnings({ "rawtypes", "unchecked" })
- Map<String,Object> newMap = new HashMap<String, Object>((Map)context);
- newMap.putAll(map);
- return newMap;
- }
- else if (IPropertiesContainer.class.equals(context.getClass())) {
- IPropertiesContainer container = new PropertiesContainer();
- container.setProperties(map);
-
- return container;
- }
- else if (context instanceof IPropertiesContainer) {
- IPropertiesContainer container = (IPropertiesContainer)context;
- container.setProperties(map);
-
- return container;
- }
-
- return null;
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/AbstractPropertiesToURIPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/AbstractPropertiesToURIPersistenceDelegate.java
deleted file mode 100644
index e7b63ab..0000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/AbstractPropertiesToURIPersistenceDelegate.java
+++ /dev/null
@@ -1,335 +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.runtime.persistence;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-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.net.URI;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-
-/**
- * Properties file persistence delegate implementation.
- * <p>
- * The persistence delegates reads and writes a simple grouped properties file format.
- */
-public abstract class AbstractPropertiesToURIPersistenceDelegate extends AbstractPropertiesPersistenceDelegate {
-
- private String defaultFileExtension;
-
- /**
- * Constructor.
- *
- * @param defaultFileExtension The default file extension.
- */
- protected AbstractPropertiesToURIPersistenceDelegate(String defaultFileExtension) {
- super();
- Assert.isNotNull(defaultFileExtension);
- this.defaultFileExtension = defaultFileExtension;
- }
-
- /**
- * Return the default extension.
- */
- protected String getDefaultFileExtension() {
- return defaultFileExtension;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate#write(java.lang.Object, java.lang.Object, java.lang.String)
- */
- @Override
- public Object write(Object context, Object container, String key) throws IOException {
- Assert.isNotNull(context);
- Assert.isNotNull(container);
-
- if (container instanceof URI) {
- URI uri = (URI)container;
-
- // Only "file:" URIs are supported
- if (!"file".equalsIgnoreCase(uri.getScheme())) { //$NON-NLS-1$
- throw new IOException("Unsupported URI schema '" + uri.getScheme() + "'"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // Create the file object from the given URI
- File file = new File(uri.normalize());
-
- // The file must be absolute
- if (!file.isAbsolute()) {
- throw new IOException("URI must denote an absolute file path."); //$NON-NLS-1$
- }
-
- // If the file defaultFileExtension is no set, default to "properties"
- IPath path = new Path(file.getCanonicalPath());
- if (path.getFileExtension() == null) {
- file = path.addFileExtension(getDefaultFileExtension()).toFile();
- }
-
- // Create the writer object
- BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8")); //$NON-NLS-1$
- try {
- // Write the first level of attributes
- writeMap(writer, key, toMap(context));
- } finally {
- writer.close();
- }
- }
-
- return container;
- }
-
- /**
- * Write the map data.
- *
- * @param writer The writer. Must not be <code>null</code>.
- * @param section The section name or <code>null</code>.
- * @param data The data. Must not be <code>null</code>.
- */
- private void writeMap(BufferedWriter writer, String section, Map<String, Object> data) throws IOException {
- Assert.isNotNull(writer);
- Assert.isNotNull(data);
-
- // Will contain the list of map keys where the value is a map type itself.
- List<String> childMapKeys = new ArrayList<String>();
- // Will contain the list of map keys where the value is not an map type.
- List<String> childKeys = new ArrayList<String>();
-
- // Get all the map keys and filter the map type values
- for (String key : data.keySet()) {
- if (data.get(key) instanceof Map) {
- childMapKeys.add(key);
- }
- else {
- childKeys.add(key);
- }
- }
-
- // Sort both lists
- Collections.sort(childMapKeys);
- Collections.sort(childKeys);
-
- // If the child key list is not empty, write the section
- if (!childKeys.isEmpty()) {
- // Write a new line except it is the "core" section
- if (section != null && !CORE_SECTION_NAME.equals(section)) {
- writer.newLine();
- }
-
- // Write the header
- if (section != null) {
- writer.write("[" + section.trim() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- writer.newLine();
- }
-
- for (String key : childKeys) {
- if (section != null) {
- writer.write('\t');
- }
- writer.write(key);
- writer.write(" = "); //$NON-NLS-1$
-
- Object value = data.get(key);
- if (value instanceof List) {
- writer.write(Arrays.deepToString(((List<?>)value).toArray()));
- } else {
- writer.write(value.toString());
- }
-
- writer.newLine();
- }
- }
-
- // If there are map type values, write them now
- if (!childMapKeys.isEmpty()) {
- for (String key : childMapKeys) {
- // Calculate the section name
- String newSection = section == null || CORE_SECTION_NAME.equals(section) ? key.trim() : section + "." + key.trim(); //$NON-NLS-1$
- // Write it
- writeMap(writer, newSection, (Map<String, Object>)data.get(key));
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate#read(java.lang.Object, java.lang.Object, java.lang.String)
- */
- @Override
- public Object read(Object context, Object container, String key) throws IOException {
- Assert.isNotNull(container);
-
- if (container instanceof URI) {
- URI uri = (URI)container;
-
- // Only "file:" URIs are supported
- if (!"file".equalsIgnoreCase(uri.getScheme())) { //$NON-NLS-1$
- throw new IOException("Unsupported URI schema '" + uri.getScheme() + "'"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // Create the file object from the given URI
- File file = new File(uri.normalize());
-
- // The file must be absolute
- if (!file.isAbsolute()) {
- throw new IOException("URI must denote an absolute file path."); //$NON-NLS-1$
- }
-
- @SuppressWarnings("unchecked")
- Map<String, Object> data = context instanceof Map ? (Map<String,Object>)context : new HashMap<String, Object>();
-
- // Create the reader object
- BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8")); //$NON-NLS-1$
- try {
- readMap(reader, key, data);
- } finally {
- reader.close();
- }
-
- if (key != null && data.containsKey(key) && data.get(key) instanceof Map) {
- data = (Map<String,Object>)data.get(key);
- }
-
- context = fromMap(data, context);
- }
-
- return context;
- }
-
- private static Pattern SECTION = Pattern.compile("\\s*\\[([^\\]]+)\\]\\s*"); //$NON-NLS-1$
- private static Pattern PROPERTY = Pattern.compile("\\s*(.+\\s*=\\s*.+)"); //$NON-NLS-1$
-
- /**
- * Read the data.
- *
- * @param reader The reader. Must not be <code>null</code>.
- * @param section The section name or <code>null</code>.
- * @param data The data. Must not be <code>null</code>.
- */
- private void readMap(BufferedReader reader, String section, Map<String, Object> data) throws IOException {
- Assert.isNotNull(reader);
- Assert.isNotNull(data);
-
- // The sections by name for easier access.
- // The "core" section is the incoming data object
- Map<String, Map<String, Object>> sections = new HashMap<String, Map<String, Object>>();
- sections.put(section == null ? CORE_SECTION_NAME : section, data);
-
- String currentSection = section == null ? CORE_SECTION_NAME : section;
- String line = reader.readLine();
- while (line != null) {
- Matcher matcher = SECTION.matcher(line);
- if (matcher.matches()) {
- // Section names are case-sensitive too
- currentSection = matcher.group(1);
- if (sections.get(currentSection) == null) {
- sections.put(currentSection, new HashMap<String, Object>());
- }
- } else {
- matcher = PROPERTY.matcher(line);
- if (matcher.matches()) {
- String property = matcher.group(1);
- String[] pieces = property.split("=", 2); //$NON-NLS-1$
- Map<String, Object> sectionMap = sections.get(currentSection);
- sectionMap.put(pieces[0].trim(), pieces[1].trim());
- }
- }
-
- line = reader.readLine();
- }
-
- // Recreate the sections hierarchy
- for (String sectionName : sections.keySet()) {
- if (CORE_SECTION_NAME.equals(sectionName)) {
- continue;
- }
- Map<String, Object> sectionMap = sections.get(sectionName);
- if (sectionName.contains(".")) { //$NON-NLS-1$
- // Split the section name and recreate the missing hierarchy
- String[] pieces = sectionName.split("\\."); //$NON-NLS-1$
- Map<String, Object> parentSection = data;
- for (String subSectionName : pieces) {
- if (CORE_SECTION_NAME.equals(subSectionName)) {
- continue;
- }
-
- if (sectionName.endsWith(subSectionName)) {
- parentSection.put(subSectionName, sectionMap);
- } else {
- Map<String, Object> subSection = (Map<String, Object>)parentSection.get(subSectionName);
- if (subSection == null) {
- subSection = new HashMap<String, Object>();
- parentSection.put(subSectionName, subSection);
- }
- parentSection = subSection;
- }
- }
- } else {
- // Place it into the root object, but check if it may exist
- Map<String, Object> oldSection = (Map<String, Object>)data.get(sectionName);
- if (oldSection != null) {
- oldSection.putAll(sectionMap);
- }
- else {
- data.put(sectionName, sectionMap);
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate#delete(java.lang.Object, java.lang.Object, java.lang.String)
- */
- @Override
- public boolean delete(Object context, Object container, String key) throws IOException {
- Assert.isNotNull(container);
-
- if (container instanceof URI) {
- URI uri = (URI)container;
-
- // Only "file:" URIs are supported
- if (!"file".equalsIgnoreCase(uri.getScheme())) { //$NON-NLS-1$
- throw new IOException("Unsupported URI schema '" + uri.getScheme() + "'"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // Create the file object from the given URI
- File file = new File(uri.normalize());
-
- // The file must be absolute
- if (!file.isAbsolute()) {
- throw new IOException("URI must denote an absolute file path."); //$NON-NLS-1$
- }
-
- // If the file defaultFileExtension is no set, default to "properties"
- IPath path = new Path(file.getCanonicalPath());
- if (path.getFileExtension() == null) {
- file = path.addFileExtension(getDefaultFileExtension()).toFile();
- }
-
- return file.delete();
- }
-
- return false;
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml
index 1ec368f..842a8dd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml
@@ -110,76 +110,4 @@
</step>
</extension>
-<!-- Persistence delegate contributions -->
- <extension point="org.eclipse.tcf.te.runtime.persistence.delegates">
- <delegate
- id="org.eclipse.tcf.te.tcf.launch.core.persistence.fileTransferToString"
- class="org.eclipse.tcf.te.tcf.launch.core.internal.FileTransferItemToStringPersistenceDelegate">
- </delegate>
- <delegate
- id="org.eclipse.tcf.te.tcf.launch.core.persistence.referencedProjectToString"
- class="org.eclipse.tcf.te.tcf.launch.core.internal.ReferencedProjectItemToStringPersistenceDelegate">
- </delegate>
- </extension>
-
-<!-- Persistence delegate bindings contributions -->
- <extension point="org.eclipse.tcf.te.runtime.persistence.bindings">
- <binding
- delegateId="org.eclipse.tcf.te.tcf.launch.core.persistence.fileTransferToString"
- id="org.eclipse.tcf.te.tcf.launch.core.binding.fileTransferToString">
- <enablement>
- <with variable="container">
- <or>
- <instanceof value="java.lang.String"/>
- <and>
- <instanceof value="java.lang.Class"/>
- <with variable="containerClass">
- <equals value="java.lang.String"/>
- </with>
- </and>
- </or>
- </with>
- <with variable="context">
- <or>
- <instanceof value="org.eclipse.tcf.te.launch.core.interfaces.IFileTransferItem"/>
- <and>
- <instanceof value="java.lang.Class"/>
- <with variable="contextClass">
- <equals value="org.eclipse.tcf.te.launch.core.interfaces.IFileTransferItem"/>
- </with>
- </and>
- </or>
- </with>
- </enablement>
- </binding>
- <binding
- delegateId="org.eclipse.tcf.te.tcf.launch.core.persistence.referencedProjectToString"
- id="org.eclipse.tcf.te.tcf.launch.core.binding.referencedProjectToString">
- <enablement>
- <with variable="container">
- <or>
- <instanceof value="java.lang.String"/>
- <and>
- <instanceof value="java.lang.Class"/>
- <with variable="containerClass">
- <equals value="java.lang.String"/>
- </with>
- </and>
- </or>
- </with>
- <with variable="context">
- <or>
- <instanceof value="org.eclipse.tcf.te.launch.core.interfaces.IReferencedProjectItem"/>
- <and>
- <instanceof value="java.lang.Class"/>
- <with variable="contextClass">
- <equals value="org.eclipse.tcf.te.launch.core.interfaces.IReferencedProjectItem"/>
- </with>
- </and>
- </or>
- </with>
- </enablement>
- </binding>
- </extension>
-
</plugin>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
index 8ec2522..795fa45 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
@@ -52,17 +52,6 @@ public class Messages extends NLS {
public static String FileTransferSection_toHost_tooltip;
public static String FileTransferSection_toTarget_tooltip;
- public static String ReferencedProjectsTab_name;
-
- public static String ReferencedProjectsSection_title;
- public static String ReferencedProjectsSection_description;
- public static String ReferencedProjectsSection_project_column;
- public static String ReferencedProjectsSection_add_button;
- public static String ReferencedProjectsSection_delete_button;
- public static String ReferencedProjectsSection_up_button;
- public static String ReferencedProjectsSection_down_button;
- public static String ReferencedProjectsSection_addDialog_message;
-
public static String AddEditFileTransferDialog_add_dialogTitle;
public static String AddEditFileTransferDialog_edit_dialogTitle;
public static String AddEditFileTransferDialog_add_title;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
index 500e106..124bfe8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
@@ -26,17 +26,6 @@ FileTransferSection_toTarget_tooltip = Transfer from Host to Target
FileTransferSection_toHost_text = <<
FileTransferSection_toTarget_text = >>
-ReferencedProjectsTab_name = Referenced Projects
-
-ReferencedProjectsSection_title = Referenced Projects
-ReferencedProjectsSection_description = Referenced Projects
-ReferencedProjectsSection_project_column = Project
-ReferencedProjectsSection_add_button = Add
-ReferencedProjectsSection_delete_button = Delete
-ReferencedProjectsSection_up_button = Up
-ReferencedProjectsSection_down_button = Down
-ReferencedProjectsSection_addDialog_message = Select projects that should be built before launch.
-
AddEditFileTransferDialog_add_dialogTitle = Add
AddEditFileTransferDialog_edit_dialogTitle = Edit
AddEditFileTransferDialog_add_title = Add new file transfer
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTab.java
index 94e77b9..a4ae714 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTab.java
@@ -13,7 +13,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.te.launch.ui.tabs.selector.LaunchContextSelectorTab;
+import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.LaunchContextSelectorTab;
import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
/**
@@ -22,7 +22,7 @@ import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
public class LaunchConfigurationMainTab extends LaunchContextSelectorTab {
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.selector.LaunchContextSelectorTab#doCreateFormContent(org.eclipse.swt.widgets.Composite, org.eclipse.tcf.te.ui.forms.CustomFormToolkit)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.LaunchContextSelectorTab#doCreateFormContent(org.eclipse.swt.widgets.Composite, org.eclipse.tcf.te.ui.forms.CustomFormToolkit)
*/
@Override
protected void doCreateFormContent(Composite parent, CustomFormToolkit toolkit) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java
index 36dd89f..f8e481c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java
@@ -14,8 +14,8 @@ import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.tcf.te.launch.ui.tabs.projects.ReferencedProjetcsTab;
import org.eclipse.tcf.te.tcf.launch.ui.remote.app.filetransfer.FileTransferTab;
-import org.eclipse.tcf.te.tcf.launch.ui.remote.app.projects.ReferencedProjetcsTab;
/**
* Remote application launch configuration tab group implementation.
@@ -40,9 +40,7 @@ public class LaunchConfigurationTabGroup extends org.eclipse.tcf.te.launch.ui.ta
@Override
public void createAdditionalTabs(ILaunchConfigurationDialog dialog, List<ILaunchConfigurationTab> tabs, String mode) {
- ILaunchConfigurationTab tab = new FileTransferTab();
- tabs.add(tab);
- tab = new ReferencedProjetcsTab();
- tabs.add(tab);
+ tabs.add(new FileTransferTab());
+ tabs.add(new ReferencedProjetcsTab());
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/FileTransferSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/FileTransferSection.java
index e83adc5..a65416a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/FileTransferSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/FileTransferSection.java
@@ -245,10 +245,10 @@ public class FileTransferSection extends AbstractTableSection implements ILaunch
if (element instanceof IFileTransferItem) {
IFileTransferItem item = (IFileTransferItem)element;
switch (item.getIntProperty(IFileTransferItem.PROPERTY_DIRECTION)) {
- case IFileTransferItem.HOST_TO_TARGET:
- return Messages.FileTransferSection_toTarget_tooltip;
case IFileTransferItem.TARGET_TO_HOST:
return Messages.FileTransferSection_toHost_tooltip;
+ default:
+ return Messages.FileTransferSection_toTarget_tooltip;
}
}
return super.getToolTipText(element);
@@ -259,10 +259,10 @@ public class FileTransferSection extends AbstractTableSection implements ILaunch
if (element instanceof IFileTransferItem) {
IFileTransferItem item = (IFileTransferItem)element;
switch (item.getIntProperty(IFileTransferItem.PROPERTY_DIRECTION)) {
- case IFileTransferItem.HOST_TO_TARGET:
- return Messages.FileTransferSection_toTarget_text;
case IFileTransferItem.TARGET_TO_HOST:
return Messages.FileTransferSection_toHost_text;
+ default:
+ return Messages.FileTransferSection_toTarget_text;
}
}
return super.getText(element);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
index fac06cf..fd3fc76 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
@@ -22,12 +22,8 @@
<!-- Persistence delegate contributions -->
<extension point="org.eclipse.tcf.te.runtime.persistence.delegates">
<delegate
- id="org.eclipse.tcf.te.tcf.locator.persistence.peerToURI"
- class="org.eclipse.tcf.te.tcf.locator.persistence.PeerToURIPersistenceDelegate">
- </delegate>
- <delegate
- id="org.eclipse.tcf.te.tcf.locator.persistence.peerToString"
- class="org.eclipse.tcf.te.tcf.locator.persistence.PeerToStringPersistenceDelegate">
+ id="org.eclipse.tcf.te.tcf.locator.persistence.gson.peer"
+ class="org.eclipse.tcf.te.tcf.locator.persistence.GsonPeerPersistenceDelegate">
</delegate>
</extension>
@@ -35,33 +31,12 @@
<extension
point="org.eclipse.tcf.te.runtime.persistence.bindings">
<binding
- delegateId="org.eclipse.tcf.te.tcf.locator.persistence.peerToURI"
- id="org.eclipse.tcf.te.tcf.locator.binding.peerToURI">
- <enablement>
- <with variable="container">
- <instanceof value="java.net.URI"/>
- </with>
- <with variable="context">
- <or>
- <instanceof value="org.eclipse.tcf.protocol.IPeer"/>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider"/>
- <and>
- <instanceof value="java.lang.Class"/>
- <with variable="contextClass">
- <equals value="org.eclipse.tcf.protocol.IPeer"/>
- </with>
- </and>
- </or>
- </with>
- </enablement>
- </binding>
- <binding
- delegateId="org.eclipse.tcf.te.tcf.locator.persistence.peerToString"
- id="org.eclipse.tcf.te.tcf.locator.binding.peerToString">
+ delegateId="org.eclipse.tcf.te.tcf.locator.persistence.gson.peer"
+ id="org.eclipse.tcf.te.tcf.locator.binding.gson.peer">
<enablement>
<with variable="container">
<or>
+ <instanceof value="java.net.URI"/>
<instanceof value="java.lang.String"/>
<and>
<instanceof value="java.lang.Class"/>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/AbstractPropertiesToStringPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/AbstractPropertiesToStringPersistenceDelegate.java
deleted file mode 100644
index 14e5f5d..0000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/AbstractPropertiesToStringPersistenceDelegate.java
+++ /dev/null
@@ -1,115 +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.tcf.locator.persistence;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.tcf.protocol.JSON;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.persistence.AbstractPropertiesPersistenceDelegate;
-
-/**
- * AbstractPropertiesToStringPersistenceDelegate
- */
-public abstract class AbstractPropertiesToStringPersistenceDelegate extends AbstractPropertiesPersistenceDelegate {
-
- /**
- * Constructor.
- */
- public AbstractPropertiesToStringPersistenceDelegate() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate#write(java.lang.Object, java.lang.Object, java.lang.String)
- */
- @Override
- public Object write(final Object context, Object container, String key) throws IOException {
- Assert.isNotNull(context);
- Assert.isNotNull(container);
-
- if (container instanceof String || String.class.equals(container)) {
- final AtomicReference<String> encoded = new AtomicReference<String>();
-
- Runnable runnable = new Runnable() {
- @SuppressWarnings("synthetic-access")
- @Override
- public void run() {
- try {
- encoded.set(JSON.toJSON(toMap(context)));
- }
- catch (IOException e) {
- }
- }
- };
-
- if (Protocol.isDispatchThread()) {
- runnable.run();
- }
- else {
- Protocol.invokeAndWait(runnable);
- }
- return encoded.get();
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate#read(java.lang.Object, java.lang.Object, java.lang.String)
- */
- @SuppressWarnings("unchecked")
- @Override
- public Object read(final Object context, final Object container, String key) throws IOException {
- Assert.isNotNull(context);
- Assert.isNotNull(container);
-
- if (container instanceof String) {
- final AtomicReference<Object> decoded = new AtomicReference<Object>();
-
- Runnable runnable = new Runnable() {
- @SuppressWarnings("synthetic-access")
- @Override
- public void run() {
- try {
- Object o = JSON.parseOne(((String)container).getBytes("UTF-8")); //$NON-NLS-1$
- if (o instanceof Map) {
- decoded.set(fromMap((Map<String,Object>)o, container));
- }
- } catch (IOException e) {
- }
- }
- };
-
- if (Protocol.isDispatchThread()) {
- runnable.run();
- }
- else {
- Protocol.invokeAndWait(runnable);
- }
-
- return decoded.get();
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate#delete(java.lang.Object, java.lang.Object, java.lang.String)
- */
- @Override
- public boolean delete(Object context, Object container, String key) throws IOException {
- return false;
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/PeerToStringPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/GsonPeerPersistenceDelegate.java
index 335b0ca..7902181 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/PeerToStringPersistenceDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/GsonPeerPersistenceDelegate.java
@@ -19,6 +19,7 @@ import org.eclipse.tcf.core.TransientPeer;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
+import org.eclipse.tcf.te.runtime.persistence.AbstractGsonMapPersistenceDelegate;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
@@ -28,13 +29,13 @@ import org.eclipse.tcf.te.tcf.locator.nodes.PeerModel;
/**
* Peer to string persistence delegate implementation.
*/
-public class PeerToStringPersistenceDelegate extends AbstractPropertiesToStringPersistenceDelegate {
+public class GsonPeerPersistenceDelegate extends AbstractGsonMapPersistenceDelegate {
/**
* Constructor.
*/
- public PeerToStringPersistenceDelegate() {
- super();
+ public GsonPeerPersistenceDelegate() {
+ super("ini"); //$NON-NLS-1$
}
/* (non-Javadoc)
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/PeerToURIPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/PeerToURIPersistenceDelegate.java
deleted file mode 100644
index 9872850..0000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/PeerToURIPersistenceDelegate.java
+++ /dev/null
@@ -1,89 +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.tcf.locator.persistence;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.tcf.core.TransientPeer;
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.te.runtime.persistence.AbstractPropertiesToURIPersistenceDelegate;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
-
-/**
- * Static peers persistence delegate implementation.
- */
-public class PeerToURIPersistenceDelegate extends AbstractPropertiesToURIPersistenceDelegate {
-
- /**
- * Constructor.
- */
- public PeerToURIPersistenceDelegate() {
- super("ini"); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate#getPersistedClass(java.lang.Object)
- */
- @Override
- public Class<?> getPersistedClass(Object context) {
- return IPeer.class;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.persistence.AbstractPropertiesPersistenceDelegate#toMap(java.lang.Object)
- */
- @Override
- protected Map<String, Object> toMap(final Object context) throws IOException {
- IPeer peer = getPeer(context);
- if (peer != null) {
- return super.toMap(peer.getAttributes());
- }
-
- return new HashMap<String, Object>();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.persistence.AbstractPropertiesPersistenceDelegate#fromMap(java.util.Map, java.lang.Object)
- */
- @Override
- protected Object fromMap(Map<String, Object> map, Object context) throws IOException {
- Map<String,String> attrs = new HashMap<String,String>();
- for (String key : map.keySet()) {
- attrs.put(key, map.get(key).toString());
- }
-
- return new TransientPeer(attrs);
- }
-
- /**
- * Get a peer from the given context.
- *
- * @param context The context. Must not be <code>null</code>.
- * @return The peer or <code>null</code>.
- */
- protected IPeer getPeer(Object context) {
- IPeer peer = null;
-
- if (context instanceof IPeer) {
- peer = (IPeer)context;
- }
- else if (context instanceof IPeerModel) {
- peer = ((IPeerModel)context).getPeer();
- }
- else if (context instanceof IPeerModelProvider) {
- peer = ((IPeerModelProvider)context).getPeerModel().getPeer();
- }
-
- return peer;
- }
-}