nishtahir / gwt-pectin

Automatically exported from code.google.com/p/gwt-pectin
0 stars 0 forks source link

Improve Watermark bindings #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Improve watermark bindings to support a wider range of components.

Should automatically support:
  * HasText & HasAllFocusHandlers
  * TextBoxBase
  * HasWatermark

Would be nice to support HasValue<String> but can't check this at runtime
without trying the match explicit sub types.  Might be better to support
via HasWatermark interface.  

May need to separate between HasWatermark components that manage when and
how the watermark is displayed and those that don't.  Could possibly use
HasWatermarkText and HasWatermark although this still feels a bit wrong. 
In reality most people would like the binding to do all the work so would
like a HasWatermark style hook that is trivial to implement.

Original issue reported on code.google.com by andrew.pietsch on 21 Nov 2009 at 12:05

GoogleCodeExporter commented 8 years ago
Perhaps an another option instead of using a HasWatermark interface might be to 
allow developers to add custom bindings, perhaps something like 
MetadataPlugin.defaults().registerWatermarkBinding(Class<T>, 
AbstractWatermarkBinding<T>).  That way you could watermark third party widgets 
without having to extend them.

Might also be worth moving watermarks to their own plugin.

Original comment by andrew.pietsch on 25 Jul 2010 at 3:40

GoogleCodeExporter commented 8 years ago
Since 0.8 pectin will now watermark widgets that implement the Watermarkable 
interface.  Watermarkable extends HasValue<String> & HasAllFocusHandlers and 
defines methods for applying and removing a watermark style.

Original comment by andrew.pietsch on 29 Jul 2010 at 11:22