You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Dilger (JIRA)" <ji...@apache.org> on 2011/04/28 14:25:03 UTC
[jira] [Created] (WICKET-3652) Provide a Typesafe Panel, that
allows to use getDefaultModel and getDefaultModelObject without casting
Provide a Typesafe Panel, that allows to use getDefaultModel and getDefaultModelObject without casting
------------------------------------------------------------------------------------------------------
Key: WICKET-3652
URL: https://issues.apache.org/jira/browse/WICKET-3652
Project: Wicket
Issue Type: Improvement
Components: wicket-core
Affects Versions: 1.5-RC3
Reporter: Martin Dilger
Priority: Minor
Attachments: 0001-TypedPanel-to-provide-TypeSafe-access-to-underlying-.patch
I want to use panels in a generic way with no need to cast, if I use getDefaultModel and getDefaultModelObject.
This issue has been thoroughly discussed, and thats why Panel is currently not implemented using generics.
Please provide a class TypedPanel instead, that can be used interchangeably with Panel itself.
The Implementation could provide the following Methods:
public T getDefaultModel()
public T getDefaultModelObject()
That would make usage of typed panels much more cleaner.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WICKET-3652) Provide a Typesafe Panel, that
allows to use getDefaultModel and getDefaultModelObject without casting
Posted by "Martin Dilger (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3652?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Dilger updated WICKET-3652:
----------------------------------
Attachment: 0001-TypedPanel-to-provide-TypeSafe-access-to-underlying-.patch
a simple patch, that provides the idea as implementation.
> Provide a Typesafe Panel, that allows to use getDefaultModel and getDefaultModelObject without casting
> ------------------------------------------------------------------------------------------------------
>
> Key: WICKET-3652
> URL: https://issues.apache.org/jira/browse/WICKET-3652
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-core
> Affects Versions: 1.5-RC3
> Reporter: Martin Dilger
> Priority: Minor
> Attachments: 0001-TypedPanel-to-provide-TypeSafe-access-to-underlying-.patch
>
>
> I want to use panels in a generic way with no need to cast, if I use getDefaultModel and getDefaultModelObject.
> This issue has been thoroughly discussed, and thats why Panel is currently not implemented using generics.
> Please provide a class TypedPanel instead, that can be used interchangeably with Panel itself.
> The Implementation could provide the following Methods:
> public T getDefaultModel()
> public T getDefaultModelObject()
> That would make usage of typed panels much more cleaner.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (WICKET-3652) Provide a Typesafe Panel, that
allows to use getDefaultModel and getDefaultModelObject without casting
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3652?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov resolved WICKET-3652.
-------------------------------------
Resolution: Fixed
Fix Version/s: 1.5-RC5
Assignee: Martin Grigorov
GenericWebPage and GenericPanel are added with r1129038.
> Provide a Typesafe Panel, that allows to use getDefaultModel and getDefaultModelObject without casting
> ------------------------------------------------------------------------------------------------------
>
> Key: WICKET-3652
> URL: https://issues.apache.org/jira/browse/WICKET-3652
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-core
> Affects Versions: 1.5-RC3
> Reporter: Martin Dilger
> Assignee: Martin Grigorov
> Priority: Minor
> Fix For: 1.5-RC5
>
> Attachments: 0001-TypedPanel-to-provide-TypeSafe-access-to-underlying-.patch, 0001-WICKET-3652-TypedPanel-and-TypedWebPage-to-provide-T.patch
>
>
> I want to use panels in a generic way with no need to cast, if I use getDefaultModel and getDefaultModelObject.
> This issue has been thoroughly discussed, and thats why Panel is currently not implemented using generics.
> Please provide a class TypedPanel instead, that can be used interchangeably with Panel itself.
> The Implementation could provide the following Methods:
> public T getDefaultModel()
> public T getDefaultModelObject()
> That would make usage of typed panels much more cleaner.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-3652) Provide a Typesafe Panel, that
allows to use getDefaultModel and getDefaultModelObject without casting
Posted by "Ivan Vasilev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13051065#comment-13051065 ]
Ivan Vasilev commented on WICKET-3652:
--------------------------------------
Hello,
Inside GenericPanel:
@SuppressWarnings("unchecked")
public final T getModel()
{
return (T)getDefaultModel();
}
Shouldn't it be:
@SuppressWarnings("unchecked")
public final T getModel()
{
return (IModel<T>)getDefaultModel();
}
Also, do you think similar GenericFragment should can be added? Thanks.
> Provide a Typesafe Panel, that allows to use getDefaultModel and getDefaultModelObject without casting
> ------------------------------------------------------------------------------------------------------
>
> Key: WICKET-3652
> URL: https://issues.apache.org/jira/browse/WICKET-3652
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-core
> Affects Versions: 1.5-RC3
> Reporter: Martin Dilger
> Assignee: Martin Grigorov
> Priority: Minor
> Fix For: 1.5-RC5
>
> Attachments: 0001-TypedPanel-to-provide-TypeSafe-access-to-underlying-.patch, 0001-WICKET-3652-TypedPanel-and-TypedWebPage-to-provide-T.patch
>
>
> I want to use panels in a generic way with no need to cast, if I use getDefaultModel and getDefaultModelObject.
> This issue has been thoroughly discussed, and thats why Panel is currently not implemented using generics.
> Please provide a class TypedPanel instead, that can be used interchangeably with Panel itself.
> The Implementation could provide the following Methods:
> public T getDefaultModel()
> public T getDefaultModelObject()
> That would make usage of typed panels much more cleaner.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-3652) Provide a Typesafe Panel, that
allows to use getDefaultModel and getDefaultModelObject without casting
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13040283#comment-13040283 ]
Igor Vaynberg commented on WICKET-3652:
---------------------------------------
methods should be called getsetmodel()/getsetmodelobject() just like they are in everything else that is generified.
> Provide a Typesafe Panel, that allows to use getDefaultModel and getDefaultModelObject without casting
> ------------------------------------------------------------------------------------------------------
>
> Key: WICKET-3652
> URL: https://issues.apache.org/jira/browse/WICKET-3652
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-core
> Affects Versions: 1.5-RC3
> Reporter: Martin Dilger
> Priority: Minor
> Attachments: 0001-TypedPanel-to-provide-TypeSafe-access-to-underlying-.patch
>
>
> I want to use panels in a generic way with no need to cast, if I use getDefaultModel and getDefaultModelObject.
> This issue has been thoroughly discussed, and thats why Panel is currently not implemented using generics.
> Please provide a class TypedPanel instead, that can be used interchangeably with Panel itself.
> The Implementation could provide the following Methods:
> public T getDefaultModel()
> public T getDefaultModelObject()
> That would make usage of typed panels much more cleaner.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WICKET-3652) Provide a Typesafe Panel, that
allows to use getDefaultModel and getDefaultModelObject without casting
Posted by "Martin Dilger (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3652?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Dilger updated WICKET-3652:
----------------------------------
Attachment: 0001-WICKET-3652-TypedPanel-and-TypedWebPage-to-provide-T.patch
Of course you are absolutely right.
I provided a new patch that also contains the idea of TypedPage.
> Provide a Typesafe Panel, that allows to use getDefaultModel and getDefaultModelObject without casting
> ------------------------------------------------------------------------------------------------------
>
> Key: WICKET-3652
> URL: https://issues.apache.org/jira/browse/WICKET-3652
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-core
> Affects Versions: 1.5-RC3
> Reporter: Martin Dilger
> Priority: Minor
> Attachments: 0001-TypedPanel-to-provide-TypeSafe-access-to-underlying-.patch, 0001-WICKET-3652-TypedPanel-and-TypedWebPage-to-provide-T.patch
>
>
> I want to use panels in a generic way with no need to cast, if I use getDefaultModel and getDefaultModelObject.
> This issue has been thoroughly discussed, and thats why Panel is currently not implemented using generics.
> Please provide a class TypedPanel instead, that can be used interchangeably with Panel itself.
> The Implementation could provide the following Methods:
> public T getDefaultModel()
> public T getDefaultModelObject()
> That would make usage of typed panels much more cleaner.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-3652) Provide a Typesafe Panel, that
allows to use getDefaultModel and getDefaultModelObject without casting
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038494#comment-13038494 ]
Martin Grigorov commented on WICKET-3652:
-----------------------------------------
I like the idea. Additionally I think to add TypedPage which will extend from WebPage.
Pages and Panels are the most often created custom components.
> Provide a Typesafe Panel, that allows to use getDefaultModel and getDefaultModelObject without casting
> ------------------------------------------------------------------------------------------------------
>
> Key: WICKET-3652
> URL: https://issues.apache.org/jira/browse/WICKET-3652
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-core
> Affects Versions: 1.5-RC3
> Reporter: Martin Dilger
> Priority: Minor
> Attachments: 0001-TypedPanel-to-provide-TypeSafe-access-to-underlying-.patch
>
>
> I want to use panels in a generic way with no need to cast, if I use getDefaultModel and getDefaultModelObject.
> This issue has been thoroughly discussed, and thats why Panel is currently not implemented using generics.
> Please provide a class TypedPanel instead, that can be used interchangeably with Panel itself.
> The Implementation could provide the following Methods:
> public T getDefaultModel()
> public T getDefaultModelObject()
> That would make usage of typed panels much more cleaner.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-3652) Provide a Typesafe Panel, that
allows to use getDefaultModel and getDefaultModelObject without casting
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13051067#comment-13051067 ]
Martin Grigorov commented on WICKET-3652:
-----------------------------------------
Yep, this is a bug. Thanks!
About GenericFragment - not sure, then someone will want GenericWebMarkupContainer, ... At the end we can make Component<T> and solve them all. But this has been discussed already.
> Provide a Typesafe Panel, that allows to use getDefaultModel and getDefaultModelObject without casting
> ------------------------------------------------------------------------------------------------------
>
> Key: WICKET-3652
> URL: https://issues.apache.org/jira/browse/WICKET-3652
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-core
> Affects Versions: 1.5-RC3
> Reporter: Martin Dilger
> Assignee: Martin Grigorov
> Priority: Minor
> Fix For: 1.5-RC5
>
> Attachments: 0001-TypedPanel-to-provide-TypeSafe-access-to-underlying-.patch, 0001-WICKET-3652-TypedPanel-and-TypedWebPage-to-provide-T.patch
>
>
> I want to use panels in a generic way with no need to cast, if I use getDefaultModel and getDefaultModelObject.
> This issue has been thoroughly discussed, and thats why Panel is currently not implemented using generics.
> Please provide a class TypedPanel instead, that can be used interchangeably with Panel itself.
> The Implementation could provide the following Methods:
> public T getDefaultModel()
> public T getDefaultModelObject()
> That would make usage of typed panels much more cleaner.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Issue Comment Edited] (WICKET-3652) Provide a Typesafe
Panel, that allows to use getDefaultModel and getDefaultModelObject without
casting
Posted by "Ivan Vasilev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13051065#comment-13051065 ]
Ivan Vasilev edited comment on WICKET-3652 at 6/17/11 1:27 PM:
---------------------------------------------------------------
Hello,
Inside GenericPanel and GenericWebPage:
@SuppressWarnings("unchecked")
public final T getModel()
{
return (T)getDefaultModel();
}
Shouldn't it be:
@SuppressWarnings("unchecked")
public final T getModel()
{
return (IModel<T>)getDefaultModel();
}
Also, do you think similar GenericFragment should can be added? Thanks.
was (Author: hok):
Hello,
Inside GenericPanel:
@SuppressWarnings("unchecked")
public final T getModel()
{
return (T)getDefaultModel();
}
Shouldn't it be:
@SuppressWarnings("unchecked")
public final T getModel()
{
return (IModel<T>)getDefaultModel();
}
Also, do you think similar GenericFragment should can be added? Thanks.
> Provide a Typesafe Panel, that allows to use getDefaultModel and getDefaultModelObject without casting
> ------------------------------------------------------------------------------------------------------
>
> Key: WICKET-3652
> URL: https://issues.apache.org/jira/browse/WICKET-3652
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-core
> Affects Versions: 1.5-RC3
> Reporter: Martin Dilger
> Assignee: Martin Grigorov
> Priority: Minor
> Fix For: 1.5-RC5
>
> Attachments: 0001-TypedPanel-to-provide-TypeSafe-access-to-underlying-.patch, 0001-WICKET-3652-TypedPanel-and-TypedWebPage-to-provide-T.patch
>
>
> I want to use panels in a generic way with no need to cast, if I use getDefaultModel and getDefaultModelObject.
> This issue has been thoroughly discussed, and thats why Panel is currently not implemented using generics.
> Please provide a class TypedPanel instead, that can be used interchangeably with Panel itself.
> The Implementation could provide the following Methods:
> public T getDefaultModel()
> public T getDefaultModelObject()
> That would make usage of typed panels much more cleaner.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira