Re: j2s-development] Dynamic Loading of CSS files
Brought to you by:
zhourenjian
|
From: Soheil H. Y. <soh...@gm...> - 2006-07-15 06:01:45
|
Hi, Splitting the css file would be a good work, I think but converting css to javascript will degrade the performance. What about a special comment like @j2sCSS for every class definition that says what css this class needs? Regards, Soheil On 7/14/06, Zhou Renjian <jo...@sj...> wrote: > Hi, > > As a matter of swt-default.css is getting a little bigger (Now > swt-default.css is about 40K), splitting swt-default.css into small > pieces should be a work. > For example css about CTabFolder, TabFolder, Group are something of 11k, > 6k, and 6k. If we have dynamic javascript loading, then we should have > dynamic css loading so we do not get extra useless css. > Again way about css would be converting css into JavaScript. Sure, we > still want the feasibility of switching to another css styles. I mean > converting *.css into *.css.js by Java2Script compiler. > > More should be discussed about this. > > BTW: As lots of UI layouts are relied on Java's calculating, it seems > that the current swt-default.css leaves a very small space for more > beautiful skins. Any ideas about balancing of Java SWT's layout and CSS > layout? > > Zhou Renjian wrote: > > Hi, > > > > Finally, function of loading Java2Script's *.js files dynamically are > > implemented. > > From now on, programmers do not need to manage classes order to get > > Java2Script applications correctly run. That is to say, loading *.js is > > transparent to programmers. > > > > This feature will be the base technology of other coming features, such > > as earlier discussed Class.forName (...). > > > > And by loading Java2Script's *.js files dynamically, we can now generate > > a line of JavaScript code or a "javascript:..." link for a J2S > > application, which can be hosted inside other sites' HTML pages. Maybe > > we can call it "A Link An Application". Read more about this in the blog > > article: http://j2s.sourceforge.net/blog/2006/07/11/a-link-an-application/ > > > > There are lots of bugs about this features. Some more tests may be required. > > > > Please check out the latest codes from SVN repository. > > > > And something should be mentioned: > > 1. Those lots of *.js in net.sf.j2s.lib/j2slib/.../*.js are generated > > from net.sf.j2s.java.core, net.sf.j2s.ajax and > > net.sf.j2s.java.org.eclipse.swt. You can run target j2slib.pack.lib of > > ant build j2s.core.build in project net.sf.j2s.lib to copy and pack the > > necessary files without checking out from the slow SVN. > > 2. Most of former *.z.js are removed. Only a new "j2slib.z.js" is left > > as the entry to all existed *.js units. So now, in the "Java2Script > > builder" property page "Add Libraries" button will open Dialog for > > choosing the only-one "j2slib.z.js" library. Just choose the library to > > make things work. And now "Add Resources", "Add Projects" and other > > buttons are now make no sense. And the those classes in the tree view > > also have no meanings now. These things will be removed or changed in > > the near future. For more details, please study the generated > > Java2Script application HTML file for more details. > > 3. ... > > > > I think later I need to write something to make the big change clear. > > > > Regards > > > > /js > > > > Soheil Hassas Yeganeh wrote: > > > >> I did not mean to use a method like the one used in dojo. I was just > >> arguing about the idea. > >> Implementing a method for import a Class( import java.util.* --> > >> j2s_import("java.util.*")), and an implementation for Class.forName(), > >> is really enough for dynamic loading of java2script. May be > >> implementing java.reflect.* would be better. > >> I think using a method like this, will provide us a dynamic loading > >> method with the developer transparency preserved. > >> > >> Regards, > >> Soheil > >> > >> On 6/15/06, Josson Smith <jo...@sj...> wrote: > >> > >> > >>> Dynamic loading *.js will be complex things. > >>> > >>> And I know that dojo toolkit is using its dynamic loading mechanism of > >>> JavaScript files. > >>> > >>> For Java2Script, > >>> First, the number of *.js files is somewhat huge already. It is more > >>> than 200. Setup the connections will require a lot of extra times. > >>> Second, referencing, sub-referencing, and sub-sub-referencing, ... may > >>> reference most of the classes. It requires some algorithm to cut off > >>> those unnecessary sub-referencing until it's necessary. > >>> Third, Java programmers should not be required to know things about > >>> dynamic loading of JavaScript. > >>> > >>> More discussions are needed. > >>> > >>> > >>> Soheil Hassas Yeganeh wrote: > >>> > >>> > >>>> Oh, a very nice doco! I found here : > >>>> http://ajaxpatterns.org/On-Demand_Javascript > >>>> > >>>> On 6/12/06, Soheil Hassas Yeganeh <soh...@gm...> wrote: > >>>> > >>>> > >>>> > >>>>> Hi, > >>>>> I've a proposal for loading javascript files, dynamically. Suppose we > >>>>> have a lot of javascript files generated. As it occures in many > >>>>> applications many of the javascript files are not used frequently. > >>>>> So, Now, if we want to run that application we have to import a lot of > >>>>> js files in the html. This will make the application very slow and > >>>>> heavy. > >>>>> So, we need a dynamic javascript loading mechanism. If we have this > >>>>> mechanism, we can also implement methods like Class.forName(). > >>>>> We can use .z files generated by j2s to dynamically loading need > >>>>> javascript files for each class. > >>>>> In other words, we need something like the Bindows' BiScriptLoader. > >>>>> Regards, > >>>>> Soheil Hassas Yeganeh > >>>>> > >>>>> > >>>>> > >>>>> > >>>> _______________________________________________ > >>>> j2s-development mailing list > >>>> j2s...@li... > >>>> https://lists.sourceforge.net/lists/listinfo/j2s-development > >>>> > >>>> > >>>> > >>>> > >>>> > >>> -- > >>> Regards > >>> > >>> /js > >>> > >>> > >>> > >>> > >>> _______________________________________________ > >>> j2s-development mailing list > >>> j2s...@li... > >>> https://lists.sourceforge.net/lists/listinfo/j2s-development > >>> > >>> > >>> > >> _______________________________________________ > >> j2s-development mailing list > >> j2s...@li... > >> https://lists.sourceforge.net/lists/listinfo/j2s-development > >> > >> > >> > >> > > > > > > > > ------------------------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, security? > > Get stuff done quickly with pre-integrated technology to make your job easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > > j2s-development mailing list > > j2s...@li... > > https://lists.sourceforge.net/lists/listinfo/j2s-development > > > > > > > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > j2s-development mailing list > j2s...@li... > https://lists.sourceforge.net/lists/listinfo/j2s-development > |