Re: j2s-development] about javascript native
Brought to you by:
zhourenjian
From: Zhou R. <zho...@gm...> - 2007-11-17 03:40:46
|
boolean b = false; /** * @j2sNative b = true; */ {} if (b) { A(); } else { B(); } Auto refactoring will fail when refactoring codes inside @j2s* annotations. We always recommend Java codes instead of JavaScript, unless it is a JavaScript-must task. About Java2Script HTML/CSS toolkit using XHTMLRender, I would like to know something more. I am not quite sure about compatibility between XHTMLRender and modern browsers. Could you please tell us more about your experience of integrating XHTMLRender inside Java application? I had some project experiment on using Java2Script with native HTML/CSS. No Java debug environment. Everything was tested inside browsers. But it was still acceptable as I were using debug mode, which Java2Script's "Hotspot" classloader is enabled inside. For your plugin, if there is no copyright problem and you would like to share it with us, you can send us a copy. There should be some ideas that Java2Script can learn from. On Nov 17, 2007 3:47 AM, < sg...@so...> wrote: > > Hi all. Well, this is my first post to this forum. I'm starting to > play > with java2script and I think it is a very promising piece of software. > (excuse me for my bad english) > > SWT port to js is great but (imho) is not oriented to the web (big, > don't take advatage of css styles, ...). So I decided to start > developing a small toolkit, with a simple visual paradigm that > supports > css styles, basic events and layouting and use a 100% java, free xhtml > renderer ( https://xhtmlrenderer.dev.java.net/ ) so applications can be > tested in java and the translated to js. > > The thing is that i'm using @j2s* java annotations for expressing > native > javascript code. My problem is that from a javascript native code I > want > to call a java method, and this will create problems when auto > refactoring the code with eclipse. So my question is if there is a > java > annotation for execute a code block A in javascript environment and B > in > a java environment. Something that translate the following code > > P1 > if(false) > /** @j2sSOMETHING */ > { > A > } > else { > B > } > P2 > > to the next javascript code: > > P1 > A > P2 > > (in java the block A will be never executed). > > Well, if there isn't something like that, it would be nice because it > is > nice to test web applications first in a jvm, but to use the ide > refactoring tools too!!) > > I hope you can understand my point. Congratulations again for this > project and for make it opensource. > > p/d > I had investigating about making a java to javascript translator using > eclipse ' jdt, but, although jdt's ast parser is makes very easy to > analize a java compile unit, it is hard to create the equivalent > javascript code. So, when I saw java2script and check that the > translator works well, i surrender... and now i move on using java2js. > If you want, only for curiosity, i could send my eclipse plugin with > this unfinnished translator (i use java annotations for javascript > native code too!!) > > --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google Groups > "Java2Script" group. > To post to this group, send email to jav...@go... > To unsubscribe from this group, send email to > jav...@go... > For more options, visit this group at > http://groups.google.com/group/java2script?hl=en > -~----------~----~----~----~------~----~------~--~--- > > -- Regards, Zhou Renjian |