home mail me! syndication

overthinkings

of Ruben Daniels

Javeline Platform 101

Skinning

Just like a human skin the skin of the application covers the internal workings of an application. It gives a face to your application with which a human can communicate. Skinning can be used for branding and for optimizing the user experience. As said earlier Platform has a strict seperation of style. It allows a designer/developer to create skins with absolute freedom (limited to the reach of XHTML/CSS).

Javeline Platform comes with two sets of predefined skins. One is a standard Windows like skin. The other is a more original Javeline skin called Perspex. When creating an application I usually don’t want to be bothered with skinning. What I love about the clear seperation is that at any point in time I can choose to change the skin without affecting the application itself. I can work together with a designer on the same application without getting in eachothers way.

How to define a skin in Javeline Platform
A skin for Javeline components is defined in an xml file. This xml file contains skins for multiple components. Each component has its own skin definition which tells it how to draw itself on the screen. A skin is defined by a skin name. You can specify a default skin for a component by giving it the component’s tagName. Each skin consists of a <Style> section which contains the css, and a <Presentation> section which holds the XHTML definition. Let me give you an example of a simple skin for a Button (I left estethics out of this example):

<Button>
   <style><![CDATA[
      .button{
         border : 1px solid black;
         background-color : blue;
      }
      .buttonDown{
         background-color : green;
      }
      .buttonOver{
         border : 1px dotted black;
      }
      .buttonFocus{
         background-color : red;
      }
      .buttonDisabled{
         background-color : gray;
      }
   ]]></style>   

   <Presentation>
      <Main
         caption="./text()"
         icon="."
         background=".">
         <div class='button'>-</div>
      </Main>
   </Presentation>
</Button>


The controller of the widget, in this case the Button, will set the appropriate classes on the div element that is created. It uses the class of the div to set new classnames to define the button’s state. These states differ per component. In a later example I will show you the skin of a Tree which has more than 20 states. The states of the button are quite self-explanatory. The controller needs to know certain things about the XHTML you’ve specified. In the case of the button it wants to know which textnode to set for the caption, where to set the icon (either on an img tag, or as a background of an XHTML element) and where to set the background. These are set by attributes on the Main tag using Xpath expressions to point to the XHTML nodes.

The skin for a Tree element is fairly advanced. Only the skin of the datagrid has more parts. For clarity i’ve left out the CSS rules in the next example.

<Tree>
   <style><![CDATA[
      .tree{}
      .treeFocus{}
      .treeDisabled{}

      .tree .loading{}
      .tree .empty{}

      /* States of the plusmin button */
      .tree LI.last{}
      .tree LI.pluslast{}
      .tree LI.minlast{}
      .tree LI.plus{}
      .tree LI.min{}
      .tree LI.root{}

      /* Same states on the container */
      .tree UL.last{}
      .tree UL.pluslast{}
      .tree UL.minlast{}
      .tree UL.pluslast{}
      .tree UL.minlast{}
      .tree UL.last{}
      .tree UL.root{}

      /* Selection states */
      .tree .selected{}
      .treeFocus .selected{}
      .tree .indicate{}
      .treeFocus .indicate{}

      /* Drag&Drop states */
      .dragtree{}
      .tree .dragAppend{}
      .treeFocus .dragAppend{}
      .tree .dragInsert{}
      .tree .dragDenied{}
   ]]></style>

   <Presentation>
      <Main container="." startclosed="false">
         <ul class="tree">

         </ul>
      </Main>
      <Item
         class         = "."
         caption      = "text()"
         icon         = "."
         openclose   = "span"
         select      = "."
         container   = "ul"
      >
         <li><span></span>-
            <ul> </ul>
         </li>
      </Item>
      <DragIndicator>
         <div class='dragtree'><span></span>-</div>
      </DragIndicator>
      <Loading>
         <li class="loading">
            <span> </span>
            Loading...
         </div>
      </Loading>
      <Empty container=".">
         <li class="empty"></li>
      </Empty>
   </Presentation>
</Tree>

The Tree component has numerous states. Besides the basic ones, the controller sets states for selection, drag&drop and to specify wether or not an item is collapsed. Lets take a look at the Presentation part. Besides the Main part which we saw before in the button skin, there are four other parts. A tree can be filled with items. The <Item> tag specifies how an item is rendered and which elements take on which functionality. An item can have child items. Each item can have a caption, icon, and a openclose button to collapse it’s children. This example renders a simple tree from ul and li elements. The Javeline windows skin package has a more advanced skin, which uses more XHTML/CSS elements. The other elements describe how other states are rendered; DragIndicator, Loading and the Empty state.

Pages: 1 2 3 4 5 6 7 8 9 10 11

8 Comments »

  Kai Tischler wrote @ October 4th, 2007 at 12:12 am

Hello Ruben !

I have already sent two emails to the Javeline team via the “info@javeline.nl” email
address, but unfortunately I got no response :-(

So I am contacting You directly here via this blog entry; because I have fallen in love with Your layout engine almost immediately :-) ! I am currently doing some research with regard to layout in the native contemporary browsers, and Your approach seems to be really unique ! I have played around with it a little bit and am so impressed right now that I want to leverage Your layout engine ! I know that I can use the packager to extract only parts out of all the Javeline SDK stuff; but I couldn’t make it extract the layout parts … in fact I couldn’t get it to work at all …

I am also very much excited about Javeline in its whole glory, but this particular blog comment shall address the issue of leveraging Your layout engine separately. Is there a technical way to do it ? And what about licensing then ? Or do You know of other layout engines for browsers which are as capable as Yours seems to be ?

I am looking forward to the comments to come !

Cheers

Kai

  Ruben wrote @ October 4th, 2007 at 9:45 am

Hi Kai,

I just found your e-mail. It got lost in the spam box somehow. You will get a reply from me on that. It is possible to extract the layout engine using the packager. For what purpose would you like to use it? Please register to the internals mailinglist at http://developer.javeline.net/mailinglists.php and sent your answers there so the community can follow them as well.

Kind Regards,

Ruben

  overthinkings » Contextmagic and Repeat wrote @ October 22nd, 2007 at 2:49 pm

[…] this was the first time you read about Javeline PlatForm, this article is a good place to start learning more about this Web Application […]

  Mehmet KURT wrote @ January 2nd, 2008 at 4:27 pm

Please ! Help Me…

Using for Framework Javeline… Help Me??

  bharath wrote @ February 9th, 2008 at 3:25 pm

hi , my name is bharath
i have a doubt in ajax connectivity

how to connect an ajax application to database using jdbc…
can u plz clarify my doubt.. with sample example with coding.
thanx & regards.

  Ruben wrote @ February 14th, 2008 at 8:32 am

Hi Bharath,

Ajax applications connect to a backend. Most popular nowadays is to use REST to connect to a backend. This backend can be written in PHP, Perl, ASP, JSP or any other language. It’s the responsibility of that language to connect to a database using jdbc.

In Javeline PlatForm you would do something like this:

<j:teleport>
   <j:rpc id="comm" protocol="POST">
      <j:method name="getUsers" url="http://example.com/users.php">
         <j:variable name="group_id" />
      </j:method>
   </j:rpc>
</j:teleport>

<j:model id="myUsers" load="rpc:comm.getUsers(10)" />

<j:list model="myUsers">
   <j:bindings>
     <j:caption select="@username" />
     <j:icon select="@icon" />
     <j:traverse select="user" />
   </j:bindings>
</j:list>

or if you want to use the javascript approach with Javeline PlatForm you’d do:


var http = new jpf.http();
var data = http.getXml(”http://example.com/users.php?group_id=10″, function(data, state, extra){
   if(state == __HTTP_SUCCESS__){
      alert(”My XML: ” + data.xml);
   }else{
      alert(”An error has occurred”);
   }
});

Please note that these code examples are for v0.9.8 of Javeline PlatForm which will be released shortly.

Kind Regards,

Ruben

[…] early version of Javeline PlatForm and up untill that moment I had only positioned elements using anchoring. I did remember a nice feature that Visual Basic had, where I could align an element to one of the […]

[…] supports Anchoring, Alignment and position using a grid (similar to a table in […]

Your comment

HTML-Tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

cheap propecia pill buying cialis discount cialis buy cialis internet buy generic cialis online cheap accutane no prescription cialis us online propecia cheapest cialis price accutane for sale buy viagra overnight delivery no rx levitra order levitra on internet levitra without rx buy cialis no prescription required cialis no prescription cheapest levitra cialis bangkok buy propecia overnight delivery accutane malaysia buy accutane on internet viagra in malaysia discount propecia no rx discount accutane without prescription discount viagra overnight delivery find discount cialis online cheapest viagra accutane sales propecia malaysia buy no rx cialis free levitra propecia pills low cost viagra online pharmacy viagra find cheap cialis levitra australia levitra in australia overnight levitra viagra free delivery buy cheapest cialis on line cialis buy order cialis without prescription viagra buy accutane sale overnight propecia order levitra without prescription lowest price accutane cheapest cialis levitra uk levitra free delivery no prescription accutane cheap viagra from usa accutane online pharmacy order discount cialis online viagra tablets cost propecia levitra price cheap accutane from canada accutane from canada find accutane online accutane pills lowest price cialis find accutane no prescription required order viagra on internet cheap propecia from canada lowest price for accutane viagra without a prescription cheap cialis from uk buy levitra in canada find viagra overnight accutane cheap levitra from canada cost of propecia cheap cialis internet find propecia online buy levitra generic levitra tablet cialis cheap price accutane vendors cost accutane discount levitra levitra no rx required buy discount cialis online sale cialis cialis cost propecia without rx accutane without a prescription accutane online online pharmacy cialis propecia bangkok levitra no online prescription cheap levitra no prescription buy propecia without prescription order cialis on internet buy cialis in canada buy viagra online accutane pharmacy online compare accutane prices online find propecia on internet propecia pill generic cialis cialis generic buy discount levitra free accutane buy viagra generic cheap cialis pill propecia drug cialis without a prescription purchase cialis without prescription cheap levitra online overnight cialis pharmacy cialis buy accutane from india find cialis online viagra in us order accutane from us viagra discount levitra online cialis cheap drug buy levitra on line discount viagra find no rx propecia accutane order levitra prescription accutane uk cheap accutane on internet compare levitra prices generic viagra online cialis pills cheap cialis in canada no rx propecia approved levitra pharmacy compare cialis prices order cheap accutane online propecia uk buy cheapest accutane on line order levitra no prescription required order propecia from canada buy viagra on internet order discount levitra propecia canada where to order levitra viagra no rx required drug viagra buy levitra from india buy accutane lowest price levitra in malaysia cheapest levitra online viagra cheap drug cheap levitra from usa levitra in uk cheap levitra on internet no prescription propecia order discount levitra online purchase cialis overnight delivery cheap price propecia cialis free delivery cheapest generic viagra cheap cialis no rx find discount levitra online buy no rx levitra find discount propecia generic levitra buy levitra on internet propecia cheap drug cheap levitra no rx accutane medication compare levitra prices online buy propecia buy accutane us order viagra no prescription required find no rx accutane find propecia propecia no rx viagra overnight buy cheap propecia online cialis from canada buy levitra online purchase propecia overnight delivery buy propecia online cheap accutane pill cheap viagra accutane without rx buy viagra without prescription order propecia without prescription buying accutane cheapest propecia price cialis cheapest price levitra overnight shipping viagra online pharmacy pharmacy levitra find discount levitra propecia online pharmacy cheapest generic accutane purchase accutane without prescription cialis no rx propecia side effects cialis buy online discount cialis online accutane in bangkok buy cheap cialis online order generic viagra order propecia from us accutane india buy propecia us tablet propecia find cheap accutane order accutane on internet cheap propecia find discount viagra levitra in us order levitra order discount viagra buying viagra online buy propecia from canada accutane buy drug viagra canada no rx cialis cheap propecia from usa order levitra online buy viagra us certified propecia accutane cheapest price approved accutane pharmacy cheap viagra without prescription buy cheap levitra internet find accutane buy viagra from india buy cheapest levitra on line propecia from canada low cost propecia cheap cialis in uk buy cialis no rx order accutane in us propecia cheapest price cheapest levitra price cheap viagra in canada buying generic viagra buy viagra no rx propecia rx buy cialis from us propecia buy online discount accutane viagra no prescription buy propecia in us buy levitra buy accutane generic purchase viagra without prescription order cheap cialis viagra pills cheap accutane pharmacy buy cialis from canada propecia in malaysia propecia overnight shipping accutane overnight buying cialis online cheap propecia from uk cialis purchase viagra sales cheap accutane in canada buy accutane online cialis no rx required accutane approved propecia us cialis pill propecia india accutane in malaysia cheap price viagra propecia prescription buy accutane on line propecia sales levitra generic accutane for order cheap viagra online order levitra overnight delivery find cheap propecia online buying levitra cialis sales buy generic accutane buy viagra online cheap order cialis no prescription required buying generic cialis viagra drug buy viagra lowest price viagra price approved propecia pharmacy cheap cialis pharmacy cheap viagra no rx find no rx cialis order cheap propecia cheap levitra in usa cialis without prescription buy cheapest propecia on line where to order viagra accutane cost order propecia cheap online accutane drug cheapest cialis online buy generic cialis cialis for order cialis prescription find cheap propecia compare cialis prices online propecia cost cheap cialis tablet purchase levitra discount propecia overnight delivery cialis india viagra australia accutane cheap drug discount viagra online cheap viagra tablet accutane australia propecia in bangkok buy cheap levitra cialis price buy generic levitra online buy cheapest cialis online levitra cost order levitra from canada viagra pharmacy online viagra without prescription viagra in uk find viagra no prescription required buy generic accutane online propecia pharmacy viagra online buy discount levitra online cialis online pharmacy viagra generic buy cialis lowest price cost of cialis find cialis levitra online drug propecia cialis tablet buy cialis low price propecia vendors cheapest generic cialis cheap propecia in usa discount propecia buy generic viagra online buying generic levitra online accutane buy levitra from canada order propecia overnight delivery best price propecia order accutane no rx cialis side effects order viagra without prescription cheap propecia on internet propecia free delivery tablet viagra levitra pills find cheap viagra buy accutane from us viagra medication buying propecia cialis from india buy cheap cialis buy accutane buy cheap levitra online find no rx levitra buy cheapest viagra on line low cost accutane propecia in us order accutane overnight delivery buy levitra lowest price approved cialis pharmacy purchase cialis online discount cialis overnight delivery buy levitra no rx order no rx levitra online pharmacy accutane discount viagra without prescription accutane no rx required cheap accutane without prescription cialis information cialis overnight fda approved cialis propecia without prescription order levitra in canada buy discount propecia fda approved viagra cheap price cialis lowest price for levitra cialis in bangkok purchase cialis discount levitra no rx cheapest generic levitra lowest price for propecia propecia buy drug cheap cialis no prescription cheap viagra from uk no rx accutane buy levitra us certified levitra cialis order generic propecia find cialis no prescription required buy viagra in us buy cialis us certified cialis levitra overnight delivery levitra without prescription buy cialis on internet fda approved levitra cost viagra viagra pill buy discount viagra online cheap levitra tablet best price for propecia buy discount viagra compare viagra prices online generic levitra cheap accutane side effects cialis order find propecia without prescription levitra accutane overnight shipping find cheap accutane online buy generic levitra levitra vendors buy viagra from us buy cheap viagra online order viagra no prescription buy cialis on line propecia online without prescription cheapest generic levitra online levitra from india cost of levitra cheap propecia overnight delivery viagra overnight shipping cheap accutane internet purchase propecia no rx find levitra viagra cost levitra no rx find cheap levitra online accutane price cheap accutane tablet best price cialis order generic levitra best price viagra levitra canada viagra cheapest price drug cialis viagra approved sale viagra cheap accutane no rx cheapest viagra price cheapest accutane generic cialis online cialis no online prescription find cheap viagra online cheap levitra internet buy no rx accutane