aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwgalanciak2014-03-26 11:25:28 (EDT)
committerwgalanciak2014-03-26 11:25:28 (EDT)
commit047967a01d954a710f56157fef903f8bc33571a6 (patch)
treeed21fc0aedd6f073e91003f02fe92c4649a0b5d4
parentd9b65baedb44bb1d71dd45581873770f03014135 (diff)
downloadorg.eclipse.pdt-047967a01d954a710f56157fef903f8bc33571a6.zip
org.eclipse.pdt-047967a01d954a710f56157fef903f8bc33571a6.tar.gz
org.eclipse.pdt-047967a01d954a710f56157fef903f8bc33571a6.tar.bz2
Bug 431247 - Remove separated tab for script argumentsrefs/changes/29/23929/1
Change-Id: I5530933b33487753435b44948973bf1eb132a8c3 Signed-off-by: wgalanciak <wojciech.galanciak@gmail.com>
-rw-r--r--plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/PHPDebugUIMessages.java8
-rw-r--r--plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/PHPDebugUIMessages.properties6
-rw-r--r--plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/launching/PHPDebugArgumentsTab.java229
-rw-r--r--plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/launching/PHPExeLaunchConfigurationTabGroup.java6
-rw-r--r--plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/launching/PHPExecutableLaunchTab.java76
5 files changed, 74 insertions, 251 deletions
diff --git a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/PHPDebugUIMessages.java b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/PHPDebugUIMessages.java
index 19bb586..dd2ba78 100644
--- a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/PHPDebugUIMessages.java
+++ b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/PHPDebugUIMessages.java
@@ -48,10 +48,6 @@ public class PHPDebugUIMessages extends NLS {
public static String CreateStepFilterDialog_stepFilterAlreadyExists;
public static String DebugBrowserView_swtBrowserNotAvailable0;
- public static String DebugPHPArgumentsTab_phpScriptArguments;
- public static String DebugPHPArgumentsTab_scriptArguments;
- public static String DebugPHPArgumentsTab_unknownError;
- public static String DebugPHPArgumentsTab_variables;
public static String DefaultPHPBreakpointProvider_0;
public static String EnableSetCondition_1;
@@ -190,6 +186,10 @@ public class PHPDebugUIMessages extends NLS {
public static String PHPExecutableLaunchTab_isNotPHPFile;
+ public static String PHPExecutableLaunchTab_scriptArguments;
+
+ public static String PHPExecutableLaunchTab_variables;
+
public static String PHPExeLaunchShortcut_0;
public static String PHPexesComboBlock_1;
diff --git a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/PHPDebugUIMessages.properties b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/PHPDebugUIMessages.properties
index 8b0a258..400067c 100644
--- a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/PHPDebugUIMessages.properties
+++ b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/PHPDebugUIMessages.properties
@@ -55,6 +55,8 @@ PHPExeCompositeFragment_2=PHP Executable
PHPExeCompositeFragment_3=Data must be instance of PHPExeItem
PHPExecutableLaunchTab_2=PHP Script
PHPExecutableLaunchTab_isNotPHPFile=\ is not a PHP file
+PHPExecutableLaunchTab_scriptArguments=Script Arguments
+PHPExecutableLaunchTab_variables=Variables...
PHPExeLaunchShortcut_0=New_configuration
PHPsPreferencePage_10=PHP executable location no longer exists and will be removed.
PHPsPreferencePage_11=PHP executable location removed
@@ -183,10 +185,6 @@ LaunchUtilities_selectProject=Select Project
LaunchUtilities_selectFile=Select File
LaunchUtilities_selectProjectFile=Select a File from the Project
-DebugPHPArgumentsTab_phpScriptArguments=PHP Script Arguments
-DebugPHPArgumentsTab_scriptArguments=Script Arguments
-DebugPHPArgumentsTab_variables=Variables
-DebugPHPArgumentsTab_unknownError=Unknown error
DefaultPHPBreakpointProvider_0=Invalid breakpoint
WorkbenchOptionsBlock_workbench_options=Workbench Options
CreateStepFilterDialog_addStepFilter=Add Step Filter
diff --git a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/launching/PHPDebugArgumentsTab.java b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/launching/PHPDebugArgumentsTab.java
deleted file mode 100644
index 921c2ca..0000000
--- a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/launching/PHPDebugArgumentsTab.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Zend Technologies
- *******************************************************************************/
-package org.eclipse.php.internal.debug.ui.launching;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.StringVariableSelectionDialog;
-import org.eclipse.php.debug.core.debugger.parameters.IDebugParametersKeys;
-import org.eclipse.php.internal.debug.ui.PHPDebugUIMessages;
-import org.eclipse.php.internal.debug.ui.actions.ControlAccessibleListener;
-import org.eclipse.php.internal.ui.IPHPHelpContextIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * A launch configuration tab that displays and edits program arguments.
- * <p>
- * This class may be instantiated. This class is not intended to be subclassed.
- * </p>
- *
- * @since PDT 1.0
- */
-public class PHPDebugArgumentsTab extends AbstractLaunchConfigurationTab {
-
- // Program arguments widgets
- protected Label fPrgmArgumentsLabel;
- protected Text fPrgmArgumentsText;
-
- // Working directory
- // protected WorkingDirectoryBlock fWorkingDirectoryBlock;
-
- protected static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(Composite)
- */
- public void createControl(Composite parent) {
- Font font = parent.getFont();
- Composite comp = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(1, true);
- comp.setLayout(layout);
- comp.setFont(font);
-
- GridData gd = new GridData(GridData.FILL_BOTH);
- comp.setLayoutData(gd);
- setControl(comp);
- // setHelpContextId();
-
- Group group = new Group(comp, SWT.NONE);
- group.setFont(font);
- layout = new GridLayout();
- group.setLayout(layout);
- group.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- String controlName = PHPDebugUIMessages.DebugPHPArgumentsTab_scriptArguments;
- group.setText(controlName);
-
- fPrgmArgumentsText = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER
- | SWT.V_SCROLL);
- gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 40;
- gd.widthHint = 100;
- fPrgmArgumentsText.setLayoutData(gd);
- fPrgmArgumentsText.setFont(font);
- fPrgmArgumentsText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent evt) {
- updateLaunchConfigurationDialog();
- }
- });
- ControlAccessibleListener.addListener(fPrgmArgumentsText, group
- .getText());
-
- String buttonLabel = PHPDebugUIMessages.DebugPHPArgumentsTab_variables;
- Button pgrmArgVariableButton = createPushButton(group, buttonLabel,
- null);
- pgrmArgVariableButton.setLayoutData(new GridData(
- GridData.HORIZONTAL_ALIGN_END));
- pgrmArgVariableButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(
- getShell());
- dialog.open();
- String variable = dialog.getVariableExpression();
- if (variable != null) {
- fPrgmArgumentsText.insert(variable);
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- });
- // HELP
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
- IPHPHelpContextIds.LOCALLY_DEBUGGING_A_PHP_SCRIPT);
-
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
- */
- public void dispose() {
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
-
- public boolean isValid(ILaunchConfiguration config) {
- return true;
- }
-
- /**
- * Defaults are empty.
- *
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy)
- */
-
- public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- config.setAttribute(IDebugParametersKeys.EXE_CONFIG_PROGRAM_ARGUMENTS,
- (String) null);
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- try {
- fPrgmArgumentsText.setText(configuration.getAttribute(
- IDebugParametersKeys.EXE_CONFIG_PROGRAM_ARGUMENTS, "")); //$NON-NLS-1$
- } catch (CoreException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- configuration.setAttribute(
- IDebugParametersKeys.EXE_CONFIG_PROGRAM_ARGUMENTS,
- getAttributeValueFrom(fPrgmArgumentsText));
- }
-
- /**
- * Returns the string in the text widget, or <code>null</code> if empty.
- *
- * @return text or <code>null</code>
- */
- protected String getAttributeValueFrom(Text text) {
- String content = text.getText().trim();
- if (content.length() > 0) {
- return content;
- }
- return null;
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return PHPDebugUIMessages.DebugPHPArgumentsTab_phpScriptArguments;
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setLaunchConfigurationDialog(ILaunchConfigurationDialog)
- */
- public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog) {
- super.setLaunchConfigurationDialog(dialog);
- // fWorkingDirectoryBlock.setLaunchConfigurationDialog(dialog);
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getErrorMessage()
- */
- public String getErrorMessage() {
- return super.getErrorMessage();
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getMessage()
- */
- public String getMessage() {
- return super.getMessage();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug
- * .core.ILaunchConfigurationWorkingCopy)
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
- // fWorkingDirectoryBlock.initializeFrom(workingCopy);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.
- * debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
- // do nothing when deactivated
- }
-
-}
diff --git a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/launching/PHPExeLaunchConfigurationTabGroup.java b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/launching/PHPExeLaunchConfigurationTabGroup.java
index 64f8395..00199ed 100644
--- a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/launching/PHPExeLaunchConfigurationTabGroup.java
+++ b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/launching/PHPExeLaunchConfigurationTabGroup.java
@@ -51,11 +51,7 @@ public class PHPExeLaunchConfigurationTabGroup extends
list.add(aTab);
}
- // Add arguments, environment and common tabs to the tabs group.
- PHPDebugArgumentsTab argumentsTab = new PHPDebugArgumentsTab();
- argumentsTab.setLaunchConfigurationDialog(dialog);
- list.add(argumentsTab);
-
+ // Add environment and common tabs to the tabs group.
EnvironmentTab environmentTab = new EnvironmentTab();
environmentTab.setLaunchConfigurationDialog(dialog);
list.add(environmentTab);
diff --git a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/launching/PHPExecutableLaunchTab.java b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/launching/PHPExecutableLaunchTab.java
index dd3d618..f7366fe 100644
--- a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/launching/PHPExecutableLaunchTab.java
+++ b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/launching/PHPExecutableLaunchTab.java
@@ -24,6 +24,7 @@ import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.debug.ui.StringVariableSelectionDialog;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
@@ -105,6 +106,8 @@ public class PHPExecutableLaunchTab extends AbstractLaunchConfigurationTab {
protected Button breakOnFirstLine;
+ protected Text fPrgmArgumentsText;
+
private boolean enableDebugInfoOption;
protected boolean enableFileSelection;
protected boolean enableBreakpointSelection;
@@ -244,15 +247,16 @@ public class PHPExecutableLaunchTab extends AbstractLaunchConfigurationTab {
createLocationComponent(mainComposite);
- if (enableFileSelection)
+ if (enableFileSelection) {
createArgumentComponent(mainComposite);
+ }
- // Create the debug info component anyway to avoid problems when
- // applying the configuration.
- createDebugInfoComponent(mainComposite);
- runWithDebugInfo.setVisible(enableDebugInfoOption);
+ createArgumentsControl(mainComposite);
createBreakControl(mainComposite);
+
+ createDebugInfoComponent(mainComposite);
+
createVerticalSpacer(mainComposite, 1);
Dialog.applyDialogFont(parent);
@@ -276,16 +280,14 @@ public class PHPExecutableLaunchTab extends AbstractLaunchConfigurationTab {
protected void createDebugInfoComponent(final Composite parent) {
runWithDebugInfo = new Button(parent, SWT.CHECK);
runWithDebugInfo.setText(PHPDebugUIMessages.PHPexe_Run_With_Debug_Info);
- final GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- runWithDebugInfo.setLayoutData(gd);
+ runWithDebugInfo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
runWithDebugInfo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent se) {
updateLaunchConfigurationDialog();
}
});
-
+ runWithDebugInfo.setVisible(enableDebugInfoOption);
}
/**
@@ -298,11 +300,58 @@ public class PHPExecutableLaunchTab extends AbstractLaunchConfigurationTab {
protected void createLocationComponent(final Composite parent) {
phpsComboBlock.createControl(parent);
final Control control = phpsComboBlock.getControl();
+ if (control instanceof Composite) {
+ Layout layout = ((Composite) control).getLayout();
+ if (layout instanceof GridLayout) {
+ GridLayout gridLayout = (GridLayout) layout;
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ }
+ }
phpsComboBlock.addPropertyChangeListener(fPropertyChangeListener);
final GridData gd = new GridData(GridData.FILL_HORIZONTAL);
control.setLayoutData(gd);
}
+ /**
+ * Creates script arguments group.
+ *
+ * @param parent
+ * parent component
+ */
+ protected void createArgumentsControl(final Composite parent) {
+ Group group = new Group(parent, SWT.NONE);
+ group.setLayout(new GridLayout());
+ group.setLayoutData(new GridData(GridData.FILL_BOTH));
+ group.setText(PHPDebugUIMessages.PHPExecutableLaunchTab_scriptArguments);
+
+ fPrgmArgumentsText = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER
+ | SWT.V_SCROLL);
+ fPrgmArgumentsText.setLayoutData(new GridData(GridData.FILL_BOTH));
+ fPrgmArgumentsText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent evt) {
+ updateLaunchConfigurationDialog();
+ }
+ });
+ addControlAccessibleListener(fPrgmArgumentsText, group.getText());
+
+ Button pgrmArgVariableButton = createPushButton(group,
+ PHPDebugUIMessages.PHPExecutableLaunchTab_variables, null);
+ pgrmArgVariableButton.setLayoutData(new GridData(
+ GridData.HORIZONTAL_ALIGN_END));
+ pgrmArgVariableButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(
+ getShell());
+ dialog.open();
+ String variable = dialog.getVariableExpression();
+ if (variable != null) {
+ fPrgmArgumentsText.insert(variable);
+ }
+ }
+ });
+ }
+
/*
* (non-Javadoc)
*
@@ -398,6 +447,8 @@ public class PHPExecutableLaunchTab extends AbstractLaunchConfigurationTab {
IDebugParametersKeys.FIRST_LINE_BREAKPOINT,
PHPDebugPlugin.getStopAtFirstLine()));
}
+ fPrgmArgumentsText.setText(configuration.getAttribute(
+ IDebugParametersKeys.EXE_CONFIG_PROGRAM_ARGUMENTS, "")); //$NON-NLS-1$
} catch (final CoreException e) {
Logger.log(Logger.ERROR, "Error reading configuration", e); //$NON-NLS-1$
}
@@ -558,6 +609,10 @@ public class PHPExecutableLaunchTab extends AbstractLaunchConfigurationTab {
configuration.setAttribute(
IDebugParametersKeys.FIRST_LINE_BREAKPOINT,
breakOnFirstLine.getSelection());
+ String scriptArguments = fPrgmArgumentsText.getText().trim();
+ configuration.setAttribute(
+ IDebugParametersKeys.EXE_CONFIG_PROGRAM_ARGUMENTS,
+ scriptArguments.length() > 0 ? scriptArguments : null);
applyLaunchDelegateConfiguration(configuration);
}
@@ -629,6 +684,9 @@ public class PHPExecutableLaunchTab extends AbstractLaunchConfigurationTab {
PHPDebugPlugin.getStopAtFirstLine());
applyLaunchDelegateConfiguration(configuration);
}
+ configuration.setAttribute(
+ IDebugParametersKeys.EXE_CONFIG_PROGRAM_ARGUMENTS,
+ (String) null);
} catch (final CoreException e) {
Logger.log(Logger.ERROR, "Error setting default configuration", e); //$NON-NLS-1$
}