Desktop Theme for my html??

4 views
Skip to first unread message

Avatar Ng

unread,
Sep 24, 2008, 2:50:44 PM9/24/08
to Java2Script
I think the biggest catch between Java2Script and GWT in their layout
is:
- one is more suitable customizable to plug into existing web
application (GWT)
- other might not, standalone (Java2Script)

Well I'm not trying to be a criticizer here, I'm trying to raise some
idea on Java2Script application.

GWT:
Because GWT is html by it self, so it is so customizable that it can
just be plug into a corner of my web page, and blend it there.

Java2Script:
The usability of desktop alike application in a browser worries me,
and does it comes with a desktop theme? if yes is it customizable?
(e.g.: the "taskbar", the installed app manager perhaps, etc)

I like the idea of using existing/familiar desktop framework to draft
a web application, no doubt J2S did better than GWT in this; also I
must praise on the simplicity of RPC call, GTalk example etc.

I think some people out there might having similar concerns as mine, I
do hope the J2S team will seriously consider these area.


Thanks & Regards,
Avatar Ng

Zhou Renjian

unread,
Sep 25, 2008, 12:16:23 PM9/25/08
to java2...@googlegroups.com
Hi Avatar,

Thanks very much for telling us your concerns about Java2Script.

For HTML embeddable application, we once had some examples there that "Control Examples" are embedded into a DIV block ( Please visit http://j2s.sourceforge.net/index.swt.controls.html , and try to "load inline demo" ). But we didn't develop that technology further.

For customizable themes, we once tried to support it ( http://j2s.svn.sourceforge.net/viewvc/j2s/trunk/sources/net.sf.j2s.java.org.eclipse.swt.laf/win32-default/org/eclipse/swt/widgets/ ).

Your feature requests make a lot of senses. We will make some improvements on next release. And we also hope that more developers will join us and contribute their effort or add more features into Java2Script project. 

Regards,
Zhou Renjian

sgurin

unread,
Oct 22, 2008, 9:31:49 PM10/22/08
to Java2Script
hi Avatar (please excuse my poor english). I think the lack of style-
themes support is more a swt's design issue, than java2script's.

But, investigating a little i found that java2script swt programs can
be "stylized" with css. For example If you inspect a javascript swt
application with a firefox dom inspector (or similar tool) you will
find that every html element representing a swt component (or
component visual fragment) has a "well named" class attribute. For
example some html elem class names related to a swt Shell are "shell-
default" "shell-title", "shell-title-text", shell-title-min, shell-
title-normal-max, shell-title-close, etc

it seems that these styles are applied dynamically using $WTC$
$.registerCSS(className, styles) function (check for example the line
in j2slib/org/eclipse/swt/widgets/Shell.z.js starting with "$WTC$
$.registerCSS"). Try to change some style rules there for inmediately
apply it in your programs. I think these style rules are defined in
build time from the swt component css files (j2slib/org/eclipse/swt/
widgets/Shell.css).

I think this could be a starting point for defining swt widget themes.
Editing each swt widget css file and rebuilding j2slib (pack.swt.css
j2s.lib ant task) should be sufficient (and hoping that swt component
html representations don't change their structure). You can change
stylesheets rules dynamically with something like :

/**
* @j2sNative
*
* var sty = document.createElement("style")
* sty.id="id1"
* sty.innerHTML = ".shell-title-text {color:red}"
* document.body.appendChild(sty)
*/{}

(that change the shell titles color to red). well, that are my 2
cents.

sgurin

unread,
Oct 22, 2008, 9:32:41 PM10/22/08
to Java2Script

sgurin

unread,
Oct 22, 2008, 9:33:36 PM10/22/08
to Java2Script
Message has been deleted

NG CHEE WEI

unread,
Oct 23, 2008, 10:33:11 PM10/23/08
to java2...@googlegroups.com
Thanks for your reply, I agree on the css thing (it should work that way, after all it's still html ... adv. like css should remain)
however, I'm actually talking more on the apps behaviour ... and how it might blend into webpages. Or better still, java2script is creating a new layout trend.
 
I'll explain by examples:
 
doubles:
- should windows frame draggable?
- maximisable, minimisable
- after minimised where it goes visually? perhaps place holder like a top pane, side pane .. wil these panes, desktop thing make the look-and-feel more like an OS than my webpage ... say a blog
- will there be a canvas api to contain all these widget?... etc
 
suggestion:
- I think a dock-able widget for each window will be of more usefulness that a standalone module (per html)
- refer to attachment (pic)
 
--------------
suggest_j2s_layout.png

Sebastian Gurin

unread,
Oct 24, 2008, 10:39:00 AM10/24/08
to java2...@googlegroups.com
hi NG chee wei.

yes now I understand your point. well I think the author of j2s-swt had to fill somehow the breach between the "dektop visual paradigm" and web's. IMHO in this case a desktop simulation was made for that. Another would be to modify the concept of Shell (swt root widget) adapting it to a html document. personally, I like the current approach.

Another important difference between desktop and web, is the position of components. In all desktop gui frameworks I know there is *a single* positioning mode (absolute) and layout objects are responsible of setting a widget children's bounds. On the other hand, in the "web visual paradigm" css define several positioning modes (in my opinion the more difficult part of the standar to understand and implement) and there are not layout objects (in the web, the layout is defined in the standar while in desktop the layout is defined by an object).

In j2s-swt, all html elements representing swt widgets use css position:absolute (I think this is the only way "desktop visual paradigm" can be "simulated" in an html document) and this makes very difficult for "embedding" a swt component inside an existing html document (for example your blog) that normally contains inline/block/table positioned elements.

IMHO, one of the desired characteristics of j2s (the main attraction) is the possibility of using visual desktop ways/paradigms/components for developing guis (for example, using a gui visual editor). and I don't think j2s must sacrifice this characteristic in benefit of adaptability/iteraction with web applications. But I'm agree with you that perhaps some desktop concepts (mainly window and window events) can be adapted in some degree to "live" inside html docs.


--
Sebastian Gurin <sgu...@softpoint.org>

Reply all
Reply to author
Forward
0 new messages