Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-dev] Problems with getting JDK 1.5 examples to work with ADJT

Hi Gerard,

Setting the compliance level to 1.5 was not supported by the AJDT APIs.  I
updated the AJDE APIs to provide a way of setting the source compliance
level to 1.5, and put these changes into the AJDE UI as well.  This means
that AJBrowser and the other Swing-based IDE plugins can now set the option
to compile 1.5.

Gerard, to make this work mimic what BuildOptionsPanel is doing in your
preferences code.  It just boils down to making this call:

AjdeUIManager.getDefault().getBuildOptions().setSourceCompatibilityLevel(Com
pilerOptions.VERSION_1_5);

Fix committed and more info at:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=83897 

Mik

> -----Original Message-----
> From: aspectj-dev-admin@xxxxxxxxxxx [mailto:aspectj-dev-admin@xxxxxxxxxxx]
> On Behalf Of Gerard Davison
> Sent: Thursday, January 27, 2005 9:16 AM
> To: aspectj-dev@xxxxxxxxxxx
> Subject: [aspectj-dev] Problems with getting JDK 1.5 examples to work with
> ADJT
> 
> 
> Hi,
> 
> I have been working on the ADJT addin for JDeveloper and I can't seem to
> get it to compile JDK 1.5 code properly. My UserPrerencesAdapter appears
> to be returning the correct values, see code snippet, but these don't
> seem to be make there way down to the actual compiler.
> 
> Am I doing something wrong? Is there an override or property I have
> missed? I am using a 5-LATEST from a few days ago.
> 
> Thanks,
> 
> Gerard
> 
> ---
>   /**
>    * Retrieves an option for the currently active project.
>    */
>   public String getProjectPreference(String name)
>   {
>     try
>     {
>       JDeveloperProjectPropertiesAdapter jdppa =
> (JDeveloperProjectPropertiesAdapter)
>         Ajde.getDefault().getProjectProperties();
>       OjcConfiguration oc = jdppa.getOjcConfiguration();
> 
>       if (name.equals("ajc.characterEncoding"))
>       {
>         return oc.getCurrentEncoding();
>       }
>       else if (name.equals("ajc.complianceLevel")
>         || name.equals("ajc.sourceLevel"))
>       {
>         if (oc.isJDK15())
>         {
>           return "1.5";
>         }
>         else
>         {
>           return "1.4";
>         }
>       }
>       else if (name.equals("ajc.sourceOnePointFourMode"))
>       {
>         return !oc.isJDK15()
>           ? "true" : "false";
>       }
>       else if (name.equals("ajc.incrementalMode"))
>       {
>         JProject project =
> JDeveloperProjectPropertiesAdapter.getProject();
>         if (project !=null)
>         {
>           return AspectJProjectSettings.getInstance(project
>             ).isIncrementalEnabled() ? "true" : "false";
>         }
>         else
>         {
>           return null;
>         }
>       }
>       else
>       {
>         System.out.println("Missing property " + name);
>         return null;
>       }
>     }
>     catch (Exception e)
>     {
>       oracle.ide.util.Assert.printStackTrace(e);
>       return null;
>     }
>   }
> 
> ---
> 
> --
> 
> Gerard M. Davison, Principal Member of Technical Staff,
> Oracle JDeveloper, Oracle UK
> http://www.orablogs.com/gdavison/
> 
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-dev



Back to the top