|
From: Johannes S. (JIRA) <no...@sp...> - 2008-01-26 13:51:01
|
Patch: ListSelectionBinding supports nonnull properties
-------------------------------------------------------
Key: RCP-530
URL: http://jira.springframework.org/browse/RCP-530
Project: Spring Framework Rich Client Project
Issue Type: New Feature
Components: Binding System
Affects Versions: 1.0.0
Reporter: Johannes Schneider
Attachments: ListSelectionDialogBinding_ready_for_non-nullable_properties.patch
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Johannes S. (JIRA) <no...@sp...> - 2008-01-26 13:49:15
|
[ http://jira.springframework.org/browse/RCP-530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johannes Schneider updated RCP-530:
-----------------------------------
Attachment: ListSelectionDialogBinding_ready_for_non-nullable_properties.patch
> Patch: ListSelectionBinding supports nonnull properties
> -------------------------------------------------------
>
> Key: RCP-530
> URL: http://jira.springframework.org/browse/RCP-530
> Project: Spring Framework Rich Client Project
> Issue Type: New Feature
> Components: Binding System
> Affects Versions: 1.0.0
> Reporter: Johannes Schneider
> Attachments: ListSelectionDialogBinding_ready_for_non-nullable_properties.patch
>
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Johannes S. (JIRA) <no...@sp...> - 2008-01-26 14:44:48
|
[ http://jira.springframework.org/browse/RCP-530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johannes Schneider updated RCP-530:
-----------------------------------
Attachment: ListSelectionDialogBinding_extended_nullable.patch
This patch additionally introduces a "detectNullable" method. Within this method some magic can be done (I created a subclass that decides whether a property is nullable based on annotations of the getter/setter).
> Patch: ListSelectionBinding supports nonnull properties
> -------------------------------------------------------
>
> Key: RCP-530
> URL: http://jira.springframework.org/browse/RCP-530
> Project: Spring Framework Rich Client Project
> Issue Type: New Feature
> Components: Binding System
> Affects Versions: 1.0.0
> Reporter: Johannes Schneider
> Attachments: ListSelectionDialogBinding_extended_nullable.patch, ListSelectionDialogBinding_ready_for_non-nullable_properties.patch
>
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Johannes S. (JIRA) <no...@sp...> - 2008-01-26 14:46:45
|
[ http://jira.springframework.org/browse/RCP-530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_31268 ]
Johannes Schneider commented on RCP-530:
----------------------------------------
Simple subclass that decides whether a property is nullable based on annotations:
extends ListSelectionDialogBinder {
@Override
protected void detectNullable( FormModel formModel, String formPropertyPath ) {
Method setter = BeanUtils.getPropertyDescriptor( formModel.getFormObject().getClass(), formPropertyPath ).getWriteMethod();
Annotation[] annotations = setter.getParameterAnnotations()[0];
if ( isSet( Nullable.class, annotations ) ) {
setNullable( true );
}
if ( isSet( NotNull.class, annotations ) ) {
setNullable( false );
}
}
private static boolean isSet( @NotNull Class<?> annotationsClass, @NotNull Annotation[] annotations ) {
for ( Annotation annotation : annotations ) {
if ( annotation.annotationType().equals( annotationsClass ) ) {
return true;
}
}
return false;
}
> Patch: ListSelectionBinding supports nonnull properties
> -------------------------------------------------------
>
> Key: RCP-530
> URL: http://jira.springframework.org/browse/RCP-530
> Project: Spring Framework Rich Client Project
> Issue Type: New Feature
> Components: Binding System
> Affects Versions: 1.0.0
> Reporter: Johannes Schneider
> Attachments: ListSelectionDialogBinding_extended_nullable.patch, ListSelectionDialogBinding_ready_for_non-nullable_properties.patch
>
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Peter De B. (JIRA) <no...@sp...> - 2008-01-29 11:54:44
|
[ http://jira.springframework.org/browse/RCP-530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_31364 ]
Peter De Bruycker commented on RCP-530:
---------------------------------------
can you provide a usecase that demonstrates this added functionality?
> Patch: ListSelectionBinding supports nonnull properties
> -------------------------------------------------------
>
> Key: RCP-530
> URL: http://jira.springframework.org/browse/RCP-530
> Project: Spring Framework Rich Client Project
> Issue Type: New Feature
> Components: Binding System
> Affects Versions: 1.0.0
> Reporter: Johannes Schneider
> Attachments: ListSelectionDialogBinding_extended_nullable.patch, ListSelectionDialogBinding_ready_for_non-nullable_properties.patch
>
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Johannes S. (JIRA) <no...@sp...> - 2008-01-29 12:00:48
|
[ http://jira.springframework.org/browse/RCP-530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_31365 ]
Johannes Schneider commented on RCP-530:
----------------------------------------
Ok, simple use case:
Think of a book that always has an author. So the user should not be allowed to set the author to null.
I have several forms here, where I want to enforce that a property is not set to null. So setting a default value and remove the "delete button" seems to be the easiest way.
> Patch: ListSelectionBinding supports nonnull properties
> -------------------------------------------------------
>
> Key: RCP-530
> URL: http://jira.springframework.org/browse/RCP-530
> Project: Spring Framework Rich Client Project
> Issue Type: New Feature
> Components: Binding System
> Affects Versions: 1.0.0
> Reporter: Johannes Schneider
> Attachments: ListSelectionDialogBinding_extended_nullable.patch, ListSelectionDialogBinding_ready_for_non-nullable_properties.patch
>
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Lieven D. (JIRA) <no...@sp...> - 2008-10-09 19:39:18
|
[ http://jira.springframework.org/browse/RCP-530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=40222#action_40222 ]
Lieven Doclo commented on RCP-530:
----------------------------------
Can't this be solved by using rules?
> Patch: ListSelectionBinding supports nonnull properties
> -------------------------------------------------------
>
> Key: RCP-530
> URL: http://jira.springframework.org/browse/RCP-530
> Project: Spring Framework Rich Client Project
> Issue Type: New Feature
> Components: Binding System
> Affects Versions: 1.0.0
> Reporter: Johannes Schneider
> Fix For: 1.x
>
> Attachments: ListSelectionDialogBinding_extended_nullable.patch, ListSelectionDialogBinding_ready_for_non-nullable_properties.patch
>
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Lieven D. (JIRA) <no...@sp...> - 2008-10-09 19:39:22
|
[ http://jira.springframework.org/browse/RCP-530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo updated RCP-530:
-----------------------------
Fix Version/s: 1.x
> Patch: ListSelectionBinding supports nonnull properties
> -------------------------------------------------------
>
> Key: RCP-530
> URL: http://jira.springframework.org/browse/RCP-530
> Project: Spring Framework Rich Client Project
> Issue Type: New Feature
> Components: Binding System
> Affects Versions: 1.0.0
> Reporter: Johannes Schneider
> Fix For: 1.x
>
> Attachments: ListSelectionDialogBinding_extended_nullable.patch, ListSelectionDialogBinding_ready_for_non-nullable_properties.patch
>
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|