Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2007-05-07 18:35:44 +0000
committerDarin Wright2007-05-07 18:35:44 +0000
commite9f08d9a6d9327525612bff3fb4edfeaeafc685c (patch)
tree95e7566a161dad275916ba38559f54b1427ecf88 /org.eclipse.debug.ui
parentede0930527d4be87011edf0cbd5475de6e64b3fd (diff)
downloadeclipse.platform.debug-e9f08d9a6d9327525612bff3fb4edfeaeafc685c.tar.gz
eclipse.platform.debug-e9f08d9a6d9327525612bff3fb4edfeaeafc685c.tar.xz
eclipse.platform.debug-e9f08d9a6d9327525612bff3fb4edfeaeafc685c.zip
Bug 184972 [launching] the Search... button is the new dirty button
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java25
1 files changed, 18 insertions, 7 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 06d2c140a..2b0585694 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
@@ -1269,13 +1269,23 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
fProgressMonitorPart.getParent().setVisible(true);
fProgressMonitorCancelButton.setFocus();
fActiveRunningOperations++;
+
+ //do work here collecting enabled states, otherwise to get these states we would need to
+ //perform the validation of the dialog again, which is expensive and would cause flashing of widgets.
+ Control[] children = ((Composite)fButtonComp.getChildren()[0]).getChildren();
+ boolean[] prev = new boolean[children.length+2];
+ prev[0] = getTabViewer().getApplyButton().isEnabled();
+ prev[1] = getTabViewer().getRevertButton().isEnabled();
+ for(int i = 0; i < children.length; i++) {
+ prev[i+2] = children[i].isEnabled();
+ }
try {
- updateRunnnableControls(false);
+ updateRunnnableControls(false, prev);
ModalContext.run(runnable, fork, fProgressMonitorPart, getShell().getDisplay());
}
finally {
fActiveRunningOperations--;
- updateRunnnableControls(true);
+ updateRunnnableControls(true, prev);
if (getShell() != null) {
fProgressMonitorPart.getParent().setVisible(false);
fProgressMonitorPart.removeFromCancelComponent(fProgressMonitorCancelButton);
@@ -1293,17 +1303,18 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/**
* Updates the enablement of the runnable controls to appear disabled as a job is running
* @param enabled the desired enable status of the dialog area, revert//apply buttons, and
+ * @param prev the previous settings for the apply and revert buttons to be reset to, only takes effect if enable is set to true
* any children of the button bar
- * @since 3.3
+ * @since 3.3.0
*/
- private void updateRunnnableControls(boolean enabled) {
+ private void updateRunnnableControls(boolean enabled, boolean[] prev) {
+ getTabViewer().getApplyButton().setEnabled(enabled ? prev[0] : enabled);
+ getTabViewer().getRevertButton().setEnabled(enabled ? prev[1] : enabled);
//the arrangement never differs: button comp has one child that holds all the buttons
Control[] children = ((Composite)fButtonComp.getChildren()[0]).getChildren();
for(int i = 0; i < children.length; i++) {
- children[i].setEnabled(enabled);
+ children[i].setEnabled(enabled ? prev[i+2] : enabled);
}
- getTabViewer().getApplyButton().setEnabled(enabled);
- getTabViewer().getRevertButton().setEnabled(enabled);
getDialogArea().setEnabled(enabled);
}

Back to the top