Skip to main content

Blog Archive for evanx during December 2006

Gooey Beans Form .underlineStyle { color: #bbbbbb; text-decoration: underline; } span.codeStyle { font-family: courier new, courier, mono; font-size: 10pt; } span.linkStyle { color: black; } span.urlStyle { color: black; } pre.javaStyle { font-family: courier new, courier, mono; background-color: #fbfbfb; font-size: 11pt; width: 800px; border: dashed 1px; border-color:...
We wanna style our documents and reports using neutral Java objects, to generate output artifacts e.g. HTML with CSS, and/or other formats, e.g. PDF and Excel (for reports). We model our style objects after CSS, e.g. font-family, font-weight, text-decoration, et al. Hyper Style: A part of the "Hyper Beans" part of a trilogy in 42 parts" We implement style objects for generating this series of...
We implement a singleton for formatting objects into strings, where custom formatters ie. for specific types, are registered with the singleton. Click here to read "Gooey Formatter, an objective expose" ;) A part of "Gooey Beans, a trilogy in 42 parts" Code Snippet Our singleton is implemented as follows. <span style='color: #000099; font-weight: bold;'>public...
Let's get us some simplistic "beans binding" to support the Presentation Model pattern. We explicitly declare our properties so as to enjoy IDE auto-completion and refactoring capabilities. "Wa wa wee wa!" Cos string references are fragile with respect to renaming getters and setters, and so we avoid them, like whatsit, the plague ;) Gooey Beans Info: A part of "Gooey Beans, a trilogy in 42...
We try some magic tricks to avoid boilerplate EDT code. First we use dynamic proxies. This makes the code is more difficult to navigate using our IDE. Nevertheless it is potentially useful for general utility classes whose methods should all run in the EDT, eg. to enable EDT-agnostic programming in background threads. Finally, we investigate using byte code manipulation using CGLib. We...