mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 17:55:39 +02:00
[fix] minor cleanups to initial new connection wizard selection handling + removed deprecates where possible
This commit is contained in:
parent
61f760dc96
commit
474843d022
2 changed files with 22 additions and 10 deletions
|
@ -370,7 +370,7 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
|
|||
// query all affected subsystems for their list of additional wizard pages...
|
||||
Vector additionalPages = new Vector();
|
||||
ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
|
||||
ISubSystemConfiguration[] factories = sr.getSubSystemConfigurationsBySystemType(systemType.getName(), true);
|
||||
ISubSystemConfiguration[] factories = sr.getSubSystemConfigurationsBySystemType(systemType, true);
|
||||
for (int idx = 0; idx < factories.length; idx++) {
|
||||
ISubSystemConfigurationAdapter adapter = (ISubSystemConfigurationAdapter)factories[idx].getAdapter(ISubSystemConfigurationAdapter.class);
|
||||
|
||||
|
|
|
@ -323,6 +323,9 @@ public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, IS
|
|||
container.updateTitleBar();
|
||||
container.updateButtons();
|
||||
}
|
||||
|
||||
// Save the current selection to the dialog settings
|
||||
saveWidgetValues();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -331,7 +334,7 @@ public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, IS
|
|||
public void addPages() {
|
||||
addPage(mainPage);
|
||||
// and restore the wizard's selection state from last session
|
||||
restoreFromDialogSettings();
|
||||
restoreWidgetValues();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -363,24 +366,33 @@ public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, IS
|
|||
*/
|
||||
public boolean performFinish() {
|
||||
// Save the current selection to the dialog settings
|
||||
IDialogSettings dialogSettings = getDialogSettings();
|
||||
if (dialogSettings != null && getSelection() instanceof IStructuredSelection) {
|
||||
IStructuredSelection selection = (IStructuredSelection)getSelection();
|
||||
if (selection.getFirstElement() instanceof IRSESystemType) {
|
||||
dialogSettings.put(LAST_SELECTED_SYSTEM_TYPE_ID, ((IRSESystemType)selection.getFirstElement()).getId());
|
||||
}
|
||||
}
|
||||
saveWidgetValues();
|
||||
|
||||
if (mainPage != null) mainPage.saveWidgetValues();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the last selected system type id to the dialog settings.
|
||||
* Called from <code>onSelectedSystemTypeChanged</code> and <code>
|
||||
* performFinish</code>.
|
||||
*/
|
||||
protected void saveWidgetValues() {
|
||||
IDialogSettings dialogSettings = getDialogSettings();
|
||||
if (dialogSettings != null && getSelection() instanceof IStructuredSelection) {
|
||||
IStructuredSelection selection = (IStructuredSelection)getSelection();
|
||||
if (selection.getFirstElement() instanceof IRSESystemType) {
|
||||
dialogSettings.put(LAST_SELECTED_SYSTEM_TYPE_ID, ((IRSESystemType)selection.getFirstElement()).getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore the persistent saved wizard state. This method
|
||||
* is called from the wizards constructor.
|
||||
*/
|
||||
protected void restoreFromDialogSettings() {
|
||||
protected void restoreWidgetValues() {
|
||||
IDialogSettings dialogSettings = getDialogSettings();
|
||||
if (dialogSettings != null) {
|
||||
String systemTypeId = dialogSettings.get(LAST_SELECTED_SYSTEM_TYPE_ID);
|
||||
|
|
Loading…
Add table
Reference in a new issue