Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Groovy
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<p><strong>This proposal is deffered and not under active development or consideration</strong><br /> The reason for deferral is that the JSR-295 API is too unstable. Since this posting it has gone under a major re-design. It will not be revisited any earlier than the posting of the first proposed final draft for that reason.</p> <p>Based off of an example in Scott Violet's <a href="http://weblogs.java.net/blog/zixle/archive/2007/02/index.html">last blog</a> at sun, a BindingBuilder in practice would look something like this:</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> // code from elsewhere... public class Bug { @BoundProperty String ID @BoundProperty int priority @BoundProperty String synopsis @BoundProperty String type } List<Bug> bugs = [...] // assuming generics make it into 1.1 bugTable = theSwingBuilder.bugTable summaryLabel = theSwingBuilder.summaryLabel idTF = theSwingBuilder.idTF descriptionTF = theSwingBuilder.descriptionTF typeTF = theSwingBuilder.typeTF prioritySlider = theSwingBuilder.prioritySlider // the actual bindings bindings = new BeansBindingBuilder() context = bindings.context() { binding(source: bugs, target: bugTable, property:'elements') { binding(value:'${ID}') { tableColumn(0) } binding(value:'${priority}') { tableColumn(1) } binding(value:'${synopsis}') { tableColumn(2) } } binding( source:bugTable, value:'${bb:listSize(selectedElements)} of ${bb:listSize(elements)} are selected', target:summaryLabel, property:'text') binding(source:bugTable, value:'${selectedElements.ID}', target:idTF, property:'text') { textChangeStrategy(CHANGE_ON_TYPE) concatenatingCondensor(['"', '"', ',']) } binding(source:bugTable, value:'${selectedElements.synopsis}', target:descriptionTF, property:'text') { textChangeStrategy(CHANGE_ON_TYPE) concatenatingCondensor(['"', '"', ',']) } binding(source:bugTable, value:'${selectedElements.type}', target:typeTF, property:'text') { textChangeStrategy(CHANGE_ON_TYPE) concatenatingCondensor(['"', '"', ',']) } binding(source:bugTable, value:'${selectedElements.priority}', target:prioritySlider, property:'value') } context.bind() </pre></td></tr></table> <p><br class="atl-forced-newline" /> <br class="atl-forced-newline" /> Once I get a better feel for the existing code I can mock up what all the possible children would be.</p> <p> Here's what the java snippets from the post are</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> context = new BindingContext(); List<Bug> bugs = ...; Binding tableBinding = context.addBinding( bugs, // Source for the binding, the List of bugs in this case. null, // Expression, relative to the source, used in obtaining the property. // For this example it's null, meaning use bugs as is. bugTable, // Target of the binding, a JTable in this case. "elements"); // The property of the target to bind to. tableBinding.addBinding( "${ID}", // Expression evaluated relative to each Bug. // In this case, it's treated as bug.getID(). null, // Target value (I'm not going to get into this parameter now) TableColumnParameter, 0); // Specifies the binding applies to the first column tableBinding.addBinding("${priority}", null, TableColumnParameter, 1); tableBinding.addBinding("${synopsis}", null, TableColumnParameter, 2); Binding textFieldBinding = context.addBinding( bugTable, // Source of the binding, the JTable in this case. "${selectedElements.ID}", // Expression relative to the source. Evaluates to the // the id property of each of the selected elements idTF, // Target of the binding, a JTextField here. "text", // The target property to bind to. // The next line specifies the 'text' property should change as you type. // The default is to change the property on enter/focus leaving. TextChangeStrategyParameter, TextChangeStrategy.CHANGE_ON_TYPE); textFieldBinding.setListCondenser(ListCondenser.concatenatingCondenser( "\"", // The string placed before each element "\"", // The string paced after each element ", ")); // The string that separates each element. context.addBinding( bugTable, // The source of the binding, the table in this case. // The expression evaluated relative to the source. Notice this makes use // of the function "listSize", that returns an size of the list supplied to it. "${bb:listSize(selectedElements)} of ${bb:listSize(elements)} are selected", summaryLabel, // The target of the binding, a JLabel here. "text"); // The target property to bind to context.bind(); </pre></td></tr></table> <p><br class="atl-forced-newline" /> <br class="atl-forced-newline" /></p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced