You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Tammo Mueller <ta...@gmail.com> on 2005/05/25 06:17:09 UTC

XMLBean to jTable

Hi!
 
I'm currently trying to find a generic way to transform a Document into a
JTable. Are there already approaches and
which is the best way? I'm trying to avoid going over the DOM, because I
loose all Datatypes by doing that.
I would like to  present a XMLBeans Document to the TableModel and it should
set values and names of the elements in the table. It should be somekind of
a propertysheet as I know it from 'normal' beans.
 
Best regards,
 
Tammo

Re: XMLBean to jTable

Posted by Jean-Christophe Pazzaglia <Je...@eurecom.fr>.
Once upon a time I did that for castor,
according that you manage to find where
the class is generated it is relatively straightforward
to generate the model as suggested by brian,
then you should probably define some entries to
use proper rendering or hide some fields (by subclassing
or with a specific constructo ....)

editing may be a bit more difficult but doable too !

jc

> Tammo,  you probably need to create an XmlObjectTableModelAdapter that 
> is something that takes your specific type of XMLObject (I assume you 
> have a type your interested in) and then adapts it to the TableModel 
> interface that JTable accepts.
>
> Once you have that in place, you should be good to go.
>
> HTH,
>
> Brian
>
>
>
> Tammo Mueller wrote:
>
>> Hi!
>>  
>> I'm currently trying to find a generic way to transform a Document 
>> into a JTable. Are there already approaches and
>> which is the best way? I'm trying to avoid going over the DOM, 
>> because I loose all Datatypes by doing that.
>> I would like to  present a XMLBeans Document to the TableModel and it 
>> should set values and names of the elements in the table. It should 
>> be somekind of a propertysheet as I know it from 'normal' beans.
>>  
>> Best regards,
>>  
>> Tammo
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>


-- 
Jean-Christophe Pazzaglia, PhD <Je...@eurecom.fr>
Corporate communications
Tel: (+33) 4-93-00-26-78 PGP Key available : http://www.eurecom.fr/~pazzagli/publickey.pgp
-- 
Institut Eurécom - Office 029
http://www.eurecom.fr/
2229 Route des Crêtes BP 193 06904 Sophia Antipolis, France
Fax: (+33) 4-93-00-26-27 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: AW: XMLBean to jTable

Posted by Brian Bonner <br...@paraware.com>.
public class YourXmlBeanTableModel implements TableModel {

private YourXmlBean myYourXmlBeang
public YourXmlBeanTableModel(yourXmlBean yourXmlBean){
     myYourXmlBean = yourXmlBean;
}

// implement the table model methods here
// accessing your bean as appropriate.

}

Check out a design pattern book for adapters or google it.

Hth,
Brian
On Sun, 5 Jun 2005 11:44 am, Tammo Mueller wrote:
> Hi Brian,
>
> do you have a small example for such an Adapter?
> Thanks,
> Tammo
>
> -----Ursprüngliche Nachricht-----
> Von: Brian Bonner [mailto:brian.bonner@paraware.com]
> Gesendet: Thursday, June 02, 2005 2:21 PM
> An: user@xmlbeans.apache.org
> Betreff: Re: XMLBean to jTable
>
> Tammo,  you probably need to create an XmlObjectTableModelAdapter that
> is something that takes your specific type of XMLObject (I assume you
> have a type your interested in) and then adapts it to the TableModel
> interface that JTable accepts.
>
> Once you have that in place, you should be good to go.
>
> HTH,
>
> Brian
>
>
>
> Tammo Mueller wrote:
>
>>  Hi!
>>
>>  I'm currently trying to find a generic way to transform a Document
>>  into a JTable. Are there already approaches and
>>  which is the best way? I'm trying to avoid going over the DOM, because
>>  I loose all Datatypes by doing that.
>>  I would like to  present a XMLBeans Document to the TableModel and it
>>  should set values and names of the elements in the table. It should be
>>  somekind of a propertysheet as I know it from 'normal' beans.
>>
>>  Best regards,
>>
>>  Tammo
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
- Brian (mobile)
ask me about my Sidekick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


AW: XMLBean to jTable

Posted by Tammo Mueller <ta...@gmail.com>.
Hi Brian,

do you have a small example for such an Adapter?
Thanks,
Tammo 

-----Ursprüngliche Nachricht-----
Von: Brian Bonner [mailto:brian.bonner@paraware.com] 
Gesendet: Thursday, June 02, 2005 2:21 PM
An: user@xmlbeans.apache.org
Betreff: Re: XMLBean to jTable

Tammo,  you probably need to create an XmlObjectTableModelAdapter that 
is something that takes your specific type of XMLObject (I assume you 
have a type your interested in) and then adapts it to the TableModel 
interface that JTable accepts.

Once you have that in place, you should be good to go.

HTH,

Brian



Tammo Mueller wrote:

> Hi!
>  
> I'm currently trying to find a generic way to transform a Document 
> into a JTable. Are there already approaches and
> which is the best way? I'm trying to avoid going over the DOM, because 
> I loose all Datatypes by doing that.
> I would like to  present a XMLBeans Document to the TableModel and it 
> should set values and names of the elements in the table. It should be 
> somekind of a propertysheet as I know it from 'normal' beans.
>  
> Best regards,
>  
> Tammo



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: XMLBean to jTable

Posted by Brian Bonner <br...@paraware.com>.
Tammo,  you probably need to create an XmlObjectTableModelAdapter that 
is something that takes your specific type of XMLObject (I assume you 
have a type your interested in) and then adapts it to the TableModel 
interface that JTable accepts.

Once you have that in place, you should be good to go.

HTH,

Brian



Tammo Mueller wrote:

> Hi!
>  
> I'm currently trying to find a generic way to transform a Document 
> into a JTable. Are there already approaches and
> which is the best way? I'm trying to avoid going over the DOM, because 
> I loose all Datatypes by doing that.
> I would like to  present a XMLBeans Document to the TableModel and it 
> should set values and names of the elements in the table. It should be 
> somekind of a propertysheet as I know it from 'normal' beans.
>  
> Best regards,
>  
> Tammo



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org