Revision: 1282
Author: mathiasbr
Date: 2006-08-08 00:17:58 -0700 (Tue, 08 Aug 2006)
ViewCVS: http://svn.sourceforge.net/spring-rich-c/?rev=1282&view=rev
Log Message:
-----------
GridBagLayoutFromBuilder now uses form model field face to configure labels
Modified Paths:
--------------
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/form/builder/GridBagLayoutFormBuilder.java
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/layout/GridBagLayoutBuilder.java
Modified:
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/form/builder/GridBagLayoutFormBuilder.java
===================================================================
---
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/form/builder/GridBagLayoutFormBuilder.java
2006-08-07 21:18:43 UTC (rev 1281)
+++
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/form/builder/GridBagLayoutFormBuilder.java
2006-08-08 07:17:58 UTC (rev 1282)
@@ -16,6 +16,7 @@
package org.springframework.richclient.form.builder;
import javax.swing.JComponent;
+import javax.swing.JLabel;
import javax.swing.JPanel;
import org.springframework.richclient.factory.ComponentFactory;
@@ -34,7 +35,7 @@
public GridBagLayoutFormBuilder(BindingFactory bindingFactory) {
super(bindingFactory);
- this.builder = new GridBagLayoutBuilder();
+ this.builder = new FormModelAwareGridBagLayoutBuilder();
}
/**
@@ -261,4 +262,11 @@
builder.setAutoSpanLastComponent(autoSpanLastComponent);
}
+ protected final class FormModelAwareGridBagLayoutBuilder extends
GridBagLayoutBuilder {
+ protected JLabel createLabel(String propertyName) {
+ JLabel label = getComponentFactory().createLabel("");
+ getFormModel().getFieldFace(propertyName).configure(label);
+ return label;
+ }
+ }
}
\ No newline at end of file
Modified:
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/layout/GridBagLayoutBuilder.java
===================================================================
---
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/layout/GridBagLayoutBuilder.java
2006-08-07 21:18:43 UTC (rev 1281)
+++
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/layout/GridBagLayoutBuilder.java
2006-08-08 07:17:58 UTC (rev 1282)
@@ -318,10 +318,14 @@
*/
public GridBagLayoutBuilder appendLabeledField(String propertyName, final
JComponent field,
LabelOrientation labelOrientation, int colSpan, int rowSpan,
boolean expandX, boolean expandY) {
- final JLabel label = getComponentFactory().createLabel(propertyName);
+ JLabel label = createLabel(propertyName);
return appendLabeledField(label, field, labelOrientation, colSpan,
rowSpan, expandX, expandY);
}
+ protected JLabel createLabel(String propertyName) {
+ return getComponentFactory().createLabel(propertyName);
+ }
+
/**
* Appends a label and field to the end of the current line.<p />
*
@@ -513,7 +517,7 @@
* @return "this" to make it easier to string together append calls
*/
public GridBagLayoutBuilder appendRightLabel(String labelKey, int colSpan)
{
- final JLabel label = getComponentFactory().createLabel(labelKey);
+ final JLabel label = createLabel(labelKey);
label.setHorizontalAlignment(SwingConstants.RIGHT);
return appendLabel(label, colSpan);
}
@@ -546,7 +550,7 @@
* @return "this" to make it easier to string together append calls
*/
public GridBagLayoutBuilder appendLeftLabel(String labelKey, int colSpan) {
- final JLabel label = getComponentFactory().createLabel(labelKey);
+ final JLabel label = createLabel(labelKey);
label.setHorizontalAlignment(SwingConstants.LEFT);
return appendLabel(label, colSpan);
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
spring-rich-c-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spring-rich-c-cvs