From 6ff98f737cbf5b289d149b49dd5cd1823be72052 Mon Sep 17 00:00:00 2001 From: Uwe Stieber Date: Fri, 16 Mar 2012 08:07:08 +0100 Subject: Target Explorer: Rename launch configuration --- .../plugin.properties | 4 +- .../org.eclipse.tcf.te.tcf.launch.core/plugin.xml | 16 +- .../tcf/launch/core/interfaces/ILaunchTypes.java | 4 +- .../META-INF/MANIFEST.MF | 4 +- .../icons/obj16/penguin_obj.gif | Bin 569 -> 0 bytes .../icons/obj16/remote_app.gif | Bin 0 -> 982 bytes .../org.eclipse.tcf.te.tcf.launch.ui/plugin.xml | 12 +- .../tcf/te/tcf/launch/ui/help/IContextHelpIds.java | 2 +- .../ui/linux/app/LaunchConfigurationMainTab.java | 42 ----- .../app/LaunchConfigurationMainTabSection.java | 196 --------------------- .../ui/linux/app/LaunchConfigurationTabGroup.java | 38 ---- .../ui/remote/app/LaunchConfigurationMainTab.java | 42 +++++ .../app/LaunchConfigurationMainTabSection.java | 196 +++++++++++++++++++++ .../ui/remote/app/LaunchConfigurationTabGroup.java | 38 ++++ .../data/agent/linux/x86_64/agent | Bin 15 files changed, 297 insertions(+), 297 deletions(-) delete mode 100644 target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/icons/obj16/penguin_obj.gif create mode 100644 target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/icons/obj16/remote_app.gif delete mode 100644 target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/linux/app/LaunchConfigurationMainTab.java delete mode 100644 target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/linux/app/LaunchConfigurationMainTabSection.java delete mode 100644 target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/linux/app/LaunchConfigurationTabGroup.java create mode 100644 target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTab.java create mode 100644 target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTabSection.java create mode 100644 target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java mode change 100755 => 100644 target_explorer/plugins/org.eclipse.tcf.te.tests/data/agent/linux/x86_64/agent (limited to 'target_explorer/plugins') diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.properties index 628facd66..de5506262 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.properties +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.properties @@ -13,11 +13,11 @@ providerName = Eclipse.org - TCF # ***** Launch Configuration Types ***** -LaunchType.Linux.App.name=Remote Linux Application +LaunchType.Remote.App.name=Remote Application # ***** Launch Step Groups ***** -LaunchStepGroup.Linux.App.name=Remote Linux Application +LaunchStepGroup.Remote.App.name=Remote Application # ***** Launch Steps ***** diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml index a34fbb900..908b10a97 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml @@ -33,22 +33,22 @@ + name="%LaunchType.Remote.App.name"> + launchConfigTypeId="org.eclipse.tcf.te.tcf.launch.type.remote.app"> @@ -58,15 +58,15 @@ + id="org.eclipse.tcf.te.tcf.launch.type.remote.app.launchManagerDelegate"> diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/interfaces/ILaunchTypes.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/interfaces/ILaunchTypes.java index 3ab004457..4fb2dca43 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/interfaces/ILaunchTypes.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/interfaces/ILaunchTypes.java @@ -17,7 +17,7 @@ package org.eclipse.tcf.te.tcf.launch.core.interfaces; public interface ILaunchTypes { /** - * Launch configuration type id: Remote Linux Application + * Launch configuration type id: Remote Application */ - public final String REMOTE_LINUX_APPLICATION = "org.eclipse.tcf.te.tcf.launch.type.linux.app"; //$NON-NLS-1$ + public final String REMOTE_APPLICATION = "org.eclipse.tcf.te.tcf.launch.type.remote.app"; //$NON-NLS-1$ } 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 136e23c5c..caf33a6c3 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 @@ -27,5 +27,5 @@ 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.help, - org.eclipse.tcf.te.tcf.launch.ui.linux.app, - org.eclipse.tcf.te.tcf.launch.ui.nls;x-internal:=true + org.eclipse.tcf.te.tcf.launch.ui.nls;x-internal:=true, + org.eclipse.tcf.te.tcf.launch.ui.remote.app diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/icons/obj16/penguin_obj.gif b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/icons/obj16/penguin_obj.gif deleted file mode 100644 index 7b5a98e0b..000000000 Binary files a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/icons/obj16/penguin_obj.gif and /dev/null differ diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/icons/obj16/remote_app.gif b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/icons/obj16/remote_app.gif new file mode 100644 index 000000000..5c3b5413d Binary files /dev/null and b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/icons/obj16/remote_app.gif differ 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 78ec73c6c..1221db99a 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 @@ -5,17 +5,17 @@ + configTypeID="org.eclipse.tcf.te.tcf.launch.type.remote.app" + icon="icons/obj16/remote_app.gif" + id="org.eclipse.tcf.te.tcf.launch.type.remote.app.image"> + class="org.eclipse.tcf.te.tcf.launch.ui.remote.app.LaunchConfigurationTabGroup" + id="org.eclipse.tcf.te.tcf.launch.type.remote.app.tabgroup" + type="org.eclipse.tcf.te.tcf.launch.type.remote.app"> diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/help/IContextHelpIds.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/help/IContextHelpIds.java index 4de18c840..228332244 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/help/IContextHelpIds.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/help/IContextHelpIds.java @@ -26,5 +26,5 @@ public interface IContextHelpIds { /** * Remote Linux Application launch tab group context help id. */ - public final static String REMOTE_LINUX_APPLICATION = ILaunchTypes.REMOTE_LINUX_APPLICATION + ".tabGroup"; //$NON-NLS-1$ + public final static String REMOTE_LINUX_APPLICATION = ILaunchTypes.REMOTE_APPLICATION + ".tabGroup"; //$NON-NLS-1$ } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/linux/app/LaunchConfigurationMainTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/linux/app/LaunchConfigurationMainTab.java deleted file mode 100644 index 347c76b36..000000000 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/linux/app/LaunchConfigurationMainTab.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved. - * This program and the accompanying materials are made available under the terms - * of the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tcf.te.tcf.launch.ui.linux.app; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.tcf.te.launch.ui.tabs.selector.LaunchContextSelectorTab; -import org.eclipse.tcf.te.ui.forms.CustomFormToolkit; - -/** - * Remote application main launch tab implementation. - */ -public class LaunchConfigurationMainTab extends LaunchContextSelectorTab { - - /* (non-Javadoc) - * @see org.eclipse.tcf.te.launch.ui.tabs.selector.LaunchContextSelectorTab#doCreateFormContent(org.eclipse.swt.widgets.Composite, org.eclipse.tcf.te.ui.forms.CustomFormToolkit) - */ - @Override - protected void doCreateFormContent(Composite parent, CustomFormToolkit toolkit) { - super.doCreateFormContent(parent, toolkit); - - // Setup the main panel (using the table wrap layout) - Composite panel = toolkit.getFormToolkit().createComposite(parent); - GridLayout layout = new GridLayout(1, false); - panel.setLayout(layout); - panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - panel.setBackground(parent.getBackground()); - - LaunchConfigurationMainTabSection section = new LaunchConfigurationMainTabSection(getManagedForm(), panel); - section.getSection().setLayoutData(new GridData(GridData.FILL_BOTH)); - getManagedForm().addPart(section); - } -} diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/linux/app/LaunchConfigurationMainTabSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/linux/app/LaunchConfigurationMainTabSection.java deleted file mode 100644 index 718717e7d..000000000 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/linux/app/LaunchConfigurationMainTabSection.java +++ /dev/null @@ -1,196 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved. - * This program and the accompanying materials are made available under the terms - * of the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tcf.te.tcf.launch.ui.linux.app; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.tcf.te.launch.core.persistence.ContextSelectorPersistenceDelegate; -import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate; -import org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart; -import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode; -import org.eclipse.tcf.te.tcf.filesystem.dialogs.FSOpenFileDialog; -import org.eclipse.tcf.te.tcf.filesystem.model.FSTreeNode; -import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILinuxAppLaunchAttributes; -import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages; -import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl; -import org.eclipse.tcf.te.ui.forms.parts.AbstractSection; -import org.eclipse.ui.forms.IManagedForm; -import org.eclipse.ui.forms.widgets.ExpandableComposite; -import org.eclipse.ui.forms.widgets.FormToolkit; -import org.eclipse.ui.forms.widgets.Section; - -/** - * Remote application launch configuration main tab section implementation. - */ -public class LaunchConfigurationMainTabSection extends AbstractSection implements ILaunchConfigurationTabFormPart { - - BaseEditBrowseTextControl processImage; - BaseEditBrowseTextControl processArguments; - IModelNode firstSelection = null; - - /** - * Constructor. - * - * @param form The parent managed form. Must not be null. - * @param parent The parent composite. Must not be null. - */ - public LaunchConfigurationMainTabSection(IManagedForm form, Composite parent) { - super(form, parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); - getSection().setBackground(parent.getBackground()); - createClient(getSection(), form.getToolkit()); - } - - /* (non-Javadoc) - * @see org.eclipse.tcf.te.ui.forms.parts.AbstractSection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) - */ - @Override - protected void createClient(final Section section, FormToolkit toolkit) { - Assert.isNotNull(section); - Assert.isNotNull(toolkit); - - // Configure the section - section.setText(Messages.LaunchConfigurationMainTabSection_title); - section.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL, SWT.CENTER, true, false)); - - // Create the section client - Composite client = createClientContainer(section, 3, toolkit); - Assert.isNotNull(client); - section.setClient(client); - client.setBackground(section.getBackground()); - - // Create a toolbar for the section - createSectionToolbar(section, toolkit); - - // Create the section sub controls - processImage = new BaseEditBrowseTextControl(null) { - @Override - protected void onButtonControlSelected() { - if (firstSelection != null) { - FSOpenFileDialog dialog = new FSOpenFileDialog(section.getShell()); - dialog.setInput(firstSelection); - if (dialog.open() == Window.OK) { - Object candidate = dialog.getFirstResult(); - if (candidate instanceof FSTreeNode) { - String absPath = ((FSTreeNode) candidate).getLocation(); - if (absPath != null) { - processImage.setEditFieldControlText(absPath); - } - } - } - } - } - @Override - public void modifyText(ModifyEvent e) { - super.modifyText(e); - getManagedForm().dirtyStateChanged(); - } - }; - processImage.setEditFieldLabel(Messages.ProcessImageSelectorControl_label); - processImage.setIsGroup(false); - processImage.setHideBrowseButton(false); - processImage.setAdjustBackgroundColor(true); - processImage.setParentControlIsInnerPanel(true); - processImage.setFormToolkit(toolkit); - processImage.setupPanel(client); - processImage.doCreateControlDecoration(processImage.getEditFieldControl()); - - processArguments = new BaseEditBrowseTextControl(null) { - @Override - public void modifyText(ModifyEvent e) { - super.modifyText(e); - getManagedForm().dirtyStateChanged(); - } - }; - processArguments.setEditFieldLabel(Messages.LaunchConfigurationMainTabSection_processArguments_label); - processArguments.setIsGroup(false); - processArguments.setHideBrowseButton(true); - processArguments.setAdjustBackgroundColor(true); - processArguments.setParentControlIsInnerPanel(true); - processArguments.setFormToolkit(toolkit); - processArguments.setupPanel(client); - } - - /* (non-Javadoc) - * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) - */ - @Override - public void initializeFrom(ILaunchConfiguration configuration) { - Assert.isNotNull(configuration); - - if (processImage != null) { - String image = DefaultPersistenceDelegate.getAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_IMAGE, ""); //$NON-NLS-1$ - processImage.setEditFieldControlText(image); - } - - if (processArguments != null) { - String arguments = DefaultPersistenceDelegate.getAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, ""); //$NON-NLS-1$ - processArguments.setEditFieldControlText(arguments); - } - } - - /* (non-Javadoc) - * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - @Override - public void performApply(ILaunchConfigurationWorkingCopy configuration) { - Assert.isNotNull(configuration); - - if (processImage != null) { - String image = processImage.getEditFieldControlText(); - - if (image != null && image.trim().length() > 0) { - DefaultPersistenceDelegate.setAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_IMAGE, image); - } else { - DefaultPersistenceDelegate.setAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_IMAGE, (String)null); - } - } else { - DefaultPersistenceDelegate.setAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_IMAGE, (String)null); - } - - if (processArguments != null) { - String arguments = processArguments.getEditFieldControlText(); - - if (arguments != null && arguments.trim().length() > 0) { - DefaultPersistenceDelegate.setAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, arguments); - } else { - DefaultPersistenceDelegate.setAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, (String)null); - } - } else { - DefaultPersistenceDelegate.setAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, (String)null); - } - } - - @Override - public boolean isValid(ILaunchConfiguration configuration) { - firstSelection = null; - IModelNode[] contexts = ContextSelectorPersistenceDelegate.getLaunchContexts(configuration); - if (contexts != null && contexts.length > 0) { - firstSelection = contexts[0]; - } - processImage.getButtonControl().setEnabled(firstSelection != null); - - if (processImage.getEditFieldControlText().trim().length() > 0) { - setMessage(null, IMessageProvider.NONE); - } - else { - setMessage(Messages.ProcessImageSelectorControl_error_missingProcessImage, IMessageProvider.ERROR); - } - processImage.updateControlDecoration(getMessage(), getMessageType()); - - return processImage.getEditFieldControlText().trim().length() > 0; - } -} diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/linux/app/LaunchConfigurationTabGroup.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/linux/app/LaunchConfigurationTabGroup.java deleted file mode 100644 index 9b7f6fdf0..000000000 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/linux/app/LaunchConfigurationTabGroup.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved. - * This program and the accompanying materials are made available under the terms - * of the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tcf.te.tcf.launch.ui.linux.app; - -import java.util.List; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.debug.ui.ILaunchConfigurationDialog; -import org.eclipse.debug.ui.ILaunchConfigurationTab; - -/** - * Remote application launch configuration tab group implementation. - */ -public class LaunchConfigurationTabGroup extends org.eclipse.tcf.te.launch.ui.tabs.LaunchConfigurationTabGroup { - - /** - * 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 null. - * @param mode The mode the launch configuration dialog was opened in. - */ - @Override - public void createContextSelectorTab(ILaunchConfigurationDialog dialog, List tabs, String mode) { - Assert.isNotNull(tabs); - - ILaunchConfigurationTab tab = new LaunchConfigurationMainTab(); - - tabs.add(tab); - } -} 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 new file mode 100644 index 000000000..94e77b97d --- /dev/null +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTab.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.tcf.te.tcf.launch.ui.remote.app; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.tcf.te.launch.ui.tabs.selector.LaunchContextSelectorTab; +import org.eclipse.tcf.te.ui.forms.CustomFormToolkit; + +/** + * Remote application main launch tab implementation. + */ +public class LaunchConfigurationMainTab extends LaunchContextSelectorTab { + + /* (non-Javadoc) + * @see org.eclipse.tcf.te.launch.ui.tabs.selector.LaunchContextSelectorTab#doCreateFormContent(org.eclipse.swt.widgets.Composite, org.eclipse.tcf.te.ui.forms.CustomFormToolkit) + */ + @Override + protected void doCreateFormContent(Composite parent, CustomFormToolkit toolkit) { + super.doCreateFormContent(parent, toolkit); + + // Setup the main panel (using the table wrap layout) + Composite panel = toolkit.getFormToolkit().createComposite(parent); + GridLayout layout = new GridLayout(1, false); + panel.setLayout(layout); + panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + panel.setBackground(parent.getBackground()); + + LaunchConfigurationMainTabSection section = new LaunchConfigurationMainTabSection(getManagedForm(), panel); + section.getSection().setLayoutData(new GridData(GridData.FILL_BOTH)); + getManagedForm().addPart(section); + } +} diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTabSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTabSection.java new file mode 100644 index 000000000..31e1f01f0 --- /dev/null +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTabSection.java @@ -0,0 +1,196 @@ +/******************************************************************************* + * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.tcf.te.tcf.launch.ui.remote.app; + +import org.eclipse.core.runtime.Assert; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.jface.dialogs.IMessageProvider; +import org.eclipse.jface.window.Window; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.tcf.te.launch.core.persistence.ContextSelectorPersistenceDelegate; +import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate; +import org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart; +import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode; +import org.eclipse.tcf.te.tcf.filesystem.dialogs.FSOpenFileDialog; +import org.eclipse.tcf.te.tcf.filesystem.model.FSTreeNode; +import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILinuxAppLaunchAttributes; +import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages; +import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl; +import org.eclipse.tcf.te.ui.forms.parts.AbstractSection; +import org.eclipse.ui.forms.IManagedForm; +import org.eclipse.ui.forms.widgets.ExpandableComposite; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.Section; + +/** + * Remote application launch configuration main tab section implementation. + */ +public class LaunchConfigurationMainTabSection extends AbstractSection implements ILaunchConfigurationTabFormPart { + + BaseEditBrowseTextControl processImage; + BaseEditBrowseTextControl processArguments; + IModelNode firstSelection = null; + + /** + * Constructor. + * + * @param form The parent managed form. Must not be null. + * @param parent The parent composite. Must not be null. + */ + public LaunchConfigurationMainTabSection(IManagedForm form, Composite parent) { + super(form, parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); + getSection().setBackground(parent.getBackground()); + createClient(getSection(), form.getToolkit()); + } + + /* (non-Javadoc) + * @see org.eclipse.tcf.te.ui.forms.parts.AbstractSection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) + */ + @Override + protected void createClient(final Section section, FormToolkit toolkit) { + Assert.isNotNull(section); + Assert.isNotNull(toolkit); + + // Configure the section + section.setText(Messages.LaunchConfigurationMainTabSection_title); + section.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL, SWT.CENTER, true, false)); + + // Create the section client + Composite client = createClientContainer(section, 3, toolkit); + Assert.isNotNull(client); + section.setClient(client); + client.setBackground(section.getBackground()); + + // Create a toolbar for the section + createSectionToolbar(section, toolkit); + + // Create the section sub controls + processImage = new BaseEditBrowseTextControl(null) { + @Override + protected void onButtonControlSelected() { + if (firstSelection != null) { + FSOpenFileDialog dialog = new FSOpenFileDialog(section.getShell()); + dialog.setInput(firstSelection); + if (dialog.open() == Window.OK) { + Object candidate = dialog.getFirstResult(); + if (candidate instanceof FSTreeNode) { + String absPath = ((FSTreeNode) candidate).getLocation(); + if (absPath != null) { + processImage.setEditFieldControlText(absPath); + } + } + } + } + } + @Override + public void modifyText(ModifyEvent e) { + super.modifyText(e); + getManagedForm().dirtyStateChanged(); + } + }; + processImage.setEditFieldLabel(Messages.ProcessImageSelectorControl_label); + processImage.setIsGroup(false); + processImage.setHideBrowseButton(false); + processImage.setAdjustBackgroundColor(true); + processImage.setParentControlIsInnerPanel(true); + processImage.setFormToolkit(toolkit); + processImage.setupPanel(client); + processImage.doCreateControlDecoration(processImage.getEditFieldControl()); + + processArguments = new BaseEditBrowseTextControl(null) { + @Override + public void modifyText(ModifyEvent e) { + super.modifyText(e); + getManagedForm().dirtyStateChanged(); + } + }; + processArguments.setEditFieldLabel(Messages.LaunchConfigurationMainTabSection_processArguments_label); + processArguments.setIsGroup(false); + processArguments.setHideBrowseButton(true); + processArguments.setAdjustBackgroundColor(true); + processArguments.setParentControlIsInnerPanel(true); + processArguments.setFormToolkit(toolkit); + processArguments.setupPanel(client); + } + + /* (non-Javadoc) + * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) + */ + @Override + public void initializeFrom(ILaunchConfiguration configuration) { + Assert.isNotNull(configuration); + + if (processImage != null) { + String image = DefaultPersistenceDelegate.getAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_IMAGE, ""); //$NON-NLS-1$ + processImage.setEditFieldControlText(image); + } + + if (processArguments != null) { + String arguments = DefaultPersistenceDelegate.getAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, ""); //$NON-NLS-1$ + processArguments.setEditFieldControlText(arguments); + } + } + + /* (non-Javadoc) + * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) + */ + @Override + public void performApply(ILaunchConfigurationWorkingCopy configuration) { + Assert.isNotNull(configuration); + + if (processImage != null) { + String image = processImage.getEditFieldControlText(); + + if (image != null && image.trim().length() > 0) { + DefaultPersistenceDelegate.setAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_IMAGE, image); + } else { + DefaultPersistenceDelegate.setAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_IMAGE, (String)null); + } + } else { + DefaultPersistenceDelegate.setAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_IMAGE, (String)null); + } + + if (processArguments != null) { + String arguments = processArguments.getEditFieldControlText(); + + if (arguments != null && arguments.trim().length() > 0) { + DefaultPersistenceDelegate.setAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, arguments); + } else { + DefaultPersistenceDelegate.setAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, (String)null); + } + } else { + DefaultPersistenceDelegate.setAttribute(configuration, ILinuxAppLaunchAttributes.ATTR_PROCESS_ARGUMENTS, (String)null); + } + } + + @Override + public boolean isValid(ILaunchConfiguration configuration) { + firstSelection = null; + IModelNode[] contexts = ContextSelectorPersistenceDelegate.getLaunchContexts(configuration); + if (contexts != null && contexts.length > 0) { + firstSelection = contexts[0]; + } + processImage.getButtonControl().setEnabled(firstSelection != null); + + if (processImage.getEditFieldControlText().trim().length() > 0) { + setMessage(null, IMessageProvider.NONE); + } + else { + setMessage(Messages.ProcessImageSelectorControl_error_missingProcessImage, IMessageProvider.ERROR); + } + processImage.updateControlDecoration(getMessage(), getMessageType()); + + return processImage.getEditFieldControlText().trim().length() > 0; + } +} 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 new file mode 100644 index 000000000..a68d7a6c8 --- /dev/null +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationTabGroup.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.tcf.te.tcf.launch.ui.remote.app; + +import java.util.List; + +import org.eclipse.core.runtime.Assert; +import org.eclipse.debug.ui.ILaunchConfigurationDialog; +import org.eclipse.debug.ui.ILaunchConfigurationTab; + +/** + * Remote application launch configuration tab group implementation. + */ +public class LaunchConfigurationTabGroup extends org.eclipse.tcf.te.launch.ui.tabs.LaunchConfigurationTabGroup { + + /** + * 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 null. + * @param mode The mode the launch configuration dialog was opened in. + */ + @Override + public void createContextSelectorTab(ILaunchConfigurationDialog dialog, List tabs, String mode) { + Assert.isNotNull(tabs); + + ILaunchConfigurationTab tab = new LaunchConfigurationMainTab(); + + tabs.add(tab); + } +} diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/data/agent/linux/x86_64/agent b/target_explorer/plugins/org.eclipse.tcf.te.tests/data/agent/linux/x86_64/agent old mode 100755 new mode 100644 -- cgit v1.2.3