1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

bug 269313: wrong shell focus after multiple configurations selection

patch from Irit Belezko
This commit is contained in:
Andrew Gvozdev 2009-07-29 16:37:36 +00:00
parent 32b3cb1228
commit ed95e2bbdf
2 changed files with 23 additions and 5 deletions

View file

@ -406,7 +406,7 @@ implements
boolean enterMultiCfgsDialog = (multiCfgs == null) boolean enterMultiCfgsDialog = (multiCfgs == null)
|| (multiCfgs == cfgDescs) || !areCfgsStillThere(multiCfgs); || (multiCfgs == cfgDescs) || !areCfgsStillThere(multiCfgs);
if (enterMultiCfgsDialog) { if (enterMultiCfgsDialog) {
ICConfigurationDescription[] mcfgs = ConfigMultiSelectionDialog.select(cfgDescs); ICConfigurationDescription[] mcfgs = ConfigMultiSelectionDialog.select(cfgDescs, parentComposite.getShell());
if (mcfgs == null || mcfgs.length == 0) { if (mcfgs == null || mcfgs.length == 0) {
// return back to previous selection // return back to previous selection
int cfgIndex = -1; int cfgIndex = -1;

View file

@ -45,9 +45,12 @@ public class ConfigMultiSelectionDialog extends Dialog {
private Label message; private Label message;
private static ICConfigurationDescription[] result = null; private static ICConfigurationDescription[] result = null;
public static ICConfigurationDescription[] select(ICConfigurationDescription[] _cfgds) { /**
* @since 5.2
*/
public static ICConfigurationDescription[] select(ICConfigurationDescription[] _cfgds, Shell parentShell) {
cfgds = _cfgds; cfgds = _cfgds;
ConfigMultiSelectionDialog d = new ConfigMultiSelectionDialog(CUIPlugin.getActiveWorkbenchShell()); ConfigMultiSelectionDialog d = new ConfigMultiSelectionDialog(parentShell);
if (d.open() == OK) if (d.open() == OK)
return result; return result;
return null; return null;
@ -136,4 +139,19 @@ public class ConfigMultiSelectionDialog extends Dialog {
return composite; return composite;
} }
/**
* @deprecated (in org.eclipse.cdt.ui 5.2.0)
*
* This call is deprecated in plugin org.eclipse.cdt.ui 5.2.0 and intended to be removed
* on occasion when the plugin increases major version (Bug 285033).
* Use {@link #select(ICConfigurationDescription[], Shell)} to properly set focus.
*/
@Deprecated
public static ICConfigurationDescription[] select(ICConfigurationDescription[] _cfgds) {
cfgds = _cfgds;
ConfigMultiSelectionDialog d = new ConfigMultiSelectionDialog(CUIPlugin.getActiveWorkbenchShell());
if (d.open() == OK)
return result;
return null;
}
} }