| convertProjectToC to convert existing project: errors [message #65200] | 
Tue, 25 March 2003 13:24   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: derek.p.gilbert.intel.com 
 
I created a wizard that will create a project within Eclipse. Depending on 
some user options I want to convert the newly created project to a C 
project in the performFinish method of a wizard page. I see that that 
CCorePlugin contains a method for converting a project. The CCorePlugin. 
How can I call this method from another plugin to convert a project to a c 
project. Since the workbench already loaded the CDT I shouldn't have to 
instantiate CCorePlugin from my wizard class correct? I tried to just 
import org.eclipse.cdt.core.CCorePlugin and call the method but it fails 
with this error: 
java.lang.NoClassDefFoundError: org/eclipse/cdt/core/CCorePlugin 
 
Could someone please provide me with some guidance as to the correct way 
to try and use this method. I pasted my method for doing this below. 
Thanks 
 
import org.eclipse.cdt.core.CCorePlugin; // import from top of file 
 
private void convertProjectToCProject(IProject project, IProgressMonitor 
monitor, String projectID) 
{ 
	coreplugin = new CCorePlugin(); 
	if (monitor == null)  
	{ 
		monitor= new NullProgressMonitor(); 
		monitor.beginTask("", 1); 
} 
 
try { 
	CCorePlugin.getDefault().convertProjectToC(project, monitor, "test", 
true); 
} catch (CoreException e) { 
	// TODO Auto-generated catch block 
	e.printStackTrace(); 
}  //$NON-NLS-1$ 
}
 |  
 |  
  | 
 | 
| Re: convertProjectToC to convert existing project: errors [message #65333 is a reply to message #65287] | 
Wed, 26 March 2003 15:02   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: derek.p.gilbert.intel.com 
 
David Inglis wrote: 
 
> Make sure that org.eclispe.cdt.core is a dependency in your plugin.xml. 
> Then just access the plugin via CCorePlugin.getDefault()... 
 
 
> Derek Gilbert wrote: 
> > I created a wizard that will create a project within Eclipse. Depending on 
> > some user options I want to convert the newly created project to a C 
> > project in the performFinish method of a wizard page. I see that that 
> > CCorePlugin contains a method for converting a project. The CCorePlugin. 
> > How can I call this method from another plugin to convert a project to a c 
> > project. Since the workbench already loaded the CDT I shouldn't have to 
> > instantiate CCorePlugin from my wizard class correct? I tried to just 
> > import org.eclipse.cdt.core.CCorePlugin and call the method but it fails 
> > with this error: 
> > java.lang.NoClassDefFoundError: org/eclipse/cdt/core/CCorePlugin 
> >  
> > Could someone please provide me with some guidance as to the correct way 
> > to try and use this method. I pasted my method for doing this below. 
> > Thanks 
> >  
> > import org.eclipse.cdt.core.CCorePlugin; // import from top of file 
> >  
> > private void convertProjectToCProject(IProject project, IProgressMonitor 
> > monitor, String projectID) 
> > { 
> > 	coreplugin = new CCorePlugin(); 
> > 	if (monitor == null)  
> > 	{ 
> > 		monitor= new NullProgressMonitor(); 
> > 		monitor.beginTask("", 1); 
> > } 
> >  
> > try { 
> > 	CCorePlugin.getDefault().convertProjectToC(project, monitor, "test", 
> > true); 
> > } catch (CoreException e) { 
> > 	// TODO Auto-generated catch block 
> > 	e.printStackTrace(); 
> > }  //$NON-NLS-1$ 
> > } 
> >  
 
 
Great. Thanks. I was including some of the other CDT but I was missing the 
org.eclispe.cdt.core in my plugin dependencies.
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.06003 seconds