diff options
author | Pablo Torregrosa Paez | 2016-04-12 13:18:36 +0000 |
---|---|---|
committer | Pablo Torregrosa Paez | 2016-04-12 13:18:36 +0000 |
commit | bb06ab515e75f9ced873593292dc6f1c5f192ecf (patch) | |
tree | ad2a20068761f8ac0a34c552fba58723e8aff385 /target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt | |
parent | 7e9010c1dfd9c377e72c7856589835f299f8ca2c (diff) | |
download | org.eclipse.tcf-bb06ab515e75f9ced873593292dc6f1c5f192ecf.tar.gz org.eclipse.tcf-bb06ab515e75f9ced873593292dc6f1c5f192ecf.tar.xz org.eclipse.tcf-bb06ab515e75f9ced873593292dc6f1c5f192ecf.zip |
Target Explorer: Added dialog to edit the "prerun" commands
Change-Id: I0a5fd1338897306da78bd4475b3413492b50d51b
Signed-off-by: Pablo Torregrosa Paez <pablo.torregrosa@windriver.com>
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt')
3 files changed, 52 insertions, 2 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.java index 2941f1d7f..8f069e8f3 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.java @@ -38,6 +38,8 @@ public class Messages extends NLS { public static String RemoteCMainTab_ErrorNoConnection; public static String RemoteCMainTab_ErrorSymbolicLink; public static String RemoteCMainTab_Pid; + public static String RemoteCMainTab_Prerun_Edit_Button; + public static String RemoteCMainTab_Prerun_Edit_Dialog_Title; public static String TEHelper_executing; public static String TEHelper_connection_not_found; diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.properties index b88fb4d06..78f15f2a5 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.properties +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.properties @@ -29,6 +29,8 @@ RemoteCMainTab_ErrorNoConnection=Remote Connection must be selected. RemoteCMainTab_ErrorSymbolicLink=Selection is a symbolic link, did you mean ''{0}''? RemoteCMainTab_Remote_Path_Browse_Button=Browse... RemoteCMainTab_Pid=PID of remote application to attach: +RemoteCMainTab_Prerun_Edit_Button=Edit... +RemoteCMainTab_Prerun_Edit_Dialog_Title=Edit Commands Gdbserver_Settings_Tab_Name=Gdbserver Settings Gdbserver_name_textfield_label=Gdbserver name: diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/tabs/TEAbstractMainTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/tabs/TEAbstractMainTab.java index ebedcfb20..603415fcf 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/tabs/TEAbstractMainTab.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/tabs/TEAbstractMainTab.java @@ -23,9 +23,11 @@ import org.eclipse.core.runtime.URIUtil; import org.eclipse.core.variables.VariablesPlugin; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.window.Window; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; @@ -34,6 +36,7 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; import org.eclipse.tcf.te.runtime.services.ServiceManager; @@ -73,8 +76,9 @@ public abstract class TEAbstractMainTab extends CMainTab { protected boolean remoteProgTextFireNotification; protected boolean remoteProgValidation = true; - private Text preRunText; + protected Text preRunText; private Label preRunLabel; + private Button preRunEditButton; private boolean preRunVisible = true; private Label pidLabel; @@ -270,7 +274,8 @@ public abstract class TEAbstractMainTab extends CMainTab { preRunText = new Text(mainComp, SWT.MULTI | SWT.BORDER); gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 2; + gd.horizontalSpan = 1; + gd.heightHint = preRunText.getLineHeight(); preRunText.setLayoutData(gd); preRunText.addModifyListener(new ModifyListener() { @@ -280,6 +285,14 @@ public abstract class TEAbstractMainTab extends CMainTab { updateLaunchConfigurationDialog(); } }); + + preRunEditButton = createPushButton(mainComp, Messages.RemoteCMainTab_Prerun_Edit_Button, null); + preRunEditButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent evt) { + showCommandsEditor(); + } + }); } } @@ -507,4 +520,37 @@ public abstract class TEAbstractMainTab extends CMainTab { config.setAttribute(IRemoteTEConfigurationConstants.ATTR_PRERUN_COMMANDS, (String)null); } + protected void showCommandsEditor() { + Dialog dialog = new Dialog(getShell()) { + private StyledText textArea = null; + + @Override + protected Control createDialogArea(Composite parent) { + Composite baseComposite = (Composite) super.createDialogArea(parent); + baseComposite.getShell().setText(Messages.RemoteCMainTab_Prerun_Edit_Dialog_Title); + textArea = new StyledText(baseComposite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); + textArea.setAlwaysShowScrollBars(false); + GridData textAreaGD = new GridData(GridData.FILL_BOTH); + textAreaGD.heightHint = 180; + textAreaGD.widthHint = 300; + textArea.setLayoutData(textAreaGD); + textArea.setText(preRunText.getText()); + return baseComposite; + } + + @Override + protected void okPressed() { + if (preRunText != null && textArea != null) { + preRunText.setText(textArea.getText()); + } + super.okPressed(); + } + + @Override + protected boolean isResizable() { + return true; + } + }; + dialog.open(); + } } |