[
https://issues.apache.org/jira/browse/WICKET-6536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16491661#comment-16491661
]
Kamil commented on WICKET-6536:
-------------------------------
[~mgrigorov], [~svenmeier] sorry, I didn't notice your question.
So currently I have:
{code:java}
public class MyWindow extends Panel implements Cancelable {...}{code}
and I reach it like this:
{code:java}
getPage().visitChildren(Cancelable.class, (object, visit) -> ((Cancelable)
object).cancel(target));{code}
Now, if signature of the method will be:
{code:java}
final <S extends Component, R> R visitChildren(final Class<S> clazz, final
IVisitor<S, R> visitor){code}
I could use visit like this:
{code:java}
getPage().visitChildren(Cancelable.class, (cancelable, visit) ->
cancelable.cancel(target));{code}
> Add generic to MarkupContainer#visitChildren
> --------------------------------------------
>
> Key: WICKET-6536
> URL: https://issues.apache.org/jira/browse/WICKET-6536
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 8.0.0-M8
> Reporter: Kamil
> Assignee: Sven Meier
> Priority: Major
>
> currently MarkupContainer#visitChildren has signature:
> {code:java}
> final <S extends Component, R> R visitChildren(final Class<?> clazz, final
> IVisitor<S, R> visitor){code}
> while im my opinion it should have:
> {code:java}
> final <S extends Component, R> R visitChildren(final Class<S> clazz, final
> IVisitor<S, R> visitor){code}
> Why force user to do class cast while we already know which class we pass to
> the method?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)