Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] problem add nature project to a plugin cdt

You know that no exceptions are being raised because of a defensive comment? I'm impressed. I prefer to print out any exceptions that occur so that I can find out why my code isn't working.

Alex 

Sent from my (new) iPhone

On 15 Mar 2010, at 10:39, Flo Menier <josieenfrance@xxxxxxxxxxx> wrote:

no error messages, I don't think the nature is executed. In plugin.xml,     
<enablement
          type="ALL">
       <hasNature
             natureId="com.infineon.cv.NatureLinkedRessources">
       </hasNature>
    </enablement>

it does the same thing as the code below does, doen't it? then i commented these codes, but it doesn't work either.
try {
      IProjectDescription description = project.getDescription();
      String[] natures = description.getNatureIds();
      String[] newNatures = new String[natures.length + 1];
      System.arraycopy(natures, 0, newNatures, 0, natures.length);
      newNatures[natures.length] = "com.xxx.cv.NatureLinkedRessources";
      description.setNatureIds(newNatures);
      project.setDescription(description, null);
   } catch (CoreException e) {
      // Something went wrong
   }

and also, add a nature project should not be in the nature project class, does it?


From: alex.blewitt@xxxxxxxxx
Subject: Re: [cdt-dev] problem add nature project to a plugin cdt
Date: Mon, 15 Mar 2010 10:25:07 +0000
To: cdt-dev@xxxxxxxxxxx

You're printing out when something goes wrong, huh?

On 15 Mar 2010, at 09:22, Flo Menier wrote:

@Override
public void configure() throws CoreException {
try {
      IProjectDescription description = project.getDescription();
      String[] natures = description.getNatureIds();
      String[] newNatures = new String[natures.length + 1];
      System.arraycopy(natures, 0, newNatures, 0, natures.length);
      newNatures[natures.length] = "com.xxx.cv.NatureLinkedRessources";
      description.setNatureIds(newNatures);
      project.setDescription(description, null);
   } catch (CoreException e) {
      // Something went wrong
   }



Votre messagerie et bien plus où que vous soyez. Passez à Windows Live Hotmail, c'est gratuit ! Inscrivez-vous
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

Back to the top