Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2005-11-04 23:42:01 -0500
committerDarin Wright2005-11-04 23:42:01 -0500
commit0b3a54d6dc5420fcd3778c40fb93d72b16be1ca3 (patch)
treef8fc6307d58ebb9ebfdec14a8d92bb734b1b78d1
parent1551d6947ffeb60f3f035ec1d4ce0a9b993cd87f (diff)
downloadeclipse.platform.debug-0b3a54d6dc5420fcd3778c40fb93d72b16be1ca3.tar.gz
eclipse.platform.debug-0b3a54d6dc5420fcd3778c40fb93d72b16be1ca3.tar.xz
eclipse.platform.debug-0b3a54d6dc5420fcd3778c40fb93d72b16be1ca3.zip
Bug 115155 - Link to perspective preferences
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java85
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/PerspectivePreferencePage.java1
6 files changed, 72 insertions, 28 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
index 6bd910ea4..9a855beee 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
@@ -25,15 +25,22 @@ import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.SWTUtil;
+import org.eclipse.debug.internal.ui.preferences.PerspectivePreferencePage;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.preference.IPreferenceNode;
+import org.eclipse.jface.preference.IPreferencePage;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.preference.PreferenceManager;
+import org.eclipse.jface.preference.PreferenceNode;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.custom.StackLayout;
@@ -41,6 +48,7 @@ import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
@@ -50,6 +58,7 @@ 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.Link;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
@@ -328,31 +337,61 @@ public class LaunchConfigurationTabGroupViewer extends Viewer {
private void createGettingStarted(Composite parent) {
Font font = parent.getFont();
GridData gd = null;
- Label label = new Label(parent, SWT.LEFT | SWT.WRAP);
- label.setFont(font);
- label.setText(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_1);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = parent.getBounds().width - 30;
- label.setLayoutData(gd);
- createSpacer(parent, 1);
- label = new Label(parent, SWT.LEFT | SWT.WRAP);
- label.setFont(font);
- label.setText(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_2);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = parent.getBounds().width - 30;
- label.setLayoutData(gd);
- label = new Label(parent, SWT.LEFT | SWT.WRAP);
- label.setFont(font);
- label.setText(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_3);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = parent.getBounds().width - 30;
- label.setLayoutData(gd);
- label = new Label(parent, SWT.LEFT | SWT.WRAP);
- label.setFont(font);
- label.setText(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_4);
+ createWrapLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_1);
+ createWrapLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_2);
+ createWrapLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_3);
+ createWrapLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_4);
+ createWrapLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_6);
+
+ createSpacer(parent, 2);
+ Link link = new Link(parent, SWT.LEFT | SWT.WRAP);
+ link.setText(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_5);
+ link.setFont(font);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = parent.getBounds().width - 30;
- label.setLayoutData(gd);
+ link.setLayoutData(gd);
+ link.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ showPreferencePage("org.eclipse.debug.ui.PerspectivePreferencePage", new PerspectivePreferencePage()); //$NON-NLS-1$
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ });
+ }
+
+ /**
+ * Create a label on the given parent that wraps text.
+ *
+ * @param parent
+ * @param text
+ */
+ private void createWrapLabel(Composite parent, String text) {
+ Label label = new Label(parent, SWT.LEFT | SWT.WRAP);
+ label.setFont(parent.getFont());
+ label.setText(text);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.widthHint = parent.getBounds().width - 30;
+ label.setLayoutData(gd);
+ }
+
+ /**
+ * This method allows us to open the preference dialog on the specific page, in this case the perspective page
+ * @param id the id of pref page to show
+ * @param page the actual page to show
+ */
+ private void showPreferencePage(String id, IPreferencePage page) {
+ final IPreferenceNode targetNode = new PreferenceNode(id, page);
+
+ PreferenceManager manager = new PreferenceManager();
+ manager.addToRoot(targetNode);
+ final PreferenceDialog dialog = new PreferenceDialog(DebugUIPlugin.getShell(), manager);
+ final boolean [] result = new boolean[] { false };
+ BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
+ public void run() {
+ dialog.create();
+ dialog.setMessage(targetNode.getLabelText());
+ result[0]= (dialog.open() == Window.OK);
+ }
+ });
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
index 55cafb7fc..3b0fd6b7f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
@@ -150,11 +150,10 @@ public class LaunchConfigurationsMessages extends NLS {
}
public static String LaunchConfigurationTabGroupViewer_1;
-
public static String LaunchConfigurationTabGroupViewer_2;
-
public static String LaunchConfigurationTabGroupViewer_3;
-
public static String LaunchConfigurationTabGroupViewer_4;
+ public static String LaunchConfigurationTabGroupViewer_5;
+ public static String LaunchConfigurationTabGroupViewer_6;
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
index 912f9375f..e5377137f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
@@ -45,10 +45,12 @@ LaunchConfigurationDialog__Name__16=&Name:
LaunchConfigurationDialog_An_exception_occurred_while_retrieving_launch_configurations_20=An exception occurred while retrieving launch configurations
LaunchConfigurationDialog_Cancel_34=Cancel
LaunchConfigurationTabGroupViewer_0={0} is an invalid character in launch configuration name {1}
-LaunchConfigurationTabGroupViewer_1=Configure application launch settings:
+LaunchConfigurationTabGroupViewer_1=Configure application launch settings from this dialog:
LaunchConfigurationTabGroupViewer_2=\t- Create a new application by selecting a type and pressing 'New'.
LaunchConfigurationTabGroupViewer_3=\t- Edit or view an existing application by selecting it.
LaunchConfigurationTabGroupViewer_4=\t- Delete an existing application by selecting it and pressing 'Delete'.
+LaunchConfigurationTabGroupViewer_6=\t- Duplicate an existing application by selecting 'Duplicate' in the context menu.
+LaunchConfigurationTabGroupViewer_5=Configure launch perspective settings from the <a>Perspectives</a> preference page.
LaunchConfigurationDialog_Create__manage__and_run_launch_configurations_8=Create, manage, and run configurations
LaunchConfigurationDialog_Dele_te_14=Dele&te
LaunchConfigurationDialog_Discard_changes__38=Discard changes?
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.java
index aeb002efe..b3f330416 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.java
@@ -113,4 +113,6 @@ public class DebugPreferencesMessages extends NLS {
public static String PerspectivePreferencePage_5;
+ public static String PerspectivePreferencePage_6;
+
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties
index d90c976d6..a448a21c9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties
@@ -95,4 +95,5 @@ PerspectivePreferencePage_1=Appli&cation types:
PerspectivePreferencePage_2=Perspectives:
PerspectivePreferencePage_3={0}:
PerspectivePreferencePage_4=None
-PerspectivePreferencePage_5=These settings assign perspectives to each application type and launch mode. Select "None" to indicate that a perspective should not be opened. \ No newline at end of file
+PerspectivePreferencePage_5=These settings assign perspectives to each application type and launch mode. Select "None" to indicate that a perspective should not be opened.
+PerspectivePreferencePage_6=Perspectives
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/PerspectivePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/PerspectivePreferencePage.java
index ac702333b..1943a59a1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/PerspectivePreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/PerspectivePreferencePage.java
@@ -174,6 +174,7 @@ public class PerspectivePreferencePage extends PreferencePage implements
public PerspectivePreferencePage() {
IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
setPreferenceStore(store);
+ setTitle(DebugPreferencesMessages.PerspectivePreferencePage_6);
setDescription(DebugPreferencesMessages.PerspectivePreferencePage_0);
}// end constructor

Back to the top