mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
[fix] [174771] New connection wizard works on 1st invocation only
This commit is contained in:
parent
9117eeab65
commit
c3584207d9
5 changed files with 86 additions and 15 deletions
|
@ -228,6 +228,18 @@ public abstract class AbstractSystemWizardPage
|
|||
// -----------------------
|
||||
// PARENT-OVERRIDE METHODS
|
||||
// -----------------------
|
||||
|
||||
public void dispose() {
|
||||
super.dispose();
|
||||
|
||||
// Once the page is disposed, the widgets are not longer accessible
|
||||
msgLine = null;
|
||||
input = null;
|
||||
parentComposite = null;
|
||||
pendingMessage = null;
|
||||
pendingErrorMessage = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parent override. <br>
|
||||
* Creates the wizard's UI component.
|
||||
|
@ -301,7 +313,7 @@ public abstract class AbstractSystemWizardPage
|
|||
*/
|
||||
public void clearErrorMessage()
|
||||
{
|
||||
if (msgLine!=null)
|
||||
if (msgLine!=null && !msgLine.isDisposed())
|
||||
msgLine.clearErrorMessage();
|
||||
}
|
||||
|
||||
|
@ -311,7 +323,7 @@ public abstract class AbstractSystemWizardPage
|
|||
*/
|
||||
public void clearMessage()
|
||||
{
|
||||
if (msgLine!=null)
|
||||
if (msgLine!=null && !msgLine.isDisposed())
|
||||
msgLine.clearMessage();
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,14 @@ public abstract class RSEAbstractNewConnectionWizard extends Wizard implements I
|
|||
isBusy = false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.wizard.Wizard#dispose()
|
||||
*/
|
||||
public void dispose() {
|
||||
super.dispose();
|
||||
systemType = null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.rse.ui.wizards.IRSENewConnectionWizardDelegate#getSystemType()
|
||||
*/
|
||||
|
|
|
@ -69,6 +69,24 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
|
|||
activeProfileNames = SystemStartHere.getSystemProfileManager().getActiveSystemProfileNames();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.wizard.Wizard#dispose()
|
||||
*/
|
||||
public void dispose() {
|
||||
super.dispose();
|
||||
|
||||
mainPage = null;
|
||||
subsystemFactorySuppliedWizardPages = null;
|
||||
ssfWizardPagesPerSystemType.clear();
|
||||
defaultUserId = null;
|
||||
defaultHostName = null;
|
||||
defaultConnectionName = null;
|
||||
activeProfileNames = null;
|
||||
privateProfileIndex = -1;
|
||||
privateProfile = null;
|
||||
currentlySelectedConnection = null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.rse.ui.wizards.AbstractNewConnectionWizard#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
|
||||
*/
|
||||
|
|
|
@ -51,7 +51,7 @@ public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, IS
|
|||
private IRSESystemType selectedSystemType;
|
||||
private boolean selectedWizardCanFinishEarly;
|
||||
|
||||
private final RSENewConnectionWizardSelectionPage mainPage;
|
||||
private RSENewConnectionWizardSelectionPage mainPage;
|
||||
private final List initializedWizards = new LinkedList();
|
||||
private final List selectionChangedListener = new LinkedList();
|
||||
|
||||
|
@ -80,7 +80,23 @@ public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, IS
|
|||
// and finally restore the wizard state
|
||||
restoreFromDialogSettings();
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.wizard.Wizard#dispose()
|
||||
*/
|
||||
public void dispose() {
|
||||
super.dispose();
|
||||
|
||||
selectedWizard = null;
|
||||
selectedSystemType = null;
|
||||
selectedWizardCanFinishEarly = false;
|
||||
mainPage = null;
|
||||
initializedWizards.clear();
|
||||
selectionChangedListener.clear();
|
||||
restrictedSystemTypes = null;
|
||||
onlySystemType = false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.wizard.Wizard#getDefaultPageImage()
|
||||
*/
|
||||
|
|
|
@ -33,17 +33,34 @@ public class RSEWizardDescriptor extends RSEWizardRegistryElement implements IRS
|
|||
*/
|
||||
public RSEWizardDescriptor(RSEAbstractWizardRegistry wizardRegistry, IConfigurationElement element) {
|
||||
super(wizardRegistry, element);
|
||||
|
||||
// Try to instanciate the wizard.
|
||||
try {
|
||||
wizard = (IWizard)element.createExecutableExtension("class"); //$NON-NLS-1$
|
||||
} catch (CoreException e) {
|
||||
String message = "RSE new connection wizard failed creation (plugin: {0}, id: {1})."; //$NON-NLS-1$
|
||||
message = MessageFormat.format(message, new Object[] { element.getContributor().getName(), element.getDeclaringExtension().getSimpleIdentifier()});
|
||||
RSECorePlugin.getDefault().getLogger().logError(message, e);
|
||||
}
|
||||
internalGetWizard();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Internal method. Returns the wizard instance or create a new one
|
||||
* if the wizard had been disposed before.
|
||||
*
|
||||
* @return The wizard instance to use.
|
||||
*/
|
||||
private IWizard internalGetWizard() {
|
||||
if (wizard == null
|
||||
|| (wizard != null && wizard.getStartingPage() != null
|
||||
&& wizard.getStartingPage().getControl() != null
|
||||
&& wizard.getStartingPage().getControl().isDisposed())) {
|
||||
// Try to instanciate the wizard.
|
||||
IConfigurationElement element = getConfigurationElement();
|
||||
try {
|
||||
wizard = (IWizard)element.createExecutableExtension("class"); //$NON-NLS-1$
|
||||
} catch (CoreException e) {
|
||||
String message = "RSE new connection wizard failed creation (plugin: {0}, id: {1})."; //$NON-NLS-1$
|
||||
message = MessageFormat.format(message, new Object[] { element.getContributor().getName(), element.getDeclaringExtension().getSimpleIdentifier()});
|
||||
RSECorePlugin.getDefault().getLogger().logError(message, e);
|
||||
}
|
||||
}
|
||||
|
||||
return wizard;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.rse.ui.wizards.registries.IWizardDescriptor#isValid()
|
||||
*/
|
||||
|
@ -55,7 +72,7 @@ public class RSEWizardDescriptor extends RSEWizardRegistryElement implements IRS
|
|||
* @see org.eclipse.rse.ui.wizards.registries.IWizardDescriptor#getWizard()
|
||||
*/
|
||||
public IWizard getWizard() {
|
||||
return wizard;
|
||||
return internalGetWizard();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
Loading…
Add table
Reference in a new issue