1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

- fixed problem with convert wizard with closed projects

- added .cdtproject convertion
This commit is contained in:
David Inglis 2003-08-21 19:43:47 +00:00
parent db989297e9
commit f1a4d0ae90
2 changed files with 17 additions and 10 deletions

View file

@ -29,7 +29,6 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.QualifiedName; import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelection;
@ -66,13 +65,12 @@ public class UpdateMakeProjectAction implements IWorkbenchWindowActionDelegate {
project = ((ICProject) elem).getProject(); project = ((ICProject) elem).getProject();
} }
if (project != null) { if (project != null) {
projects.add(project);
} }
} }
final IProject[] projectArray = (IProject[]) projects.toArray(new IProject[projects.size()]); final IProject[] projectArray = (IProject[]) projects.toArray(new IProject[projects.size()]);
ProgressMonitorDialog pd = new ProgressMonitorDialog(MakeUIPlugin.getActiveWorkbenchShell());
run(true, pd, projectArray);
UpdateMakeProjectWizard wizard = new UpdateMakeProjectWizard(projectArray); UpdateMakeProjectWizard wizard = new UpdateMakeProjectWizard(projectArray);
WizardDialog dialog = new WizardDialog(MakeUIPlugin.getActiveWorkbenchShell(), wizard); WizardDialog dialog = new WizardDialog(MakeUIPlugin.getActiveWorkbenchShell(), wizard);
dialog.open(); dialog.open();
@ -114,12 +112,19 @@ public class UpdateMakeProjectAction implements IWorkbenchWindowActionDelegate {
project[i], project[i],
MakeCorePlugin.OLD_BUILDER_ID, MakeCorePlugin.OLD_BUILDER_ID,
new SubProgressMonitor(monitor, 1)); new SubProgressMonitor(monitor, 1));
// convert .cdtproject
CCorePlugin.getDefault().mapCProjectOwner(project[i], MakeCorePlugin.getUniqueIdentifier() + ".make", true);
// add new nature // add new nature
MakeProjectNature.addNature(project[i], new SubProgressMonitor(monitor, 1)); MakeProjectNature.addNature(project[i], new SubProgressMonitor(monitor, 1));
// move existing build properties to new
IMakeBuilderInfo newInfo = MakeCorePlugin.createBuildInfo(project[i], MakeBuilder.BUILDER_ID); IMakeBuilderInfo newInfo = MakeCorePlugin.createBuildInfo(project[i], MakeBuilder.BUILDER_ID);
QualifiedName qlocation = new QualifiedName(CCorePlugin.PLUGIN_ID, "buildLocation"); QualifiedName qlocation = new QualifiedName(CCorePlugin.PLUGIN_ID, "buildLocation");
String location = project[i].getPersistentProperty(qlocation); String location = project[i].getPersistentProperty(qlocation);
if ( location != null) {
newInfo.setBuildCommand(new Path(location)); newInfo.setBuildCommand(new Path(location));
}
//remove old properties //remove old properties
QualifiedName[] qName = QualifiedName[] qName =

View file

@ -117,6 +117,7 @@ public class UpdateMakeProjectWizardPage extends StatusWizardPage {
Vector result = new Vector(); Vector result = new Vector();
try { try {
for (int i = 0; i < project.length; i++) { for (int i = 0; i < project.length; i++) {
if (project[i].isAccessible()) {
IProjectDescription desc = project[i].getDescription(); IProjectDescription desc = project[i].getDescription();
ICommand builder[] = desc.getBuildSpec(); ICommand builder[] = desc.getBuildSpec();
for (int j = 0; j < builder.length; j++) { for (int j = 0; j < builder.length; j++) {
@ -126,6 +127,7 @@ public class UpdateMakeProjectWizardPage extends StatusWizardPage {
} }
} }
} }
}
} catch (CoreException e) { } catch (CoreException e) {
MakeUIPlugin.logException(e); MakeUIPlugin.logException(e);
} }