You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Chris Walters <wa...@id.com> on 2013/05/31 17:19:38 UTC

Swing / Data views

I have a need to bind some Cayenne data objects to Swing components in a Netbeans platform-based app.  Google tells me there used to be something called Data Views.  Are they completely gone?  Any other recommendations for binding data objects to Swing components if so?

Am I showing how out of touch I am by even contemplating this combination?


Re: Swing / Data views

Posted by Emanuele Maiarelli <ma...@gmail.com>.
I suggest to use a "fresh" context for every form you gonna instance, that
will avoid leaving uncommitted objects around in one single context.

You can eventually avoid reflection , since every cayenne objects have
static string fields containing method names, that can be readen/written
using readPropery/writeProperty methods eg:
a.readProperty(AutomCat.AC_CODE_PROPERTY);.

Handling prefetchs in some automated way is also usefull.



2013/5/31 Andrew Faust <ar...@gmail.com>

> Hi Chris.  About 2 years ago I developed a desktop java app, using Swing
> and Cayenne.  I was using Eclipse becuase there is a free plug-in called *
> WindowBuilderPro*, that allows you to visually create your Swing views.
> Anyway this tool also had some kind of Data-Binding support; however, I did
> not use that....I simply had code that would do like....
>
> On view show....
>
> someEditBox.setText(myCayennePoJo.getLastName())
>
> and, on "save"
>
> myCayennePoJo.setLastName(someEditBox.getText())
>
> At this point, if I were to develop something like that again, I would
> develop the screens & POJOs so the UI control names & POJO prop names are
> the same and then have some *reflection* type code to do the heavy moving.
>
>
> On Fri, May 31, 2013 at 11:19 AM, Chris Walters <wa...@id.com> wrote:
>
> > I have a need to bind some Cayenne data objects to Swing components in a
> > Netbeans platform-based app.  Google tells me there used to be something
> > called Data Views.  Are they completely gone?  Any other recommendations
> > for binding data objects to Swing components if so?
> >
> > Am I showing how out of touch I am by even contemplating this
> combination?
> >
> >
>

Re: Swing / Data views

Posted by Andrew Faust <ar...@gmail.com>.
Hi Chris.  About 2 years ago I developed a desktop java app, using Swing
and Cayenne.  I was using Eclipse becuase there is a free plug-in called *
WindowBuilderPro*, that allows you to visually create your Swing views.
Anyway this tool also had some kind of Data-Binding support; however, I did
not use that....I simply had code that would do like....

On view show....

someEditBox.setText(myCayennePoJo.getLastName())

and, on "save"

myCayennePoJo.setLastName(someEditBox.getText())

At this point, if I were to develop something like that again, I would
develop the screens & POJOs so the UI control names & POJO prop names are
the same and then have some *reflection* type code to do the heavy moving.


On Fri, May 31, 2013 at 11:19 AM, Chris Walters <wa...@id.com> wrote:

> I have a need to bind some Cayenne data objects to Swing components in a
> Netbeans platform-based app.  Google tells me there used to be something
> called Data Views.  Are they completely gone?  Any other recommendations
> for binding data objects to Swing components if so?
>
> Am I showing how out of touch I am by even contemplating this combination?
>
>

Re: Swing / Data views

Posted by John Huss <jo...@gmail.com>.
+1
I have used jgoodies binding with cayenne in just that way.  IMHO it's the
best binding library considering that the one that was supposed to become
standard has ceased to be developed.

John

On Saturday, June 1, 2013, Dirk Olmes wrote:

> On 05/31/2013 06:24 PM, Andrus Adamchik wrote:
> > On the DataViews status... Yes, DataViews is no longer a supported
> > technology in Cayenne. DataViews was a great and promising framework,
> > but ended up archived and removed from the main line of development
> > after its main and only developer moved on to other things. The code
> > is there, and Swing hasn't changed that much in the last 5 years
> > (Cayenne did somewhat), so given a motivated person, it can be
> > resurrected. Otherwise yeah, you'd have to look for data bindings
> > elsewhere, or do it traditional Swing way.
>
> If I was to implement a Swing GUI again, I'd take a look into the
> excellent JGoodies binding library [1]. It does not come with direct
> support for Cayenne but I'm sure those two frameworks could be married
> fairly easily using cayenne's entity templates.
>
> -dirk
>
> [1] http://www.jgoodies.com/freeware/libraries/binding/
>

Re: Swing / Data views

Posted by Dirk Olmes <di...@xanthippe.ping.de>.
On 05/31/2013 06:24 PM, Andrus Adamchik wrote:
> On the DataViews status... Yes, DataViews is no longer a supported
> technology in Cayenne. DataViews was a great and promising framework,
> but ended up archived and removed from the main line of development
> after its main and only developer moved on to other things. The code
> is there, and Swing hasn't changed that much in the last 5 years
> (Cayenne did somewhat), so given a motivated person, it can be
> resurrected. Otherwise yeah, you'd have to look for data bindings
> elsewhere, or do it traditional Swing way.

If I was to implement a Swing GUI again, I'd take a look into the
excellent JGoodies binding library [1]. It does not come with direct
support for Cayenne but I'm sure those two frameworks could be married
fairly easily using cayenne's entity templates.

-dirk

[1] http://www.jgoodies.com/freeware/libraries/binding/

Re: Swing / Data views

Posted by Andrus Adamchik <an...@objectstyle.org>.
On the DataViews status... Yes, DataViews is no longer a supported technology in Cayenne. DataViews was a great and promising framework, but ended up archived and removed from the main line of development after its main and only developer moved on to other things. The code is there, and Swing hasn't changed that much in the last 5 years (Cayenne did somewhat), so given a motivated person, it can be resurrected. Otherwise yeah, you'd have to look for data bindings elsewhere, or do it traditional Swing way.

Andrus


On May 31, 2013, at 6:19 PM, Chris Walters <wa...@id.com> wrote:
> I have a need to bind some Cayenne data objects to Swing components in a Netbeans platform-based app.  Google tells me there used to be something called Data Views.  Are they completely gone?  Any other recommendations for binding data objects to Swing components if so?
> 
> Am I showing how out of touch I am by even contemplating this combination?
> 
> 


Re: Swing / Data views

Posted by Emanuele Maiarelli <ma...@gmail.com>.
I wrote a mini framework working with netbeans app framework for
databinding.
Il giorno 31/mag/2013 17:20, "Chris Walters" <wa...@id.com> ha scritto:

> I have a need to bind some Cayenne data objects to Swing components in a
> Netbeans platform-based app.  Google tells me there used to be something
> called Data Views.  Are they completely gone?  Any other recommendations
> for binding data objects to Swing components if so?
>
> Am I showing how out of touch I am by even contemplating this combination?
>
>