Posts filed under 'BeanView'

Metawidget

Here is another project similar to BeanView. It supports more UI types, but of course uses yet another set of annotations.

http://metawidget.sourceforge.net/

I still wish there was a standard for these annotations, but my guess is we won’t see those until roughly 2010-2011.

1 comment June 19th, 2008

Wicket Implementation of BeanView-style Functionality

A new project called “Wicket Web Beans” provides BeanView-style functionality for Wicket.

I love that there are other implementations of this stuff for different user interface platforms (Swing, Echo 2, Tapestry, Wicket) – it would be really nice if the same annotations would work across multiple user interface stacks.

Ah, well. I’ve got a day job… :)

1 comment September 12th, 2007

Tapestry Implementation of BeanView-style Functionality

The Tapestry 5 tutorial has an example of BeanView-style form generation – check it out!

Add comment July 5th, 2007

Beanview: Hibernate Validator, Languages

The version of Beanview in CVS has been converted from Apache Commons Validation to the new Hibernate Validation annotations system. This means that you can use a single set of validation annotations for both persistence and for BeanView-generated user interfaces.

Hibernate Validation includes support for several languages besides English, including Dutch, German, Spanish, French, Italian, Danish, Portugese, Swedish, and both Simplified and Traditional Chinese. The only non-Hibernate Validation validation message BeanView generates has been localized to all of these languages (except Chinese). If anyone sends along Chinese property files they will be added.

…and no, this is not an April Fool’s joke. :)

Add comment April 1st, 2007

BeanView 1.1.2 Posted

BeanView 1.1.2 has been posted. This release fixes a minor bug (a NPE has been replaced with a slightly more informative exception), updated documentation, and updated demonstrations (including a prototype Naked Objects example).

More information (including updated screenshots and download information) can be found at BeanView.com.

Add comment October 15th, 2006

BeanForm (BeanView-like stuff for Tapestry)

If you like the idea[s] behind BeanView, but instead of Echo 2 or Swing you use Tapestry as your preferred web framework, you should check out BeanForm.

Thanks to Daniel G (creator of BeanForm) for the tip!

Add comment October 15th, 2006

Using Collections

Q: I love the concept of your BeanView, but I just can’t get it to work at all with Collections. Can you tell me if I’m doing something completely wrong. If I change the nicknames property to String[] instead of Collection, everything works. But as Collection, I get the following error:

Exception in thread "main" java.lang.NullPointerException
at com.beanview.swing.SwingBeanViewPanel .setUpEntryField(SwingBeanViewPanel.java:67)
at com.beanview.swing.SwingBeanViewPanel .configure(SwingBeanViewPanel.java:116)
at com.beanview.BeanViewConfiguration .setDataObject(BeanViewConfiguration.java:71)
at com.beanview.swing.SwingBeanViewPanelBase .setDataObject(SwingBeanViewPanelBase.java:57)
at com.project.data.Person.main(Person.java:18)

A: It looks like your Collection getters are missing a BeanView annotation to indicate the possible options for the collection. The Array implementation is “forgiving” enough to return an empty multivalue select, whereas the Collection factory expects an annotation for the possible values. I’ve added an exception to make this more clear for other users in CVS.

For example, you could add the following utility method and annotation:

import com.beanview.annotation.PropertyOptions;

public Collection possibleNicknames()
{
   Collection nicks = new ArrayList();
   nicks.add("Key");
   nicks.add("KK");
   nicks.add("Knudsen");
   return nicks;
}

@PropertyOptions(options = "possibleNicknames")
public Collection getNicknames()
{
   return nicknames;
}

If you are missing the @PropertyOptions annotation, BeanView doesn’t know what values to present for the user to choose from.

There are a number of different ways to bind these annotations. See package com.beanview.test.PeoplePicker and com.beanview.test.SimpleObjectFactory for more examples.

Add comment October 15th, 2006

BeanView moving to Java.net

BeanView CVS has moved to java.net. A clean checkin of BeanView 1.1 can be found at:

https://beanview.dev.java.net/

Hopefully, this will fix the various CVS outages, dropped connections, “broken pipes”, and other issues.

Add comment September 18th, 2006

BeanView 1.1 Released

BeanView 1.1 is available for download now at:
http://www.attainware.com/beanview/BeanView_1.1.zip

Most notably, all of the Ant scripts have been tossed out and the whole package redone with Maven 2. In addition, the BeanView-specific BeanUtils has been removed and BeanView now relies on the standard BeanUtils.

Add comment September 17th, 2006

Future BeanView Design Questions

Pavel K emailed me with some questions and suggestions regarding BeanView, and I thought it might be interesting to summarize some of the questions and open it up to the community. Feel free to make comments if you have any thoughts or questions.

Q: What about locale support for labels? For example, obtaining labels from *.properties, @PropertyOptions, or the reflected property name in descending priority?

A: This is absolutely the desired goal. My plan was to provide a simple tool that would autogenerate a default *.properties associated with a BeanView object automatically. The idea would be that a user could pass in a configured BeanView object and autogenerate a default properties file, with well-known default options based on the properites. Something like:

com.example.Cat_label_name=Name
com.example.Cat_label_weight=Weight

Q: What about nullable values? Might make sense to look at the @Column annotation to see if nullable=true, and map empty strings back to null?

A: I thought about this, but for now I figured that BeanView would just do empty strings on the theory that the user is inputting an empty string, not a null by the time it came back around to stuff back into the database. If someone wanted to simulate the empty string = null behavior, they could put that in their setter implementation.

Q: EJB3 is now final – what about removing the com.beanview.ejb3 code and replacing with the real EJB3 reference (which would of course add a dependency of EJB3)?

A: That was always the idea, I need to check to make sure the license for EJB3 allows me to include the JAR. On the TODO list.

Q: What about allowing for programmatically setting the style names to support Echo 2 styles?

A: You could do that easily now by just sub-classing com.beanview.echo.EchoBeanViewPanel. You could use the BeanView.setContext method to pass in the appropriate flag to avoid breaking the BeanView high level interface. e..g.:

BeanView catPanel = new MyEchoBeanViewPanelSubClass();
catPanel.setContext("style", "fancy");

…and your catPanel overrides setUpLabel, setUpEntry, setUpError to apply style information. One interesting thing about this is that you could have one style guide set and provide both an Echo 2 and a Swing implementation (e.g. the fancy panel is drawn in 16 point green Helvetica in Echo 2 and 18 point blue Garamond in Swing).

As another thought, I was thinking it would be interesting to provide Master views for BeanView as well, allowing you to pass in an array of BeanView objects and get read-only Master views.

One thing I contemplated was adding the component type as an additional generic type parameter for BeanView, so you would know what kind of components were supported by that panel as sub-components.

Q: What’s with the Commons BeanUtil hack?

A: The Commons BeanUtil hack is to work around a bug in NetBeans. Basically, there’s a classloader conflict that affects the Swing user interface form builder. By including the hack, I was able to get drag-and-drop user interface construction in NetBeans – which makes for a v. nice demo. :) One of the things I’d like to do is support the new layout engine for Swing for the Swing implementation of BeanView. I’m planning on writing an article on using BeanView & NetBeans w/drag & drop sometime in the near future…

Add comment August 18th, 2006

Previous Posts


Calendar

March 2010
S M T W T F S
« Jun    
 123456
78910111213
14151617181920
21222324252627
28293031  

Posts by Month

Posts by Category