1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 22:22:11 +02:00

Fix from Andrew Ferguson to the project creation with small updates

This commit is contained in:
Mikhail Sennikovsky 2007-04-26 20:15:44 +00:00
parent c5603e5a0e
commit 279868fade
2 changed files with 16 additions and 3 deletions

View file

@ -54,7 +54,8 @@ implements IExecutableExtension, IWizardWithMemory
private String wz_title;
private String wz_desc;
public String lastProjectName = null;
private String lastProjectName = null;
private IPath lastProjectLocation = null;
private ICWizardHandler savedHandler = null;
protected List localPages = new ArrayList(); // replacing Wizard.pages since we have to delete them
@ -83,7 +84,9 @@ implements IExecutableExtension, IWizardWithMemory
* @return true if user has changed settings since project creation
*/
private boolean isChanged() {
if (savedHandler != fMainPage.h_selected || !fMainPage.getProjectName().equals(lastProjectName))
if (savedHandler != fMainPage.h_selected
|| !fMainPage.getProjectName().equals(lastProjectName)
|| !fMainPage.getProjectLocation().equals(lastProjectLocation))
return true;
return savedHandler.isChanged();
}
@ -95,6 +98,7 @@ implements IExecutableExtension, IWizardWithMemory
savedHandler = fMainPage.h_selected;
savedHandler.saveState();
lastProjectName = fMainPage.getProjectName();
lastProjectLocation = fMainPage.getProjectLocation();
// start creation process
invokeRunnable(getRunnable(defaults));
}
@ -112,6 +116,7 @@ implements IExecutableExtension, IWizardWithMemory
} catch (CoreException ignore) {}
newProject = null;
lastProjectName = null;
lastProjectLocation = null;
}
private boolean invokeRunnable(IRunnableWithProgress runnable) {
@ -154,7 +159,7 @@ implements IExecutableExtension, IWizardWithMemory
getShell().getDisplay().syncExec(new Runnable() {
public void run() {
try {
newProject = createIProject(lastProjectName, fMainPage.getProjectLocation());
newProject = createIProject(lastProjectName, lastProjectLocation);
if (newProject != null)
fMainPage.h_selected.createProject(newProject, defaults);
} catch (CoreException e) { CUIPlugin.getDefault().log(e); }
@ -222,4 +227,8 @@ implements IExecutableExtension, IWizardWithMemory
public String getLastProjectName() {
return lastProjectName;
}
public IPath getLastProjectLocation() {
return lastProjectLocation;
}
}

View file

@ -10,10 +10,14 @@
*******************************************************************************/
package org.eclipse.cdt.ui.wizards;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.wizard.IWizard;
public interface IWizardWithMemory extends IWizard {
// returns name of last-created project
// or null if no projects were created
public String getLastProjectName();
public IPath getLastProjectLocation();
}