Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsgibly2007-02-12 17:57:36 +0000
committersgibly2007-02-12 17:57:36 +0000
commitdaaa43277d823c67bc6f39ff322a2f778ae04eef (patch)
tree08f81fe5270d831a7c79dd466e3cf60ad1c59404
parent1010d6de3b7eec806bf732bab20da0cd9837f968 (diff)
downloadorg.eclipse.pdt-daaa43277d823c67bc6f39ff322a2f778ae04eef.tar.gz
org.eclipse.pdt-daaa43277d823c67bc6f39ff322a2f778ae04eef.tar.xz
org.eclipse.pdt-daaa43277d823c67bc6f39ff322a2f778ae04eef.zip
Implemented the enhancement request #163830 - "Multiple Debug Sessions Should Provide a Message to the User"
-rw-r--r--plugins/org.eclipse.php.debug.ui/plugin.properties1
-rw-r--r--plugins/org.eclipse.php.debug.ui/plugin.xml7
-rw-r--r--plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/PHPDebugUIMessages.java6
-rw-r--r--plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/PHPDebugUIMessages.properties4
-rw-r--r--plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/preferences/PHPLaunchingPreferencePage.java126
5 files changed, 143 insertions, 1 deletions
diff --git a/plugins/org.eclipse.php.debug.ui/plugin.properties b/plugins/org.eclipse.php.debug.ui/plugin.properties
index 7b81e22ae..aa4098478 100644
--- a/plugins/org.eclipse.php.debug.ui/plugin.properties
+++ b/plugins/org.eclipse.php.debug.ui/plugin.properties
@@ -17,6 +17,7 @@ parameterStack.name=Parameter Stack
debugOutput.name=Debug Output
browserOutput.name=Browser Output
debugPreferencePageName=Debug
+launchingPreferencePageName=Launching
phpVariableHoverLabel=Variable Values
phpVariableHoverDescription=Shows the value of the selected variable when debugging
DebugPerspective.name=PHP Debug
diff --git a/plugins/org.eclipse.php.debug.ui/plugin.xml b/plugins/org.eclipse.php.debug.ui/plugin.xml
index 7693babdf..570958519 100644
--- a/plugins/org.eclipse.php.debug.ui/plugin.xml
+++ b/plugins/org.eclipse.php.debug.ui/plugin.xml
@@ -244,7 +244,12 @@
class="org.eclipse.php.internal.debug.ui.preferences.phps.PHPsPreferencePage"
id="org.eclipse.php.debug.ui.preferencesphps.PHPsPreferencePage">
<keywordReference id="org.eclipse.php.debug.ui.debug"/>
- </page>
+ </page>
+ <page
+ category="org.eclipse.php.debug.ui.preferences.PhpDebugPreferencePage"
+ class="org.eclipse.php.internal.debug.ui.preferences.PHPLaunchingPreferencePage"
+ id="org.eclipse.php.debug.ui.page1"
+ name="%launchingPreferencePageName"/>
</extension>
<extension point="org.eclipse.ui.propertyPages">
<page
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 9dfb2e136..6429dd76b 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
@@ -25,6 +25,12 @@ public class PHPDebugUIMessages extends NLS {
public static String EnterCondition_1;
public static String InstalledPHPsBlock_16;
+
+ public static String PHPLaunchingPreferencePage_Always;
+ public static String PHPLaunchingPreferencePage_message;
+ public static String PHPLaunchingPreferencePage_Never;
+
+ public static String PHPLaunchingPreferencePage_Prompt;
public static String SetCondition_1;
public static String ErrorCreatingBreakpoint_1;
public static String CannotRunToLine;
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 260090c2a..c84ed8ae6 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
@@ -80,6 +80,10 @@ InstalledPHPsBlock_15=&PHP executables:
InstalledPHPsBlock_16=PHP executable
PHPexe_executable_was_not_found_1=Target is not a PHP Root. PHP executable was not found
+PHPLaunchingPreferencePage_message=Allow multiple debug sessions
+PHPLaunchingPreferencePage_Always=Always
+PHPLaunchingPreferencePage_Never=Never
+PHPLaunchingPreferencePage_Prompt=Prompt
PHPexe_ok_2=ok
PHPexe_Run_With_Debug_Info=Run With Debug Info
diff --git a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/preferences/PHPLaunchingPreferencePage.java b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/preferences/PHPLaunchingPreferencePage.java
new file mode 100644
index 000000000..a5bac8f29
--- /dev/null
+++ b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/preferences/PHPLaunchingPreferencePage.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Zend Corporation and IBM Corporation.
+ * 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:
+ * Zend and IBM - Initial implementation
+ *******************************************************************************/
+package org.eclipse.php.internal.debug.ui.preferences;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.MessageDialogWithToggle;
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.preference.RadioGroupFieldEditor;
+import org.eclipse.php.internal.debug.ui.PHPDebugUIMessages;
+import org.eclipse.php.internal.ui.PHPUiPlugin;
+import org.eclipse.php.internal.ui.preferences.PreferenceConstants;
+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.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * A preference page for configuring PHP launching preferences.
+ */
+public class PHPLaunchingPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ /**
+ * a list of the field editors
+ * @since 3.2
+ */
+ private List fFieldEditors;
+
+ /**
+ * The default contsructor
+ */
+ public PHPLaunchingPreferencePage() {
+ super();
+ setPreferenceStore(PHPUiPlugin.getDefault().getPreferenceStore());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ // TODO - Attach the Help
+ // PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.LAUNCHING_PREFERENCE_PAGE);
+ }
+
+ /**
+ * creates a composite to place tab controls on
+ * @param parent the parent to create to composite for
+ * @return a composite for settgin as a tabitem control
+ * @since 3.2
+ */
+ private Composite createComposite(Composite parent) {
+ Composite comp = new Composite(parent, SWT.NONE);
+ comp.setLayout(new GridLayout());
+ comp.setFont(parent.getFont());
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ comp.setLayoutData(gd);
+ return comp;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createContents(Composite parent) {
+ fFieldEditors = new ArrayList();
+ Composite comp = createComposite(parent);
+ //save dirty editors
+ FieldEditor edit = new RadioGroupFieldEditor(PreferenceConstants.ALLOW_MULTIPLE_LAUNCHES, PHPDebugUIMessages.PHPLaunchingPreferencePage_message, 3, new String[][] { { PHPDebugUIMessages.PHPLaunchingPreferencePage_Always, MessageDialogWithToggle.ALWAYS }, { PHPDebugUIMessages.PHPLaunchingPreferencePage_Never, MessageDialogWithToggle.NEVER }, { PHPDebugUIMessages.PHPLaunchingPreferencePage_Prompt, MessageDialogWithToggle.PROMPT } }, comp, true);
+ fFieldEditors.add(edit);
+
+ //init the field editors
+ initFieldEditors();
+ return comp;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench workbench) {
+ }
+
+ /**
+ * Initializes the field editors to their values
+ * @since 3.2
+ */
+ private void initFieldEditors() {
+ FieldEditor editor;
+ for (int i = 0; i < fFieldEditors.size(); i++) {
+ editor = (FieldEditor) fFieldEditors.get(i);
+ editor.setPreferenceStore(getPreferenceStore());
+ editor.load();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+ */
+ protected void performDefaults() {
+ for (int i = 0; i < fFieldEditors.size(); i++) {
+ ((FieldEditor) fFieldEditors.get(i)).loadDefault();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#performOk()
+ */
+ public boolean performOk() {
+ for (int i = 0; i < fFieldEditors.size(); i++) {
+ ((FieldEditor) fFieldEditors.get(i)).store();
+ }
+ return super.performOk();
+ }
+}

Back to the top