aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2012-04-19 01:55:10 (EDT)
committerUwe Stieber2012-04-19 01:55:10 (EDT)
commitcb5e6b752f693f394164a037052543bf8a6d435b (patch)
tree60859aedbcc489abf0527563a2813655ef9733b3
parent1a9d44e7c35bf78e3723b5328584271beba6cd9d (diff)
downloadorg.eclipse.tcf-cb5e6b752f693f394164a037052543bf8a6d435b.zip
org.eclipse.tcf-cb5e6b752f693f394164a037052543bf8a6d435b.tar.gz
org.eclipse.tcf-cb5e6b752f693f394164a037052543bf8a6d435b.tar.bz2
Target Explorer: CHANGE launch context selector
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/delegates/DefaultLaunchManagerDelegate.java3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/META-INF/MANIFEST.MF3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/help/IContextHelpIds.java51
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.java192
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.properties55
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/AbstractLaunchConfigurationTabGroup.java49
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/LaunchConfigurationTabGroup.java74
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/AbstractContextSelectorControl.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/ContextSelectorControl.java)223
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/AbstractContextSelectorSection.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorSection.java)24
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/AbstractContextSelectorTab.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorTab.java)32
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorControl.java218
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/RemoteAppLaunchManagerDelegate.java34
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml15
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTab.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java14
-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.java86
-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.java47
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/META-INF/MANIFEST.MF85
19 files changed, 668 insertions, 564 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/delegates/DefaultLaunchManagerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/delegates/DefaultLaunchManagerDelegate.java
index 6728aa7..3905a4d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/delegates/DefaultLaunchManagerDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/delegates/DefaultLaunchManagerDelegate.java
@@ -191,6 +191,9 @@ public class DefaultLaunchManagerDelegate extends ExecutableExtension implements
*/
@Override
public String getDefaultLaunchName(ILaunchSpecification launchSpec) {
+ if (launchSpec.getLaunchConfigName() != null) {
+ return launchSpec.getLaunchConfigName();
+ }
return Messages.DefaultLaunchManagerDelegate_defaultLaunchName;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/META-INF/MANIFEST.MF
index 112f08d..6e0156c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/META-INF/MANIFEST.MF
@@ -22,7 +22,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
org.eclipse.tcf.te.ui.forms;bundle-version="1.0.0",
org.eclipse.tcf.te.ui.swt;bundle-version="1.0.0",
org.eclipse.tcf.te.ui.views;bundle-version="1.0.0",
- org.eclipse.tcf.te.runtime.concurrent;bundle-version="1.0.0"
+ org.eclipse.tcf.te.runtime.concurrent;bundle-version="1.0.0",
+ org.eclipse.tcf.te.ui;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/help/IContextHelpIds.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/help/IContextHelpIds.java
index 5362183..fd84a0a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/help/IContextHelpIds.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/help/IContextHelpIds.java
@@ -1,23 +1,28 @@
-/*******************************************************************************
- * 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.launch.ui.help;
-
-import org.eclipse.tcf.te.launch.ui.activator.UIPlugin;
-
-/**
- * Context help id definitions.
- */
-public interface IContextHelpIds {
-
- /**
- * UI plug-in common context help id prefix.
- */
- public final static String PREFIX = UIPlugin.getUniqueIdentifier() + "."; //$NON-NLS-1$
-}
+/*******************************************************************************
+ * 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.launch.ui.help;
+
+import org.eclipse.tcf.te.launch.ui.activator.UIPlugin;
+
+/**
+ * Context help id definitions.
+ */
+public interface IContextHelpIds {
+
+ /**
+ * UI plug-in common context help id prefix.
+ */
+ public final static String PREFIX = UIPlugin.getUniqueIdentifier() + "."; //$NON-NLS-1$
+
+ /**
+ * Launch editor page.
+ */
+ public final static String LAUNCH_EDITOR = PREFIX + "LaunchEditor"; //$NON-NLS-1$
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.java
index c81160b..53c0405 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.java
@@ -1,95 +1,97 @@
-/*******************************************************************************
- * 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.launch.ui.nls;
-
-import java.lang.reflect.Field;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Launch UI Plug-in externalized strings management.
- */
-public class Messages extends NLS {
-
- // The plug-in resource bundle name
- private static final String BUNDLE_NAME = "org.eclipse.tcf.te.launch.ui.nls.Messages"; //$NON-NLS-1$
-
- /**
- * Static constructor.
- */
- static {
- // Load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- /**
- * Returns if or if not this NLS manager contains a constant for
- * the given externalized strings key.
- *
- * @param key The externalized strings key or <code>null</code>.
- * @return <code>True</code> if a constant for the given key exists, <code>false</code> otherwise.
- */
- public static boolean hasString(String key) {
- if (key != null) {
- try {
- Field field = Messages.class.getDeclaredField(key);
- return field != null;
- } catch (NoSuchFieldException e) { /* ignored on purpose */ }
- }
-
- return false;
- }
-
- /**
- * Returns the corresponding string for the given externalized strings
- * key or <code>null</code> if the key does not exist.
- *
- * @param key The externalized strings key or <code>null</code>.
- * @return The corresponding string or <code>null</code>.
- */
- public static String getString(String key) {
- if (key != null) {
- try {
- Field field = Messages.class.getDeclaredField(key);
- if (field != null) {
- return (String)field.get(null);
- }
- } catch (Exception e) { /* ignored on purpose */ }
- }
-
- return null;
- }
-
- // **** Declare externalized string id's down here *****
-
- public static String LaunchSelectionManager_error_failedToDetermineElfType;
-
- public static String ContextSelectorControl_toolbar_refresh_tooltip;
-
- public static String LaunchContextSelectorTab_name;
-
- public static String ContextSelectorSection_title;
-
- public static String RemoteContextSelectorControl_error_noContextSelected_single;
- public static String RemoteContextSelectorControl_error_noContextSelected_multi;
-
- public static String ReferencedProjectsTab_name;
-
- public static String ReferencedProjectsSection_title;
- public static String ReferencedProjectsSection_description;
- public static String ReferencedProjectsSection_project_column;
- public static String ReferencedProjectsSection_add_button;
- public static String ReferencedProjectsSection_delete_button;
- public static String ReferencedProjectsSection_up_button;
- public static String ReferencedProjectsSection_down_button;
- public static String ReferencedProjectsSection_addDialog_message;
-
-
-}
+/*******************************************************************************
+ * 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.launch.ui.nls;
+
+import java.lang.reflect.Field;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Launch UI Plug-in externalized strings management.
+ */
+public class Messages extends NLS {
+
+ // The plug-in resource bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tcf.te.launch.ui.nls.Messages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
+ static {
+ // Load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ /**
+ * Returns if or if not this NLS manager contains a constant for
+ * the given externalized strings key.
+ *
+ * @param key The externalized strings key or <code>null</code>.
+ * @return <code>True</code> if a constant for the given key exists, <code>false</code> otherwise.
+ */
+ public static boolean hasString(String key) {
+ if (key != null) {
+ try {
+ Field field = Messages.class.getDeclaredField(key);
+ return field != null;
+ } catch (NoSuchFieldException e) { /* ignored on purpose */ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns the corresponding string for the given externalized strings
+ * key or <code>null</code> if the key does not exist.
+ *
+ * @param key The externalized strings key or <code>null</code>.
+ * @return The corresponding string or <code>null</code>.
+ */
+ public static String getString(String key) {
+ if (key != null) {
+ try {
+ Field field = Messages.class.getDeclaredField(key);
+ if (field != null) {
+ return (String)field.get(null);
+ }
+ } catch (Exception e) { /* ignored on purpose */ }
+ }
+
+ return null;
+ }
+
+ // **** Declare externalized string id's down here *****
+
+ public static String LaunchSelectionManager_error_failedToDetermineElfType;
+
+ public static String ContextSelectorControl_toolbar_refresh_tooltip;
+
+ public static String LaunchContextSelectorTab_name;
+
+ public static String ContextSelectorSection_title;
+
+ public static String RemoteContextSelectorControl_error_noContextSelected_single;
+ public static String RemoteContextSelectorControl_error_noContextSelected_multi;
+
+ public static String ReferencedProjectsTab_name;
+
+ public static String ReferencedProjectsSection_title;
+ public static String ReferencedProjectsSection_description;
+ public static String ReferencedProjectsSection_project_column;
+ public static String ReferencedProjectsSection_add_button;
+ public static String ReferencedProjectsSection_delete_button;
+ public static String ReferencedProjectsSection_up_button;
+ public static String ReferencedProjectsSection_down_button;
+ public static String ReferencedProjectsSection_addDialog_message;
+
+ public static String LaunchEditorPage_title;
+
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.properties
index 40774a4..63f510a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/nls/Messages.properties
@@ -1,27 +1,28 @@
-#
-# org.eclipse.tcf.te.launch.ui
-# Externalized Strings.
-#
-
-LaunchSelectionManager_error_failedToDetermineElfType=Failed to determine ELF type of file ''{0}''.
-
-LaunchContextSelectorTab_name=Main
-
-ContextSelectorControl_toolbar_refresh_tooltip=Refresh
-
-ContextSelectorSection_title=Remote Context
-
-RemoteContextSelectorControl_error_noContextSelected_single=Please select a remote context.
-RemoteContextSelectorControl_error_noContextSelected_multi=Please select one or more remote contexts.
-
-ReferencedProjectsTab_name = Referenced Projects
-
-ReferencedProjectsSection_title = Referenced Projects
-ReferencedProjectsSection_description = Referenced Projects
-ReferencedProjectsSection_project_column = Project
-ReferencedProjectsSection_add_button = Add
-ReferencedProjectsSection_delete_button = Delete
-ReferencedProjectsSection_up_button = Up
-ReferencedProjectsSection_down_button = Down
-ReferencedProjectsSection_addDialog_message = Select projects that should be built before launch.
-
+#
+# org.eclipse.tcf.te.launch.ui
+# Externalized Strings.
+#
+
+LaunchSelectionManager_error_failedToDetermineElfType=Failed to determine ELF type of file ''{0}''.
+
+LaunchContextSelectorTab_name=Main
+
+ContextSelectorControl_toolbar_refresh_tooltip=Refresh
+
+ContextSelectorSection_title=Remote Context
+
+RemoteContextSelectorControl_error_noContextSelected_single=Please select a remote context.
+RemoteContextSelectorControl_error_noContextSelected_multi=Please select one or more remote contexts.
+
+ReferencedProjectsTab_name = Referenced Projects
+
+ReferencedProjectsSection_title = Referenced Projects
+ReferencedProjectsSection_description = Referenced Projects
+ReferencedProjectsSection_project_column = Project
+ReferencedProjectsSection_add_button = Add
+ReferencedProjectsSection_delete_button = Delete
+ReferencedProjectsSection_up_button = Up
+ReferencedProjectsSection_down_button = Down
+ReferencedProjectsSection_addDialog_message = Select projects that should be built before launch.
+
+LaunchEditorPage_title = Launches \ No newline at end of file
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/AbstractLaunchConfigurationTabGroup.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/AbstractLaunchConfigurationTabGroup.java
index 13fc78b..80c9308 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/AbstractLaunchConfigurationTabGroup.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/AbstractLaunchConfigurationTabGroup.java
@@ -9,11 +9,16 @@
*******************************************************************************/
package org.eclipse.tcf.te.launch.ui.tabs;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
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;
@@ -42,9 +47,47 @@ public abstract class AbstractLaunchConfigurationTabGroup extends org.eclipse.de
* @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
*/
@Override
- public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
this.dialog = dialog;
this.mode = mode;
+
+ // The list of tabs to be set to the launch tab group
+ List<ILaunchConfigurationTab> tabs = new ArrayList<ILaunchConfigurationTab>();
+
+ // Create the default launch tabs
+ createContextSelectorTab(dialog, tabs, mode);
+
+ // Create and add any additional launch tabs
+ createAdditionalTabs(dialog, tabs, mode);
+
+ // Apply the tabs
+ setTabs(tabs.toArray(new ILaunchConfigurationTab[tabs.size()]));
+ }
+
+ /**
+ * Create the context selector tab.
+ *
+ * @param dialog The launch configuration dialog this tab group is contained in.
+ * @param tabs The list of launch configuration tabs. Must not be <code>null</code>.
+ * @param mode The mode the launch configuration dialog was opened in.
+ */
+ public void createContextSelectorTab(ILaunchConfigurationDialog dialog, List<ILaunchConfigurationTab> tabs, String mode) {
+ Assert.isNotNull(tabs);
+ }
+
+ /**
+ * Hook for subclasses to overwrite to add additional launch configuration tabs to the given
+ * tab list.
+ * <p>
+ * Called from {@link #createTabs(ILaunchConfigurationDialog, String)} before setting the tabs list
+ * to the launch configuration tab group.
+ *
+ * @param dialog The launch configuration dialog this tab group is contained in.
+ * @param tabs The list of launch configuration tabs. Must not be <code>null</code>.
+ * @param mode The mode the launch configuration dialog was opened in.
+ */
+ public void createAdditionalTabs(ILaunchConfigurationDialog dialog, List<ILaunchConfigurationTab> tabs, String mode) {
+ Assert.isNotNull(tabs);
}
/*
@@ -101,7 +144,9 @@ public abstract class AbstractLaunchConfigurationTabGroup extends org.eclipse.de
ILaunchSpecification launchSpec = delegate.getLaunchSpecification(launchConfigTypeId, launchSelection);
// initialize the new launch configuration.
// ignore validation result of launch spec - init as much attributes as possible
- if (launchSpec != null) delegate.initLaunchConfigAttributes(configuration, launchSpec);
+ if (launchSpec != null) {
+ delegate.initLaunchConfigAttributes(configuration, launchSpec);
+ }
}
}
catch (CoreException e) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/LaunchConfigurationTabGroup.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/LaunchConfigurationTabGroup.java
deleted file mode 100644
index 84a7362..0000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/LaunchConfigurationTabGroup.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.launch.ui.tabs;
-
-import java.util.ArrayList;
-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.launchcontext.LaunchContextSelectorTab;
-
-/**
- * Default launch configuration tab group implementation.
- */
-public class LaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
-
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.AbstractLaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
- */
- @Override
- public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
- super.createTabs(dialog, mode);
-
- // The list of tabs to be set to the launch tab group
- List<ILaunchConfigurationTab> tabs = new ArrayList<ILaunchConfigurationTab>();
-
- // Create the default launch tabs
- createContextSelectorTab(dialog, tabs, mode);
-
- // Create and add any additional launch tabs
- createAdditionalTabs(dialog, tabs, mode);
-
- // Apply the tabs
- setTabs(tabs.toArray(new ILaunchConfigurationTab[tabs.size()]));
- }
-
- /**
- * Create the context selector tab.
- *
- * @param dialog The launch configuration dialog this tab group is contained in.
- * @param tabs The list of launch configuration tabs. Must not be <code>null</code>.
- * @param mode The mode the launch configuration dialog was opened in.
- */
- public void createContextSelectorTab(ILaunchConfigurationDialog dialog, List<ILaunchConfigurationTab> tabs, String mode) {
- Assert.isNotNull(tabs);
-
- ILaunchConfigurationTab tab = new LaunchContextSelectorTab();
- tabs.add(tab);
- }
-
- /**
- * Hook for subclasses to overwrite to add additional launch configuration tabs to the given
- * tab list.
- * <p>
- * Called from {@link #createTabs(ILaunchConfigurationDialog, String)} before setting the tabs list
- * to the launch configuration tab group.
- *
- * @param dialog The launch configuration dialog this tab group is contained in.
- * @param tabs The list of launch configuration tabs. Must not be <code>null</code>.
- * @param mode The mode the launch configuration dialog was opened in.
- */
- public void createAdditionalTabs(ILaunchConfigurationDialog dialog, List<ILaunchConfigurationTab> tabs, String mode) {
- Assert.isNotNull(tabs);
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/ContextSelectorControl.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/AbstractContextSelectorControl.java
index c81ba7d..b611475 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/ContextSelectorControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/AbstractContextSelectorControl.java
@@ -17,6 +17,7 @@ import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.AssertionFailedException;
import org.eclipse.jface.dialogs.IDialogPage;
+import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.jface.viewers.ICheckStateListener;
@@ -37,6 +38,7 @@ import org.eclipse.swt.widgets.Item;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.Widget;
+import org.eclipse.tcf.te.launch.ui.nls.Messages;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
@@ -45,14 +47,12 @@ import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService;
import org.eclipse.tcf.te.ui.controls.AbstractDecoratedDialogPageControl;
import org.eclipse.tcf.te.ui.jface.interfaces.IValidatingContainer;
import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.tcf.te.ui.views.internal.ViewRoot;
+import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer;
-import org.eclipse.ui.internal.navigator.NavigatorContentService;
import org.eclipse.ui.navigator.CommonViewerSorter;
/**
- * Context selector control.
+ * Abstract context selector control.
* <p>
* Allows to present a configurable set of elements from the data model from which the user can
* select one or more elements.
@@ -60,10 +60,10 @@ import org.eclipse.ui.navigator.CommonViewerSorter;
* Default properties:
* <ul>
* <li>PROPERTY_SHOW_GHOST_MODEL_NODES = false</li>
+ * <li>PROPERTY_MULTI_CONTEXT_SELECTOR = false</li>
* </ul>
*/
-@SuppressWarnings("restriction")
-public class ContextSelectorControl extends AbstractDecoratedDialogPageControl implements ISelectionProvider {
+public abstract class AbstractContextSelectorControl extends AbstractDecoratedDialogPageControl implements ISelectionProvider {
/**
* Property: If set to <code>true</code>, ghost model nodes will be shown within the tree.
@@ -71,6 +71,19 @@ public class ContextSelectorControl extends AbstractDecoratedDialogPageControl i
public static final String PROPERTY_SHOW_GHOST_MODEL_NODES = "showGhostModelNodes"; //$NON-NLS-1$
/**
+ * Property: If set to <code>true</code>, the control will be created as multi
+ * context control. That means that more than one tree item will be
+ * checkmarkable. In single context selector mode, only one tree item
+ * can be checkmarked at the same time.
+ */
+ public static final String PROPERTY_MULTI_CONTEXT_SELECTOR = "multiContextSelector"; //$NON-NLS-1$
+
+ // The last failure cause
+ private Throwable lastFailureCause;
+ // Flag for controlling if at least one element has to be selected
+ private boolean requireSelection = true;
+
+ /**
* List of selection changed listeners.
*/
private final List<ISelectionChangedListener> selectionListeners = new ArrayList<ISelectionChangedListener>();
@@ -86,9 +99,6 @@ public class ContextSelectorControl extends AbstractDecoratedDialogPageControl i
// The current selection within the tree viewer.
/* default */ ISelection selection;
- // Reference to the navigator content service used
- private NavigatorContentService contentService;
-
/**
* Constant to return an empty viewer filter array.
*/
@@ -187,7 +197,9 @@ public class ContextSelectorControl extends AbstractDecoratedDialogPageControl i
// If the element is a ghost model element, then we have to check
// on the parent as well.
if (!skipDoubleCheckParentState) {
- skipDoubleCheckParentState |= ((IModelNode) element).getParent() == null || !isGhost(((IModelNode) element).getParent());
+ IPropertiesAccessService service = ServiceManager.getInstance().getService(IPropertiesAccessService.class);
+ IModelNode parent = service != null ? (IModelNode)service.getParent(element) : null;
+ skipDoubleCheckParentState |= parent == null || !isGhost(parent);
}
// Call the super implementation to check the item and
@@ -262,8 +274,13 @@ public class ContextSelectorControl extends AbstractDecoratedDialogPageControl i
@Override
public void checkStateChanged(CheckStateChangedEvent event) {
Object element = event.getElement();
- if (element instanceof IModelNode) {
- onModelNodeCheckStateChanged((IModelNode) element, event.getChecked());
+ boolean checked = event.getChecked();
+
+ onCheckStateChanged(element, checked);
+
+ // validate the parent page if there is one set
+ if (getParentPage() instanceof IValidatingContainer) {
+ ((IValidatingContainer) getParentPage()).validate();
}
}
}
@@ -288,13 +305,17 @@ public class ContextSelectorControl extends AbstractDecoratedDialogPageControl i
*/
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof IModelNode) {
+ if (element instanceof ICategory) {
+ return true;
+ }
+ else if (element instanceof IModelNode) {
if (isGhost((IModelNode) element)) {
return doShowGhostModelElements();
}
+ return true;
}
- return true;
+ return false;
}
}
@@ -304,7 +325,7 @@ public class ContextSelectorControl extends AbstractDecoratedDialogPageControl i
* @param parentPage The parent target connection page this control is embedded in. Might be
* <code>null</code> if the control is not associated with a page.
*/
- public ContextSelectorControl(IDialogPage parentPage) {
+ public AbstractContextSelectorControl(IDialogPage parentPage) {
super(parentPage);
selectionListeners.clear();
// initialize the properties
@@ -328,6 +349,28 @@ public class ContextSelectorControl extends AbstractDecoratedDialogPageControl i
protected void initializeProperties(IPropertiesContainer properties) {
Assert.isNotNull(properties);
properties.setProperty(PROPERTY_SHOW_GHOST_MODEL_NODES, false);
+ properties.setProperty(PROPERTY_MULTI_CONTEXT_SELECTOR, false);
+ }
+
+ /**
+ * Set the last failure cause to display.
+ *
+ * @param cause The last failure case or <code>null</code>.
+ */
+ public final void setLastFailureCause(Throwable cause) {
+ lastFailureCause = cause;
+ if (getParentPage() instanceof IValidatingContainer) {
+ ((IValidatingContainer)getParentPage()).validate();
+ }
+ }
+
+ /**
+ * Returns the last failure cause to display.
+ *
+ * @return The last failure cause or <code>null</code>.
+ */
+ public final Throwable getLastFailureCause() {
+ return lastFailureCause;
}
/**
@@ -347,11 +390,6 @@ public class ContextSelectorControl extends AbstractDecoratedDialogPageControl i
*/
@Override
public void dispose() {
- // Dispose the navigator content service
- if (contentService != null) {
- contentService.dispose();
- contentService = null;
- }
viewer = null;
@@ -405,6 +443,37 @@ public class ContextSelectorControl extends AbstractDecoratedDialogPageControl i
return NO_CONTEXTS;
}
+
+ /**
+ * Called from the default check state listener implementation if the checked state of an element has changed.
+ *
+ * @param element The element checked or unchecked. Must not be <code>null</code>.
+ * @param checked <code>True</code> if the model node has been checked, <code>false</code> if
+ * unchecked.
+ */
+ protected void onCheckStateChanged(Object element, boolean checked) {
+ // In case the control is operating in single context selector mode,
+ // we have to uncheck any other element than the given checked one.
+ if (checked && getPropertiesContainer().isProperty(PROPERTY_MULTI_CONTEXT_SELECTOR, false)) {
+ if (getViewer() instanceof ContextSelectorTreeViewer) {
+ // Node: Within here, only methods which do not fire the check state listeners
+ // again must be used!
+ ContextSelectorTreeViewer viewer = (ContextSelectorTreeViewer)getViewer();
+
+ // If the checked node is a container node and has children, select
+ // the first children of the container.
+ Item[] childItems = viewer.getChildren(element);
+ if (childItems != null && childItems.length > 1) {
+ // Take the first item as element to be checked
+ viewer.setCheckedElements(new Object[] { childItems[0].getData() });
+ } else {
+ // Set the passed in element node checked
+ viewer.setCheckedElements(new Object[] { element });
+ }
+ }
+ }
+ }
+
/**
* Sets the list of checked model node contexts.
*
@@ -526,13 +595,7 @@ public class ContextSelectorControl extends AbstractDecoratedDialogPageControl i
viewer.setUseHashlookup(true);
doConfigureTreeLayoutData(viewer.getTree());
-
- // Create the navigator content service
- contentService = new NavigatorContentService(IUIConstants.ID_EXPLORER, viewer);
- Assert.isNotNull(contentService);
-
- viewer.setContentProvider(contentService.createCommonContentProvider());
- viewer.setLabelProvider(contentService.createCommonLabelProvider());
+ doConfigureTreeContentAndLabelProvider(viewer);
viewer.setSorter(doCreateViewerSorter());
if ((getTreeViewerStyle() & SWT.CHECK) != 0 && getViewerCheckStateListener(viewer) != null) {
@@ -577,7 +640,7 @@ public class ContextSelectorControl extends AbstractDecoratedDialogPageControl i
* @return The style bits to apply to the tree viewer.
*/
protected int getTreeViewerStyle() {
- return SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER;
+ return SWT.CHECK | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.MULTI;
}
/**
@@ -655,28 +718,17 @@ public class ContextSelectorControl extends AbstractDecoratedDialogPageControl i
}
/**
- * Called from the default check state listener implementation if the checked state of the
- * passed in model node has changed.
+ * Returns the initial input object to set to the controls tree viewer.
*
- * @param node The model node. Must not be <code>null</code>.
- * @param checked <code>True</code> if the model node has been checked, <code>false</code> if
- * unchecked.
+ * @return The initial viewer input to set or <code>null</code> if none.
*/
- protected void onModelNodeCheckStateChanged(IModelNode node, boolean checked) {
- // validate the parent page if there is one set
- if (getParentPage() instanceof IValidatingContainer) {
- ((IValidatingContainer) getParentPage()).validate();
- }
- }
+ protected abstract Object getInitialViewerInput();
/**
- * Returns the initial input object to set to the controls tree viewer.
- *
- * @return The initial viewer input to set or <code>null</code> if none.
+ * Configure content and label provider.
+ * @param viewer The tree viewer.
*/
- protected Object getInitialViewerInput() {
- return ViewRoot.getInstance();
- }
+ protected abstract void doConfigureTreeContentAndLabelProvider(TreeViewer viewer);
/**
* Enables the tree control.
@@ -759,4 +811,85 @@ public class ContextSelectorControl extends AbstractDecoratedDialogPageControl i
}
}
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseControl#isValid()
+ */
+ @Override
+ public boolean isValid() {
+ boolean valid = super.isValid();
+
+ // If there is a last failure cause set, show that failure cause
+ valid = getLastFailureCause() == null;
+ if (!valid) {
+ setMessage(getLastFailureCause().getLocalizedMessage(), IMessageProvider.ERROR);
+ }
+
+ // The remote context selector control is only valid, if at least one
+ // element has been checked (if operating with CHECK style set)
+ if (valid && (getTreeViewerStyle() & SWT.CHECK) != 0 && requireSelection) {
+ int count = getCheckedModelContexts().length;
+ valid = count == 1 || (count > 1 && getPropertiesContainer().isProperty(PROPERTY_MULTI_CONTEXT_SELECTOR, true));
+
+ // if we are not valid here, it can only mean, that there is
+ // no connectable checked.
+ if (!valid) {
+ String messageId = "RemoteContextSelectorControl_error_noContextSelected"; //$NON-NLS-1$
+ if (getPropertiesContainer().isProperty(PROPERTY_MULTI_CONTEXT_SELECTOR, true)) {
+ messageId += "_multi"; //$NON-NLS-1$
+ }
+ else {
+ messageId += "_single"; //$NON-NLS-1$
+ }
+
+ setMessage(getMessageForId(messageId), getMessageTypeForId(messageId, IMessageProvider.ERROR));
+ }
+ }
+
+ if (getControlDecoration() != null) {
+ // Setup and show the control decoration if necessary
+ if (isEnabled() && (!valid || (getMessage() != null && getMessageType() != IMessageProvider.NONE))) {
+ // Update the control decorator
+ updateControlDecoration(getMessage(), getMessageType());
+ } else {
+ updateControlDecoration(null, IMessageProvider.NONE);
+ }
+ }
+
+
+ return valid;
+ }
+
+ /**
+ * Returns the message text for the given message id. Subclass in case different
+ * message text should be used for standard messages.
+ *
+ * @param messageId The message id. Must be not <code>null</code>.
+ * @return The message text.
+ */
+ protected String getMessageForId(String messageId) {
+ Assert.isNotNull(messageId);
+ return Messages.getString(messageId);
+ }
+
+ /**
+ * Returns the message type for the given message id. Subclass in case different
+ * message types should by used for standard messages. The default implementation
+ * returns the proposed message type unchanged.
+ *
+ * @param messageId The message id. Must be not <code>null</code>.
+ * @param proposed The proposed message type.
+ * @return The message type for the given message id.
+ */
+ protected int getMessageTypeForId(String messageId, int proposed) {
+ Assert.isNotNull(messageId);
+ return proposed;
+ }
+
+ /**
+ * Configures whether a selection is required or not.
+ */
+ public void setRequireSelection(boolean value) {
+ requireSelection = value;
+ }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorSection.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/AbstractContextSelectorSection.java
index 819eaa1..6e47e91 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/AbstractContextSelectorSection.java
@@ -34,11 +34,11 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
/**
- * Context selector section implementation.
+ * Abstract context selector section implementation.
*/
-public class LaunchContextSelectorSection extends AbstractSection implements ILaunchConfigurationTabFormPart {
+public abstract class AbstractContextSelectorSection extends AbstractSection implements ILaunchConfigurationTabFormPart {
// Reference to the section sub controls
- /* default */ LaunchContextSelectorControl selector;
+ /* default */ AbstractContextSelectorControl selector;
/**
* Context selector control refresh action implementation.
@@ -71,7 +71,7 @@ public class LaunchContextSelectorSection extends AbstractSection implements ILa
* @param form The parent managed form. Must not be <code>null</code>.
* @param parent The parent composite. Must not be <code>null</code>.
*/
- public LaunchContextSelectorSection(IManagedForm form, Composite parent) {
+ public AbstractContextSelectorSection(IManagedForm form, Composite parent) {
super(form, parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
getSection().setBackground(parent.getBackground());
createClient(getSection(), form.getToolkit());
@@ -99,19 +99,17 @@ public class LaunchContextSelectorSection extends AbstractSection implements ILa
createSectionToolbar(section, toolkit);
// Create the section sub controls
- selector = new LaunchContextSelectorControl(null) {
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.LaunchContextSelectorControl#onModelNodeCheckStateChanged(org.eclipse.tcf.te.runtime.model.interfaces.IModelNode, boolean)
- */
- @Override
- protected void onModelNodeCheckStateChanged(IModelNode node, boolean checked) {
- getManagedForm().dirtyStateChanged();
- }
- };
+ selector = doCreateContextSelector();
selector.setFormToolkit(toolkit);
selector.setupPanel(client);
}
+ /**
+ * Create the context selector control.
+ * @return The context selector control.
+ */
+ protected abstract AbstractContextSelectorControl doCreateContextSelector();
+
/* (non-Javadoc)
* @see org.eclipse.ui.forms.AbstractFormPart#dispose()
*/
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorTab.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/AbstractContextSelectorTab.java
index e20ba81..aefe3e3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/AbstractContextSelectorTab.java
@@ -16,15 +16,16 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.tcf.te.launch.ui.nls.Messages;
import org.eclipse.tcf.te.launch.ui.tabs.AbstractFormsLaunchConfigurationTab;
import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
+import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.widgets.TableWrapData;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
/**
- * Context selector launch configuration tab implementation.
+ * Abstract context selector launch configuration tab implementation.
*/
-public class LaunchContextSelectorTab extends AbstractFormsLaunchConfigurationTab {
+public abstract class AbstractContextSelectorTab extends AbstractFormsLaunchConfigurationTab {
// References to the tab sub sections
- private LaunchContextSelectorSection selectorSection;
+ private AbstractContextSelectorSection selectorSection;
/* (non-Javadoc)
* @see org.eclipse.tcf.te.launch.ui.tabs.AbstractFormsLaunchConfigurationTab#dispose()
@@ -32,14 +33,14 @@ public class LaunchContextSelectorTab extends AbstractFormsLaunchConfigurationTa
@Override
public void dispose() {
if (selectorSection != null) { selectorSection.dispose(); selectorSection = null; }
- super.dispose();
+ 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) {
+ protected final void doCreateFormContent(Composite parent, CustomFormToolkit toolkit) {
Assert.isNotNull(parent);
Assert.isNotNull(toolkit);
@@ -52,11 +53,30 @@ public class LaunchContextSelectorTab extends AbstractFormsLaunchConfigurationTa
panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
panel.setBackground(parent.getBackground());
- selectorSection = new LaunchContextSelectorSection(getManagedForm(), panel);
+ selectorSection = doCreateContextSelectorSection(getManagedForm(), panel);
selectorSection.getSection().setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP));
getManagedForm().addPart(selectorSection);
+
+ doCreateAdditionalFormContent(getManagedForm(), parent, toolkit);
}
+ /**
+ * Do create additional managed form content.
+ *
+ * @param form The managed form.
+ * @param parent The parent composite. Must not be <code>null</code>
+ * @param toolkit The {@link CustomFormToolkit} instance. Must not be <code>null</code>.
+ */
+ protected abstract void doCreateAdditionalFormContent(IManagedForm form, Composite parent, CustomFormToolkit toolkit);
+
+ /**
+ * Create the context selector section
+ * @param form The managed form.
+ * @param panel The panel.
+ * @return The context selector section.
+ */
+ protected abstract AbstractContextSelectorSection doCreateContextSelectorSection(IManagedForm form, Composite panel);
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorControl.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorControl.java
deleted file mode 100644
index f54fa7b..0000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/LaunchContextSelectorControl.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.launch.ui.tabs.launchcontext;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.dialogs.IDialogPage;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.tcf.te.launch.ui.nls.Messages;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.ui.jface.interfaces.IValidatingContainer;
-
-/**
- * Step context selector control implementation.
- * <p>
- * Default properties:
- * <ul>
- * <li>PROPERTY_SHOW_GHOST_MODEL_NODES = false</li>
- * <li>PROPERTY_MULTI_CONTEXT_SELECTOR = true</li>
- * </ul>
- */
-public class LaunchContextSelectorControl extends ContextSelectorControl {
- /**
- * Property: If set to <code>true</code>, the control will be created as multi
- * context control. That means that more than one tree item will be
- * checkmarkable. In single context selector mode, only one tree item
- * can be checkmarked at the same time.
- */
- public static final String PROPERTY_MULTI_CONTEXT_SELECTOR = "multiContextSelector"; //$NON-NLS-1$
-
- // The last failure cause
- private Throwable lastFailureCause;
- // Flag for controlling if at least one element has to be selected
- private boolean requireSelection = true;
-
- /**
- * Constructor.
- *
- * @param parentPage The parent target connection page this control is embedded in. Might be
- * <code>null</code> if the control is not associated with a page.
- */
- public LaunchContextSelectorControl(IDialogPage parentPage) {
- super(parentPage);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.ContextSelectorControl#initializeProperties(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- protected void initializeProperties(IPropertiesContainer properties) {
- super.initializeProperties(properties);
- properties.setProperty(PROPERTY_MULTI_CONTEXT_SELECTOR, true);
- }
-
- /**
- * Set the last failure cause to display.
- *
- * @param cause The last failure case or <code>null</code>.
- */
- public final void setLastFailureCause(Throwable cause) {
- lastFailureCause = cause;
- if (getParentPage() instanceof IValidatingContainer) {
- ((IValidatingContainer)getParentPage()).validate();
- }
- }
-
- /**
- * Returns the last failure cause to display.
- *
- * @return The last failure cause or <code>null</code>.
- */
- public final Throwable getLastFailureCause() {
- return lastFailureCause;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.ContextSelectorControl#createTreeViewerControl(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected TreeViewer createTreeViewerControl(Composite parent) {
- TreeViewer viewer = super.createTreeViewerControl(parent);
- if (viewer != null) {
- viewer.expandAll();
- }
- return viewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.ContextSelectorControl#getTreeViewerStyle()
- */
- @Override
- protected int getTreeViewerStyle() {
- // For the step context selector we do want to have checkboxes in front
- // of the tree items and allow for multi-selection.
- return super.getTreeViewerStyle() & ~SWT.SINGLE | SWT.CHECK | SWT.MULTI;
- }
-
- /* (non-Javadoc)
- * @see com.windriver.ide.target.ui.wizard.controls.elementselector.WRModelContextSelectorControl#onModelNodeCheckStateChanged(com.windriver.ide.target.api.model.IModelNode, boolean)
- */
- @Override
- protected void onModelNodeCheckStateChanged(IModelNode node, boolean checked) {
- // In case the control is operating in single context selector mode,
- // we have to uncheck any other element than the given checked one.
- if (checked && getPropertiesContainer().isProperty(PROPERTY_MULTI_CONTEXT_SELECTOR, false)) {
- if (getViewer() instanceof ContextSelectorTreeViewer) {
- // Node: Within here, only methods which do not fire the check state listeners
- // again must be used!
- ContextSelectorTreeViewer viewer = (ContextSelectorTreeViewer)getViewer();
-
- // If the checked node is a container node and has children, select
- // the first children of the container.
- Item[] childItems = viewer.getChildren(node);
- if (childItems != null && childItems.length > 1) {
- // Take the first item as element to be checked
- viewer.setCheckedElements(new Object[] { childItems[0].getData() });
- } else {
- // Set the passed in element node checked
- viewer.setCheckedElements(new Object[] { node });
- }
- }
- }
-
- // Trigger page validation after adjusting the checked state.
- super.onModelNodeCheckStateChanged(node, checked);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseControl#isValid()
- */
- @Override
- public boolean isValid() {
- boolean valid = super.isValid();
-
- // If there is a last failure cause set, show that failure cause
- valid = getLastFailureCause() == null;
- if (!valid) {
- setMessage(getLastFailureCause().getLocalizedMessage(), IMessageProvider.ERROR);
- }
-
- // The remote context selector control is only valid, if at least one
- // element has been checked (if operating with CHECK style set)
- if (valid && (getTreeViewerStyle() & SWT.CHECK) != 0 && requireSelection) {
- valid = getCheckedModelContexts().length > 0;
-
- // if we are not valid here, it can only mean, that there is
- // no connectable checked.
- if (!valid) {
- String messageId = "RemoteContextSelectorControl_error_noContextSelected"; //$NON-NLS-1$
- if (getPropertiesContainer().isProperty(PROPERTY_MULTI_CONTEXT_SELECTOR, true)) {
- messageId += "_multi"; //$NON-NLS-1$
- }
- else {
- messageId += "_single"; //$NON-NLS-1$
- }
-
- setMessage(getMessageForId(messageId), getMessageTypeForId(messageId, IMessageProvider.ERROR));
- }
- }
-
- if (getControlDecoration() != null) {
- // Setup and show the control decoration if necessary
- if (isEnabled() && (!valid || (getMessage() != null && getMessageType() != IMessageProvider.NONE))) {
- // Update the control decorator
- updateControlDecoration(getMessage(), getMessageType());
- } else {
- updateControlDecoration(null, IMessageProvider.NONE);
- }
- }
-
-
- return valid;
- }
-
- /**
- * Returns the message text for the given message id. Subclass in case different
- * message text should be used for standard messages.
- *
- * @param messageId The message id. Must be not <code>null</code>.
- * @return The message text.
- */
- protected String getMessageForId(String messageId) {
- Assert.isNotNull(messageId);
- return Messages.getString(messageId);
- }
-
- /**
- * Returns the message type for the given message id. Subclass in case different
- * message types should by used for standard messages. The default implementation
- * returns the proposed message type unchanged.
- *
- * @param messageId The message id. Must be not <code>null</code>.
- * @param proposed The proposed message type.
- * @return The message type for the given message id.
- */
- protected int getMessageTypeForId(String messageId, int proposed) {
- Assert.isNotNull(messageId);
- return proposed;
- }
-
- /**
- * Configures whether a selection is required or not.
- */
- public void setRequireSelection(boolean value) {
- requireSelection = value;
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/RemoteAppLaunchManagerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/RemoteAppLaunchManagerDelegate.java
index a31b7b3..efb4dfb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/RemoteAppLaunchManagerDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/RemoteAppLaunchManagerDelegate.java
@@ -23,6 +23,7 @@ import org.eclipse.tcf.te.launch.core.lm.interfaces.IFileTransferLaunchAttribute
import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchContextLaunchAttributes;
import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification;
import org.eclipse.tcf.te.launch.core.lm.interfaces.IReferencedProjectLaunchAttributes;
+import org.eclipse.tcf.te.launch.core.nls.Messages;
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.core.persistence.projects.ReferencedProjectItem;
@@ -31,13 +32,17 @@ import org.eclipse.tcf.te.launch.core.selection.interfaces.IProjectSelectionCont
import org.eclipse.tcf.te.launch.core.selection.interfaces.IRemoteSelectionContext;
import org.eclipse.tcf.te.launch.core.selection.interfaces.ISelectionContext;
import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.filetransfer.FileTransferItem;
+import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService;
+import org.eclipse.tcf.te.runtime.services.interfaces.constants.IPropertiesAccessServiceConstants;
import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
import org.eclipse.tcf.te.tcf.launch.core.interfaces.IRemoteAppLaunchAttributes;
/**
* RemoteAppLaunchManagerDelegate
*/
+@SuppressWarnings("restriction")
public class RemoteAppLaunchManagerDelegate extends DefaultLaunchManagerDelegate {
/**
@@ -76,11 +81,25 @@ public class RemoteAppLaunchManagerDelegate extends DefaultLaunchManagerDelegate
launchContexts.add(remoteCtx);
LaunchContextsPersistenceDelegate.setLaunchContexts(launchSpec, launchContexts.toArray(new IModelNode[launchContexts.size()]));
}
+
+ IPropertiesAccessService service = ServiceManager.getInstance().getService(remoteCtx, IPropertiesAccessService.class);
+ String ctxName = service != null ? (String)service.getTargetAddress(remoteCtx).get(IPropertiesAccessServiceConstants.PROP_ADDRESS) : null;
+
+ if (ctxName != null) {
+ if (launchSpec.getLaunchConfigName() == null ||
+ Messages.DefaultLaunchManagerDelegate_defaultLaunchName.equals(launchSpec.getLaunchConfigName())) {
+ launchSpec.setLaunchConfigName(ctxName);
+ }
+ else {
+ launchSpec.setLaunchConfigName(launchSpec.getLaunchConfigName() + " (" + ctxName + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
}
else if (selectionContext instanceof IProjectSelectionContext) {
List<IFileTransferItem> transfers = new ArrayList<IFileTransferItem>(Arrays.asList(FileTransfersPersistenceDelegate.getFileTransfers(launchSpec)));
List<IReferencedProjectItem> projects = new ArrayList<IReferencedProjectItem>(Arrays.asList(ReferencedProjectsPersistenceDelegate.getReferencedProjects(launchSpec)));
- String processImage = null;
+ String processName = null;
+ String processPath = null;
boolean added = false;
for (Object selection : selectionContext.getSelections()) {
@@ -93,7 +112,8 @@ public class RemoteAppLaunchManagerDelegate extends DefaultLaunchManagerDelegate
transfer.setProperty(IFileTransferItem.PROPERTY_TARGET, new Path("/tmp/").toPortableString()); //$NON-NLS-1$
transfers.add(transfer);
if (!added) {
- processImage = "/tmp/" + path.lastSegment(); //$NON-NLS-1$
+ processName = path.lastSegment();
+ processPath = "/tmp/" + processName; //$NON-NLS-1$
}
added = true;
}
@@ -108,7 +128,15 @@ public class RemoteAppLaunchManagerDelegate extends DefaultLaunchManagerDelegate
FileTransfersPersistenceDelegate.setFileTransfers(launchSpec, transfers.toArray(new IFileTransferItem[transfers.size()]));
ReferencedProjectsPersistenceDelegate.setReferencedProjects(launchSpec, projects.toArray(new IReferencedProjectItem[projects.size()]));
- launchSpec.addAttribute(IRemoteAppLaunchAttributes.ATTR_PROCESS_IMAGE, processImage);
+ launchSpec.addAttribute(IRemoteAppLaunchAttributes.ATTR_PROCESS_IMAGE, processPath);
+
+ if (launchSpec.getLaunchConfigName() == null ||
+ Messages.DefaultLaunchManagerDelegate_defaultLaunchName.equals(launchSpec.getLaunchConfigName())) {
+ launchSpec.setLaunchConfigName(processName);
+ }
+ else {
+ launchSpec.setLaunchConfigName(processName + " (" + launchSpec.getLaunchConfigName() + ")"); //$NON-NLS-1$//$NON-NLS-2$
+ }
}
return launchSpec;
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 38ac541..61f362e 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
@@ -23,7 +23,10 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
org.eclipse.tcf.te.ui.controls;bundle-version="1.0.0",
org.eclipse.tcf.te.runtime.model;bundle-version="1.0.0",
org.eclipse.tcf.te.tcf.filesystem.core;bundle-version="1.0.0",
- org.eclipse.tcf.te.runtime.services;bundle-version="1.0.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"
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.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml
index 1221db9..4735218 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
@@ -18,4 +18,19 @@
type="org.eclipse.tcf.te.tcf.launch.type.remote.app">
</launchConfigurationTabGroup>
</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.eclispe.tcf.te.launch.ui.editor.LaunchEditorPage"
+ insertAfter="org.eclipse.tcf.te.tcf.ui.OverviewEditorPage">
+ <enablement>
+ <with variable="activeEditorInput">
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ </with>
+ </enablement>
+ </editorPageBinding>
+ </extension>
+
</plugin>
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 a4ae714..09dfd28 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTab.java
@@ -13,21 +13,29 @@ 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.LaunchContextSelectorTab;
+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 LaunchContextSelectorTab {
+public class LaunchConfigurationMainTab extends AbstractContextSelectorTab {
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.LaunchContextSelectorTab#doCreateFormContent(org.eclipse.swt.widgets.Composite, org.eclipse.tcf.te.ui.forms.CustomFormToolkit)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorTab#doCreateContextSelectorSection(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite)
*/
@Override
- protected void doCreateFormContent(Composite parent, CustomFormToolkit toolkit) {
- super.doCreateFormContent(parent, toolkit);
+ 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);
@@ -35,8 +43,8 @@ public class LaunchConfigurationMainTab extends LaunchContextSelectorTab {
panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
panel.setBackground(parent.getBackground());
- LaunchConfigurationMainTabSection section = new LaunchConfigurationMainTabSection(getManagedForm(), panel);
+ LaunchConfigurationMainTabSection section = new LaunchConfigurationMainTabSection(form, panel);
section.getSection().setLayoutData(new GridData(GridData.FILL_BOTH));
- getManagedForm().addPart(section);
+ 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/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 f8e481c..2c89077 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java
@@ -14,20 +14,17 @@ 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 org.eclipse.tcf.te.launch.ui.tabs.LaunchConfigurationTabGroup {
+public class LaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
- /**
- * Create the context processImage tab.
- *
- * @param dialog The launch configuration dialog this tab group is contained in.
- * @param tabs The list of launch configuration tabs. Must not be <code>null</code>.
- * @param mode The mode the launch configuration dialog was opened in.
+ /* (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) {
@@ -37,6 +34,9 @@ public class LaunchConfigurationTabGroup extends org.eclipse.tcf.te.launch.ui.ta
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) {
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
new file mode 100644
index 0000000..74796aa
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/launchcontext/ContextSelectorControl.java
@@ -0,0 +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));
+ }
+}
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
new file mode 100644
index 0000000..98d225f
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/launchcontext/ContextSelectorSection.java
@@ -0,0 +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();
+ }
+ };
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/META-INF/MANIFEST.MF
index 23325fd..a37e07f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/META-INF/MANIFEST.MF
@@ -1,42 +1,43 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.tcf.te.ui.views;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.tcf.te.ui.views.activator.UIPlugin
-Bundle-Vendor: %providerName
-Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
- org.eclipse.core.expressions;bundle-version="3.4.300",
- org.eclipse.help;bundle-version="3.5.100",
- org.eclipse.ui;bundle-version="3.7.0",
- org.eclipse.ui.forms;bundle-version="3.5.100",
- org.eclipse.ui.navigator;bundle-version="3.5.100",
- org.eclipse.tcf.te.runtime;bundle-version="1.0.0",
- org.eclipse.tcf.te.runtime.model;bundle-version="1.0.0",
- org.eclipse.tcf.te.ui;bundle-version="1.0.0",
- org.eclipse.tcf.te.ui.forms;bundle-version="1.0.0",
- org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.200",
- org.eclipse.tcf.te.tcf.locator;bundle-version="1.0.0",
- org.eclipse.tcf.te.core;bundle-version="1.0.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ActivationPolicy: lazy
-Bundle-Localization: plugin
-Export-Package: org.eclipse.tcf.te.ui.views,
- org.eclipse.tcf.te.ui.views.actions,
- org.eclipse.tcf.te.ui.views.activator;x-internal:=true,
- org.eclipse.tcf.te.ui.views.categories,
- org.eclipse.tcf.te.ui.views.editor,
- org.eclipse.tcf.te.ui.views.editor.pages,
- org.eclipse.tcf.te.ui.views.events,
- org.eclipse.tcf.te.ui.views.expressions,
- org.eclipse.tcf.te.ui.views.extensions,
- org.eclipse.tcf.te.ui.views.handler,
- org.eclipse.tcf.te.ui.views.interfaces,
- org.eclipse.tcf.te.ui.views.interfaces.handler,
- org.eclipse.tcf.te.ui.views.interfaces.tracing;x-internal:=true,
- org.eclipse.tcf.te.ui.views.interfaces.workingsets,
- org.eclipse.tcf.te.ui.views.internal;x-friends:="org.eclipse.tcf.te.ui.views.workingsets,org.eclipse.tcf.te.launch.ui",
- org.eclipse.tcf.te.ui.views.listeners,
- org.eclipse.tcf.te.ui.views.nls;x-internal:=true,
- org.eclipse.tcf.te.ui.views.perspective,
- org.eclipse.tcf.te.ui.views.tabbed
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.tcf.te.ui.views;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.tcf.te.ui.views.activator.UIPlugin
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.core.expressions;bundle-version="3.4.300",
+ org.eclipse.help;bundle-version="3.5.100",
+ org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.ui.forms;bundle-version="3.5.100",
+ org.eclipse.ui.navigator;bundle-version="3.5.100",
+ org.eclipse.tcf.te.runtime;bundle-version="1.0.0",
+ org.eclipse.tcf.te.runtime.model;bundle-version="1.0.0",
+ org.eclipse.tcf.te.ui;bundle-version="1.0.0",
+ org.eclipse.tcf.te.ui.forms;bundle-version="1.0.0",
+ org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.200",
+ org.eclipse.tcf.te.tcf.locator;bundle-version="1.0.0",
+ org.eclipse.tcf.te.core;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Export-Package: org.eclipse.tcf.te.ui.views,
+ org.eclipse.tcf.te.ui.views.actions,
+ org.eclipse.tcf.te.ui.views.activator;x-internal:=true,
+ org.eclipse.tcf.te.ui.views.categories,
+ org.eclipse.tcf.te.ui.views.editor,
+ org.eclipse.tcf.te.ui.views.editor.pages,
+ org.eclipse.tcf.te.ui.views.events,
+ org.eclipse.tcf.te.ui.views.expressions,
+ org.eclipse.tcf.te.ui.views.extensions,
+ org.eclipse.tcf.te.ui.views.handler,
+ org.eclipse.tcf.te.ui.views.interfaces,
+ org.eclipse.tcf.te.ui.views.interfaces.handler,
+ org.eclipse.tcf.te.ui.views.interfaces.tracing;x-internal:=true,
+ org.eclipse.tcf.te.ui.views.interfaces.workingsets,
+ org.eclipse.tcf.te.ui.views.internal;x-friends:="org.eclipse.tcf.te.ui.views.workingsets,org.eclipse.tcf.te.launch.ui",
+ org.eclipse.tcf.te.ui.views.listeners,
+ org.eclipse.tcf.te.ui.views.navigator,
+ org.eclipse.tcf.te.ui.views.nls;x-internal:=true,
+ org.eclipse.tcf.te.ui.views.perspective,
+ org.eclipse.tcf.te.ui.views.tabbed