Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » convertProjectToC to convert existing project: errors
convertProjectToC to convert existing project: errors [message #65200] Tue, 25 March 2003 18:24 Go to next message
Eclipse UserFriend
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 #65287 is a reply to message #65200] Wed, 26 March 2003 15:42 Go to previous messageGo to next message
David Inglis is currently offline David InglisFriend
Messages: 45
Registered: July 2009
Member
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$
> }
>
Re: convertProjectToC to convert existing project: errors [message #65333 is a reply to message #65287] Wed, 26 March 2003 20:02 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Is there a public method to set the project build command?
Next Topic:Extending the CDT
Goto Forum:
  


Current Time: Wed Jun 26 19:56:48 GMT 2024

Powered by FUDForum. Page generated in 0.03310 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top