Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 115577 Details for
Bug 250982
CDTCommonProjectWizard does not report progress
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch for cdt_5_0
bug_250982_wizard_progress_cdt_5_0-2 (text/plain), 19.11 KB, created by
Vivian Kong
on 2008-10-20 11:38:16 EDT
(
hide
)
Description:
patch for cdt_5_0
Filename:
MIME Type:
Creator:
Vivian Kong
Created:
2008-10-20 11:38:16 EDT
Size:
19.11 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.managedbuilder.ui >Index: src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java,v >retrieving revision 1.11 >diff -u -r1.11 STDWizardHandler.java >--- src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java 26 Feb 2008 14:38:37 -0000 1.11 >+++ src/org/eclipse/cdt/managedbuilder/ui/wizards/STDWizardHandler.java 20 Oct 2008 15:36:27 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * Intel Corporation - initial API and implementation >+ * IBM Corporation > *******************************************************************************/ > package org.eclipse.cdt.managedbuilder.ui.wizards; > >@@ -26,6 +27,7 @@ > import org.eclipse.cdt.ui.newui.UIMessages; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.jface.wizard.IWizard; > import org.eclipse.swt.widgets.Composite; > >@@ -48,40 +50,49 @@ > /** > * Note that configurations parameter is ignored > */ >- public void createProject(IProject project, boolean defaults, boolean onFinish) throws CoreException { >- ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager(); >- ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish); >- ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project); >- ManagedProject mProj = new ManagedProject(des); >- info.setManagedProject(mProj); >- >- cfgs = CfgHolder.unique(fConfigPage.getCfgItems(defaults)); >- cfgs = CfgHolder.reorder(cfgs); >- >- for (int i=0; i<cfgs.length; i++) { >- String s = (cfgs[i].getToolChain() == null) ? "0" : ((ToolChain)(cfgs[i].getToolChain())).getId(); //$NON-NLS-1$ >- Configuration cfg = new Configuration(mProj, (ToolChain)cfgs[i].getToolChain(), ManagedBuildManager.calculateChildId(s, null), cfgs[i].getName()); >- IBuilder bld = cfg.getEditableBuilder(); >- if (bld != null) { >- if(bld.isInternalBuilder()){ >- IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false); >- IBuilder prefBuilder = prefCfg.getBuilder(); >- cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName()); >- bld = cfg.getEditableBuilder(); >- bld.setBuildPath(null); >+ @Override >+ public void createProject(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException { >+ try { >+ monitor.beginTask("Create project", 100); >+ >+ ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager(); >+ ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish); >+ ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project); >+ ManagedProject mProj = new ManagedProject(des); >+ info.setManagedProject(mProj); >+ monitor.worked(20); >+ cfgs = CfgHolder.unique(fConfigPage.getCfgItems(defaults)); >+ cfgs = CfgHolder.reorder(cfgs); >+ int work = 50/cfgs.length; >+ for (int i=0; i<cfgs.length; i++) { >+ String s = (cfgs[i].getToolChain() == null) ? "0" : ((ToolChain)(cfgs[i].getToolChain())).getId(); //$NON-NLS-1$ >+ Configuration cfg = new Configuration(mProj, (ToolChain)cfgs[i].getToolChain(), ManagedBuildManager.calculateChildId(s, null), cfgs[i].getName()); >+ IBuilder bld = cfg.getEditableBuilder(); >+ if (bld != null) { >+ if(bld.isInternalBuilder()){ >+ IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false); >+ IBuilder prefBuilder = prefCfg.getBuilder(); >+ cfg.changeBuilder(prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(), null), prefBuilder.getName()); >+ bld = cfg.getEditableBuilder(); >+ bld.setBuildPath(null); >+ } >+ bld.setManagedBuildOn(false); >+ } else { >+ System.out.println(UIMessages.getString("StdProjectTypeHandler.3")); //$NON-NLS-1$ > } >- bld.setManagedBuildOn(false); >- } else { >- System.out.println(UIMessages.getString("StdProjectTypeHandler.3")); //$NON-NLS-1$ >+ cfg.setArtifactName(removeSpaces(project.getName())); >+ CConfigurationData data = cfg.getConfigurationData(); >+ des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data); >+ monitor.worked(work); > } >- cfg.setArtifactName(removeSpaces(project.getName())); >- CConfigurationData data = cfg.getConfigurationData(); >- des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data); >+ mngr.setProjectDescription(project, des); >+ >+ doTemplatesPostProcess(project); >+ doCustom(project); >+ monitor.worked(30); >+ } finally { >+ monitor.done(); > } >- mngr.setProjectDescription(project, des); >- >- doTemplatesPostProcess(project); >- doCustom(project); > } > public boolean canCreateWithoutToolchain() { return true; } > >Index: src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java,v >retrieving revision 1.38.2.2 >diff -u -r1.38.2.2 MBSWizardHandler.java >--- src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java 6 Oct 2008 07:58:50 -0000 1.38.2.2 >+++ src/org/eclipse/cdt/managedbuilder/ui/wizards/MBSWizardHandler.java 20 Oct 2008 15:36:27 -0000 >@@ -55,6 +55,7 @@ > import org.eclipse.cdt.ui.wizards.IWizardItemsListListener; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Status; > import org.eclipse.jface.operation.IRunnableWithProgress; >@@ -502,54 +503,63 @@ > } > > @Override >- public void createProject(IProject project, boolean defaults, boolean onFinish) throws CoreException { >- ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager(); >- ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish); >- ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project); >- >- cfgs = fConfigPage.getCfgItems(false); >- if (cfgs == null || cfgs.length == 0) >- cfgs = CDTConfigWizardPage.getDefaultCfgs(this); >- >- if (cfgs == null || cfgs.length == 0 || cfgs[0].getConfiguration() == null) { >- throw new CoreException(new Status(IStatus.ERROR, >- ManagedBuilderUIPlugin.getUniqueIdentifier(), >- Messages.getString("CWizardHandler.6"))); //$NON-NLS-1$ >- } >- Configuration cf = (Configuration)cfgs[0].getConfiguration(); >- ManagedProject mProj = new ManagedProject(project, cf.getProjectType()); >- info.setManagedProject(mProj); >- >- cfgs = CfgHolder.unique(cfgs); >- cfgs = CfgHolder.reorder(cfgs); >- >- ICConfigurationDescription cfgDebug = null; >- ICConfigurationDescription cfgFirst = null; >- >- for(int i = 0; i < cfgs.length; i++){ >- cf = (Configuration)cfgs[i].getConfiguration(); >- String id = ManagedBuildManager.calculateChildId(cf.getId(), null); >- Configuration config = new Configuration(mProj, cf, id, false, true); >- CConfigurationData data = config.getConfigurationData(); >- ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data); >- config.setConfigurationDescription(cfgDes); >- config.exportArtifactInfo(); >- >- IBuilder bld = config.getEditableBuilder(); >- if (bld != null) { bld.setManagedBuildOn(true); } >- >- config.setName(cfgs[i].getName()); >- config.setArtifactName(removeSpaces(project.getName())); >- >- IBuildProperty b = config.getBuildProperties().getProperty(PROPERTY); >- if (cfgDebug == null && b != null && b.getValue() != null && PROP_VAL.equals(b.getValue().getId())) >- cfgDebug = cfgDes; >- if (cfgFirst == null) // select at least first configuration >- cfgFirst = cfgDes; >- } >- mngr.setProjectDescription(project, des); >- doTemplatesPostProcess(project); >- doCustom(project); >+ public void createProject(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException { >+ try { >+ monitor.beginTask("Create project", 100); >+ ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager(); >+ ICProjectDescription des = mngr.createProjectDescription(project, false, !onFinish); >+ ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project); >+ monitor.worked(10); >+ cfgs = fConfigPage.getCfgItems(false); >+ if (cfgs == null || cfgs.length == 0) >+ cfgs = CDTConfigWizardPage.getDefaultCfgs(this); >+ >+ if (cfgs == null || cfgs.length == 0 || cfgs[0].getConfiguration() == null) { >+ throw new CoreException(new Status(IStatus.ERROR, >+ ManagedBuilderUIPlugin.getUniqueIdentifier(), >+ Messages.getString("CWizardHandler.6"))); //$NON-NLS-1$ >+ } >+ Configuration cf = (Configuration)cfgs[0].getConfiguration(); >+ ManagedProject mProj = new ManagedProject(project, cf.getProjectType()); >+ info.setManagedProject(mProj); >+ monitor.worked(10); >+ cfgs = CfgHolder.unique(cfgs); >+ cfgs = CfgHolder.reorder(cfgs); >+ >+ ICConfigurationDescription cfgDebug = null; >+ ICConfigurationDescription cfgFirst = null; >+ >+ int work = 50/cfgs.length; >+ >+ for(int i = 0; i < cfgs.length; i++){ >+ cf = (Configuration)cfgs[i].getConfiguration(); >+ String id = ManagedBuildManager.calculateChildId(cf.getId(), null); >+ Configuration config = new Configuration(mProj, cf, id, false, true); >+ CConfigurationData data = config.getConfigurationData(); >+ ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data); >+ config.setConfigurationDescription(cfgDes); >+ config.exportArtifactInfo(); >+ >+ IBuilder bld = config.getEditableBuilder(); >+ if (bld != null) { bld.setManagedBuildOn(true); } >+ >+ config.setName(cfgs[i].getName()); >+ config.setArtifactName(removeSpaces(project.getName())); >+ >+ IBuildProperty b = config.getBuildProperties().getProperty(PROPERTY); >+ if (cfgDebug == null && b != null && b.getValue() != null && PROP_VAL.equals(b.getValue().getId())) >+ cfgDebug = cfgDes; >+ if (cfgFirst == null) // select at least first configuration >+ cfgFirst = cfgDes; >+ monitor.worked(work); >+ } >+ mngr.setProjectDescription(project, des); >+ doTemplatesPostProcess(project); >+ doCustom(project); >+ monitor.worked(30); >+ } finally { >+ monitor.done(); >+ } > } > > @Override >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.12.4.1 >diff -u -r1.12.4.1 MANIFEST.MF >--- META-INF/MANIFEST.MF 26 Aug 2008 20:05:05 -0000 1.12.4.1 >+++ META-INF/MANIFEST.MF 20 Oct 2008 15:36:27 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.ui; singleton:=true >-Bundle-Version: 5.0.1.qualifier >+Bundle-Version: 5.0.2.qualifier > Bundle-Activator: org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin > Bundle-Vendor: %providerName > Bundle-Localization: plugin >#P org.eclipse.cdt.ui >Index: src/org/eclipse/cdt/ui/wizards/CWizardHandler.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CWizardHandler.java,v >retrieving revision 1.12 >diff -u -r1.12 CWizardHandler.java >--- src/org/eclipse/cdt/ui/wizards/CWizardHandler.java 28 Apr 2008 18:35:19 -0000 1.12 >+++ src/org/eclipse/cdt/ui/wizards/CWizardHandler.java 20 Oct 2008 15:36:27 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * Intel Corporation - initial API and implementation >+ * IBM Corporation > *******************************************************************************/ > package org.eclipse.cdt.ui.wizards; > >@@ -14,6 +15,8 @@ > > import org.eclipse.core.resources.IProject; > import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.jface.wizard.IWizardPage; > import org.eclipse.swt.SWT; > import org.eclipse.swt.graphics.Image; >@@ -148,14 +151,32 @@ > * @param proj - simple project to be used as base > * @param defaults - true if called from 1st Wizard page > * @param onFinish - true when the project creation is performed on finish. false -otherwise >- * false means that the project created is actually a temporary one that can be removed in case cancell is pressed >+ * false means that the project created is actually a temporary one that can be removed in case cancel is pressed > * > * @throws CoreException > */ > public void createProject(IProject proj, boolean defaults, boolean onFinish) > throws CoreException { >+ createProject(proj, defaults, onFinish, new NullProgressMonitor()); >+ } >+ >+ /** >+ * Creates project >+ * >+ * @param proj - simple project to be used as base >+ * @param defaults - true if called from 1st Wizard page >+ * @param onFinish - true when the project creation is performed on finish. false -otherwise >+ * false means that the project created is actually a temporary one that can be removed in case cancel is pressed >+ * @param monitor - progress monitor to track the creation process >+ * >+ * @throws CoreException >+ * @since 5.0 >+ */ >+ public void createProject(IProject proj, boolean defaults, boolean onFinish, IProgressMonitor monitor) >+ throws CoreException { > createProject(proj, defaults); > } >+ > /** > * > * @return true if settings were changed >Index: src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java,v >retrieving revision 1.23 >diff -u -r1.23 CDTCommonProjectWizard.java >--- src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java 28 Apr 2008 18:35:19 -0000 1.23 >+++ src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java 20 Oct 2008 15:36:27 -0000 >@@ -30,6 +30,7 @@ > import org.eclipse.core.runtime.IExecutableExtension; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.NullProgressMonitor; >+import org.eclipse.core.runtime.SubProgressMonitor; > import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.jface.operation.IRunnableWithProgress; > import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation; >@@ -222,23 +223,66 @@ > final boolean defaults = _defaults; > return new IRunnableWithProgress() { > public void run(IProgressMonitor imonitor) throws InvocationTargetException, InterruptedException { >+ final Exception except[] = new Exception[1]; > getShell().getDisplay().syncExec(new Runnable() { >- public void run() { >+ public void run() { >+ IRunnableWithProgress op= new WorkspaceModifyDelegatingOperation(new IRunnableWithProgress() { >+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { >+ final IProgressMonitor fMonitor; >+ if (monitor == null) { >+ fMonitor= new NullProgressMonitor(); >+ } else { >+ fMonitor = monitor; >+ } >+ fMonitor.beginTask(CUIPlugin.getResourceString("CProjectWizard.op_description"), 100); //$NON-NLS-1$ >+ fMonitor.worked(10); >+ try { >+ newProject = createIProject(lastProjectName, lastProjectLocation, new SubProgressMonitor(fMonitor, 40)); >+// fMonitor.worked(60); >+ if (newProject != null) >+ fMainPage.h_selected.createProject(newProject, defaults, onFinish, new SubProgressMonitor(fMonitor, 40)); >+ fMonitor.worked(10); >+ } catch (CoreException e) { CUIPlugin.log(e); } >+ finally { >+ fMonitor.done(); >+ } >+ } >+ }); > try { >- newProject = createIProject(lastProjectName, lastProjectLocation); >- if (newProject != null) >- fMainPage.h_selected.createProject(newProject, defaults, onFinish); >- } catch (CoreException e) { CUIPlugin.log(e); } >+ getContainer().run(false, true, op); >+ } catch (InvocationTargetException e) { >+ except[0] = e; >+ } catch (InterruptedException e) { >+ except[0] = e; >+ } > } > }); >+ if (except[0] != null) { >+ if (except[0] instanceof InvocationTargetException) { >+ throw (InvocationTargetException)except[0]; >+ } >+ if (except[0] instanceof InterruptedException) { >+ throw (InterruptedException)except[0]; >+ } >+ throw new InvocationTargetException(except[0]); >+ } > } > }; > } >+ >+ public IProject createIProject(final String name, final URI location) throws CoreException{ >+ return createIProject(name, location, new NullProgressMonitor()); >+ } > > /** >+ * @param monitor >+ * @since 5.0 > * > */ >- public IProject createIProject(final String name, final URI location) throws CoreException{ >+ public IProject createIProject(final String name, final URI location, IProgressMonitor monitor) throws CoreException{ >+ >+ monitor.beginTask("createIProject", 100); >+ > if (newProject != null) return newProject; > > IWorkspace workspace = ResourcesPlugin.getWorkspace(); >@@ -252,26 +296,33 @@ > IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName()); > if(location != null) > description.setLocationURI(location); >- newProject = CCorePlugin.getDefault().createCDTProject(description, newProjectHandle, new NullProgressMonitor()); >+ newProject = CCorePlugin.getDefault().createCDTProject(description, newProjectHandle, new SubProgressMonitor(monitor,25)); > } else { > IWorkspaceRunnable runnable = new IWorkspaceRunnable() { > public void run(IProgressMonitor monitor) throws CoreException { > newProjectHandle.refreshLocal(IResource.DEPTH_INFINITE, monitor); > } > }; >- NullProgressMonitor monitor = new NullProgressMonitor(); >- workspace.run(runnable, root, IWorkspace.AVOID_UPDATE, monitor); >+// NullProgressMonitor monitor = new NullProgressMonitor(); >+ workspace.run(runnable, root, IWorkspace.AVOID_UPDATE, new SubProgressMonitor(monitor,25)); > newProject = newProjectHandle; > } > > // Open the project if we have to > if (!newProject.isOpen()) { >- newProject.open(new NullProgressMonitor()); >+ newProject.open(new SubProgressMonitor(monitor,25)); > } >- return continueCreation(newProject); >+ >+ IProject proj = continueCreation(newProject); >+ monitor.worked(25); >+ >+ monitor.done(); >+ >+ return proj; > } >- >+ > protected abstract IProject continueCreation(IProject prj); >+ > public abstract String[] getNatures(); > > @Override
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 250982
:
115176
|
115211
|
115276
|
115577
|
115815
|
117791