Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis Windatt2010-05-18 14:37:17 -0400
committerCurtis Windatt2010-05-18 14:37:17 -0400
commitc324df2d40610af4688918b6353926cd07afdb51 (patch)
tree3c58cb272ba96668f962208a9d9f506996035da7
parentfdbc9b08c8f68d038595bdd42d9ba7ad1238a2b9 (diff)
downloadeclipse.platform.debug-c324df2d40610af4688918b6353926cd07afdb51.tar.gz
eclipse.platform.debug-c324df2d40610af4688918b6353926cd07afdb51.tar.xz
eclipse.platform.debug-c324df2d40610af4688918b6353926cd07afdb51.zip
Bug 312974: flash in LCD description when switching between configurations
https://bugs.eclipse.org/bugs/show_bug.cgi?id=312974
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java78
1 files changed, 46 insertions, 32 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
index 6963dd12d..64281cc30 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
@@ -239,6 +239,11 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
private boolean fSetDefaultOnOpen = false;
/**
+ * Whether in the process of setting the input to the tab viewer
+ */
+ private boolean fSettingInput = false;
+
+ /**
* Constructs a new launch configuration dialog on the given
* parent shell.
*
@@ -911,30 +916,35 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
if (newInput instanceof ILaunchConfiguration) {
renamed = getLaunchManager().getMovedFrom((ILaunchConfiguration)newInput) != null;
}
- if (fTabViewer.canSave() && fTabViewer.isDirty() && !deleted && !renamed) {
- if(fLaunchConfigurationView != null) {
- fLaunchConfigurationView.setAutoSelect(false);
- }
- int ret = showUnsavedChangesDialog();
- if(ret == IDialogConstants.YES_ID) {
- fTabViewer.handleApplyPressed();
- fTabViewer.setInput(newInput);
- }
- else if(ret == IDialogConstants.NO_ID) {
- fTabViewer.handleRevertPressed();
- fTabViewer.setInput(newInput);
- }
- else {
- fLaunchConfigurationView.getViewer().setSelection(new StructuredSelection(input));
- }
- fLaunchConfigurationView.setAutoSelect(true);
- }
- else {
- fTabViewer.setInput(newInput);
- if(fTabViewer.isDirty()) {
- fTabViewer.handleApplyPressed();
- }
- }
+ try {
+ fSettingInput = true;
+ if (fTabViewer.canSave() && fTabViewer.isDirty() && !deleted && !renamed) {
+ if(fLaunchConfigurationView != null) {
+ fLaunchConfigurationView.setAutoSelect(false);
+ }
+ int ret = showUnsavedChangesDialog();
+ if(ret == IDialogConstants.YES_ID) {
+ fTabViewer.handleApplyPressed();
+ fTabViewer.setInput(newInput);
+ }
+ else if(ret == IDialogConstants.NO_ID) {
+ fTabViewer.handleRevertPressed();
+ fTabViewer.setInput(newInput);
+ }
+ else {
+ fLaunchConfigurationView.getViewer().setSelection(new StructuredSelection(input));
+ }
+ fLaunchConfigurationView.setAutoSelect(true);
+ }
+ else {
+ fTabViewer.setInput(newInput);
+ if(fTabViewer.isDirty()) {
+ fTabViewer.handleApplyPressed();
+ }
+ }
+ } finally {
+ fSettingInput = false;
+ }
if(getShell() != null && getShell().isVisible()) {
resize();
}
@@ -1499,20 +1509,24 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
* @see org.eclipse.debug.ui.ILaunchConfigurationDialog#updateButtons()
*/
public void updateButtons() {
- // New, Delete, & Duplicate toolbar actions
- getNewAction().setEnabled(getNewAction().isEnabled());
- getDeleteAction().setEnabled(getDeleteAction().isEnabled());
- getDuplicateAction().setEnabled(getDuplicateAction().isEnabled());
- fTabViewer.refresh();
- getButton(ID_LAUNCH_BUTTON).setEnabled(fTabViewer.canLaunch() & fTabViewer.canLaunchWithModes() & !fTabViewer.hasDuplicateDelegates());
+ if (!fSettingInput) {
+ // New, Delete, & Duplicate toolbar actions
+ getNewAction().setEnabled(getNewAction().isEnabled());
+ getDeleteAction().setEnabled(getDeleteAction().isEnabled());
+ getDuplicateAction().setEnabled(getDuplicateAction().isEnabled());
+ fTabViewer.refresh();
+ getButton(ID_LAUNCH_BUTTON).setEnabled(fTabViewer.canLaunch() & fTabViewer.canLaunchWithModes() & !fTabViewer.hasDuplicateDelegates());
+ }
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationDialog#updateMessage()
*/
public void updateMessage() {
- setErrorMessage(fTabViewer.getErrorMesssage());
- setMessage(fTabViewer.getMessage());
+ if (!fSettingInput) {
+ setErrorMessage(fTabViewer.getErrorMesssage());
+ setMessage(fTabViewer.getMessage());
+ }
}
/**

Back to the top