Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2012-04-26 14:38:19 +0000
committerUwe Stieber2012-04-26 14:38:19 +0000
commit56d62eb7a0653edcc6a187ba7f81f89c6420ae67 (patch)
treefe6810ffbb71d8fb2ffaeb237c5ae534334f5bf6 /target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui
parentae2e2e5fc68024ad74014f0ba2978292c10e28d8 (diff)
downloadorg.eclipse.tcf-56d62eb7a0653edcc6a187ba7f81f89c6420ae67.tar.gz
org.eclipse.tcf-56d62eb7a0653edcc6a187ba7f81f89c6420ae67.tar.xz
org.eclipse.tcf-56d62eb7a0653edcc6a187ba7f81f89c6420ae67.zip
Target Explorer: ADD Launches to target explorer, editor and context menus
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml112
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/activator/UIPlugin.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTab.java100
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTabSection.java392
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java92
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchShortcut.java113
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/RemoteAppFilter.java35
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/RemoteAppPropertiesSection.java82
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/AddEditFileTransferDialog.java592
-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.java708
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/FileTransferTab.java96
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/launchcontext/ContextSelectorControl.java172
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/launchcontext/ContextSelectorSection.java94
17 files changed, 1189 insertions, 1454 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF
index 61f362e17..ce4723a7d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF
@@ -26,7 +26,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
org.eclipse.tcf.te.runtime.services;bundle-version="1.0.0",
org.eclipse.tcf.te.tcf.ui;bundle-version="1.0.0",
org.eclipse.ui.navigator;bundle-version="3.5.101",
- org.eclipse.tcf.te.ui.views;bundle-version="1.0.0"
+ org.eclipse.tcf.te.ui.views;bundle-version="1.0.0",
+ org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.200"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties
index f44373ee2..eed629c8a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties
@@ -15,3 +15,7 @@ providerName = Eclipse.org - TCF
Command.showInDebugView.name=Show In Debug View Command
Command.showInDebugView.description=Show the selection in the Debug View.
+
+LauchTree.name=Launches
+
+LaunchShortcut.Remote.App.name=Remote Application
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml
index ec6161642..313dc3002 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml
@@ -2,6 +2,15 @@
<?eclipse version="3.4"?>
<plugin>
+<!-- Adapter factory contributions -->
+ <extension point="org.eclipse.core.runtime.adapters">
+ <factory
+ class=""
+ adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapter type="org.eclipse.debug.ui.actions.ILaunchable"/>
+ </factory>
+ </extension>
+
<!-- Launch configuration type contributions -->
<extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
<launchConfigurationTypeImage
@@ -11,6 +20,7 @@
</launchConfigurationTypeImage>
</extension>
+<!-- Launch configuration tab group contributions -->
<extension point="org.eclipse.debug.ui.launchConfigurationTabGroups">
<launchConfigurationTabGroup
class="org.eclipse.tcf.te.tcf.launch.ui.remote.app.LaunchConfigurationTabGroup"
@@ -18,13 +28,62 @@
type="org.eclipse.tcf.te.tcf.launch.type.remote.app">
</launchConfigurationTabGroup>
</extension>
+
+ <!-- Launch shortcut contributions -->
+ <extension point="org.eclipse.debug.ui.launchShortcuts">
+ <shortcut
+ class="org.eclipse.tcf.te.tcf.launch.ui.remote.app.LaunchShortcut"
+ id="org.eclipse.tcf.te.tcf.launch.ui.launchshortcut.remote.app.run"
+ label="%LaunchShortcut.Remote.App.name"
+ icon="icons/obj16/remote_app.gif"
+ modes="run">
+ <contextualLaunch>
+ <enablement>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.tcf.te.launch.core.isValidLaunchConfigType"
+ value="org.eclipse.tcf.te.tcf.launch.type.remote.app"
+ args="run"/>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+ </shortcut>
+ <shortcut
+ class="org.eclipse.tcf.te.tcf.launch.ui.remote.app.LaunchShortcut"
+ id="org.eclipse.tcf.te.tcf.launch.ui.launchshortcut.remote.app.debug"
+ label="%LaunchShortcut.Remote.App.name"
+ icon="icons/obj16/remote_app.gif"
+ modes="debug">
+ <contextualLaunch>
+ <enablement>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <test
+ property="org.eclipse.tcf.te.launch.core.isValidLaunchConfigType"
+ value="org.eclipse.tcf.te.tcf.launch.type.remote.app"
+ args="debug"/>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+ </shortcut>
+ </extension>
<!-- Editor page binding contributions -->
-<!--
<extension point="org.eclipse.tcf.te.ui.views.editorPageBindings">
<editorPageBinding
- id="org.eclispe.tcf.te.tcf.launch.ui.editor.LaunchEditorPage"
- pageId="org.eclipse.tcf.te.launch.ui.editor.LaunchEditorPage"
+ id="org.eclipse.tcf.te.tcf.launch.ui.binding.LaunchEditorPage"
+ pageId="org.eclipse.tcf.te.launch.ui.LaunchEditorPage"
+ insertBefore="org.eclipse.tcf.te.tcf.filesystem.FSExplorerEditorPage"
insertAfter="org.eclipse.tcf.te.tcf.ui.OverviewEditorPage">
<enablement>
<with variable="activeEditorInput">
@@ -33,6 +92,51 @@
</enablement>
</editorPageBinding>
</extension>
--->
+
+<!-- Navigator viewer contributions -->
+ <extension point="org.eclipse.ui.navigator.viewer">
+ <viewerContentBinding viewerId="org.eclipse.tcf.te.ui.views.View">
+ <includes>
+ <contentExtension
+ pattern="org.eclipse.tcf.te.tcf.launch.ui.navigator.*"
+ isRoot="false"/>
+ </includes>
+ </viewerContentBinding>
+ </extension>
+
+<!-- Navigator content contributions -->
+ <extension point="org.eclipse.ui.navigator.navigatorContent">
+ <navigatorContent
+ id="org.eclipse.tcf.te.tcf.launch.ui.navigator.content"
+ name="%LauchTree.name"
+ activeByDefault="false"
+ contentProvider="org.eclipse.tcf.te.launch.ui.internal.viewer.LaunchNavigatorContentProvider"
+ labelProvider="org.eclipse.tcf.te.launch.ui.internal.viewer.LaunchTreeLabelProvider"
+ priority="normal">
+ <triggerPoints>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ </triggerPoints>
+ <possibleChildren>
+ <instanceof value="org.eclipse.tcf.te.launch.ui.model.LaunchNode"/>
+ </possibleChildren>
+ <commonSorter
+ class="org.eclipse.tcf.te.launch.ui.internal.viewer.LaunchTreeViewerSorter">
+ </commonSorter>
+ </navigatorContent>
+ </extension>
+
+<!-- Property section contributions -->
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertySections">
+ <propertySections contributorId="org.eclipse.tcf.te.ui">
+ <propertySection
+ id="org.eclipse.tcf.te.tcf.launch.ui.propertytab.remote.app"
+ class="org.eclipse.tcf.te.tcf.launch.ui.remote.app.RemoteAppPropertiesSection"
+ enablesFor="1"
+ afterSection="org.eclipse.tcf.te.launch.ui.launchcontext"
+ filter="org.eclipse.tcf.te.tcf.launch.ui.remote.app.RemoteAppFilter"
+ tab="org.eclipse.tcf.te.launch.ui.propertytab.general">
+ </propertySection>
+ </propertySections>
+ </extension>
</plugin>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/activator/UIPlugin.java
index 583427796..ae2e90081 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/activator/UIPlugin.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/activator/UIPlugin.java
@@ -66,7 +66,7 @@ public class UIPlugin extends AbstractUIPlugin {
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
@Override
- public void start(BundleContext context) throws Exception {
+ public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@@ -75,7 +75,7 @@ public class UIPlugin extends AbstractUIPlugin {
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
@Override
- public void stop(BundleContext context) throws Exception {
+ public void stop(BundleContext context) throws Exception {
plugin = null;
traceHandler = null;
super.stop(context);
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 795fa4596..f5b1c7be2 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
@@ -31,26 +31,8 @@ public class Messages extends NLS {
public static String LaunchConfigurationMainTabSection_title;
public static String LaunchConfigurationMainTabSection_processArguments_label;
-
- public static String ProcessImageSelectorControl_label;
- public static String ProcessImageSelectorControl_error_missingProcessImage;
-
- public static String FileTransferTab_name;
-
- public static String FileTransferSection_title;
- public static String FileTransferSection_description;
- public static String FileTransferSection_host_column;
- public static String FileTransferSection_target_column;
- public static String FileTransferSection_options_column;
- public static String FileTransferSection_add_button;
- public static String FileTransferSection_edit_button;
- public static String FileTransferSection_delete_button;
- public static String FileTransferSection_up_button;
- public static String FileTransferSection_down_button;
- public static String FileTransferSection_toHost_text;
- public static String FileTransferSection_toTarget_text;
- public static String FileTransferSection_toHost_tooltip;
- public static String FileTransferSection_toTarget_tooltip;
+ public static String LaunchConfigurationMainTabSection_processImage_label;
+ public static String LaunchConfigurationMainTabSection_error_missingProcessImage;
public static String AddEditFileTransferDialog_add_dialogTitle;
public static String AddEditFileTransferDialog_edit_dialogTitle;
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 124bfe86b..02e1e8435 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
@@ -4,27 +4,9 @@
#
LaunchConfigurationMainTabSection_title = Process
+LaunchConfigurationMainTabSection_processImage_label = Image:
LaunchConfigurationMainTabSection_processArguments_label = Arguments:
-
-ProcessImageSelectorControl_label = Process Image:
-ProcessImageSelectorControl_error_missingProcessImage = Please select or enter a process image.
-
-FileTransferTab_name = File Transfers
-
-FileTransferSection_title = File Transfers
-FileTransferSection_description = File Transfers
-FileTransferSection_host_column = Host
-FileTransferSection_target_column = Target
-FileTransferSection_options_column = Options
-FileTransferSection_add_button = Add
-FileTransferSection_edit_button = Edit
-FileTransferSection_delete_button = Delete
-FileTransferSection_up_button = Up
-FileTransferSection_down_button = Down
-FileTransferSection_toHost_tooltip = Transfer from Target to Host
-FileTransferSection_toTarget_tooltip = Transfer from Host to Target
-FileTransferSection_toHost_text = <<
-FileTransferSection_toTarget_text = >>
+LaunchConfigurationMainTabSection_error_missingProcessImage = Please select or enter a process image.
AddEditFileTransferDialog_add_dialogTitle = Add
AddEditFileTransferDialog_edit_dialogTitle = Edit
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 09dfd282c..86917c815 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
@@ -1,50 +1,50 @@
-/*******************************************************************************
- * 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.launch.ui.remote.app;
-
-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.launchcontext.AbstractContextSelectorTab;
-import org.eclipse.tcf.te.tcf.launch.ui.remote.app.launchcontext.ContextSelectorSection;
-import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
-import org.eclipse.ui.forms.IManagedForm;
-
-/**
- * Remote application main launch tab implementation.
- */
-public class LaunchConfigurationMainTab extends AbstractContextSelectorTab {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorTab#doCreateContextSelectorSection(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected ContextSelectorSection doCreateContextSelectorSection(IManagedForm form, Composite panel) {
- return new ContextSelectorSection(form, panel);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorTab#doCreateAdditionalFormContent(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite, org.eclipse.tcf.te.ui.forms.CustomFormToolkit)
- */
- @Override
- protected void doCreateAdditionalFormContent(IManagedForm form, Composite parent, CustomFormToolkit toolkit) {
- // Setup the main panel (using the table wrap layout)
- Composite panel = toolkit.getFormToolkit().createComposite(parent);
- GridLayout layout = new GridLayout(1, false);
- panel.setLayout(layout);
- panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- panel.setBackground(parent.getBackground());
-
- LaunchConfigurationMainTabSection section = new LaunchConfigurationMainTabSection(form, panel);
- section.getSection().setLayoutData(new GridData(GridData.FILL_BOTH));
- form.addPart(section);
- }
-}
+/*******************************************************************************
+ * 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.launch.ui.remote.app;
+
+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.launchcontext.AbstractContextSelectorTab;
+import org.eclipse.tcf.te.tcf.launch.ui.remote.app.launchcontext.ContextSelectorSection;
+import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
+import org.eclipse.ui.forms.IManagedForm;
+
+/**
+ * Remote application main launch tab implementation.
+ */
+public class LaunchConfigurationMainTab extends AbstractContextSelectorTab {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorTab#doCreateContextSelectorSection(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected ContextSelectorSection doCreateContextSelectorSection(IManagedForm form, Composite panel) {
+ return new ContextSelectorSection(form, panel);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorTab#doCreateAdditionalFormContent(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite, org.eclipse.tcf.te.ui.forms.CustomFormToolkit)
+ */
+ @Override
+ protected void doCreateAdditionalFormContent(IManagedForm form, Composite parent, CustomFormToolkit toolkit) {
+ // Setup the main panel (using the table wrap layout)
+ Composite panel = toolkit.getFormToolkit().createComposite(parent);
+ GridLayout layout = new GridLayout(1, false);
+ panel.setLayout(layout);
+ panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ panel.setBackground(parent.getBackground());
+
+ LaunchConfigurationMainTabSection section = new LaunchConfigurationMainTabSection(form, panel);
+ section.getSection().setLayoutData(new GridData(GridData.FILL_BOTH));
+ form.addPart(section);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTabSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTabSection.java
index 971775257..c4d65d176 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTabSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTabSection.java
@@ -1,196 +1,196 @@
-/*******************************************************************************
- * 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.launch.ui.remote.app;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate;
-import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
-import org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.filesystem.ui.dialogs.FSOpenFileDialog;
-import org.eclipse.tcf.te.tcf.launch.core.interfaces.IRemoteAppLaunchAttributes;
-import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
-import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
-import org.eclipse.tcf.te.ui.forms.parts.AbstractSection;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * Remote application launch configuration main tab section implementation.
- */
-public class LaunchConfigurationMainTabSection extends AbstractSection implements ILaunchConfigurationTabFormPart {
-
- BaseEditBrowseTextControl processImage;
- BaseEditBrowseTextControl processArguments;
- IModelNode firstSelection = null;
-
- /**
- * Constructor.
- *
- * @param form The parent managed form. Must not be <code>null</code>.
- * @param parent The parent composite. Must not be <code>null</code>.
- */
- public LaunchConfigurationMainTabSection(IManagedForm form, Composite parent) {
- super(form, parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- getSection().setBackground(parent.getBackground());
- createClient(getSection(), form.getToolkit());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.forms.parts.AbstractSection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit)
- */
- @Override
- protected void createClient(final Section section, FormToolkit toolkit) {
- Assert.isNotNull(section);
- Assert.isNotNull(toolkit);
-
- // Configure the section
- section.setText(Messages.LaunchConfigurationMainTabSection_title);
- section.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL, SWT.CENTER, true, false));
-
- // Create the section client
- Composite client = createClientContainer(section, 3, toolkit);
- Assert.isNotNull(client);
- section.setClient(client);
- client.setBackground(section.getBackground());
-
- // Create a toolbar for the section
- createSectionToolbar(section, toolkit);
-
- // Create the section sub controls
- processImage = new BaseEditBrowseTextControl(null) {
- @Override
- protected void onButtonControlSelected() {
- if (firstSelection != null) {
- FSOpenFileDialog dialog = new FSOpenFileDialog(section.getShell());
- dialog.setInput(firstSelection);
- if (dialog.open() == Window.OK) {
- Object candidate = dialog.getFirstResult();
- if (candidate instanceof FSTreeNode) {
- String absPath = ((FSTreeNode) candidate).getLocation();
- if (absPath != null) {
- processImage.setEditFieldControlText(absPath);
- }
- }
- }
- }
- }
- @Override
- public void modifyText(ModifyEvent e) {
- super.modifyText(e);
- getManagedForm().dirtyStateChanged();
- }
- };
- processImage.setEditFieldLabel(Messages.ProcessImageSelectorControl_label);
- processImage.setIsGroup(false);
- processImage.setHideBrowseButton(false);
- processImage.setAdjustBackgroundColor(true);
- processImage.setParentControlIsInnerPanel(true);
- processImage.setFormToolkit(toolkit);
- processImage.setupPanel(client);
- processImage.doCreateControlDecoration(processImage.getEditFieldControl());
-
- processArguments = new BaseEditBrowseTextControl(null) {
- @Override
- public void modifyText(ModifyEvent e) {
- super.modifyText(e);
- getManagedForm().dirtyStateChanged();
- }
- };
- processArguments.setEditFieldLabel(Messages.LaunchConfigurationMainTabSection_processArguments_label);
- processArguments.setIsGroup(false);
- processArguments.setHideBrowseButton(true);
- processArguments.setAdjustBackgroundColor(true);
- processArguments.setParentControlIsInnerPanel(true);
- processArguments.setFormToolkit(toolkit);
- processArguments.setupPanel(client);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- @Override
- public void initializeFrom(ILaunchConfiguration configuration) {
- Assert.isNotNull(configuration);
-
- if (processImage != null) {
- String image = DefaultPersistenceDelegate.getAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_IMAGE, ""); //$NON-NLS-1$
- processImage.setEditFieldControlText(image);
- }
-
- if (processArguments != null) {
- String arguments = DefaultPersistenceDelegate.getAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, ""); //$NON-NLS-1$
- processArguments.setEditFieldControlText(arguments);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- @Override
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- Assert.isNotNull(configuration);
-
- if (processImage != null) {
- String image = processImage.getEditFieldControlText();
-
- if (image != null && image.trim().length() > 0) {
- DefaultPersistenceDelegate.setAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_IMAGE, image);
- } else {
- DefaultPersistenceDelegate.setAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_IMAGE, (String)null);
- }
- } else {
- DefaultPersistenceDelegate.setAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_IMAGE, (String)null);
- }
-
- if (processArguments != null) {
- String arguments = processArguments.getEditFieldControlText();
-
- if (arguments != null && arguments.trim().length() > 0) {
- DefaultPersistenceDelegate.setAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, arguments);
- } else {
- DefaultPersistenceDelegate.setAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, (String)null);
- }
- } else {
- DefaultPersistenceDelegate.setAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, (String)null);
- }
- }
-
- @Override
- public boolean isValid(ILaunchConfiguration configuration) {
- firstSelection = null;
- IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(configuration);
- if (contexts != null && contexts.length > 0) {
- firstSelection = contexts[0];
- }
- processImage.getButtonControl().setEnabled(firstSelection != null);
-
- if (processImage.getEditFieldControlText().trim().length() > 0) {
- setMessage(null, IMessageProvider.NONE);
- }
- else {
- setMessage(Messages.ProcessImageSelectorControl_error_missingProcessImage, IMessageProvider.ERROR);
- }
- processImage.updateControlDecoration(getMessage(), getMessageType());
-
- return processImage.getEditFieldControlText().trim().length() > 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.launch.ui.remote.app;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate;
+import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
+import org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart;
+import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
+import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
+import org.eclipse.tcf.te.tcf.filesystem.ui.dialogs.FSOpenFileDialog;
+import org.eclipse.tcf.te.tcf.launch.core.interfaces.IRemoteAppLaunchAttributes;
+import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
+import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
+import org.eclipse.tcf.te.ui.forms.parts.AbstractSection;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * Remote application launch configuration main tab section implementation.
+ */
+public class LaunchConfigurationMainTabSection extends AbstractSection implements ILaunchConfigurationTabFormPart {
+
+ BaseEditBrowseTextControl processImage;
+ BaseEditBrowseTextControl processArguments;
+ IModelNode firstSelection = null;
+
+ /**
+ * Constructor.
+ *
+ * @param form The parent managed form. Must not be <code>null</code>.
+ * @param parent The parent composite. Must not be <code>null</code>.
+ */
+ public LaunchConfigurationMainTabSection(IManagedForm form, Composite parent) {
+ super(form, parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ getSection().setBackground(parent.getBackground());
+ createClient(getSection(), form.getToolkit());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.forms.parts.AbstractSection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit)
+ */
+ @Override
+ protected void createClient(final Section section, FormToolkit toolkit) {
+ Assert.isNotNull(section);
+ Assert.isNotNull(toolkit);
+
+ // Configure the section
+ section.setText(Messages.LaunchConfigurationMainTabSection_title);
+ section.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL, SWT.CENTER, true, false));
+
+ // Create the section client
+ Composite client = createClientContainer(section, 3, toolkit);
+ Assert.isNotNull(client);
+ section.setClient(client);
+ client.setBackground(section.getBackground());
+
+ // Create a toolbar for the section
+ createSectionToolbar(section, toolkit);
+
+ // Create the section sub controls
+ processImage = new BaseEditBrowseTextControl(null) {
+ @Override
+ protected void onButtonControlSelected() {
+ if (firstSelection != null) {
+ FSOpenFileDialog dialog = new FSOpenFileDialog(section.getShell());
+ dialog.setInput(firstSelection);
+ if (dialog.open() == Window.OK) {
+ Object candidate = dialog.getFirstResult();
+ if (candidate instanceof FSTreeNode) {
+ String absPath = ((FSTreeNode) candidate).getLocation();
+ if (absPath != null) {
+ processImage.setEditFieldControlText(absPath);
+ }
+ }
+ }
+ }
+ }
+ @Override
+ public void modifyText(ModifyEvent e) {
+ super.modifyText(e);
+ getManagedForm().dirtyStateChanged();
+ }
+ };
+ processImage.setEditFieldLabel(Messages.LaunchConfigurationMainTabSection_processImage_label);
+ processImage.setIsGroup(false);
+ processImage.setHideBrowseButton(false);
+ processImage.setAdjustBackgroundColor(true);
+ processImage.setParentControlIsInnerPanel(true);
+ processImage.setFormToolkit(toolkit);
+ processImage.setupPanel(client);
+ processImage.doCreateControlDecoration(processImage.getEditFieldControl());
+
+ processArguments = new BaseEditBrowseTextControl(null) {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ super.modifyText(e);
+ getManagedForm().dirtyStateChanged();
+ }
+ };
+ processArguments.setEditFieldLabel(Messages.LaunchConfigurationMainTabSection_processArguments_label);
+ processArguments.setIsGroup(false);
+ processArguments.setHideBrowseButton(true);
+ processArguments.setAdjustBackgroundColor(true);
+ processArguments.setParentControlIsInnerPanel(true);
+ processArguments.setFormToolkit(toolkit);
+ processArguments.setupPanel(client);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ @Override
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ Assert.isNotNull(configuration);
+
+ if (processImage != null) {
+ String image = DefaultPersistenceDelegate.getAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_IMAGE, ""); //$NON-NLS-1$
+ processImage.setEditFieldControlText(image);
+ }
+
+ if (processArguments != null) {
+ String arguments = DefaultPersistenceDelegate.getAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, ""); //$NON-NLS-1$
+ processArguments.setEditFieldControlText(arguments);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
+ @Override
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ Assert.isNotNull(configuration);
+
+ if (processImage != null) {
+ String image = processImage.getEditFieldControlText();
+
+ if (image != null && image.trim().length() > 0) {
+ DefaultPersistenceDelegate.setAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_IMAGE, image);
+ } else {
+ DefaultPersistenceDelegate.setAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_IMAGE, (String)null);
+ }
+ } else {
+ DefaultPersistenceDelegate.setAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_IMAGE, (String)null);
+ }
+
+ if (processArguments != null) {
+ String arguments = processArguments.getEditFieldControlText();
+
+ if (arguments != null && arguments.trim().length() > 0) {
+ DefaultPersistenceDelegate.setAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, arguments);
+ } else {
+ DefaultPersistenceDelegate.setAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, (String)null);
+ }
+ } else {
+ DefaultPersistenceDelegate.setAttribute(configuration, IRemoteAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, (String)null);
+ }
+ }
+
+ @Override
+ public boolean isValid(ILaunchConfiguration configuration) {
+ firstSelection = null;
+ IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(configuration);
+ if (contexts != null && contexts.length > 0) {
+ firstSelection = contexts[0];
+ }
+ processImage.getButtonControl().setEnabled(firstSelection != null);
+
+ if (processImage.getEditFieldControlText().trim().length() > 0) {
+ setMessage(null, IMessageProvider.NONE);
+ }
+ else {
+ setMessage(Messages.LaunchConfigurationMainTabSection_error_missingProcessImage, IMessageProvider.ERROR);
+ }
+ processImage.updateControlDecoration(getMessage(), getMessageType());
+
+ return processImage.getEditFieldControlText().trim().length() > 0;
+ }
+}
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 2c8907775..3a494fa50 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
@@ -1,46 +1,46 @@
-/*******************************************************************************
- * 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.launch.ui.remote.app;
-
-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.AbstractLaunchConfigurationTabGroup;
-import org.eclipse.tcf.te.launch.ui.tabs.projects.ReferencedProjetcsTab;
-import org.eclipse.tcf.te.tcf.launch.ui.remote.app.filetransfer.FileTransferTab;
-
-/**
- * Remote application launch configuration tab group implementation.
- */
-public class LaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.AbstractLaunchContextConfigurationTabGroup#createContextSelectorTab(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.util.List, java.lang.String)
- */
- @Override
- public void createContextSelectorTab(ILaunchConfigurationDialog dialog, List<ILaunchConfigurationTab> tabs, String mode) {
- Assert.isNotNull(tabs);
-
- ILaunchConfigurationTab tab = new LaunchConfigurationMainTab();
- tabs.add(tab);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.AbstractLaunchContextConfigurationTabGroup#createAdditionalTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.util.List, java.lang.String)
- */
- @Override
- public void createAdditionalTabs(ILaunchConfigurationDialog dialog, List<ILaunchConfigurationTab> tabs, String mode) {
-
- tabs.add(new FileTransferTab());
- tabs.add(new ReferencedProjetcsTab());
- }
-}
+/*******************************************************************************
+ * 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.launch.ui.remote.app;
+
+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.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.tcf.te.launch.ui.tabs.refprojects.RefProjetcsTab;
+import org.eclipse.tcf.te.tcf.launch.ui.remote.app.filetransfer.FileTransferTab;
+
+/**
+ * Remote application launch configuration tab group implementation.
+ */
+public class LaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.AbstractLaunchContextConfigurationTabGroup#createContextSelectorTab(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.util.List, java.lang.String)
+ */
+ @Override
+ public void createContextSelectorTab(ILaunchConfigurationDialog dialog, List<ILaunchConfigurationTab> tabs, String mode) {
+ Assert.isNotNull(tabs);
+
+ ILaunchConfigurationTab tab = new LaunchConfigurationMainTab();
+ tabs.add(tab);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.AbstractLaunchContextConfigurationTabGroup#createAdditionalTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.util.List, java.lang.String)
+ */
+ @Override
+ public void createAdditionalTabs(ILaunchConfigurationDialog dialog, List<ILaunchConfigurationTab> tabs, String mode) {
+
+ tabs.add(new FileTransferTab());
+ tabs.add(new RefProjetcsTab());
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchShortcut.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchShortcut.java
new file mode 100644
index 000000000..2ba8721a4
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchShortcut.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * 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.launch.ui.remote.app;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.ILaunchGroup;
+import org.eclipse.debug.ui.ILaunchShortcut2;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.tcf.te.launch.core.lm.LaunchManager;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchManagerDelegate;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification;
+import org.eclipse.tcf.te.launch.core.selection.interfaces.ILaunchSelection;
+import org.eclipse.tcf.te.launch.ui.selection.LaunchSelectionManager;
+import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILaunchTypes;
+import org.eclipse.tcf.te.tcf.launch.ui.activator.UIPlugin;
+import org.eclipse.ui.IEditorPart;
+
+/**
+ * LaunchShortcut
+ */
+public class LaunchShortcut implements ILaunchShortcut2 {
+
+ /**
+ * Constructor.
+ */
+ public LaunchShortcut() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.jface.viewers.ISelection, java.lang.String)
+ */
+ @Override
+ public void launch(ISelection selection, String mode) {
+ ILaunchConfigurationType launchConfigType = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(ILaunchTypes.REMOTE_APPLICATION);
+ try {
+ ILaunchSelection launchSelection = LaunchSelectionManager.getInstance().getLaunchSelection(launchConfigType, mode, null);
+ ILaunchManagerDelegate delegate = LaunchManager.getInstance().getLaunchManagerDelegate(launchConfigType, mode);
+ if (delegate != null && launchSelection != null) {
+ // create an empty launch configuration specification to initialize all attributes with their default defaults.
+ ILaunchSpecification launchSpec = delegate.getLaunchSpecification(launchConfigType.getIdentifier(), launchSelection);
+ // initialize the new launch config.
+ // ignore validation result of launch spec - init as much attributes as possible
+ if (launchSpec != null) {
+ ILaunchConfiguration[] launchConfigs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(launchConfigType);
+ launchConfigs = delegate.getMatchingLaunchConfigurations(launchSpec, launchConfigs);
+
+ ILaunchConfiguration config = launchConfigs != null && launchConfigs.length > 0 ? launchConfigs[0] : null;
+ config = LaunchManager.getInstance().createOrUpdateLaunchConfiguration(config, launchSpec);
+
+ ILaunchGroup launchGroup = DebugUITools.getLaunchGroup(config, mode);
+ DebugUITools.openLaunchConfigurationDialogOnGroup(UIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(), new StructuredSelection(config), launchGroup.getIdentifier());
+ }
+ }
+ }
+ catch (Exception e) {
+ DebugUITools.openLaunchConfigurationDialogOnGroup(UIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(), null, null);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.ui.IEditorPart, java.lang.String)
+ */
+ @Override
+ public void launch(IEditorPart editor, String mode) {
+ launch((ISelection)null, mode);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchConfigurations(org.eclipse.jface.viewers.ISelection)
+ */
+ @Override
+ public ILaunchConfiguration[] getLaunchConfigurations(ISelection selection) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchConfigurations(org.eclipse.ui.IEditorPart)
+ */
+ @Override
+ public ILaunchConfiguration[] getLaunchConfigurations(IEditorPart editorpart) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchableResource(org.eclipse.jface.viewers.ISelection)
+ */
+ @Override
+ public IResource getLaunchableResource(ISelection selection) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchableResource(org.eclipse.ui.IEditorPart)
+ */
+ @Override
+ public IResource getLaunchableResource(IEditorPart editorpart) {
+ return null;
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/RemoteAppFilter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/RemoteAppFilter.java
new file mode 100644
index 000000000..5fe9e5d2d
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/RemoteAppFilter.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * 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.launch.ui.remote.app;
+
+import org.eclipse.jface.viewers.IFilter;
+import org.eclipse.tcf.te.launch.ui.model.LaunchNode;
+import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILaunchTypes;
+
+/**
+ * The filter to filter out non launch configuration nodes.
+ */
+public class RemoteAppFilter implements IFilter {
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IFilter#select(java.lang.Object)
+ */
+ @Override
+ public boolean select(Object toTest) {
+ if (toTest instanceof LaunchNode) {
+ LaunchNode node = (LaunchNode)toTest;
+ return LaunchNode.TYPE_LAUNCH_CONFIG.equals(node.getType()) &&
+ node.getLaunchConfigurationType().getIdentifier().equals(ILaunchTypes.REMOTE_APPLICATION);
+ }
+ return false;
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/RemoteAppPropertiesSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/RemoteAppPropertiesSection.java
new file mode 100644
index 000000000..bab79e057
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/RemoteAppPropertiesSection.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * 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.launch.ui.remote.app;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate;
+import org.eclipse.tcf.te.launch.ui.model.LaunchNode;
+import org.eclipse.tcf.te.launch.ui.properties.BaseTitledSection;
+import org.eclipse.tcf.te.tcf.launch.core.interfaces.IRemoteAppLaunchAttributes;
+import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
+/**
+ * The property section to display the properties of a launch configuration.
+ */
+public class RemoteAppPropertiesSection extends BaseTitledSection {
+ private String processImageValue = ""; //$NON-NLS-1$
+ private String processArgsValue = ""; //$NON-NLS-1$
+
+
+ private Text processImage;
+ private Text processArgs;
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
+ */
+ @Override
+ public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
+ super.createControls(parent, aTabbedPropertySheetPage);
+
+ processImage = createTextField(null, Messages.LaunchConfigurationMainTabSection_processImage_label);
+ processArgs = createTextField(processImage, Messages.LaunchConfigurationMainTabSection_processArguments_label);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#setInput(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+ */
+ @Override
+ public void setInput(IWorkbenchPart part, ISelection selection) {
+ super.setInput(part, selection);
+ Assert.isTrue(selection instanceof IStructuredSelection);
+ Object input = ((IStructuredSelection) selection).getFirstElement();
+ Assert.isTrue(input instanceof LaunchNode);
+ ILaunchConfiguration node = ((LaunchNode)input).getLaunchConfiguration();
+ processImageValue = DefaultPersistenceDelegate.getAttribute(node, IRemoteAppLaunchAttributes.ATTR_PROCESS_IMAGE, ""); //$NON-NLS-1$
+ processArgsValue = DefaultPersistenceDelegate.getAttribute(node, IRemoteAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, ""); //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#refresh()
+ */
+ @Override
+ public void refresh() {
+ processImage.setText(new Path(processImageValue).toPortableString());
+ processArgs.setText(processArgsValue);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.tabbed.BaseTitledSection#getText()
+ */
+ @Override
+ protected String getText() {
+ return Messages.LaunchConfigurationMainTabSection_title;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/AddEditFileTransferDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/AddEditFileTransferDialog.java
index 271b257f6..5de20945e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/AddEditFileTransferDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/AddEditFileTransferDialog.java
@@ -1,296 +1,296 @@
-/*******************************************************************************
- * 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.launch.ui.remote.app.filetransfer;
-
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.runtime.services.filetransfer.FileTransferItem;
-import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
-import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.filesystem.ui.dialogs.FSFolderSelectionDialog;
-import org.eclipse.tcf.te.tcf.filesystem.ui.dialogs.FSOpenFileDialog;
-import org.eclipse.tcf.te.tcf.launch.core.filetransfer.FileTransferItemValidator;
-import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
-import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
-import org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-
-/**
- * AddEditFileTransferDialog
- */
-public class AddEditFileTransferDialog extends CustomTitleAreaDialog {
-
- final private IFileTransferItem item;
- final IModelNode launchContext;
-
- private BaseEditBrowseTextControl host;
- private BaseEditBrowseTextControl target;
- private BaseEditBrowseTextControl options;
-
- private Button toTarget;
- private Button toHost;
-
- private boolean modeNew = true;
-
-
- /**
- * Constructor.
- *
- * @param item The file transfer item to edit or <code>null</code> to create a new one.
- * @param shell The shell.
- * @param contextHelpId The context help id.
- */
- public AddEditFileTransferDialog(Shell shell, String contextHelpId, IFileTransferItem item, IModelNode launchContexts) {
- super(shell, contextHelpId);
-
- Assert.isNotNull(item);
-
- this.item = item;
- this.launchContext = launchContexts;
- this.modeNew = item.isEmpty();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- // Set dialog title and default message
- setDialogTitle(modeNew ? Messages.AddEditFileTransferDialog_add_dialogTitle : Messages.AddEditFileTransferDialog_edit_dialogTitle);
- setTitle(modeNew ? Messages.AddEditFileTransferDialog_add_title : Messages.AddEditFileTransferDialog_edit_title);
- setDefaultMessage(modeNew ? Messages.AddEditFileTransferDialog_add_message : Messages.AddEditFileTransferDialog_edit_message, IMessageProvider.INFORMATION);
-
- // Get the parent container composite
- Composite container = (Composite) super.createDialogArea(parent);
-
- // Create the inner panel
- Composite panel = new Composite(container, SWT.NULL);
- GridLayout layout = new GridLayout(2, false);
- layout.marginHeight = 0; layout.marginWidth = 0;
- panel.setLayout(layout);
- panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- @SuppressWarnings("unused")
- Label spacer = new Label(panel, SWT.NONE);
-
- toTarget = new Button(panel, SWT.RADIO);
- toTarget.setText(Messages.AddEditFileTransferDialog_toTarget_checkbox);
- toTarget.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- validate();
- }
- });
-
- spacer = new Label(panel, SWT.NONE);
-
- toHost = new Button(panel, SWT.RADIO);
- toHost.setText(Messages.AddEditFileTransferDialog_toHost_checkbox);
- toHost.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- validate();
- }
- });
-
- // Create the section sub controls
- host = new BaseEditBrowseTextControl(null) {
- @Override
- protected void onButtonControlSelected() {
- @SuppressWarnings("synthetic-access")
- int direction = toTarget.getSelection() ? IFileTransferItem.HOST_TO_TARGET : IFileTransferItem.TARGET_TO_HOST;
- if (direction == IFileTransferItem.HOST_TO_TARGET) {
- FileDialog fileDialog = new FileDialog(getShell(), SWT.OPEN);
- fileDialog.setFilterPath(getEditFieldControlText());
- fileDialog.setFileName(getEditFieldControlText());
- String file = fileDialog.open();
- if (file != null) {
- setEditFieldControlText(file);
- }
- }
- else {
- DirectoryDialog directoryDialog = new DirectoryDialog(getShell(), SWT.OPEN);
- directoryDialog.setFilterPath(getEditFieldControlText());
- String directory = directoryDialog.open();
- if (directory != null) {
- setEditFieldControlText(directory);
- }
- }
- }
- @Override
- public void modifyText(ModifyEvent e) {
- validate();
- }
- };
- host.setEditFieldLabel(Messages.AddEditFileTransferDialog_host_label);
- host.setIsGroup(false);
- host.setHideBrowseButton(false);
- host.setAdjustBackgroundColor(true);
- host.setParentControlIsInnerPanel(true);
- host.setupPanel(panel);
- host.doCreateControlDecoration(host.getEditFieldControl());
-
- // Create the section sub controls
- target = new BaseEditBrowseTextControl(null) {
- @Override
- protected void onButtonControlSelected() {
- @SuppressWarnings("synthetic-access")
- int direction = toTarget.getSelection() ? IFileTransferItem.HOST_TO_TARGET : IFileTransferItem.TARGET_TO_HOST;
- ElementTreeSelectionDialog dialog = direction == IFileTransferItem.HOST_TO_TARGET ? new FSFolderSelectionDialog(getShell()) : new FSOpenFileDialog(getShell());
- dialog.setInput(getEditFieldControlText());
- dialog.setInput(launchContext);
- if (dialog.open() == Window.OK) {
- Object candidate = dialog.getFirstResult();
- if (candidate instanceof FSTreeNode) {
- String absPath = ((FSTreeNode) candidate).getLocation();
- if (absPath != null) {
- setEditFieldControlText(absPath);
- }
- }
- }
- }
- @Override
- public void modifyText(ModifyEvent e) {
- validate();
- }
- };
- target.setEditFieldLabel(Messages.AddEditFileTransferDialog_target_label);
- target.setIsGroup(false);
- target.setHideBrowseButton(false);
- target.setAdjustBackgroundColor(true);
- target.setParentControlIsInnerPanel(true);
- target.setupPanel(panel);
- target.doCreateControlDecoration(target.getEditFieldControl());
-
- spacer = new Label(panel, SWT.NONE);
- spacer = new Label(panel, SWT.NONE);
-
- options = new BaseEditBrowseTextControl(null) {
- @Override
- public void modifyText(ModifyEvent e) {
- validate();
- }
- };
- options.setEditFieldLabel(Messages.AddEditFileTransferDialog_options_label);
- options.setIsGroup(false);
- options.setHideBrowseButton(true);
- options.setHasHistory(false);
- options.setAdjustBackgroundColor(true);
- options.setParentControlIsInnerPanel(true);
- options.setupPanel(panel);
- options.doCreateControlDecoration(target.getEditFieldControl());
-
- applyDialogFont(container);
-
- return container;
- }
-
- @Override
- protected Control createContents(Composite parent) {
- Control control = super.createContents(parent);
-
- restoreWidgetValues();
- validate();
-
- return control;
- }
-
- protected void validate() {
- IFileTransferItem wc = new FileTransferItem();
- saveWidgetValues(wc);
- Map<String,String> invalid = FileTransferItemValidator.validate(wc);
- boolean valid = true;
-
- if (invalid != null && invalid.containsKey(IFileTransferItem.PROPERTY_HOST)) {
- host.updateControlDecoration(invalid.get(IFileTransferItem.PROPERTY_HOST), IMessageProvider.ERROR);
- if (valid) {
- setErrorMessage(invalid.get(IFileTransferItem.PROPERTY_HOST));
- }
- valid = false;
- }
- else {
- host.updateControlDecoration(null, IMessageProvider.NONE);
- }
-
- if (invalid != null && invalid.containsKey(IFileTransferItem.PROPERTY_TARGET)) {
- target.updateControlDecoration(invalid.get(IFileTransferItem.PROPERTY_TARGET), IMessageProvider.ERROR);
- if (valid) {
- setErrorMessage(invalid.get(IFileTransferItem.PROPERTY_TARGET));
- }
- valid = false;
- }
- else {
- target.updateControlDecoration(null, IMessageProvider.NONE);
- }
-
- if (valid) {
- setErrorMessage(null);
- }
-
- getButton(IDialogConstants.OK_ID).setEnabled(valid);
- }
-
- private void saveWidgetValues(IFileTransferItem wc) {
- wc.setProperty(IFileTransferItem.PROPERTY_HOST, new Path(host.getEditFieldControlText()).toPortableString());
- wc.setProperty(IFileTransferItem.PROPERTY_TARGET, new Path(target.getEditFieldControlText()).toPortableString());
- wc.setProperty(IFileTransferItem.PROPERTY_OPTIONS, options.getEditFieldControlText());
-
- int direction = toTarget.getSelection() ? IFileTransferItem.HOST_TO_TARGET : IFileTransferItem.TARGET_TO_HOST;
- wc.setProperty(IFileTransferItem.PROPERTY_DIRECTION, direction);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog#restoreWidgetValues()
- */
- @Override
- protected void restoreWidgetValues() {
- String hostPath = item.getStringProperty(IFileTransferItem.PROPERTY_HOST);
- host.setEditFieldControlText(hostPath != null ? new Path(hostPath).toOSString() : ""); //$NON-NLS-1$
-
- String targetPath = item.getStringProperty(IFileTransferItem.PROPERTY_TARGET);
- target.setEditFieldControlText(targetPath != null ? new Path(targetPath).toPortableString() : ""); //$NON-NLS-1$
- target.getButtonControl().setEnabled(launchContext != null);
-
- String optionsString = item.getStringProperty(IFileTransferItem.PROPERTY_OPTIONS);
- options.setEditFieldControlText(optionsString != null ? optionsString : ""); //$NON-NLS-1$
-
- int direction = item.getIntProperty(IFileTransferItem.PROPERTY_DIRECTION);
- toTarget.setSelection(direction != IFileTransferItem.TARGET_TO_HOST);
- toHost.setSelection(direction == IFileTransferItem.TARGET_TO_HOST);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog#saveWidgetValues()
- */
- @Override
- protected void saveWidgetValues() {
- saveWidgetValues(item);
- }
-}
+/*******************************************************************************
+ * 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.launch.ui.remote.app.filetransfer;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
+import org.eclipse.tcf.te.runtime.services.filetransfer.FileTransferItem;
+import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
+import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
+import org.eclipse.tcf.te.tcf.filesystem.ui.dialogs.FSFolderSelectionDialog;
+import org.eclipse.tcf.te.tcf.filesystem.ui.dialogs.FSOpenFileDialog;
+import org.eclipse.tcf.te.tcf.launch.core.filetransfer.FileTransferItemValidator;
+import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
+import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
+import org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
+
+/**
+ * AddEditFileTransferDialog
+ */
+public class AddEditFileTransferDialog extends CustomTitleAreaDialog {
+
+ final private IFileTransferItem item;
+ final IModelNode launchContext;
+
+ private BaseEditBrowseTextControl host;
+ private BaseEditBrowseTextControl target;
+ private BaseEditBrowseTextControl options;
+
+ private Button toTarget;
+ private Button toHost;
+
+ private boolean modeNew = true;
+
+
+ /**
+ * Constructor.
+ *
+ * @param item The file transfer item to edit or <code>null</code> to create a new one.
+ * @param shell The shell.
+ * @param contextHelpId The context help id.
+ */
+ public AddEditFileTransferDialog(Shell shell, String contextHelpId, IFileTransferItem item, IModelNode launchContexts) {
+ super(shell, contextHelpId);
+
+ Assert.isNotNull(item);
+
+ this.item = item;
+ this.launchContext = launchContexts;
+ this.modeNew = item.isEmpty();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ // Set dialog title and default message
+ setDialogTitle(modeNew ? Messages.AddEditFileTransferDialog_add_dialogTitle : Messages.AddEditFileTransferDialog_edit_dialogTitle);
+ setTitle(modeNew ? Messages.AddEditFileTransferDialog_add_title : Messages.AddEditFileTransferDialog_edit_title);
+ setDefaultMessage(modeNew ? Messages.AddEditFileTransferDialog_add_message : Messages.AddEditFileTransferDialog_edit_message, IMessageProvider.INFORMATION);
+
+ // Get the parent container composite
+ Composite container = (Composite) super.createDialogArea(parent);
+
+ // Create the inner panel
+ Composite panel = new Composite(container, SWT.NULL);
+ GridLayout layout = new GridLayout(2, false);
+ layout.marginHeight = 0; layout.marginWidth = 0;
+ panel.setLayout(layout);
+ panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ @SuppressWarnings("unused")
+ Label spacer = new Label(panel, SWT.NONE);
+
+ toTarget = new Button(panel, SWT.RADIO);
+ toTarget.setText(Messages.AddEditFileTransferDialog_toTarget_checkbox);
+ toTarget.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ validate();
+ }
+ });
+
+ spacer = new Label(panel, SWT.NONE);
+
+ toHost = new Button(panel, SWT.RADIO);
+ toHost.setText(Messages.AddEditFileTransferDialog_toHost_checkbox);
+ toHost.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ validate();
+ }
+ });
+
+ // Create the section sub controls
+ host = new BaseEditBrowseTextControl(null) {
+ @Override
+ protected void onButtonControlSelected() {
+ @SuppressWarnings("synthetic-access")
+ int direction = toTarget.getSelection() ? IFileTransferItem.HOST_TO_TARGET : IFileTransferItem.TARGET_TO_HOST;
+ if (direction == IFileTransferItem.HOST_TO_TARGET) {
+ FileDialog fileDialog = new FileDialog(getShell(), SWT.OPEN);
+ fileDialog.setFilterPath(getEditFieldControlText());
+ fileDialog.setFileName(getEditFieldControlText());
+ String file = fileDialog.open();
+ if (file != null) {
+ setEditFieldControlText(file);
+ }
+ }
+ else {
+ DirectoryDialog directoryDialog = new DirectoryDialog(getShell(), SWT.OPEN);
+ directoryDialog.setFilterPath(getEditFieldControlText());
+ String directory = directoryDialog.open();
+ if (directory != null) {
+ setEditFieldControlText(directory);
+ }
+ }
+ }
+ @Override
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ };
+ host.setEditFieldLabel(Messages.AddEditFileTransferDialog_host_label);
+ host.setIsGroup(false);
+ host.setHideBrowseButton(false);
+ host.setAdjustBackgroundColor(true);
+ host.setParentControlIsInnerPanel(true);
+ host.setupPanel(panel);
+ host.doCreateControlDecoration(host.getEditFieldControl());
+
+ // Create the section sub controls
+ target = new BaseEditBrowseTextControl(null) {
+ @Override
+ protected void onButtonControlSelected() {
+ @SuppressWarnings("synthetic-access")
+ int direction = toTarget.getSelection() ? IFileTransferItem.HOST_TO_TARGET : IFileTransferItem.TARGET_TO_HOST;
+ ElementTreeSelectionDialog dialog = direction == IFileTransferItem.HOST_TO_TARGET ? new FSFolderSelectionDialog(getShell()) : new FSOpenFileDialog(getShell());
+ dialog.setInput(getEditFieldControlText());
+ dialog.setInput(launchContext);
+ if (dialog.open() == Window.OK) {
+ Object candidate = dialog.getFirstResult();
+ if (candidate instanceof FSTreeNode) {
+ String absPath = ((FSTreeNode) candidate).getLocation();
+ if (absPath != null) {
+ setEditFieldControlText(absPath);
+ }
+ }
+ }
+ }
+ @Override
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ };
+ target.setEditFieldLabel(Messages.AddEditFileTransferDialog_target_label);
+ target.setIsGroup(false);
+ target.setHideBrowseButton(false);
+ target.setAdjustBackgroundColor(true);
+ target.setParentControlIsInnerPanel(true);
+ target.setupPanel(panel);
+ target.doCreateControlDecoration(target.getEditFieldControl());
+
+ spacer = new Label(panel, SWT.NONE);
+ spacer = new Label(panel, SWT.NONE);
+
+ options = new BaseEditBrowseTextControl(null) {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ };
+ options.setEditFieldLabel(Messages.AddEditFileTransferDialog_options_label);
+ options.setIsGroup(false);
+ options.setHideBrowseButton(true);
+ options.setHasHistory(false);
+ options.setAdjustBackgroundColor(true);
+ options.setParentControlIsInnerPanel(true);
+ options.setupPanel(panel);
+ options.doCreateControlDecoration(target.getEditFieldControl());
+
+ applyDialogFont(container);
+
+ return container;
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ Control control = super.createContents(parent);
+
+ restoreWidgetValues();
+ validate();
+
+ return control;
+ }
+
+ protected void validate() {
+ IFileTransferItem wc = new FileTransferItem();
+ saveWidgetValues(wc);
+ Map<String,String> invalid = FileTransferItemValidator.validate(wc);
+ boolean valid = true;
+
+ if (invalid != null && invalid.containsKey(IFileTransferItem.PROPERTY_HOST)) {
+ host.updateControlDecoration(invalid.get(IFileTransferItem.PROPERTY_HOST), IMessageProvider.ERROR);
+ if (valid) {
+ setErrorMessage(invalid.get(IFileTransferItem.PROPERTY_HOST));
+ }
+ valid = false;
+ }
+ else {
+ host.updateControlDecoration(null, IMessageProvider.NONE);
+ }
+
+ if (invalid != null && invalid.containsKey(IFileTransferItem.PROPERTY_TARGET)) {
+ target.updateControlDecoration(invalid.get(IFileTransferItem.PROPERTY_TARGET), IMessageProvider.ERROR);
+ if (valid) {
+ setErrorMessage(invalid.get(IFileTransferItem.PROPERTY_TARGET));
+ }
+ valid = false;
+ }
+ else {
+ target.updateControlDecoration(null, IMessageProvider.NONE);
+ }
+
+ if (valid) {
+ setErrorMessage(null);
+ }
+
+ getButton(IDialogConstants.OK_ID).setEnabled(valid);
+ }
+
+ private void saveWidgetValues(IFileTransferItem wc) {
+ wc.setProperty(IFileTransferItem.PROPERTY_HOST, new Path(host.getEditFieldControlText()).toPortableString());
+ wc.setProperty(IFileTransferItem.PROPERTY_TARGET, new Path(target.getEditFieldControlText()).toPortableString());
+ wc.setProperty(IFileTransferItem.PROPERTY_OPTIONS, options.getEditFieldControlText());
+
+ int direction = toTarget.getSelection() ? IFileTransferItem.HOST_TO_TARGET : IFileTransferItem.TARGET_TO_HOST;
+ wc.setProperty(IFileTransferItem.PROPERTY_DIRECTION, direction);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog#restoreWidgetValues()
+ */
+ @Override
+ protected void restoreWidgetValues() {
+ String hostPath = item.getStringProperty(IFileTransferItem.PROPERTY_HOST);
+ host.setEditFieldControlText(hostPath != null ? new Path(hostPath).toOSString() : ""); //$NON-NLS-1$
+
+ String targetPath = item.getStringProperty(IFileTransferItem.PROPERTY_TARGET);
+ target.setEditFieldControlText(targetPath != null ? new Path(targetPath).toPortableString() : ""); //$NON-NLS-1$
+ target.getButtonControl().setEnabled(launchContext != null);
+
+ String optionsString = item.getStringProperty(IFileTransferItem.PROPERTY_OPTIONS);
+ options.setEditFieldControlText(optionsString != null ? optionsString : ""); //$NON-NLS-1$
+
+ int direction = item.getIntProperty(IFileTransferItem.PROPERTY_DIRECTION);
+ toTarget.setSelection(direction != IFileTransferItem.TARGET_TO_HOST);
+ toHost.setSelection(direction == IFileTransferItem.TARGET_TO_HOST);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog#saveWidgetValues()
+ */
+ @Override
+ protected void saveWidgetValues() {
+ saveWidgetValues(item);
+ }
+}
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 c177e3ddb..d9e65e802 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
@@ -1,619 +1,89 @@
-/*******************************************************************************
- * 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.launch.ui.remote.app.filetransfer;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.fieldassist.ControlDecoration;
-import org.eclipse.jface.fieldassist.FieldDecoration;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxCellEditor;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ColumnPixelData;
-import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.EditingSupport;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ICheckStateProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.tcf.te.launch.core.persistence.filetransfer.FileTransfersPersistenceDelegate;
-import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
-import org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.runtime.services.filetransfer.FileTransferItem;
-import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
-import org.eclipse.tcf.te.tcf.launch.core.filetransfer.FileTransferItemValidator;
-import org.eclipse.tcf.te.tcf.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.forms.IManagedForm;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * FileTransferSection
- */
-public class FileTransferSection extends AbstractTableSection implements ILaunchConfigurationTabFormPart {
-
- private ControlDecoration controlDecoration;
- private IModelNode launchContext = null;
-
- protected static final String PROPERTY_VALIDATION_RESULT = "validation_result.transient"; //$NON-NLS-1$
-
- /**
- * Constructor.
- * @param form
- * @param parent
- */
- public FileTransferSection(IManagedForm form, Composite parent) {
- super(form, parent, SWT.NONE, new String[]{
- Messages.FileTransferSection_add_button,
- Messages.FileTransferSection_edit_button,
- Messages.FileTransferSection_delete_button,
- null,
- Messages.FileTransferSection_up_button,
- Messages.FileTransferSection_down_button});
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- @Override
- public void initializeFrom(ILaunchConfiguration configuration) {
- IFileTransferItem[] items = FileTransfersPersistenceDelegate.getFileTransfers(configuration);
- getTablePart().getViewer().setInput(items);
- if (items != null && items.length > 0) {
- ((TableViewer)getTablePart().getViewer()).setSelection(new StructuredSelection(items[0]), true);
- }
- launchContext = LaunchContextsPersistenceDelegate.getFirstLaunchContext(configuration);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- @Override
- public void performApply(ILaunchConfigurationWorkingCopy wc) {
- FileTransfersPersistenceDelegate.setFileTransfers(wc, (IFileTransferItem[])getTablePart().getViewer().getInput());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#isValid(org.eclipse.debug.core.ILaunchConfiguration)
- */
- @Override
- public boolean isValid(ILaunchConfiguration configuration) {
- return validateInputList();
- }
-
- private boolean validateInputList() {
- List<IFileTransferItem> list = getInputList();
- boolean valid = true;
- for (IFileTransferItem item : list) {
- Map<String,String> invalid = item.getBooleanProperty(IFileTransferItem.PROPERTY_ENABLED) ? FileTransferItemValidator.validate(item) : null;
- item.setProperty(PROPERTY_VALIDATION_RESULT, invalid);
- if (valid && invalid != null) {
- valid = false;
- setMessage(invalid.get(invalid.keySet().toArray()[0]), IMessageProvider.ERROR);
- }
- }
- return valid;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.forms.parts.AbstractSection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit)
- */
- @Override
- protected void createClient(Section section, FormToolkit toolkit) {
- Assert.isNotNull(section);
- Assert.isNotNull(toolkit);
-
- section.setText(Messages.FileTransferSection_title);
- section.setDescription(Messages.FileTransferSection_description);
-
- section.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL, SWT.CENTER, true, true));
-
- Composite client = createClientContainer(section, 2, toolkit);
- client.setBackground(section.getBackground());
-
- section.setClient(client);
-
- createPartControl((Composite)section.getClient(), SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION, 2, toolkit);
- }
-
- @Override
- protected TableViewer createTableViewer(Composite parent, int style) {
- return new CheckboxTableViewer(new Table(parent, style | SWT.CHECK));
- }
-
- @Override
- protected void configureTableViewer(TableViewer viewer) {
- super.configureTableViewer(viewer);
-
- ColumnViewerToolTipSupport.enableFor(viewer);
-
- final Table table = viewer.getTable();
-
- ((CheckboxTableViewer)viewer).setCheckStateProvider(new ICheckStateProvider() {
- @Override
- public boolean isGrayed(Object element) {
- return false;
- }
- @Override
- public boolean isChecked(Object element) {
- if (element instanceof IFileTransferItem) {
- IFileTransferItem item = (IFileTransferItem)element;
- return item.getBooleanProperty(IFileTransferItem.PROPERTY_ENABLED);
- }
- return false;
- }
- });
- ((CheckboxTableViewer)viewer).addCheckStateListener(new ICheckStateListener() {
- @Override
- public void checkStateChanged(CheckStateChangedEvent event) {
- if (event.getElement() instanceof IFileTransferItem) {
- IFileTransferItem item = (IFileTransferItem)event.getElement();
- item.setProperty(IFileTransferItem.PROPERTY_ENABLED, event.getChecked());
- getManagedForm().dirtyStateChanged();
- }
- }
- });
-
- TableViewerColumn tvEnableCol = new TableViewerColumn(viewer, SWT.NONE);
- final TableColumn colEnable = tvEnableCol.getColumn();
- colEnable.setResizable(false);
- tvEnableCol.setLabelProvider(new ColumnLabelProvider() {
- @Override
- public String getText(Object element) {
- return null;
- }
- });
-
- TableViewerColumn tvHostCol = new TableViewerColumn(viewer, SWT.NONE);
- final TableColumn colHost = tvHostCol.getColumn();
- colHost.setText(Messages.FileTransferSection_host_column);
- colHost.setResizable(true);
- tvHostCol.setLabelProvider(new ColumnLabelProvider() {
- @Override
- public String getToolTipText(Object element) {
- if (element instanceof IFileTransferItem) {
- IFileTransferItem item = (IFileTransferItem)element;
- Map<String,String> invalid = (Map<String,String>)item.getProperty(PROPERTY_VALIDATION_RESULT);
- if (invalid != null && invalid.containsKey(IFileTransferItem.PROPERTY_HOST)) {
- return invalid.get(IFileTransferItem.PROPERTY_HOST);
- }
- String host = item.getStringProperty(IFileTransferItem.PROPERTY_HOST);
- return host != null ? new Path(host).toOSString() : host;
- }
- return super.getText(element);
- }
-
- @Override
- public String getText(Object element) {
- if (element instanceof IFileTransferItem) {
- IFileTransferItem item = (IFileTransferItem)element;
- String host = item.getStringProperty(IFileTransferItem.PROPERTY_HOST);
- return host != null ? new Path(host).toOSString() : host;
- }
- return super.getText(element);
- }
- });
-
- TableViewerColumn tvDirCol = new TableViewerColumn(viewer, SWT.NONE);
- final TableColumn colDir = tvDirCol.getColumn();
- colDir.setResizable(false);
- colDir.setAlignment(SWT.CENTER);
- tvDirCol.setLabelProvider(new ColumnLabelProvider() {
- @Override
- public String getToolTipText(Object element) {
- if (element instanceof IFileTransferItem) {
- IFileTransferItem item = (IFileTransferItem)element;
- switch (item.getIntProperty(IFileTransferItem.PROPERTY_DIRECTION)) {
- case IFileTransferItem.TARGET_TO_HOST:
- return Messages.FileTransferSection_toHost_tooltip;
- default:
- return Messages.FileTransferSection_toTarget_tooltip;
- }
- }
- return super.getToolTipText(element);
- }
-
- @Override
- public String getText(Object element) {
- if (element instanceof IFileTransferItem) {
- IFileTransferItem item = (IFileTransferItem)element;
- switch (item.getIntProperty(IFileTransferItem.PROPERTY_DIRECTION)) {
- case IFileTransferItem.TARGET_TO_HOST:
- return Messages.FileTransferSection_toHost_text;
- default:
- return Messages.FileTransferSection_toTarget_text;
- }
- }
- return super.getText(element);
- }
- });
- tvDirCol.setEditingSupport(new EditingSupport(tvDirCol.getViewer()) {
- @Override
- protected void setValue(Object element, Object value) {
- if (element instanceof IFileTransferItem) {
- IFileTransferItem item = (IFileTransferItem)element;
- item.setProperty(IFileTransferItem.PROPERTY_DIRECTION,
- Boolean.parseBoolean(value.toString()) ? IFileTransferItem.HOST_TO_TARGET : IFileTransferItem.TARGET_TO_HOST);
- getManagedForm().dirtyStateChanged();
- getViewer().refresh();
- }
- }
-
- @Override
- protected Object getValue(Object element) {
- if (element instanceof IFileTransferItem) {
- IFileTransferItem item = (IFileTransferItem)element;
- return new Boolean(item.getIntProperty(IFileTransferItem.PROPERTY_DIRECTION) != IFileTransferItem.TARGET_TO_HOST);
- }
- return null;
- }
-
- @Override
- protected CellEditor getCellEditor(Object element) {
- return new CheckboxCellEditor();
- }
-
- @Override
- protected boolean canEdit(Object element) {
- return true;
- }
- });
-
- TableViewerColumn tvTargetCol = new TableViewerColumn(viewer, SWT.NONE);
- final TableColumn colTarget = tvTargetCol.getColumn();
- colTarget.setText(Messages.FileTransferSection_target_column);
- colTarget.setResizable(true);
- tvTargetCol.setLabelProvider(new ColumnLabelProvider() {
- @Override
- public String getToolTipText(Object element) {
- if (element instanceof IFileTransferItem) {
- IFileTransferItem item = (IFileTransferItem)element;
- Map<String,String> invalid = (Map<String,String>)item.getProperty(PROPERTY_VALIDATION_RESULT);
- if (invalid != null && invalid.containsKey(IFileTransferItem.PROPERTY_TARGET)) {
- return invalid.get(IFileTransferItem.PROPERTY_TARGET);
- }
- String target = item.getStringProperty(IFileTransferItem.PROPERTY_TARGET);
- return target != null ? new Path(target).toPortableString() : target;
- }
- return super.getText(element);
- }
-
- @Override
- public String getText(Object element) {
- if (element instanceof IFileTransferItem) {
- IFileTransferItem item = (IFileTransferItem)element;
- String target = item.getStringProperty(IFileTransferItem.PROPERTY_TARGET);
- return target != null ? new Path(target).toPortableString() : target;
- }
- return super.getText(element);
- }
- });
-
- TableViewerColumn tvOptionCol = new TableViewerColumn(viewer, SWT.NONE);
- final TableColumn colOption = tvOptionCol.getColumn();
- colOption.setText(Messages.FileTransferSection_options_column);
- colOption.setResizable(true);
- tvOptionCol.setLabelProvider(new ColumnLabelProvider() {
- @Override
- public String getToolTipText(Object element) {
- if (element instanceof IFileTransferItem) {
- IFileTransferItem item = (IFileTransferItem)element;
- return item.getStringProperty(IFileTransferItem.PROPERTY_OPTIONS);
- }
- return super.getText(element);
- }
-
- @Override
- public String getText(Object element) {
- if (element instanceof IFileTransferItem) {
- IFileTransferItem item = (IFileTransferItem)element;
- return item.getStringProperty(IFileTransferItem.PROPERTY_OPTIONS);
- }
- return super.getText(element);
- }
- });
-
- TableLayout tableLayout = new TableLayout();
- tableLayout.addColumnData(new ColumnPixelData(30, true));
- tableLayout.addColumnData(new ColumnPixelData(200, true));
- tableLayout.addColumnData(new ColumnPixelData(30, true));
- tableLayout.addColumnData(new ColumnPixelData(200, true));
- tableLayout.addColumnData(new ColumnPixelData(100, true));
- table.setLayout(tableLayout);
- GridData data = new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING);
- table.setLayoutData(data);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- table.addListener(SWT.Resize, new Listener() {
- @Override
- public void handleEvent(Event event) {
- int width = table.getSize().x - 4 - colEnable.getWidth() - colHost.getWidth() - colDir.getWidth() - colTarget.getWidth();
- colOption.setWidth(Math.max(width, 100));
- }
- });
- colHost.addListener(SWT.Resize, new Listener() {
- @Override
- public void handleEvent(Event event) {
- int colWidth = colHost.getWidth();
- if (colWidth < 100) {
- event.doit = false;
- colHost.setWidth(100);
- colWidth = 100;
- }
- int width = table.getSize().x - 4 - colWidth - colEnable.getWidth() - colDir.getWidth() - colTarget.getWidth();
- colOption.setWidth(Math.max(width, 100));
- }
- });
- colTarget.addListener(SWT.Resize, new Listener() {
- @Override
- public void handleEvent(Event event) {
- int colWidth = colTarget.getWidth();
- if (colWidth < 100) {
- event.doit = false;
- colTarget.setWidth(100);
- colWidth = 100;
- }
- int width = table.getSize().x - 4 - colWidth - colEnable.getWidth() - colHost.getWidth() - colDir.getWidth();
- colOption.setWidth(Math.max(width, 100));
- }
- });
-
- @SuppressWarnings("unused")
- AbstractDecorationCellPaintListener cpl = new AbstractDecorationCellPaintListener(table, 1, 3) {
- @Override
- protected int getDecorationState(Object data, int columnIndex) {
- if (data instanceof IFileTransferItem) {
- IFileTransferItem item = (IFileTransferItem)data;
- if (item.getBooleanProperty(IFileTransferItem.PROPERTY_ENABLED)) {
- Map<String,String> invalid = (Map<String,String>)item.getProperty(PROPERTY_VALIDATION_RESULT);
- if (invalid != null) {
- switch (columnIndex) {
- case 1:
- if (invalid.containsKey(IFileTransferItem.PROPERTY_HOST)) {
- return STATE_ERROR;
- }
- break;
- case 3:
- if (invalid.containsKey(IFileTransferItem.PROPERTY_TARGET)) {
- return STATE_ERROR;
- }
- break;
- }
- }
- }
- }
- return STATE_NONE;
- }
- };
-
- viewer.setContentProvider(new IStructuredContentProvider() {
- @Override
- public void dispose() {
- }
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- viewer.refresh();
- }
- @Override
- public Object[] getElements(Object inputElement) {
- return inputElement instanceof Object[] ? (Object[])inputElement : new Object[0];
- }
- });
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- initializeButtonsEnablement();
- }
- });
-
- doCreateControlDecoration(table);
- configureControlDecoration(getControlDecoration());
- }
-
- /**
- * Creates a new instance of a {@link ControlDecoration} object associated with
- * the given control. The method is called after the control has been created.
- *
- * @param control The control. Must not be <code>null</code>.
- * @return The control decoration object instance.
- */
- public ControlDecoration doCreateControlDecoration(Control control) {
- Assert.isNotNull(control);
- controlDecoration = new ControlDecoration(control, SWT.TOP | SWT.LEFT);
- return controlDecoration;
- }
-
- /**
- * Returns the control decoration.
- *
- * @return The control decoration instance or <code>null</code> if not yet created.
- */
- public final ControlDecoration getControlDecoration() {
- return controlDecoration;
- }
-
- /**
- * Configure the given control decoration.
- *
- * @param decoration The control decoration. Must not be <code>null</code>.
- */
- protected void configureControlDecoration(ControlDecoration decoration) {
- Assert.isNotNull(decoration);
- decoration.setShowOnlyOnFocus(false);
- }
-
- /**
- * Updates the control decoration to represent the given message and message type.
- * If the message is <code>null</code> or the message type is IMessageProvider.NONE,
- * no decoration will be shown.
- *
- * @param message The message.
- * @param messageType The message type.
- */
- public void updateControlDecoration(String message, int messageType) {
- if (getControlDecoration() != null) {
- // The description is the same as the message
- getControlDecoration().setDescriptionText(message);
-
- // The icon depends on the message type
- FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
-
- // Determine the id of the decoration to show
- String decorationId = FieldDecorationRegistry.DEC_INFORMATION;
- if (messageType == IMessageProvider.ERROR) {
- decorationId = FieldDecorationRegistry.DEC_ERROR;
- } else if (messageType == IMessageProvider.WARNING) {
- decorationId = FieldDecorationRegistry.DEC_WARNING;
- }
-
- // Get the field decoration
- FieldDecoration fieldDeco = registry.getFieldDecoration(decorationId);
- if (fieldDeco != null) {
- getControlDecoration().setImage(fieldDeco.getImage());
- }
-
- if (message == null || messageType == IMessageProvider.NONE) {
- getControlDecoration().hide();
- }
- else {
- getControlDecoration().show();
- }
- }
- }
-
- private List<IFileTransferItem> getInputList() {
- return new ArrayList<IFileTransferItem>(Arrays.asList((IFileTransferItem[])getTablePart().getViewer().getInput()));
- }
-
- private void setInputList(List<IFileTransferItem> list) {
- getTablePart().getViewer().setInput(list.toArray(new IFileTransferItem[list.size()]));
- }
-
- @Override
- public void doubleClick(DoubleClickEvent event) {
- onButtonEditClick();
- }
-
- @Override
- protected void onButtonSelected(Button button) {
- int selIndex = ((TableViewer)getTablePart().getViewer()).getTable().getSelectionIndex();
- List<IFileTransferItem> list = getInputList();
-
- switch (((Integer)button.getData()).intValue()) {
- case 0: // Add
- onButtonAddClick();
- break;
- case 1: // Edit
- onButtonEditClick();
- break;
- case 2: // Delete
- list.remove(selIndex);
- setInputList(list);
- if (!list.isEmpty()) {
- ((TableViewer)getTablePart().getViewer()).setSelection(
- new StructuredSelection(list.get(selIndex < list.size() ? selIndex : list.size()-1)), true);
- }
- break;
- case 4: // Up
- list.add(selIndex-1, list.remove(selIndex));
- setInputList(list);
- ((TableViewer)getTablePart().getViewer()).setSelection(new StructuredSelection(list.get(selIndex-1)), true);
- break;
- case 5: // Down
- list.add(selIndex+1, list.remove(selIndex));
- setInputList(list);
- ((TableViewer)getTablePart().getViewer()).setSelection(new StructuredSelection(list.get(selIndex+1)), true);
- break;
- }
- validateInputList();
- getManagedForm().dirtyStateChanged();
- }
-
- private void onButtonAddClick() {
- int selIndex = ((TableViewer)getTablePart().getViewer()).getTable().getSelectionIndex();
- List<IFileTransferItem> list = getInputList();
- IFileTransferItem item = new FileTransferItem();
- AddEditFileTransferDialog dialog = new AddEditFileTransferDialog(getSection().getShell(), null, item, launchContext);
- if (dialog.open() == Window.OK) {
- item.setProperty(IFileTransferItem.PROPERTY_ENABLED, true);
- list.add(selIndex != -1 ? selIndex : 0, item);
- setInputList(list);
- ((TableViewer)getTablePart().getViewer()).setSelection(new StructuredSelection(item), true);
- }
- }
-
- private void onButtonEditClick() {
- int selIndex = ((TableViewer)getTablePart().getViewer()).getTable().getSelectionIndex();
-
- if (selIndex >= 0) {
- List<IFileTransferItem> list = getInputList();
- IFileTransferItem item = list.get(selIndex);
-
- AddEditFileTransferDialog dialog = new AddEditFileTransferDialog(getSection().getShell(), null, item, launchContext);
- if (dialog.open() == Window.OK) {
- list.set(selIndex, item);
- setInputList(list);
- ((TableViewer)getTablePart().getViewer()).setSelection(new StructuredSelection(item), true);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.forms.parts.AbstractTableSection#initializeButtonsEnablement()
- */
- @Override
- protected void initializeButtonsEnablement() {
- ISelection selection = ((TableViewer)getTablePart().getViewer()).getSelection();
- boolean singleSelection = selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1;
- int selIndex = ((TableViewer)getTablePart().getViewer()).getTable().getSelectionIndex();
- int count = ((TableViewer)getTablePart().getViewer()).getTable().getItemCount();
-
- getTablePart().getButton(0).setEnabled(getTablePart().isEnabled());
- getTablePart().getButton(1).setEnabled(getTablePart().isEnabled() && singleSelection);
- getTablePart().getButton(2).setEnabled(getTablePart().isEnabled() && singleSelection);
- getTablePart().getButton(4).setEnabled(getTablePart().isEnabled() && singleSelection && selIndex > 0);
- getTablePart().getButton(5).setEnabled(getTablePart().isEnabled() && singleSelection && selIndex < count-1);
- }
-}
+/*******************************************************************************
+ * 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.launch.ui.remote.app.filetransfer;
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.launch.ui.tabs.filetransfers.AbstractFileTransferSection;
+import org.eclipse.tcf.te.runtime.services.filetransfer.FileTransferItem;
+import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
+import org.eclipse.tcf.te.tcf.launch.core.filetransfer.FileTransferItemValidator;
+import org.eclipse.ui.forms.IManagedForm;
+
+/**
+ * FileTransferSection
+ */
+public class FileTransferSection extends AbstractFileTransferSection {
+
+ /**
+ * Constructor.
+ * @param form
+ * @param parent
+ */
+ public FileTransferSection(IManagedForm form, Composite parent) {
+ super(form, parent);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.filetransfers.AbstractFileTransferSection#validateInputList()
+ */
+ @Override
+ protected boolean validateInputList() {
+ List<IFileTransferItem> list = getInputList();
+ boolean valid = true;
+ for (IFileTransferItem item : list) {
+ Map<String,String> invalid = item.getBooleanProperty(IFileTransferItem.PROPERTY_ENABLED) ? FileTransferItemValidator.validate(item) : null;
+ item.setProperty(PROPERTY_VALIDATION_RESULT, invalid);
+ if (valid && invalid != null) {
+ valid = false;
+ setMessage(invalid.get(invalid.keySet().toArray()[0]), IMessageProvider.ERROR);
+ }
+ }
+ return valid;
+ }
+
+ @Override
+ protected void onButtonAddClick() {
+ int selIndex = ((TableViewer)getTablePart().getViewer()).getTable().getSelectionIndex();
+ List<IFileTransferItem> list = getInputList();
+ IFileTransferItem item = new FileTransferItem();
+ AddEditFileTransferDialog dialog = new AddEditFileTransferDialog(getSection().getShell(), null, item, launchContext);
+ if (dialog.open() == Window.OK) {
+ item.setProperty(IFileTransferItem.PROPERTY_ENABLED, true);
+ list.add(selIndex != -1 ? selIndex : 0, item);
+ setInputList(list);
+ ((TableViewer)getTablePart().getViewer()).setSelection(new StructuredSelection(item), true);
+ }
+ }
+
+ @Override
+ protected void onButtonEditClick() {
+ int selIndex = ((TableViewer)getTablePart().getViewer()).getTable().getSelectionIndex();
+
+ if (selIndex >= 0) {
+ List<IFileTransferItem> list = getInputList();
+ IFileTransferItem item = list.get(selIndex);
+
+ AddEditFileTransferDialog dialog = new AddEditFileTransferDialog(getSection().getShell(), null, item, launchContext);
+ if (dialog.open() == Window.OK) {
+ list.set(selIndex, item);
+ setInputList(list);
+ ((TableViewer)getTablePart().getViewer()).setSelection(new StructuredSelection(item), true);
+ }
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/FileTransferTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/FileTransferTab.java
index 44dcd4c76..d5a4e3528 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/FileTransferTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/FileTransferTab.java
@@ -1,67 +1,29 @@
-/*******************************************************************************
- * 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.launch.ui.remote.app.filetransfer;
-
-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.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;
-
-/**
- * File transfer launch configuration tab implementation.
- */
-public class FileTransferTab extends AbstractFormsLaunchConfigurationTab {
- // References to the tab sub sections
- private FileTransferSection section;
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.AbstractFormsLaunchConfigurationTab#dispose()
- */
- @Override
- public void dispose() {
- if (section != null) { section.dispose(); section = null; }
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.AbstractFormsLaunchConfigurationTab#doCreateFormContent(org.eclipse.swt.widgets.Composite, org.eclipse.tcf.te.ui.forms.CustomFormToolkit)
- */
- @Override
- protected void doCreateFormContent(Composite parent, CustomFormToolkit toolkit) {
- Assert.isNotNull(parent);
- Assert.isNotNull(toolkit);
-
- // Setup the main panel (using the table wrap layout)
- Composite panel = toolkit.getFormToolkit().createComposite(parent);
- TableWrapLayout layout = new TableWrapLayout();
- layout.makeColumnsEqualWidth = true;
- layout.numColumns = 1;
- panel.setLayout(layout);
- panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- panel.setBackground(parent.getBackground());
-
- section = new FileTransferSection(getManagedForm(), panel);
- section.getSection().setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP));
- getManagedForm().addPart(section);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- @Override
- public String getName() {
- return Messages.FileTransferTab_name;
- }
-}
+/*******************************************************************************
+ * 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.launch.ui.remote.app.filetransfer;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.launch.ui.tabs.filetransfers.AbstractFileTransferSection;
+import org.eclipse.tcf.te.launch.ui.tabs.filetransfers.AbstractFileTransferTab;
+import org.eclipse.ui.forms.IManagedForm;
+
+/**
+ * File transfer launch configuration tab implementation.
+ */
+public class FileTransferTab extends AbstractFileTransferTab {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.filetransfers.AbstractFileTransferTab#createFileTransferSection(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected AbstractFileTransferSection createFileTransferSection(IManagedForm form, Composite panel) {
+ return new FileTransferSection(getManagedForm(), panel);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/launchcontext/ContextSelectorControl.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/launchcontext/ContextSelectorControl.java
index 74796aaa9..c0b49b183 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/launchcontext/ContextSelectorControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/launchcontext/ContextSelectorControl.java
@@ -1,86 +1,86 @@
-/*******************************************************************************
- * 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.launch.ui.remote.app.launchcontext;
-
-import org.eclipse.jface.dialogs.IDialogPage;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl;
-import org.eclipse.tcf.te.tcf.ui.navigator.ContentProviderDelegate;
-import org.eclipse.tcf.te.tcf.ui.navigator.LabelProviderDelegate;
-import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
-import org.eclipse.tcf.te.ui.views.interfaces.IRoot;
-import org.eclipse.tcf.te.ui.views.internal.ViewRoot;
-
-/**
- * Locator model launch context selector control.
- */
-@SuppressWarnings("restriction")
-public class ContextSelectorControl extends AbstractContextSelectorControl {
-
- protected static class ContentProvider extends ContentProviderDelegate {
- private ITreeContentProvider catContentProvider = new org.eclipse.tcf.te.ui.views.navigator.ContentProviderDelegate();
- @Override
- public Object[] getElements(Object inputElement) {
- if (inputElement instanceof IRoot) {
- return catContentProvider.getElements(inputElement);
- }
- return super.getElements(inputElement);
- }
- }
-
- protected static class LabelProvider extends LabelProviderDelegate {
- private ILabelProvider catLabelProvider = new org.eclipse.tcf.te.ui.views.navigator.LabelProviderDelegate();
- @Override
- public String getText(Object element) {
- if (element instanceof ICategory) {
- return catLabelProvider.getText(element);
- }
- return super.getText(element);
- }
- @Override
- public Image getImage(Object element) {
- if (element instanceof ICategory) {
- return catLabelProvider.getImage(element);
- }
- return super.getImage(element);
- }
- }
-
- /**
- * Constructor.
- * @param parentPage
- */
- public ContextSelectorControl(IDialogPage parentPage) {
- super(parentPage);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl#getInitialViewerInput()
- */
- @Override
- protected Object getInitialViewerInput() {
- return ViewRoot.getInstance();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl#doConfigureTreeContentAndLabelProvider(org.eclipse.jface.viewers.TreeViewer)
- */
- @Override
- protected void doConfigureTreeContentAndLabelProvider(TreeViewer viewer) {
- viewer.setContentProvider(new ContentProvider());
- LabelProvider labelProvider = new LabelProvider();
- viewer.setLabelProvider(new DecoratingLabelProvider(labelProvider, labelProvider));
- }
-}
+/*******************************************************************************
+ * 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.launch.ui.remote.app.launchcontext;
+
+import org.eclipse.jface.dialogs.IDialogPage;
+import org.eclipse.jface.viewers.DecoratingLabelProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl;
+import org.eclipse.tcf.te.tcf.ui.navigator.ContentProviderDelegate;
+import org.eclipse.tcf.te.tcf.ui.navigator.LabelProviderDelegate;
+import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
+import org.eclipse.tcf.te.ui.views.interfaces.IRoot;
+import org.eclipse.tcf.te.ui.views.internal.ViewRoot;
+
+/**
+ * Locator model launch context selector control.
+ */
+@SuppressWarnings("restriction")
+public class ContextSelectorControl extends AbstractContextSelectorControl {
+
+ protected static class ContentProvider extends ContentProviderDelegate {
+ private ITreeContentProvider catContentProvider = new org.eclipse.tcf.te.ui.views.navigator.ContentProviderDelegate();
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof IRoot) {
+ return catContentProvider.getElements(inputElement);
+ }
+ return super.getElements(inputElement);
+ }
+ }
+
+ protected static class LabelProvider extends LabelProviderDelegate {
+ private ILabelProvider catLabelProvider = new org.eclipse.tcf.te.ui.views.navigator.LabelProviderDelegate();
+ @Override
+ public String getText(Object element) {
+ if (element instanceof ICategory) {
+ return catLabelProvider.getText(element);
+ }
+ return super.getText(element);
+ }
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof ICategory) {
+ return catLabelProvider.getImage(element);
+ }
+ return super.getImage(element);
+ }
+ }
+
+ /**
+ * Constructor.
+ * @param parentPage
+ */
+ public ContextSelectorControl(IDialogPage parentPage) {
+ super(parentPage);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl#getInitialViewerInput()
+ */
+ @Override
+ protected Object getInitialViewerInput() {
+ return ViewRoot.getInstance();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl#doConfigureTreeContentAndLabelProvider(org.eclipse.jface.viewers.TreeViewer)
+ */
+ @Override
+ protected void doConfigureTreeContentAndLabelProvider(TreeViewer viewer) {
+ viewer.setContentProvider(new ContentProvider());
+ LabelProvider labelProvider = new LabelProvider();
+ viewer.setLabelProvider(new DecoratingLabelProvider(labelProvider, labelProvider));
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/launchcontext/ContextSelectorSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/launchcontext/ContextSelectorSection.java
index 98d225feb..e635b6170 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/launchcontext/ContextSelectorSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/launchcontext/ContextSelectorSection.java
@@ -1,47 +1,47 @@
-/*******************************************************************************
- * 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.launch.ui.remote.app.launchcontext;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl;
-import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorSection;
-import org.eclipse.ui.forms.IManagedForm;
-
-/**
- * Locator model context selector section implementation.
- */
-public class ContextSelectorSection extends AbstractContextSelectorSection {
-
- /**
- * Constructor.
- * @param form The managed form.
- * @param parent The parent composite.
- */
- public ContextSelectorSection(IManagedForm form, Composite parent) {
- super(form, parent);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorSection#doCreateContextSelector()
- */
- @Override
- protected AbstractContextSelectorControl doCreateContextSelector() {
- return new ContextSelectorControl(null) {
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl#onCheckStateChanged(java.lang.Object, boolean)
- */
- @Override
- protected void onCheckStateChanged(Object element, boolean checked) {
- super.onCheckStateChanged(element, checked);
- getManagedForm().dirtyStateChanged();
- }
- };
- }
-}
+/*******************************************************************************
+ * 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.launch.ui.remote.app.launchcontext;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl;
+import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorSection;
+import org.eclipse.ui.forms.IManagedForm;
+
+/**
+ * Locator model context selector section implementation.
+ */
+public class ContextSelectorSection extends AbstractContextSelectorSection {
+
+ /**
+ * Constructor.
+ * @param form The managed form.
+ * @param parent The parent composite.
+ */
+ public ContextSelectorSection(IManagedForm form, Composite parent) {
+ super(form, parent);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorSection#doCreateContextSelector()
+ */
+ @Override
+ protected AbstractContextSelectorControl doCreateContextSelector() {
+ return new ContextSelectorControl(null) {
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl#onCheckStateChanged(java.lang.Object, boolean)
+ */
+ @Override
+ protected void onCheckStateChanged(Object element, boolean checked) {
+ super.onCheckStateChanged(element, checked);
+ getManagedForm().dirtyStateChanged();
+ }
+ };
+ }
+}

Back to the top