[jira] [Commented] (WICKET-6626) Introduce application-wide Component#onComponentTag listeners
[ https://issues.apache.org/jira/browse/WICKET-6626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16733843#comment-16733843 ] ASF subversion and git services commented on WICKET-6626: - Commit 5c6fe2ea31cddbf3efb384347e2b073867379c55 in wicket's branch refs/heads/master from Martin Tzvetanov Grigorov [ https://gitbox.apache.org/repos/asf?p=wicket.git;h=5c6fe2e ] WICKET-6626 Update OnComponentTagListenerTest to JUnit 5 > Introduce application-wide Component#onComponentTag listeners > - > > Key: WICKET-6626 > URL: https://issues.apache.org/jira/browse/WICKET-6626 > Project: Wicket > Issue Type: New Feature > Components: wicket >Reporter: Igor Vaynberg >Assignee: Igor Vaynberg >Priority: Minor > Fix For: 8.3.0, 9.0.0, 7.12.0 > > > Such a listener will be useful for implementing application-wide styling as > well as outputting debug information. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WICKET-6626) Introduce application-wide Component#onComponentTag listeners
[ https://issues.apache.org/jira/browse/WICKET-6626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16733842#comment-16733842 ] ASF subversion and git services commented on WICKET-6626: - Commit 989148e7a470b3364ceb537040b8c6d45bd99b8d in wicket's branch refs/heads/master from Martin Tzvetanov Grigorov [ https://gitbox.apache.org/repos/asf?p=wicket.git;h=989148e ] WICKET-6626 Mark IOnComponentTagListener as a @FunctionalInterface Fix javadoc - Component#onComponentTag() is not visible here (cherry picked from commit 91d0350197209fa95fa60366300fc79c646cdde0) > Introduce application-wide Component#onComponentTag listeners > - > > Key: WICKET-6626 > URL: https://issues.apache.org/jira/browse/WICKET-6626 > Project: Wicket > Issue Type: New Feature > Components: wicket >Reporter: Igor Vaynberg >Assignee: Igor Vaynberg >Priority: Minor > Fix For: 8.3.0, 9.0.0, 7.12.0 > > > Such a listener will be useful for implementing application-wide styling as > well as outputting debug information. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[wicket] 02/02: WICKET-6626 Update OnComponentTagListenerTest to JUnit 5
This is an automated email from the ASF dual-hosted git repository. mgrigorov pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/wicket.git commit 5c6fe2ea31cddbf3efb384347e2b073867379c55 Author: Martin Tzvetanov Grigorov AuthorDate: Fri Jan 4 08:02:21 2019 +0200 WICKET-6626 Update OnComponentTagListenerTest to JUnit 5 --- .../java/org/apache/wicket/OnComponentTagListenerTest.java | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wicket-core/src/test/java/org/apache/wicket/OnComponentTagListenerTest.java b/wicket-core/src/test/java/org/apache/wicket/OnComponentTagListenerTest.java index 23af5a2..0a588a0 100644 --- a/wicket-core/src/test/java/org/apache/wicket/OnComponentTagListenerTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/OnComponentTagListenerTest.java @@ -16,7 +16,7 @@ */ package org.apache.wicket; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.apache.commons.collections4.MultiSet; import org.apache.commons.collections4.multiset.HashMultiSet; @@ -28,18 +28,18 @@ import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.StringResourceStream; import org.apache.wicket.util.tester.WicketTestCase; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Tests {@link IOnComponentTagListener} * * @author Igor Vaynberg (ivaynberg) */ -public class OnComponentTagListenerTest extends WicketTestCase { +class OnComponentTagListenerTest extends WicketTestCase { @Test - public void multipleListeners() { + void multipleListeners() { TestListener listener1 = new TestListener(); TestListener listener2 = new TestListener(); tester.getApplication().getOnComponentTagListeners().add(listener1); @@ -58,7 +58,7 @@ public class OnComponentTagListenerTest extends WicketTestCase { } @Test - public void visibility() { + void visibility() { TestListener listener = new TestListener(); tester.getApplication().getOnComponentTagListeners().add(listener); @@ -72,10 +72,10 @@ public class OnComponentTagListenerTest extends WicketTestCase { } @Test - public void calledEvenIfNoSuper() { + void calledEvenIfNoSuper() { class DoesntCallSuper extends WebMarkupContainer { - public DoesntCallSuper(String id) { + private DoesntCallSuper(String id) { super(id); }
[wicket] 01/02: WICKET-6626 Mark IOnComponentTagListener as a @FunctionalInterface
This is an automated email from the ASF dual-hosted git repository. mgrigorov pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/wicket.git commit 989148e7a470b3364ceb537040b8c6d45bd99b8d Author: Martin Tzvetanov Grigorov AuthorDate: Fri Jan 4 07:56:46 2019 +0200 WICKET-6626 Mark IOnComponentTagListener as a @FunctionalInterface Fix javadoc - Component#onComponentTag() is not visible here (cherry picked from commit 91d0350197209fa95fa60366300fc79c646cdde0) --- .../java/org/apache/wicket/application/IOnComponentTagListener.java| 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java b/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java index 21be8f7..a2d15fd 100644 --- a/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java +++ b/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java @@ -25,9 +25,10 @@ import org.apache.wicket.markup.ComponentTag; * * @author Igor Vaynberg (ivaynberg) */ +@FunctionalInterface public interface IOnComponentTagListener { /** -* Called before {@link Component#onComponentTag(ComponentTag)} +* Called before Component#onComponentTag(ComponentTag) * * @param component * the component whose tag is being modified
[wicket] branch master updated (e5f9c94 -> 5c6fe2e)
This is an automated email from the ASF dual-hosted git repository. mgrigorov pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/wicket.git. from e5f9c94 WICKET-6626 - application wide Component#onComponentTag listeners - fix imports new 989148e WICKET-6626 Mark IOnComponentTagListener as a @FunctionalInterface new 5c6fe2e WICKET-6626 Update OnComponentTagListenerTest to JUnit 5 The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../apache/wicket/application/IOnComponentTagListener.java | 3 ++- .../java/org/apache/wicket/OnComponentTagListenerTest.java | 14 +++--- 2 files changed, 9 insertions(+), 8 deletions(-)
[wicket] branch wicket-8.x updated: WICKET-6626 Mark IOnComponentTagListener as a @FunctionalInterface
This is an automated email from the ASF dual-hosted git repository. mgrigorov pushed a commit to branch wicket-8.x in repository https://gitbox.apache.org/repos/asf/wicket.git The following commit(s) were added to refs/heads/wicket-8.x by this push: new 91d0350 WICKET-6626 Mark IOnComponentTagListener as a @FunctionalInterface 91d0350 is described below commit 91d0350197209fa95fa60366300fc79c646cdde0 Author: Martin Tzvetanov Grigorov AuthorDate: Fri Jan 4 07:56:46 2019 +0200 WICKET-6626 Mark IOnComponentTagListener as a @FunctionalInterface Fix javadoc - Component#onComponentTag() is not visible here --- .../java/org/apache/wicket/application/IOnComponentTagListener.java| 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java b/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java index 21be8f7..a2d15fd 100644 --- a/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java +++ b/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java @@ -25,9 +25,10 @@ import org.apache.wicket.markup.ComponentTag; * * @author Igor Vaynberg (ivaynberg) */ +@FunctionalInterface public interface IOnComponentTagListener { /** -* Called before {@link Component#onComponentTag(ComponentTag)} +* Called before Component#onComponentTag(ComponentTag) * * @param component * the component whose tag is being modified
[jira] [Commented] (WICKET-6626) Introduce application-wide Component#onComponentTag listeners
[ https://issues.apache.org/jira/browse/WICKET-6626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16733838#comment-16733838 ] ASF subversion and git services commented on WICKET-6626: - Commit 91d0350197209fa95fa60366300fc79c646cdde0 in wicket's branch refs/heads/wicket-8.x from Martin Tzvetanov Grigorov [ https://gitbox.apache.org/repos/asf?p=wicket.git;h=91d0350 ] WICKET-6626 Mark IOnComponentTagListener as a @FunctionalInterface Fix javadoc - Component#onComponentTag() is not visible here > Introduce application-wide Component#onComponentTag listeners > - > > Key: WICKET-6626 > URL: https://issues.apache.org/jira/browse/WICKET-6626 > Project: Wicket > Issue Type: New Feature > Components: wicket >Reporter: Igor Vaynberg >Assignee: Igor Vaynberg >Priority: Minor > Fix For: 8.3.0, 9.0.0, 7.12.0 > > > Such a listener will be useful for implementing application-wide styling as > well as outputting debug information. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (WICKET-6627) Improve web site compliance
Martin Grigorov created WICKET-6627: --- Summary: Improve web site compliance Key: WICKET-6627 URL: https://issues.apache.org/jira/browse/WICKET-6627 Project: Wicket Issue Type: Task Components: site Reporter: Martin Grigorov Improve the compliance of http://wicket.apache.org according to https://whimsy.apache.org/site/ -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WICKET-6626) Introduce application-wide Component#onComponentTag listeners
[ https://issues.apache.org/jira/browse/WICKET-6626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16733685#comment-16733685 ] ASF subversion and git services commented on WICKET-6626: - Commit e5f9c94641a14b5291fbc27536853e053aa342a1 in wicket's branch refs/heads/master from Igor Vaynberg [ https://gitbox.apache.org/repos/asf?p=wicket.git;h=e5f9c94 ] WICKET-6626 - application wide Component#onComponentTag listeners - fix imports > Introduce application-wide Component#onComponentTag listeners > - > > Key: WICKET-6626 > URL: https://issues.apache.org/jira/browse/WICKET-6626 > Project: Wicket > Issue Type: New Feature > Components: wicket >Reporter: Igor Vaynberg >Assignee: Igor Vaynberg >Priority: Minor > Fix For: 8.3.0, 9.0.0, 7.12.0 > > > Such a listener will be useful for implementing application-wide styling as > well as outputting debug information. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[wicket] branch master updated: WICKET-6626 - application wide Component#onComponentTag listeners - fix imports
This is an automated email from the ASF dual-hosted git repository. ivaynberg pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/wicket.git The following commit(s) were added to refs/heads/master by this push: new e5f9c94 WICKET-6626 - application wide Component#onComponentTag listeners - fix imports e5f9c94 is described below commit e5f9c94641a14b5291fbc27536853e053aa342a1 Author: Igor Vaynberg AuthorDate: Thu Jan 3 16:40:48 2019 -0800 WICKET-6626 - application wide Component#onComponentTag listeners - fix imports --- .../src/test/java/org/apache/wicket/OnComponentTagListenerTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wicket-core/src/test/java/org/apache/wicket/OnComponentTagListenerTest.java b/wicket-core/src/test/java/org/apache/wicket/OnComponentTagListenerTest.java index 073e143..23af5a2 100644 --- a/wicket-core/src/test/java/org/apache/wicket/OnComponentTagListenerTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/OnComponentTagListenerTest.java @@ -16,6 +16,8 @@ */ package org.apache.wicket; +import static org.junit.Assert.*; + import org.apache.commons.collections4.MultiSet; import org.apache.commons.collections4.multiset.HashMultiSet; import org.apache.wicket.application.IOnComponentTagListener;
[jira] [Commented] (WICKET-6626) Introduce application-wide Component#onComponentTag listeners
[ https://issues.apache.org/jira/browse/WICKET-6626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16733679#comment-16733679 ] ASF subversion and git services commented on WICKET-6626: - Commit efe30a905335cd6d45baace4dd7d80bef5d78000 in wicket's branch refs/heads/master from Igor Vaynberg [ https://gitbox.apache.org/repos/asf?p=wicket.git;h=efe30a9 ] WICKET-6626 - application wide Component#onComponentTag listeners > Introduce application-wide Component#onComponentTag listeners > - > > Key: WICKET-6626 > URL: https://issues.apache.org/jira/browse/WICKET-6626 > Project: Wicket > Issue Type: New Feature > Components: wicket >Reporter: Igor Vaynberg >Assignee: Igor Vaynberg >Priority: Minor > Fix For: 8.3.0, 9.0.0, 7.12.0 > > > Such a listener will be useful for implementing application-wide styling as > well as outputting debug information. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[wicket] branch wicket-8.x updated: WICKET-6626 - application wide Component#onComponentTag listeners
This is an automated email from the ASF dual-hosted git repository. ivaynberg pushed a commit to branch wicket-8.x in repository https://gitbox.apache.org/repos/asf/wicket.git The following commit(s) were added to refs/heads/wicket-8.x by this push: new a3aa2a6 WICKET-6626 - application wide Component#onComponentTag listeners a3aa2a6 is described below commit a3aa2a6b5a0232757a79d9802f0bf431ec4cee67 Author: Igor Vaynberg AuthorDate: Thu Jan 3 16:27:39 2019 -0800 WICKET-6626 - application wide Component#onComponentTag listeners --- .../main/java/org/apache/wicket/Application.java | 9 ++ .../src/main/java/org/apache/wicket/Component.java | 3 + .../application/IOnComponentTagListener.java | 38 ++ .../OnComponentTagListenerCollection.java | 37 ++ .../apache/wicket/OnComponentTagListenerTest.java | 128 + 5 files changed, 215 insertions(+) diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index 9415afa..5178f3b 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -33,6 +33,7 @@ import org.apache.wicket.application.ComponentOnConfigureListenerCollection; import org.apache.wicket.application.HeaderContributorListenerCollection; import org.apache.wicket.application.IComponentInitializationListener; import org.apache.wicket.application.IComponentInstantiationListener; +import org.apache.wicket.application.OnComponentTagListenerCollection; import org.apache.wicket.core.request.mapper.IMapperContext; import org.apache.wicket.core.util.lang.PropertyResolver; import org.apache.wicket.core.util.lang.WicketObjects; @@ -887,6 +888,8 @@ public abstract class Application implements UnboundListener, IEventSink private final BehaviorInstantiationListenerCollection behaviorInstantiationListeners = new BehaviorInstantiationListenerCollection(); + private final OnComponentTagListenerCollection onComponentTagListeners = new OnComponentTagListenerCollection(); + /** * @return Gets the application's {@link HeaderContributorListenerCollection} */ @@ -927,6 +930,12 @@ public abstract class Application implements UnboundListener, IEventSink return behaviorInstantiationListeners; } + /** +* @return collection of application's on-component-tag listeners +*/ + public final OnComponentTagListenerCollection getOnComponentTagListeners() { + return onComponentTagListeners; + } /** * @return Gets the application's ComponentInstantiationListenerCollection diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java b/wicket-core/src/main/java/org/apache/wicket/Component.java index 4968843..2e1b935 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Component.java +++ b/wicket-core/src/main/java/org/apache/wicket/Component.java @@ -2418,6 +2418,9 @@ public abstract class Component final ComponentTag openTag = markupStream.getTag(); final ComponentTag tag = openTag.mutable(); + // call application-wide tag listeners + getApplication().getOnComponentTagListeners().onComponentTag(this, tag); + // Call any tag handler onComponentTag(tag); diff --git a/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java b/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java new file mode 100644 index 000..21be8f7 --- /dev/null +++ b/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.application; + +import org.apache.wicket.Component; +import org.apache.wicket.markup.ComponentTag; + +/** + * Listener interface that receives messages when components render their tags. Useful for cross-cutting concerns that + * want to output tag attribute or otherwise modify component tags. + * + * @author Igor Vaynberg (iv
[wicket] branch master updated: WICKET-6626 - application wide Component#onComponentTag listeners
This is an automated email from the ASF dual-hosted git repository. ivaynberg pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/wicket.git The following commit(s) were added to refs/heads/master by this push: new efe30a9 WICKET-6626 - application wide Component#onComponentTag listeners efe30a9 is described below commit efe30a905335cd6d45baace4dd7d80bef5d78000 Author: Igor Vaynberg AuthorDate: Thu Jan 3 16:27:39 2019 -0800 WICKET-6626 - application wide Component#onComponentTag listeners --- .../main/java/org/apache/wicket/Application.java | 9 ++ .../src/main/java/org/apache/wicket/Component.java | 3 + .../application/IOnComponentTagListener.java | 38 ++ .../OnComponentTagListenerCollection.java | 37 ++ .../apache/wicket/OnComponentTagListenerTest.java | 128 + 5 files changed, 215 insertions(+) diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index 4ba6e05..c97c582 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -33,6 +33,7 @@ import org.apache.wicket.application.ComponentOnConfigureListenerCollection; import org.apache.wicket.application.HeaderContributorListenerCollection; import org.apache.wicket.application.IComponentInitializationListener; import org.apache.wicket.application.IComponentInstantiationListener; +import org.apache.wicket.application.OnComponentTagListenerCollection; import org.apache.wicket.core.request.mapper.IMapperContext; import org.apache.wicket.core.util.lang.PropertyResolver; import org.apache.wicket.core.util.lang.WicketObjects; @@ -889,6 +890,8 @@ public abstract class Application implements UnboundListener, IEventSink, IMetad private final BehaviorInstantiationListenerCollection behaviorInstantiationListeners = new BehaviorInstantiationListenerCollection(); + private final OnComponentTagListenerCollection onComponentTagListeners = new OnComponentTagListenerCollection(); + /** * @return Gets the application's {@link HeaderContributorListenerCollection} */ @@ -929,6 +932,12 @@ public abstract class Application implements UnboundListener, IEventSink, IMetad return behaviorInstantiationListeners; } + /** +* @return collection of application's on-component-tag listeners +*/ + public final OnComponentTagListenerCollection getOnComponentTagListeners() { + return onComponentTagListeners; + } /** * @return Gets the application's ComponentInstantiationListenerCollection diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java b/wicket-core/src/main/java/org/apache/wicket/Component.java index 0a90016..9c191a8 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Component.java +++ b/wicket-core/src/main/java/org/apache/wicket/Component.java @@ -2420,6 +2420,9 @@ public abstract class Component final ComponentTag openTag = markupStream.getTag(); final ComponentTag tag = openTag.mutable(); + // call application-wide tag listeners + getApplication().getOnComponentTagListeners().onComponentTag(this, tag); + // Call any tag handler onComponentTag(tag); diff --git a/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java b/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java new file mode 100644 index 000..21be8f7 --- /dev/null +++ b/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.application; + +import org.apache.wicket.Component; +import org.apache.wicket.markup.ComponentTag; + +/** + * Listener interface that receives messages when components render their tags. Useful for cross-cutting concerns that + * want to output tag attribute or otherwise modify component tags. + * + * @author Igor Vayn
[jira] [Commented] (WICKET-6626) Introduce application-wide Component#onComponentTag listeners
[ https://issues.apache.org/jira/browse/WICKET-6626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16733678#comment-16733678 ] ASF subversion and git services commented on WICKET-6626: - Commit a3aa2a6b5a0232757a79d9802f0bf431ec4cee67 in wicket's branch refs/heads/wicket-8.x from Igor Vaynberg [ https://gitbox.apache.org/repos/asf?p=wicket.git;h=a3aa2a6 ] WICKET-6626 - application wide Component#onComponentTag listeners > Introduce application-wide Component#onComponentTag listeners > - > > Key: WICKET-6626 > URL: https://issues.apache.org/jira/browse/WICKET-6626 > Project: Wicket > Issue Type: New Feature > Components: wicket >Reporter: Igor Vaynberg >Assignee: Igor Vaynberg >Priority: Minor > Fix For: 8.3.0, 9.0.0, 7.12.0 > > > Such a listener will be useful for implementing application-wide styling as > well as outputting debug information. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WICKET-6626) Introduce application-wide Component#onComponentTag listeners
[ https://issues.apache.org/jira/browse/WICKET-6626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16733677#comment-16733677 ] ASF subversion and git services commented on WICKET-6626: - Commit fdd8517bacc9145e9ec7299245afc3d81794e9db in wicket's branch refs/heads/wicket-7.x from Igor Vaynberg [ https://gitbox.apache.org/repos/asf?p=wicket.git;h=fdd8517 ] WICKET-6626 - application wide Component#onComponentTag listeners > Introduce application-wide Component#onComponentTag listeners > - > > Key: WICKET-6626 > URL: https://issues.apache.org/jira/browse/WICKET-6626 > Project: Wicket > Issue Type: New Feature > Components: wicket >Reporter: Igor Vaynberg >Assignee: Igor Vaynberg >Priority: Minor > Fix For: 8.3.0, 9.0.0, 7.12.0 > > > Such a listener will be useful for implementing application-wide styling as > well as outputting debug information. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (WICKET-6626) Introduce application-wide Component#onComponentTag listeners
Igor Vaynberg created WICKET-6626: - Summary: Introduce application-wide Component#onComponentTag listeners Key: WICKET-6626 URL: https://issues.apache.org/jira/browse/WICKET-6626 Project: Wicket Issue Type: New Feature Components: wicket Reporter: Igor Vaynberg Assignee: Igor Vaynberg Such a listener will be useful for implementing application-wide styling as well as outputting debug information. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[wicket] branch wicket-7.x updated: WICKET-6626 - application wide Component#onComponentTag listeners
This is an automated email from the ASF dual-hosted git repository. ivaynberg pushed a commit to branch wicket-7.x in repository https://gitbox.apache.org/repos/asf/wicket.git The following commit(s) were added to refs/heads/wicket-7.x by this push: new fdd8517 WICKET-6626 - application wide Component#onComponentTag listeners fdd8517 is described below commit fdd8517bacc9145e9ec7299245afc3d81794e9db Author: Igor Vaynberg AuthorDate: Thu Jan 3 16:27:39 2019 -0800 WICKET-6626 - application wide Component#onComponentTag listeners --- .../main/java/org/apache/wicket/Application.java | 9 ++ .../src/main/java/org/apache/wicket/Component.java | 3 + .../application/IOnComponentTagListener.java | 38 ++ .../OnComponentTagListenerCollection.java | 42 +++ .../apache/wicket/OnComponentTagListenerTest.java | 128 + 5 files changed, 220 insertions(+) diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index 22a9971..7502679 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -43,6 +43,7 @@ import org.apache.wicket.application.ComponentOnConfigureListenerCollection; import org.apache.wicket.application.HeaderContributorListenerCollection; import org.apache.wicket.application.IComponentInitializationListener; import org.apache.wicket.application.IComponentInstantiationListener; +import org.apache.wicket.application.OnComponentTagListenerCollection; import org.apache.wicket.core.request.mapper.IMapperContext; import org.apache.wicket.core.util.lang.PropertyResolver; import org.apache.wicket.core.util.lang.WicketObjects; @@ -1058,6 +1059,8 @@ public abstract class Application implements UnboundListener, IEventSink private final BehaviorInstantiationListenerCollection behaviorInstantiationListeners = new BehaviorInstantiationListenerCollection(); + private final OnComponentTagListenerCollection onComponentTagListeners = new OnComponentTagListenerCollection(); + /** * @return Gets the application's {@link HeaderContributorListenerCollection} */ @@ -1098,6 +1101,12 @@ public abstract class Application implements UnboundListener, IEventSink return behaviorInstantiationListeners; } + /** +* @return collection of application's on-component-tag listeners +*/ + public final OnComponentTagListenerCollection getOnComponentTagListeners() { + return onComponentTagListeners; + } /** * @return Gets the application's ComponentInstantiationListenerCollection diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java b/wicket-core/src/main/java/org/apache/wicket/Component.java index 368941a..3a4d0dc 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Component.java +++ b/wicket-core/src/main/java/org/apache/wicket/Component.java @@ -2540,6 +2540,9 @@ public abstract class Component final ComponentTag openTag = markupStream.getTag(); final ComponentTag tag = openTag.mutable(); + // call application-wide tag listeners + getApplication().getOnComponentTagListeners().onComponentTag(this, tag); + // Call any tag handler onComponentTag(tag); diff --git a/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java b/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java new file mode 100644 index 000..21be8f7 --- /dev/null +++ b/wicket-core/src/main/java/org/apache/wicket/application/IOnComponentTagListener.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.application; + +import org.apache.wicket.Component; +import org.apache.wicket.markup.ComponentTag; + +/** + * Listener interface that receives messages when components render their tags. Useful for cross-cutting concerns that + * want to output tag attribute or otherwise modify component tags. + * + * @author Igor Vaynber
[jira] [Updated] (WICKET-6626) Introduce application-wide Component#onComponentTag listeners
[ https://issues.apache.org/jira/browse/WICKET-6626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Vaynberg updated WICKET-6626: -- Fix Version/s: 7.12.0 9.0.0 8.3.0 > Introduce application-wide Component#onComponentTag listeners > - > > Key: WICKET-6626 > URL: https://issues.apache.org/jira/browse/WICKET-6626 > Project: Wicket > Issue Type: New Feature > Components: wicket >Reporter: Igor Vaynberg >Assignee: Igor Vaynberg >Priority: Minor > Fix For: 8.3.0, 9.0.0, 7.12.0 > > > Such a listener will be useful for implementing application-wide styling as > well as outputting debug information. -- This message was sent by Atlassian JIRA (v7.6.3#76005)