aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2012-06-20 06:58:05 (EDT)
committerUwe Stieber2012-06-20 06:58:05 (EDT)
commit8b2198bef42e3331ccf733e7a772adc78394fabb (patch)
tree6d57068f4fa29f0f32d6c7ddb9dca0a5e9be2f4c
parenta40131fce73718f23454afa639cfc893282ae650 (diff)
downloadorg.eclipse.tcf-8b2198bef42e3331ccf733e7a772adc78394fabb.zip
org.eclipse.tcf-8b2198bef42e3331ccf733e7a772adc78394fabb.tar.gz
org.eclipse.tcf-8b2198bef42e3331ccf733e7a772adc78394fabb.tar.bz2
Target Explorer: REWORK launch tabs
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/attach/LaunchConfigurationMainTab.java13
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/filetransfer/AddEditFileTransferDialog.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/AddEditFileTransferDialog.java)2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/filetransfer/FileTransferSection.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/FileTransferSection.java)2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/filetransfer/FileTransferTab.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/filetransfer/FileTransferTab.java)80
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/AbstractLaunchContextMainTab.java125
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/ContextSelectorControl.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/launchcontext/ContextSelectorControl.java)2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/ContextSelectorSection.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/launchcontext/ContextSelectorSection.java)2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTab.java108
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java116
10 files changed, 234 insertions, 222 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 a1f1a92..3b580f6 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
@@ -35,8 +35,8 @@ Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Export-Package: org.eclipse.tcf.te.tcf.launch.ui.activator;x-internal:=true,
org.eclipse.tcf.te.tcf.launch.ui.attach,
+ org.eclipse.tcf.te.tcf.launch.ui.filetransfer,
org.eclipse.tcf.te.tcf.launch.ui.help,
+ org.eclipse.tcf.te.tcf.launch.ui.launchcontext,
org.eclipse.tcf.te.tcf.launch.ui.nls;x-internal:=true,
- org.eclipse.tcf.te.tcf.launch.ui.remote.app,
- org.eclipse.tcf.te.tcf.launch.ui.remote.app.filetransfer,
- org.eclipse.tcf.te.tcf.launch.ui.remote.app.launchcontext
+ org.eclipse.tcf.te.tcf.launch.ui.remote.app
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/attach/LaunchConfigurationMainTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/attach/LaunchConfigurationMainTab.java
index 79cee5f..e25b837 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/attach/LaunchConfigurationMainTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/attach/LaunchConfigurationMainTab.java
@@ -12,24 +12,15 @@ package org.eclipse.tcf.te.tcf.launch.ui.attach;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorTab;
import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILaunchTypes;
-import org.eclipse.tcf.te.tcf.launch.ui.remote.app.launchcontext.ContextSelectorSection;
+import org.eclipse.tcf.te.tcf.launch.ui.launchcontext.AbstractLaunchContextMainTab;
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);
- }
+public class LaunchConfigurationMainTab extends AbstractLaunchContextMainTab {
/* (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)
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/filetransfer/AddEditFileTransferDialog.java
index 5de2094..7223abb 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/filetransfer/AddEditFileTransferDialog.java
@@ -8,7 +8,7 @@
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.ui.remote.app.filetransfer;
+package org.eclipse.tcf.te.tcf.launch.ui.filetransfer;
import java.util.Map;
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/filetransfer/FileTransferSection.java
index d9e65e8..88dd68e 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/filetransfer/FileTransferSection.java
@@ -8,7 +8,7 @@
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.ui.remote.app.filetransfer;
+package org.eclipse.tcf.te.tcf.launch.ui.filetransfer;
import java.util.List;
import java.util.Map;
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/filetransfer/FileTransferTab.java
index 029a8ee..c470491 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/filetransfer/FileTransferTab.java
@@ -1,40 +1,40 @@
-/*******************************************************************************
- * 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.graphics.Image;
-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.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-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);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getImage()
- */
- @Override
- public Image getImage() {
- return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_COPY);
- }
-}
+/*******************************************************************************
+ * 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.filetransfer;
+
+import org.eclipse.swt.graphics.Image;
+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.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+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);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getImage()
+ */
+ @Override
+ public Image getImage() {
+ return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_COPY);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/AbstractLaunchContextMainTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/AbstractLaunchContextMainTab.java
new file mode 100644
index 0000000..68922a1
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/AbstractLaunchContextMainTab.java
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * 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.launchcontext;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jface.dialogs.IDialogPage;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.launch.core.bindings.LaunchConfigTypeBindingsManager;
+import org.eclipse.tcf.te.launch.core.selection.RemoteSelectionContext;
+import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl;
+import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorTab;
+import org.eclipse.tcf.te.tcf.launch.ui.launchcontext.ContextSelectorSection.ContextSelectorSectionSelectorControl;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.ui.forms.IManagedForm;
+
+/**
+ * Launch context selection main launch tab implementation.
+ */
+public abstract class AbstractLaunchContextMainTab extends AbstractContextSelectorTab {
+ /* default */ ILaunchConfiguration configuration = null;
+
+ /**
+ * Context selector control filter filtering remote contexts which are not
+ * enabled for the launch configuration type.
+ */
+ protected class MainTabContextSelectorViewerFilter extends ViewerFilter {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (element instanceof IPeerModel) {
+ String typeId = null;
+ if (configuration != null) {
+ try {
+ typeId = configuration.getType().getIdentifier();
+ }
+ catch (CoreException e) { /* ignored on purpose */ }
+ }
+
+ String mode = getLaunchConfigurationDialog().getMode();
+
+ if (typeId != null && mode != null) {
+ return LaunchConfigTypeBindingsManager.getInstance().isValidLaunchConfigType(typeId, mode, new RemoteSelectionContext((IPeerModel)element, true));
+ }
+ }
+ return true;
+ }
+ }
+
+ /**
+ * Launch configuration main tab context selector control implementation.
+ */
+ protected class MainTabContextSelectorControl extends ContextSelectorSectionSelectorControl {
+
+ /**
+ * Constructor.
+ *
+ * @param section The parent context selector section. Must not be <code>null</code>.
+ * @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 MainTabContextSelectorControl(ContextSelectorSection section, IDialogPage parentPage) {
+ super(section, parentPage);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl#doCreateViewerFilters()
+ */
+ @Override
+ protected ViewerFilter[] doCreateViewerFilters() {
+ List<ViewerFilter> filters = new ArrayList<ViewerFilter>(Arrays.asList(super.doCreateViewerFilters()));
+ filters.add(new MainTabContextSelectorViewerFilter());
+ return filters.toArray(new ViewerFilter[filters.size()]);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.AbstractFormsLaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ @Override
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ super.initializeFrom(configuration);
+ this.configuration = configuration;
+
+ if (getContextSelectorSection() != null) {
+ AbstractContextSelectorControl control = (AbstractContextSelectorControl)getContextSelectorSection().getAdapter(AbstractContextSelectorControl.class);
+ if (control != null && control.getViewer() != null) {
+ control.getViewer().refresh();
+ }
+ }
+ }
+
+ /* (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.tcf.launch.ui.launchcontext.ContextSelectorSection#doCreateContextSelector()
+ */
+ @Override
+ protected AbstractContextSelectorControl doCreateContextSelector() {
+ return new MainTabContextSelectorControl(this, null);
+ }
+ };
+ }
+}
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/launchcontext/ContextSelectorControl.java
index 9d1d9f7..b7a3537 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/launchcontext/ContextSelectorControl.java
@@ -8,7 +8,7 @@
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.ui.remote.app.launchcontext;
+package org.eclipse.tcf.te.tcf.launch.ui.launchcontext;
import org.eclipse.jface.dialogs.IDialogPage;
import org.eclipse.jface.viewers.DecoratingLabelProvider;
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/launchcontext/ContextSelectorSection.java
index 6dbdd2a..0bc0878 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/launchcontext/ContextSelectorSection.java
@@ -7,7 +7,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.ui.remote.app.launchcontext;
+package org.eclipse.tcf.te.tcf.launch.ui.launchcontext;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.dialogs.IDialogPage;
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 118077b..70f0f70 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
@@ -9,125 +9,21 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.launch.ui.remote.app;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.dialogs.IDialogPage;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.te.launch.core.bindings.LaunchConfigTypeBindingsManager;
-import org.eclipse.tcf.te.launch.core.selection.RemoteSelectionContext;
-import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl;
-import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorTab;
import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILaunchTypes;
-import org.eclipse.tcf.te.tcf.launch.ui.remote.app.launchcontext.ContextSelectorSection;
-import org.eclipse.tcf.te.tcf.launch.ui.remote.app.launchcontext.ContextSelectorSection.ContextSelectorSectionSelectorControl;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.launch.ui.launchcontext.AbstractLaunchContextMainTab;
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 {
- /* default */ ILaunchConfiguration configuration = null;
-
- /**
- * Context selector control filter filtering remote contexts which are not
- * enabled for the launch configuration type.
- */
- protected class MainTabContextSelectorViewerFilter extends ViewerFilter {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof IPeerModel) {
- String typeId = null;
- if (configuration != null) {
- try {
- typeId = configuration.getType().getIdentifier();
- }
- catch (CoreException e) { /* ignored on purpose */ }
- }
-
- String mode = getLaunchConfigurationDialog().getMode();
-
- if (typeId != null && mode != null) {
- return LaunchConfigTypeBindingsManager.getInstance().isValidLaunchConfigType(typeId, mode, new RemoteSelectionContext((IPeerModel)element, true));
- }
- }
- return true;
- }
- }
-
- /**
- * Launch configuration main tab context selector control implementation.
- */
- protected class MainTabContextSelectorControl extends ContextSelectorSectionSelectorControl {
-
- /**
- * Constructor.
- *
- * @param section The parent context selector section. Must not be <code>null</code>.
- * @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 MainTabContextSelectorControl(ContextSelectorSection section, IDialogPage parentPage) {
- super(section, parentPage);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl#doCreateViewerFilters()
- */
- @Override
- protected ViewerFilter[] doCreateViewerFilters() {
- List<ViewerFilter> filters = new ArrayList<ViewerFilter>(Arrays.asList(super.doCreateViewerFilters()));
- filters.add(new MainTabContextSelectorViewerFilter());
- return filters.toArray(new ViewerFilter[filters.size()]);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.AbstractFormsLaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- @Override
- public void initializeFrom(ILaunchConfiguration configuration) {
- super.initializeFrom(configuration);
- this.configuration = configuration;
-
- if (getContextSelectorSection() != null) {
- AbstractContextSelectorControl control = (AbstractContextSelectorControl)getContextSelectorSection().getAdapter(AbstractContextSelectorControl.class);
- if (control != null && control.getViewer() != null) control.getViewer().refresh();
- }
- }
-
- /* (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.tcf.launch.ui.remote.app.launchcontext.ContextSelectorSection#doCreateContextSelector()
- */
- @Override
- protected AbstractContextSelectorControl doCreateContextSelector() {
- return new MainTabContextSelectorControl(this, null);
- }
- };
- }
+public class LaunchConfigurationMainTab extends AbstractLaunchContextMainTab {
/* (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)
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 7aefb11..35b3f51 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,58 +1,58 @@
-/*******************************************************************************
- * 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.core.ILaunchManager;
-import org.eclipse.debug.ui.CommonTab;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
-import org.eclipse.tcf.internal.debug.ui.launch.TCFMemoryMapTab;
-import org.eclipse.tcf.internal.debug.ui.launch.TCFPathMapTab;
-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.
- */
-@SuppressWarnings("restriction")
-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());
- if (ILaunchManager.DEBUG_MODE.equalsIgnoreCase(mode)) {
- tabs.add(new TCFMemoryMapTab());
- tabs.add(new TCFPathMapTab());
- tabs.add(new SourceLookupTab());
- }
- tabs.add(new CommonTab());
- }
-}
+/*******************************************************************************
+ * 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.core.ILaunchManager;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
+import org.eclipse.tcf.internal.debug.ui.launch.TCFMemoryMapTab;
+import org.eclipse.tcf.internal.debug.ui.launch.TCFPathMapTab;
+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.filetransfer.FileTransferTab;
+
+/**
+ * Remote application launch configuration tab group implementation.
+ */
+@SuppressWarnings("restriction")
+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());
+ if (ILaunchManager.DEBUG_MODE.equalsIgnoreCase(mode)) {
+ tabs.add(new TCFMemoryMapTab());
+ tabs.add(new TCFPathMapTab());
+ tabs.add(new SourceLookupTab());
+ }
+ tabs.add(new CommonTab());
+ }
+}