From ce43d1b6ffdcbc66cad482aa2497926357899907 Mon Sep 17 00:00:00 2001 From: mbowie Date: Sat, 31 May 2008 02:28:14 +0000 Subject: [PATCH 1/1] Adds a private listener class to the Arguments tab and an appropriate listener to each input. closes #702. --- .../debug/ui/launcher/PHPArgumentsTab.java | 38 +++++++++++++++++--- 1 files changed, 33 insertions(+), 5 deletions(-) diff --git a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPArgumentsTab.java b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPArgumentsTab.java index ad11c41..0626c18 100644 --- a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPArgumentsTab.java +++ b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPArgumentsTab.java @@ -32,6 +32,31 @@ public class PHPArgumentsTab extends AbstractLaunchConfigurationTab { protected Button useDefaultWorkingDirectoryButton; + private class ArgumentsTabListener extends SelectionAdapter implements + ModifyListener { + + /* + * (non-Javadoc) + * + * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent) + */ + public void modifyText(ModifyEvent e) { + updateLaunchConfigurationDialog(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent) + */ + public void widgetSelected(SelectionEvent e) { + updateLaunchConfigurationDialog(); + } + + } + + private ArgumentsTabListener fListener = new ArgumentsTabListener(); + public PHPArgumentsTab() { super(); } @@ -53,11 +78,7 @@ public class PHPArgumentsTab extends AbstractLaunchConfigurationTab { .getString("LaunchConfigurationTab.PHPArguments.working_dir_browser_message")); workingDirectorySelector.setLayoutData(new GridData( GridData.FILL_HORIZONTAL)); - workingDirectorySelector.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateLaunchConfigurationDialog(); - } - }); + workingDirectorySelector.addModifyListener(fListener); Composite defaultWorkingDirectoryComposite = new Composite( grpWorkingDir, SWT.NONE); @@ -73,11 +94,15 @@ public class PHPArgumentsTab extends AbstractLaunchConfigurationTab { .getSelection()); } }); + useDefaultWorkingDirectoryButton.addSelectionListener(fListener); + new Label(defaultWorkingDirectoryComposite, SWT.NONE) .setText(PHPDebugUiMessages .getString("LaunchConfigurationTab.PHPArguments.working_dir_use_default_message")); defaultWorkingDirectoryComposite.pack(); + workingDirectorySelector.addModifyListener(fListener); + // new Label(composite, SWT.NONE) // .setText(PHPDebugUiMessages // .getString("LaunchConfigurationTab.PHPArguments.interpreter_args_box_title")); @@ -89,7 +114,9 @@ public class PHPArgumentsTab extends AbstractLaunchConfigurationTab { interpreterArgsText = new Text(grpArgs, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER | SWT.WRAP); interpreterArgsText.setLayoutData(new GridData(GridData.FILL_BOTH)); + interpreterArgsText.addModifyListener(fListener); + // new Label(composite, SWT.NONE) // .setText(PHPDebugUiMessages // .getString("LaunchConfigurationTab.PHPArguments.program_args_box_title")); @@ -101,6 +128,7 @@ public class PHPArgumentsTab extends AbstractLaunchConfigurationTab { programArgsText = new Text(grpProgArgs, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER | SWT.WRAP); programArgsText.setLayoutData(new GridData(GridData.FILL_BOTH)); + programArgsText.addModifyListener(fListener); } protected void setUseDefaultWorkingDirectory(boolean useDefault) { -- 1.7.1