[Osr-101] Re: [Yulup-commits] rev 23793 - in public/yulup/src/branches: . WIDGET_REFACTORING_BRANCH/yulup/src/templates/src/html.nar

Thomas Comiotto comiotto at rcfmedia.ch
Tue Apr 17 17:36:27 CEST 2007


Hi Andi

>
> Sure, although I do it with the most recent format I have in mind:
>
>       <widget icon="icons/table.png">
>         <name xml:lang="en">Table</name>
>         <name xml:lang="de">Tabelle</name>
>         <description xml:lang="en">Insert a table</description>
>         <description xml:lang="de">Tabelle einfügen</description>
>         <insert>
>           <parameter xpath="table/attribute::border">
>             <name xml:lang="en">Border</name>
>             <name xml:lang="de">Rand</name>
>             <description xml:lang="en">Border thickness</description>
>             <description xml:lang="de">Randbreite</description>
>           </parameter>
>           ... add more parameters if you like
>           <fragment>
>             <table border="0" cellpadding="0" cellspacing="0"  
> bgcolor="#DDDDDD" xmlns="">
>               <tr>
>                 <td>Column 1, Row 1</td>
>                 <td>Column 2, Row 1</td>
>               </tr>
>               <tr>
>                 <td>Column 1, Row 2</td>
>                 <td>Column 2, Row 2</td>
>               </tr>
>             </table>
>           </fragment>
>         </insert>
>       </widget>
>



Also consider:

  * Adding/Removing Table rows
  * Adding/Removing Talbe cells
  * Adding/Removing Lists
  * Increment/Decrement List Indent
  * couple of more things

Widgets are not only about inserting/surrounding fragments..

The key argument here is that you don't want to assume datatype  
awareness on the client side. So your proposal duplicates quite a bit  
that can be taken from datatype definitions (or the corresponding  
specs in case of standardized datatypes like html/xhtml). Attribues  
editing for instance.

Besides that, why would anyone to implement a "Neutron GUI rendering  
engine" for standardized datatypes where everything needed to make  
widgets work is well known and defined by corresponding spec? There  
are some html editors around and IIRC they already dealt with tables  
before Neutron;)

Where Neutron comes in to play is with non-standardized datatypes/ 
doctypes, xml based or not. But then again you have to assume at  
least some degree of datatype awareness on the client side to make  
editing happen at all... Given that, it's enough to provide the  
client with data needed to resolve some document context to some  
widget - everything else can be taken from the corresponding schema,  
DTD, whatever.

Why not..

<widget component="table" xpath="//table">
   <template>
      <table border="0" cellpadding="0" cellspacing="0"  
bgcolor="#DDDDDD" xmlns="">
        <tr>
          <td>Column 1, Row 1</td>
          <td>Column 2, Row 1</td>
        </tr>
      </table>
   </template>
</widget>
<widget component="tablerow" xpath="//tr[parent::table]"/>


I sent some XBL-style (similar to above but using css selectors)  
draft to this list awhile ago. Will try to find it in the archives  
and repost.

Bests
Thomas





More information about the Osr-101 mailing list