Permalink
Browse files

Upgrade to pax-wicket 1.0.1 and Karaf 2.2.8.

git-svn-id: https://svn.apache.org/repos/asf/karaf/webconsole/trunk@1363711 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 3fbeb28 commit 59e3c04aeaf6e562f43072c55926799414162f7d @splatch splatch committed Jul 20, 2012
Showing with 404 additions and 394 deletions.
  1. +2 −1 camel/src/main/java/org/apache/karaf/webconsole/camel/internal/context/CamelContextsPage.java
  2. +11 −13 core/pom.xml
  3. +2 −2 core/src/main/java/org/apache/karaf/webconsole/core/BasePage.java
  4. +19 −21 core/src/main/java/org/apache/karaf/webconsole/core/behavior/BootstrapBehavior.java
  5. +57 −0 core/src/main/java/org/apache/karaf/webconsole/core/behavior/CompositeBehavior.java
  6. +0 −49 core/src/main/java/org/apache/karaf/webconsole/core/behavior/CompositeHeaderContributor.java
  7. +27 −0 core/src/main/java/org/apache/karaf/webconsole/core/behavior/CssBehavior.java
  8. +11 −12 core/src/main/java/org/apache/karaf/webconsole/core/behavior/DraculaBehavior.java
  9. +6 −7 core/src/main/java/org/apache/karaf/webconsole/core/behavior/JQueryBehavior.java
  10. +27 −0 core/src/main/java/org/apache/karaf/webconsole/core/behavior/JavaScriptBehavior.java
  11. +6 −7 core/src/main/java/org/apache/karaf/webconsole/core/behavior/RaphaelBehavior.java
  12. +2 −2 core/src/main/java/org/apache/karaf/webconsole/core/behavior/RemoveAttributeBehavior.java
  13. +2 −2 core/src/main/java/org/apache/karaf/webconsole/core/brand/BrandProvider.java
  14. +12 −13 core/src/main/java/org/apache/karaf/webconsole/core/brand/DefaultBrandProvider.java
  15. +4 −4 core/src/main/java/org/apache/karaf/webconsole/core/conventer/URIConverter.java
  16. +4 −5 core/src/main/java/org/apache/karaf/webconsole/core/conventer/URLConverter.java
  17. +1 −1 core/src/main/java/org/apache/karaf/webconsole/core/conventer/WebConsoleConverterLocator.java
  18. +5 −8 core/src/main/java/org/apache/karaf/webconsole/core/dashboard/DashboardPage.java
  19. +5 −5 core/src/main/java/org/apache/karaf/webconsole/core/internal/LanguagePanel.java
  20. +10 −6 core/src/main/java/org/apache/karaf/webconsole/core/internal/WebConsoleApplication.java
  21. +2 −4 core/src/main/java/org/apache/karaf/webconsole/core/internal/preferences/SystemPreferencesForm.java
  22. +8 −7 core/src/main/java/org/apache/karaf/webconsole/core/navigation/markup/LanguageTopPanel.java
  23. +4 −4 core/src/main/java/org/apache/karaf/webconsole/core/navigation/markup/LogoutLink.java
  24. +5 −5 core/src/main/java/org/apache/karaf/webconsole/core/navigation/markup/NavigationTopPanel.java
  25. +3 −4 core/src/main/java/org/apache/karaf/webconsole/core/page/AvatarImage.java
  26. +2 −2 core/src/main/java/org/apache/karaf/webconsole/core/page/LoginPage.java
  27. +1 −1 core/src/main/java/org/apache/karaf/webconsole/core/page/SecuredPage.java
  28. +1 −1 core/src/main/java/org/apache/karaf/webconsole/core/panel/StaticImagePanel.java
  29. +3 −3 core/src/main/java/org/apache/karaf/webconsole/core/security/HierarchicalRoleCheckingStrategy.java
  30. +1 −1 core/src/main/java/org/apache/karaf/webconsole/core/security/HierarchicalRoles.java
  31. +2 −2 core/src/main/java/org/apache/karaf/webconsole/core/security/JaasWebSession.java
  32. +1 −1 core/src/main/java/org/apache/karaf/webconsole/core/security/KarafJaasWebSession.java
  33. +2 −2 core/src/main/java/org/apache/karaf/webconsole/core/security/SecuredPageLink.java
  34. +3 −2 core/src/main/java/org/apache/karaf/webconsole/core/security/WebConsoleSession.java
  35. +6 −6 core/src/main/java/org/apache/karaf/webconsole/core/table/ActionsPanel.java
  36. +2 −2 core/src/main/java/org/apache/karaf/webconsole/core/util/LinkUtils.java
  37. +3 −3 core/src/test/java/org/apache/karaf/webconsole/core/BasePageTest.java
  38. +5 −0 core/src/test/java/org/apache/karaf/webconsole/core/LoginTest.java
  39. +10 −0 core/src/test/java/org/apache/karaf/webconsole/core/TestInjector.java
  40. +2 −2 core/src/test/java/org/apache/karaf/webconsole/core/WebConsoleTest.java
  41. +1 −1 core/src/test/java/org/apache/karaf/webconsole/core/dashboard/DashboardPageTest.java
  42. +1 −1 core/src/test/java/org/apache/karaf/webconsole/core/page/SecuredPageTest.java
  43. +3 −2 core/src/test/java/org/apache/karaf/webconsole/core/page/SidebarPageTest.java
  44. +3 −2 core/src/test/java/org/apache/karaf/webconsole/core/page/SinglePageTest.java
  45. +3 −1 core/src/test/java/org/apache/karaf/webconsole/core/security/HierarchicalRolesTest.java
  46. +2 −2 core/src/test/java/org/apache/karaf/webconsole/core/test/AlwaysAuthenticatedWebSession.java
  47. +2 −2 cxf/src/main/java/org/apache/karaf/webconsole/cxf/internal/services/CxfBusesActionPanel.java
  48. +2 −1 cxf/src/main/java/org/apache/karaf/webconsole/cxf/internal/services/CxfServicesPage.java
  49. +2 −2 cxf/src/main/java/org/apache/karaf/webconsole/cxf/internal/services/DetailsPage.java
  50. +7 −7 ...es/branding/src/main/java/org/apache/karaf/webconsole/examples/branding/ExampleBrandProvider.java
  51. +1 −1 karaf/admin/src/main/java/org/apache/karaf/webconsole/karaf/admin/create/CreateInstancePage.java
  52. +3 −1 karaf/admin/src/main/java/org/apache/karaf/webconsole/karaf/admin/list/InstancePage.java
  53. +2 −1 karaf/feature/src/main/java/org/apache/karaf/webconsole/karaf/feature/FeaturesProvider.java
  54. +2 −2 karaf/feature/src/main/java/org/apache/karaf/webconsole/karaf/feature/feature/FeaturesPage.java
  55. +13 −11 .../feature/src/main/java/org/apache/karaf/webconsole/karaf/feature/repository/RepositoriesPage.java
  56. +0 −44 manual/pom.xml
  57. +0 −2 ...ueprint/src/main/java/org/apache/karaf/webconsole/osgi/blueprint/BlueprintBundleStateTracker.java
  58. +2 −2 ...rint/src/main/java/org/apache/karaf/webconsole/osgi/blueprint/bundle/BlueprintActionProvider.java
  59. +2 −2 .../src/main/java/org/apache/karaf/webconsole/osgi/blueprint/bundle/BlueprintDecorationProvider.java
  60. +6 −11 osgi/blueprint/src/main/java/org/apache/karaf/webconsole/osgi/blueprint/details/DetailsPage.java
  61. +2 −2 .../main/java/org/apache/karaf/webconsole/osgi/blueprint/navigation/BlueprintNavigationProvider.java
  62. +2 −2 ...lueprint/src/main/java/org/apache/karaf/webconsole/osgi/blueprint/view/BlueprintActionsPanel.java
  63. +3 −3 osgi/config/src/main/java/org/apache/karaf/webconsole/osgi/config/ConfigurationEditPage.java
  64. +2 −2 osgi/config/src/main/java/org/apache/karaf/webconsole/osgi/config/ConfigurationRemovePage.java
  65. +2 −3 osgi/config/src/main/java/org/apache/karaf/webconsole/osgi/config/ConfigurationsPage.java
  66. +2 −2 osgi/config/src/main/java/org/apache/karaf/webconsole/osgi/config/view/ConfigurationRemoveForm.java
  67. +5 −5 .../config/src/main/java/org/apache/karaf/webconsole/osgi/config/view/ConfigurationsActionPanel.java
  68. +1 −1 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/FrameworkPage.java
  69. +3 −3 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/bundle/SingleBundlePage.java
  70. +1 −1 ...e/src/main/java/org/apache/karaf/webconsole/osgi/core/bundle/install/InstallBundleSubmitLink.java
  71. +2 −2 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/bundle/list/DecorationPanel.java
  72. +2 −2 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/bundle/list/link/RefreshLink.java
  73. +2 −2 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/bundle/list/link/ResolveLink.java
  74. +2 −2 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/bundle/list/link/StartLink.java
  75. +2 −2 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/bundle/list/link/StopLink.java
  76. +2 −2 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/bundle/list/link/UninstallLink.java
  77. +2 −2 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/bundle/list/link/UpdateLink.java
  78. +3 −1 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/pkg/HeaderTable.java
  79. +3 −3 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/pkg/SinglePackagePage.java
  80. +1 −1 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/pkg/column/PackagePanel.java
  81. +1 −1 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/pkg/list/PackagePage.java
  82. +3 −1 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/service/ExportServiceTable.java
  83. +3 −1 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/service/ImportServiceTable.java
  84. +2 −2 osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/service/ServiceDetailPage.java
  85. +1 −1 osgi/log/src/main/java/org/apache/karaf/webconsole/osgi/log/LogsPage.java
  86. +2 −3 osgi/scr/src/main/java/org/apache/karaf/webconsole/osgi/scr/ScrDecorationProvider.java
  87. +3 −19 pom.xml
  88. +2 −2 servicemix/src/main/java/org/apache/karaf/webconsole/servicemix/internal/DetailsPage.java
  89. +2 −7 servicemix/src/main/java/org/apache/karaf/webconsole/servicemix/internal/EndpointsPage.java
  90. +1 −1 servicemix/src/main/java/org/apache/karaf/webconsole/servicemix/internal/ExchangeActionsPanel.java
  91. +2 −2 servicemix/src/main/java/org/apache/karaf/webconsole/servicemix/internal/TrackNmrPage.java
  92. +2 −3 web/pom.xml
@@ -17,6 +17,7 @@
package org.apache.karaf.webconsole.camel.internal.context;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
@@ -86,7 +87,7 @@ public int size() {
}
};
- add(new DefaultDataTable<CamelContext>("contexts", columns, provider, 20));
+ add(new DefaultDataTable<CamelContext>("contexts", Arrays.asList(columns), provider, 20));
}
}
View
@@ -42,17 +42,6 @@
<!-- WICKET DEPENDENCIES -->
<dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket</artifactId>
- <version>1.4.18</version>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-extensions</artifactId>
- <version>1.4.18</version>
- </dependency>
-
- <dependency>
<groupId>org.ops4j.pax.wicket</groupId>
<artifactId>org.ops4j.pax.wicket.service</artifactId>
<version>${ops4j.paxwicket.version}</version>
@@ -106,13 +95,22 @@
<Import-Package>
!org.apache.karaf.webconsole.core*,
*,<!-- let bnd import direct dependencies -->
+ org.apache.wicket,
+ org.apache.wicket.util,
+ org.apache.wicket.event,
+ org.apache.wicket.page,
+ org.apache.wicket.request.resource,
+ org.apache.wicket.request.mapper,
+ org.apache.wicket.request.cycle,
+ org.apache.wicket.markup.html,
+ org.apache.wicket.markup.html.basic,
+ org.apache.wicket.protocol.http,
+ org.apache.wicket.request.http,
org.apache.wicket.settings,
org.apache.wicket.session,
org.apache.wicket.util.file,
org.apache.wicket.request,
org.apache.wicket.ajax,
- org.apache.wicket.markup.html.link,
- org.apache.wicket.protocol.http,
<!-- then wicket stuff -->
org.ops4j.pax.wicket.api,
@@ -22,7 +22,7 @@
import org.apache.karaf.webconsole.core.brand.BrandProvider;
import org.apache.karaf.webconsole.core.navigation.markup.LanguageTopPanel;
-import org.apache.wicket.behavior.IBehavior;
+import org.apache.wicket.behavior.Behavior;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
@@ -49,7 +49,7 @@ public BasePage() {
add(new Label("footer", "Apache Karaf Console"));
- for (IBehavior behavior : brandProvider.getBehaviors()) {
+ for (Behavior behavior : brandProvider.getBehaviors()) {
add(behavior);
}
}
@@ -16,17 +16,15 @@
*/
package org.apache.karaf.webconsole.core.behavior;
-import static org.apache.wicket.markup.html.JavascriptPackageResource.getHeaderContribution;
-
-import org.apache.wicket.ResourceReference;
-import org.apache.wicket.markup.html.CSSPackageResource;
-import org.apache.wicket.markup.html.IHeaderContributor;
+import org.apache.wicket.request.resource.CssResourceReference;
+import org.apache.wicket.request.resource.JavaScriptResourceReference;
+import org.apache.wicket.request.resource.ResourceReference;
/**
* A Twitter bootstrap behavior which contains css and javascript resources.
* http://twitter.github.com/bootstrap
*/
-public class BootstrapBehavior extends CompositeHeaderContributor {
+public class BootstrapBehavior extends CompositeBehavior {
private static final long serialVersionUID = 1L;
@@ -35,21 +33,21 @@ public BootstrapBehavior() {
}
@Override
- protected IHeaderContributor[] getOwnHeaderContributors() {
- return new IHeaderContributor[] {
- CSSPackageResource.getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/css/bootstrap.css")),
- getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-alert.js")),
- getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-button.js")),
- getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-carousel.js")),
- getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-collapse.js")),
- getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-dropdown.js")),
- getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-modal.js")),
- getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-scrollspy.js")),
- getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-tab.js")),
- getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-tooltip.js")),
- getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-popover.js")),
- getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-transition.js")),
- getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-typeahead.js"))
+ protected ResourceReference[] getResourceReferences() {
+ return new ResourceReference[] {
+ new CssResourceReference(BootstrapBehavior.class, "bootstrap/css/bootstrap.css"),
+ new JavaScriptResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-alert.js"),
+ new JavaScriptResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-button.js"),
+ new JavaScriptResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-carousel.js"),
+ new JavaScriptResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-collapse.js"),
+ new JavaScriptResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-dropdown.js"),
+ new JavaScriptResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-modal.js"),
+ new JavaScriptResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-scrollspy.js"),
+ new JavaScriptResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-tab.js"),
+ new JavaScriptResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-tooltip.js"),
+ new JavaScriptResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-popover.js"),
+ new JavaScriptResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-transition.js"),
+ new JavaScriptResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-typeahead.js")
};
}
@@ -0,0 +1,57 @@
+/*
+ * 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.karaf.webconsole.core.behavior;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.behavior.Behavior;
+import org.apache.wicket.markup.html.IHeaderResponse;
+import org.apache.wicket.request.resource.CssResourceReference;
+import org.apache.wicket.request.resource.JavaScriptResourceReference;
+import org.apache.wicket.request.resource.ResourceReference;
+
+/**
+ * Composite behavior which collects other resources.
+ */
+public abstract class CompositeBehavior extends Behavior {
+
+ private static final long serialVersionUID = 1L;
+ private Behavior[] behaviors;
+
+ protected CompositeBehavior(Behavior ... behaviors) {
+ this.behaviors = behaviors;
+ }
+
+ protected abstract ResourceReference[] getResourceReferences();
+
+ @Override
+ public void renderHead(Component component, IHeaderResponse response) {
+ for (Behavior behavior : behaviors) {
+ behavior.renderHead(component, response);
+ }
+
+ for (ResourceReference reference : getResourceReferences()) {
+ if (reference instanceof JavaScriptResourceReference) {
+ response.renderJavaScriptReference(reference);
+ } else if (reference instanceof CssResourceReference) {
+ response.renderCSSReference(reference);
+ } else {
+ throw new IllegalArgumentException("Unknown type of resource reference " + reference);
+ }
+ }
+ }
+
+}
@@ -1,49 +0,0 @@
-/*
- * 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.karaf.webconsole.core.behavior;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.wicket.behavior.AbstractHeaderContributor;
-import org.apache.wicket.markup.html.IHeaderContributor;
-
-/**
- * Composite behavior which collects other resources.
- */
-public abstract class CompositeHeaderContributor extends AbstractHeaderContributor {
-
- private static final long serialVersionUID = 1L;
-
- private IHeaderContributor[] contributors;
-
- protected CompositeHeaderContributor(IHeaderContributor ...contributors) {
- this.contributors = contributors;
- }
-
- protected abstract IHeaderContributor[] getOwnHeaderContributors();
-
- @Override
- public final IHeaderContributor[] getHeaderContributors() {
- List<IHeaderContributor> merge = new ArrayList<IHeaderContributor>();
- Collections.addAll(merge, contributors);
- Collections.addAll(merge, getOwnHeaderContributors());
- return merge.toArray(new IHeaderContributor[merge.size()]);
- }
-
-}
@@ -0,0 +1,27 @@
+package org.apache.karaf.webconsole.core.behavior;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.behavior.Behavior;
+import org.apache.wicket.markup.html.IHeaderResponse;
+import org.apache.wicket.request.resource.CssResourceReference;
+
+public class CssBehavior extends Behavior {
+
+ private static final long serialVersionUID = 1L;
+
+ private final CssResourceReference cssResourceReference;
+
+ public CssBehavior(Class<?> pageClass, String resource) {
+ this(new CssResourceReference(pageClass, resource));
+ }
+
+ public CssBehavior(CssResourceReference resourceReference) {
+ this.cssResourceReference = resourceReference;
+ }
+
+ @Override
+ public void renderHead(Component component, IHeaderResponse response) {
+ response.renderCSSReference(cssResourceReference);
+ }
+
+}
@@ -16,30 +16,29 @@
*/
package org.apache.karaf.webconsole.core.behavior;
-import static org.apache.wicket.markup.html.JavascriptPackageResource.getHeaderContribution;
-
-import org.apache.wicket.markup.html.IHeaderContributor;
+import org.apache.wicket.request.resource.JavaScriptResourceReference;
+import org.apache.wicket.request.resource.ResourceReference;
/**
* Dracula graphing library.
* http://www.graphdracula.net/
*/
-public class DraculaBehavior extends CompositeHeaderContributor {
+public class DraculaBehavior extends CompositeBehavior {
private static final long serialVersionUID = 1L;
- public DraculaBehavior() {
+ public DraculaBehavior() {
super(new JQueryBehavior(), new RaphaelBehavior());
}
@Override
- protected IHeaderContributor[] getOwnHeaderContributors() {
- return new IHeaderContributor[] {
- getHeaderContribution(DraculaBehavior.class, "dracula/Curry-1.0.1.js"),
- getHeaderContribution(DraculaBehavior.class, "dracula/seedrandom.js"),
- getHeaderContribution(DraculaBehavior.class, "dracula/dracula_graph.js"),
- getHeaderContribution(DraculaBehavior.class, "dracula/dracula_graffle.js"),
- getHeaderContribution(DraculaBehavior.class, "dracula/dracula_algorithms.js"),
+ protected ResourceReference[] getResourceReferences() {
+ return new ResourceReference[] {
+ new JavaScriptResourceReference(DraculaBehavior.class, "dracula/Curry-1.0.1.js"),
+ new JavaScriptResourceReference(DraculaBehavior.class, "dracula/seedrandom.js"),
+ new JavaScriptResourceReference(DraculaBehavior.class, "dracula/dracula_graph.js"),
+ new JavaScriptResourceReference(DraculaBehavior.class, "dracula/dracula_graffle.js"),
+ new JavaScriptResourceReference(DraculaBehavior.class, "dracula/dracula_algorithms.js"),
};
}
}
@@ -16,22 +16,21 @@
*/
package org.apache.karaf.webconsole.core.behavior;
-import org.apache.wicket.behavior.AbstractHeaderContributor;
-import org.apache.wicket.markup.html.IHeaderContributor;
-import org.apache.wicket.markup.html.JavascriptPackageResource;
+import org.apache.wicket.request.resource.JavaScriptResourceReference;
+import org.apache.wicket.request.resource.ResourceReference;
/**
* JQuery behavior. http://jquery.com
*/
-public class JQueryBehavior extends AbstractHeaderContributor {
+public class JQueryBehavior extends CompositeBehavior {
private static final long serialVersionUID = 1L;
@Override
- public IHeaderContributor[] getHeaderContributors() {
- return new IHeaderContributor[] {
- JavascriptPackageResource.getHeaderContribution(JQueryBehavior.class, "jquery/jquery-1.7.1.min.js")
+ protected ResourceReference[] getResourceReferences() {
+ return new ResourceReference[] {
+ new JavaScriptResourceReference(JQueryBehavior.class, "jquery/jquery-1.7.1.min.js")
};
}
@@ -0,0 +1,27 @@
+package org.apache.karaf.webconsole.core.behavior;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.behavior.Behavior;
+import org.apache.wicket.markup.html.IHeaderResponse;
+import org.apache.wicket.request.resource.JavaScriptResourceReference;
+
+public class JavaScriptBehavior extends Behavior {
+
+ private static final long serialVersionUID = 1L;
+
+ private final JavaScriptResourceReference javaScriptResourceReference;
+
+ public JavaScriptBehavior(Class<?> pageClass, String resource) {
+ this(new JavaScriptResourceReference(pageClass, resource));
+ }
+
+ public JavaScriptBehavior(JavaScriptResourceReference resourceReference) {
+ this.javaScriptResourceReference = resourceReference;
+ }
+
+ @Override
+ public void renderHead(Component component, IHeaderResponse response) {
+ response.renderCSSReference(javaScriptResourceReference);
+ }
+
+}
Oops, something went wrong.

0 comments on commit 59e3c04

Please sign in to comment.