Upgrade to Pax-Wicket 2.0.1 and Wicket 6.2.0
authorŁukasz Dywicki <ldywicki@apache.org>
Fri, 28 Dec 2012 13:15:06 +0000 (13:15 +0000)
committerŁukasz Dywicki <ldywicki@apache.org>
Fri, 28 Dec 2012 13:15:06 +0000 (13:15 +0000)
Signed-off-by: Lukasz Dywicki <luke@code-house.org>
git-svn-id: https://svn.apache.org/repos/asf/karaf/webconsole/trunk@1426499 13f79535-47bb-0310-9956-ffa450edef68

59 files changed:
assembly/src/main/resources/features.xml
camel/src/main/java/org/apache/karaf/webconsole/camel/internal/context/CamelContextsDataProvider.java
camel/src/main/java/org/apache/karaf/webconsole/camel/internal/context/CamelContextsPage.java
core/pom.xml
core/src/main/java/org/apache/karaf/webconsole/core/behavior/CompositeBehavior.java
core/src/main/java/org/apache/karaf/webconsole/core/behavior/CssBehavior.java
core/src/main/java/org/apache/karaf/webconsole/core/behavior/JavaScriptBehavior.java
core/src/main/java/org/apache/karaf/webconsole/core/form/LabelBorder.java
core/src/main/java/org/apache/karaf/webconsole/core/table/OrdinalColumn.java
core/src/main/java/org/apache/karaf/webconsole/core/table/PropertyColumnExt.java
core/src/main/java/org/apache/karaf/webconsole/core/table/SortablePropertyColumnExt.java
core/src/main/java/org/apache/karaf/webconsole/core/table/advanced/AdvancedDataProvider.java [new file with mode: 0644]
core/src/main/java/org/apache/karaf/webconsole/core/table/advanced/BaseDataProvider.java [new file with mode: 0644]
core/src/main/java/org/apache/karaf/webconsole/core/table/advanced/BaseDataTable.java [new file with mode: 0644]
core/src/main/java/org/apache/karaf/webconsole/core/table/map/MapDataProvider.java
core/src/main/java/org/apache/karaf/webconsole/core/table/map/MapDataTable.java
core/src/main/resources/org/apache/karaf/webconsole/core/dashboard/wicket-package.properties [moved from core/src/main/resources/org/apache/karaf/webconsole/core/dashboard/package.properties with 100% similarity]
core/src/main/resources/org/apache/karaf/webconsole/core/wicket-package.properties [moved from core/src/main/resources/org/apache/karaf/webconsole/core/package.properties with 100% similarity]
cxf/src/main/java/org/apache/karaf/webconsole/cxf/internal/services/CxfServicesPage.java
karaf/admin/src/main/java/org/apache/karaf/webconsole/karaf/admin/list/InstancePage.java
karaf/admin/src/main/java/org/apache/karaf/webconsole/karaf/admin/model/InstanceDataProvider.java
karaf/feature/src/main/java/org/apache/karaf/webconsole/karaf/feature/FeaturesProvider.java
karaf/feature/src/main/java/org/apache/karaf/webconsole/karaf/feature/RepositoriesProvider.java
karaf/feature/src/main/java/org/apache/karaf/webconsole/karaf/feature/feature/FeaturesPage.java
karaf/feature/src/main/java/org/apache/karaf/webconsole/karaf/feature/model/RepositoryModel.java
karaf/feature/src/main/java/org/apache/karaf/webconsole/karaf/feature/repository/RepositoriesPage.java
osgi/blueprint/src/main/java/org/apache/karaf/webconsole/osgi/blueprint/BlueprintDataProvider.java
osgi/blueprint/src/main/java/org/apache/karaf/webconsole/osgi/blueprint/bundle/BlueprintColumn.java
osgi/blueprint/src/main/java/org/apache/karaf/webconsole/osgi/blueprint/bundle/BlueprintColumnProvider.java
osgi/blueprint/src/main/java/org/apache/karaf/webconsole/osgi/blueprint/view/BlueprintDataTable.java
osgi/blueprint/src/main/java/org/apache/karaf/webconsole/osgi/blueprint/view/ServiceReferencePropertyColumn.java
osgi/config/src/main/java/org/apache/karaf/webconsole/osgi/config/ConfigurationProvider.java
osgi/config/src/main/java/org/apache/karaf/webconsole/osgi/config/view/ConfigurationsDataTable.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/bundle/list/BundlePage.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/pkg/ExportPackageTable.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/pkg/HeaderDataProvider.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/pkg/HeaderTable.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/pkg/ImportPackageTable.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/pkg/list/PackageDataProvider.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/pkg/list/PackagePage.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/service/ExportServiceTable.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/service/ImportServiceTable.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/service/column/ObjectClassColumn.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/service/column/ServiceProviderColumn.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/service/list/ServicePage.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/shared/BundleDataProvider.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/shared/ServiceDataProvider.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/shared/ServiceReferenceModel.java
osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/spi/IColumnProvider.java
osgi/core/src/main/resources/org/apache/karaf/webconsole/osgi/core/wicket-package.properties [moved from osgi/core/src/main/resources/org/apache/karaf/webconsole/osgi/core/package.properties with 100% similarity]
osgi/event/src/main/java/org/apache/karaf/webconsole/osgi/event/EventsPage.java
osgi/event/src/main/java/org/apache/karaf/webconsole/osgi/event/model/EventTopicsProvider.java
osgi/log/src/main/java/org/apache/karaf/webconsole/osgi/log/LogEntriesDataProvider.java
osgi/log/src/main/java/org/apache/karaf/webconsole/osgi/log/LogsPage.java
osgi/scr/src/main/java/org/apache/karaf/webconsole/osgi/scr/ScrColumn.java
osgi/scr/src/main/java/org/apache/karaf/webconsole/osgi/scr/ScrColumnProvider.java
pom.xml
servicemix/src/main/java/org/apache/karaf/webconsole/servicemix/internal/EndpointsPage.java
servicemix/src/main/java/org/apache/karaf/webconsole/servicemix/internal/TrackNmrPage.java

index 3c59027..528385f 100644 (file)
@@ -33,7 +33,9 @@
   <!-- Pax-Wicket Core Feature; loading all required features. Do a feature:install paxwicket and you're ready to go -->
   <feature name="webconsole-core" version="${project.version}" description="Karaf WebConsole Core">
     <details>The Webconsole core package provides the base view required for all bundles</details>
-    <feature>wicket-spring</feature>
+    <feature version="${wicket.version}">wicket</feature>
+    <feature version="${pax-wicket.version}">pax-wicket</feature>
+    <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.cglib/2.2.2_1</bundle>
     <bundle>mvn:org.apache.felix/org.apache.felix.prefs/${felix-prefs.version}</bundle>
     <bundle>mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.core/${project.version}</bundle>
   </feature>
index 10b43f6..61be19a 100644 (file)
@@ -21,13 +21,13 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.apache.camel.CamelContext;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
 import org.apache.wicket.model.IModel;
 
 /**
  * Camel context list data provider.
  */
-public class CamelContextsDataProvider extends SortableDataProvider<CamelContext> {
+public class CamelContextsDataProvider extends BaseDataProvider<CamelContext> {
 
     private static final long serialVersionUID = 1L;
 
@@ -37,11 +37,11 @@ public class CamelContextsDataProvider extends SortableDataProvider<CamelContext
         this.contexts = contexts;
     }
 
-    public Iterator<? extends CamelContext> iterator(int first, int count) {
-        return new ArrayList<CamelContext>(contexts).subList(first, first + count).iterator();
+    public Iterator<? extends CamelContext> iterator(long first, long count) {
+        return new ArrayList<CamelContext>(contexts).subList((int) first, (int) first + (int) count).iterator();
     }
 
-    public int size() {
+    public long size() {
         return contexts.size();
     }
 
index 8de1dac..eb44a58 100644 (file)
@@ -24,9 +24,9 @@ import org.apache.karaf.webconsole.camel.internal.CamelPage;
 import org.apache.karaf.webconsole.camel.internal.tracking.TraceContainer;
 import org.apache.karaf.webconsole.core.table.OrdinalColumn;
 import org.apache.karaf.webconsole.core.table.PropertyColumnExt;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.repeater.Item;
@@ -52,30 +52,30 @@ public class CamelContextsPage extends CamelPage {
     @SuppressWarnings("unchecked")
     public CamelContextsPage() {
         @SuppressWarnings("serial")
-        IColumn<CamelContext>[] columns = new IColumn[] {
+        IColumn<CamelContext, String>[] columns = new IColumn[] {
             new OrdinalColumn<CamelContext>(),
             new PropertyColumnExt<CamelContext>("Name", "name"),
             new PropertyColumnExt<CamelContext>("Version", "version"),
             new PropertyColumnExt<CamelContext>("Status", "status"),
             new PropertyColumnExt<CamelContext>("Uptime", "uptime"),
-            new AbstractColumn<CamelContext>(Model.of("Message preview")) {
+            new AbstractColumn<CamelContext, String>(Model.of("Message preview")) {
                 public void populateItem(Item<ICellPopulator<CamelContext>> cellItem, String componentId, IModel<CamelContext> rowModel) {
                     cellItem.add(new Label(componentId, "" + container.isTracePossible(rowModel.getObject())));
                 }
             },
-            new AbstractColumn<CamelContext>(Model.of("Tracing enabled")) {
+            new AbstractColumn<CamelContext, String>(Model.of("Tracing enabled")) {
                 public void populateItem(Item<ICellPopulator<CamelContext>> cellItem, String componentId, IModel<CamelContext> rowModel) {
                     cellItem.add(new Label(componentId, "" + container.isTraced(rowModel.getObject())));
                 }
             },
-            new AbstractColumn<CamelContext>(Model.of("Operations")) {
+            new AbstractColumn<CamelContext, String>(Model.of("Operations")) {
                 public void populateItem(Item<ICellPopulator<CamelContext>> cellItem, String componentId, IModel<CamelContext> rowModel) {
                     cellItem.add(new ContextActionsPanel(componentId, rowModel));
                 }
             }
         };
 
-        add(new DefaultDataTable<CamelContext>("contexts", Arrays.asList(columns), new CamelContextsDataProvider(contexts), 20));
+        add(new BaseDataTable<CamelContext>("contexts", Arrays.asList(columns), new CamelContextsDataProvider(contexts), 20));
     }
 
 }
index 882cdf9..cc44239 100644 (file)
                         <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.protocol.http,
+                            org.apache.wicket.util,
                             org.apache.wicket.ajax,
+                            org.apache.wicket.page,
+                            org.apache.wicket.core.request.mapper,
 
                             <!-- then wicket stuff -->
                             org.ops4j.pax.wicket.api,
index 9128886..37db747 100644 (file)
@@ -18,7 +18,9 @@ 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.markup.head.CssHeaderItem;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
 import org.apache.wicket.request.resource.CssResourceReference;
 import org.apache.wicket.request.resource.JavaScriptResourceReference;
 import org.apache.wicket.request.resource.ResourceReference;
@@ -45,9 +47,9 @@ public abstract class CompositeBehavior extends Behavior {
 
         for (ResourceReference reference : getResourceReferences()) {
             if (reference instanceof JavaScriptResourceReference) {
-                response.renderJavaScriptReference(reference);
+                response.render(JavaScriptHeaderItem.forReference(reference));
             } else if (reference instanceof CssResourceReference) {
-                response.renderCSSReference(reference);
+                response.render(CssHeaderItem.forReference(reference));
             } else {
                 throw new IllegalArgumentException("Unknown type of resource reference " + reference);
             }
index 14fe8c8..af5bc83 100644 (file)
@@ -18,7 +18,8 @@ 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.markup.head.CssHeaderItem;
+import org.apache.wicket.markup.head.IHeaderResponse;
 import org.apache.wicket.request.resource.CssResourceReference;
 
 public class CssBehavior extends Behavior {
@@ -37,7 +38,7 @@ public class CssBehavior extends Behavior {
 
     @Override
     public void renderHead(Component component, IHeaderResponse response) {
-        response.renderCSSReference(cssResourceReference);
+        response.render(CssHeaderItem.forReference(cssResourceReference));
     }
 
 }
index a359465..a4a4975 100644 (file)
@@ -18,7 +18,8 @@ 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.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
 import org.apache.wicket.request.resource.JavaScriptResourceReference;
 
 public class JavaScriptBehavior extends Behavior {
@@ -37,7 +38,7 @@ public class JavaScriptBehavior extends Behavior {
 
     @Override
     public void renderHead(Component component, IHeaderResponse response) {
-        response.renderCSSReference(javaScriptResourceReference);
+        response.render(JavaScriptHeaderItem.forReference(javaScriptResourceReference));
     }
 
 }
index 1239935..918f199 100644 (file)
@@ -57,7 +57,7 @@ public class LabelBorder extends Border {
     protected void onBeforeRender() {
         super.onBeforeRender();
 
-        if (component.getFeedbackMessage() != null) {
+        if (component.getFeedbackMessages() != null) {
             add(new AttributeAppender("class", Model.of("error"), " "));
         }
     }
index 0fb26b8..1439576 100644 (file)
@@ -22,16 +22,15 @@ import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
 
 /**
  * Column with ordinal number.
  */
-public class OrdinalColumn<T> extends AbstractColumn<T> {
+public class OrdinalColumn<T> extends AbstractColumn<T, String> {
 
     private static final long serialVersionUID = 1L;
 
-    private transient int counter = 1;
-
     public OrdinalColumn(String displayModel, String sortProperty) {
         super(Model.of(displayModel), sortProperty);
     }
@@ -45,12 +44,15 @@ public class OrdinalColumn<T> extends AbstractColumn<T> {
     }
 
     public void populateItem(Item<ICellPopulator<T>> cellItem, String componentId, IModel<T> rowModel) {
-        cellItem.add(new Label(componentId, "" + counter++));
+        cellItem.add(new Label(componentId, new PropertyModel<Integer>(cellItem, "parent.parent.index") {
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public Integer getObject() {
+                // start counting from 1, not from 0
+                return super.getObject() + 1;
+            }
+        }));
     }
 
-    @Override
-    public void detach() {
-        super.detach();
-        counter = 1;
-    }
 }
index 42cdeb7..49be1b0 100644 (file)
@@ -24,7 +24,7 @@ import org.apache.wicket.model.Model;
  *
  * @param <T> Type of displayed data.
  */
-public class PropertyColumnExt<T> extends PropertyColumn<T> {
+public class PropertyColumnExt<T> extends PropertyColumn<T, String> {
 
     private static final long serialVersionUID = 1L;
 
index 77ffa7b..44d67a1 100644 (file)
@@ -24,7 +24,7 @@ import org.apache.wicket.model.Model;
  *
  * @param <T> Type of displayed data.
  */
-public class SortablePropertyColumnExt<T> extends PropertyColumn<T> {
+public class SortablePropertyColumnExt<T> extends PropertyColumn<T, String> {
 
     private static final long serialVersionUID = 1L;
 
diff --git a/core/src/main/java/org/apache/karaf/webconsole/core/table/advanced/AdvancedDataProvider.java b/core/src/main/java/org/apache/karaf/webconsole/core/table/advanced/AdvancedDataProvider.java
new file mode 100644 (file)
index 0000000..71ffe1d
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * 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.table.advanced;
+
+import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
+
+/**
+ * Marker interface for data providers.
+ *
+ * @param <T> Type of the model.
+ */
+public interface AdvancedDataProvider<T> extends ISortableDataProvider<T, String> {
+
+}
diff --git a/core/src/main/java/org/apache/karaf/webconsole/core/table/advanced/BaseDataProvider.java b/core/src/main/java/org/apache/karaf/webconsole/core/table/advanced/BaseDataProvider.java
new file mode 100644 (file)
index 0000000..956dd06
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * 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.table.advanced;
+
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+
+/**
+ * Base class for data providers.
+ *
+ * @param <T> Type of model.
+ */
+public abstract class BaseDataProvider<T> extends SortableDataProvider<T, String> implements AdvancedDataProvider<T> {
+
+    private static final long serialVersionUID = 1L;
+
+}
diff --git a/core/src/main/java/org/apache/karaf/webconsole/core/table/advanced/BaseDataTable.java b/core/src/main/java/org/apache/karaf/webconsole/core/table/advanced/BaseDataTable.java
new file mode 100644 (file)
index 0000000..a948a03
--- /dev/null
@@ -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.karaf.webconsole.core.table.advanced;
+
+import java.util.List;
+
+import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+
+/**
+ * Base class for data tables.
+ *
+ * @param <T> Type of model.
+ */
+public class BaseDataTable<T> extends DefaultDataTable<T, String> {
+
+    private static final long serialVersionUID = 1L;
+
+    public BaseDataTable(String id, List<IColumn<T, String>> columns, AdvancedDataProvider<T> dataProvider,
+        int rowsPerPage) {
+        super(id, columns, dataProvider, rowsPerPage);
+    }
+
+}
index f638553..0908cd8 100644 (file)
@@ -21,7 +21,7 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
 import org.apache.wicket.model.IModel;
 
 /**
@@ -30,7 +30,7 @@ import org.apache.wicket.model.IModel;
  * @param <K> Key type.
  * @param <V> Value type.
  */
-public class MapDataProvider<K, V> extends SortableDataProvider<Entry<K, V>> {
+public class MapDataProvider<K, V> extends BaseDataProvider<Entry<K, V>> {
 
     private static final long serialVersionUID = 1L;
 
@@ -40,11 +40,11 @@ public class MapDataProvider<K, V> extends SortableDataProvider<Entry<K, V>> {
         this.map = map;
     }
 
-    public Iterator<? extends Entry<K, V>> iterator(int first, int count) {
-        return new ArrayList<Entry<K, V>>(map.entrySet()).subList(first, first + count).iterator();
+    public Iterator<? extends Entry<K, V>> iterator(long first, long count) {
+        return new ArrayList<Entry<K, V>>(map.entrySet()).subList((int) first, (int) (first + count)).iterator();
     }
 
-    public int size() {
+    public long size() {
         return map.size();
     }
 
index e5b5b08..895b9dc 100644 (file)
@@ -21,9 +21,9 @@ import java.util.Map.Entry;
 
 import org.apache.karaf.webconsole.core.table.OrdinalColumn;
 import org.apache.karaf.webconsole.core.table.PropertyColumnExt;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
+import org.apache.karaf.webconsole.core.table.advanced.AdvancedDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
 import org.apache.wicket.markup.repeater.data.IDataProvider;
 
 /**
@@ -32,21 +32,21 @@ import org.apache.wicket.markup.repeater.data.IDataProvider;
  * @param <K> Key type.
  * @param <V> Value type.
  */
-public class MapDataTable<K, V> extends DefaultDataTable<Entry<K, V>> {
+public class MapDataTable<K, V> extends BaseDataTable<Entry<K, V>> {
 
     private static final long serialVersionUID = 1L;
 
-    public MapDataTable(String id, IColumn<Entry<K, V>>[] columns, ISortableDataProvider<Entry<K, V>> dataProvider, int rowsPerPage) {
+    public MapDataTable(String id, IColumn<Entry<K, V>, String>[] columns, AdvancedDataProvider<Entry<K, V>> dataProvider, int rowsPerPage) {
         super(id, Arrays.asList(columns), dataProvider, rowsPerPage);
     }
 
-    public MapDataTable(String id, ISortableDataProvider<Entry<K, V>> dataProvider, int rowsPerPage) {
+    public MapDataTable(String id, AdvancedDataProvider<Entry<K, V>> dataProvider, int rowsPerPage) {
         this(id, getDefaultColumns(dataProvider), dataProvider, rowsPerPage);
     }
 
     @SuppressWarnings("unchecked")
-    static <K,V> IColumn<Entry<K, V>>[] getDefaultColumns(IDataProvider<Entry<K, V>> provider) {
-        IColumn<Entry<K, V>>[] columns = new IColumn[] {
+    static <K,V> IColumn<Entry<K, V>, String>[] getDefaultColumns(IDataProvider<Entry<K, V>> provider) {
+        IColumn<Entry<K, V>, String>[] columns = new IColumn[] {
             new OrdinalColumn<Entry<K, V>>(),
             new PropertyColumnExt<Entry<K, V>>("Key", "key"),
             new PropertyColumnExt<Entry<K, V>>("Value", "value")
index a3c4b09..559342e 100644 (file)
@@ -25,12 +25,12 @@ import org.apache.cxf.Bus;
 import org.apache.karaf.webconsole.core.page.SinglePage;
 import org.apache.karaf.webconsole.core.table.OrdinalColumn;
 import org.apache.karaf.webconsole.core.table.PropertyColumnExt;
+import org.apache.karaf.webconsole.core.table.advanced.AdvancedDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
 import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
@@ -49,22 +49,22 @@ public class CxfServicesPage extends SinglePage {
     @SuppressWarnings("serial")
     public CxfServicesPage() {
         @SuppressWarnings("unchecked")
-        IColumn<Bus>[] columns = new IColumn[] {
+        IColumn<Bus, String>[] columns = new IColumn[] {
             new OrdinalColumn<Bus>(),
             new PropertyColumnExt<Bus>("Bus id", "id"),
-            new AbstractColumn<Bus>(Model.of("Actions")) {
+            new AbstractColumn<Bus, String>(Model.of("Actions")) {
                 public void populateItem(Item<ICellPopulator<Bus>> cellItem, String componentId, IModel<Bus> rowModel) {
                     cellItem.add(new CxfBusesActionPanel(componentId, rowModel));
                 }
             }
         };
 
-        ISortableDataProvider<Bus> provider = new SortableDataProvider<Bus>() {
-            public Iterator<? extends Bus> iterator(int first, int count) {
-                return new ArrayList<Bus>(buses).subList(first, first + count).iterator();
+        AdvancedDataProvider<Bus> provider = new BaseDataProvider<Bus>() {
+            public Iterator<? extends Bus> iterator(long first, long count) {
+                return new ArrayList<Bus>(buses).subList((int) first, (int) first + (int) count).iterator();
             }
 
-            public int size() {
+            public long size() {
                 return buses.size();
             }
 
@@ -73,7 +73,7 @@ public class CxfServicesPage extends SinglePage {
             }
         };
 
-        add(new DefaultDataTable<Bus>("buses", Arrays.asList(columns), provider, 20));
+        add(new BaseDataTable<Bus>("buses", Arrays.asList(columns), provider, 20));
     }
 
 }
index 83a0ce5..4fbe0b4 100644 (file)
@@ -23,11 +23,11 @@ import java.util.Arrays;
 import org.apache.karaf.admin.Instance;
 import org.apache.karaf.webconsole.core.table.OrdinalColumn;
 import org.apache.karaf.webconsole.core.table.PropertyColumnExt;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.karaf.webconsole.karaf.admin.AdminPage;
 import org.apache.karaf.webconsole.karaf.admin.model.InstanceDataProvider;
 import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.model.IModel;
@@ -43,14 +43,14 @@ public class InstancePage extends AdminPage {
 
     @SuppressWarnings("unchecked")
     public InstancePage() {
-        IColumn<Instance>[] columns = new IColumn[] {
+        IColumn<Instance, String>[] columns = new IColumn[] {
             new OrdinalColumn<Instance>(),
             new PropertyColumnExt<Instance>("PID", "pid"),
             new PropertyColumnExt<Instance>("Name", "name"),
             new PropertyColumnExt<Instance>("Root", "root"),
             new PropertyColumnExt<Instance>("State", "state"),
             new PropertyColumnExt<Instance>("Location", "location"),
-            new AbstractColumn<Instance>(of("Actions")) {
+            new AbstractColumn<Instance, String>(of("Actions")) {
                 private static final long serialVersionUID = 1L;
 
                 public void populateItem(Item<ICellPopulator<Instance>> cellItem, String componentId, IModel<Instance> rowModel) {
@@ -59,7 +59,7 @@ public class InstancePage extends AdminPage {
             }
         };
 
-        add(new DefaultDataTable<Instance>("instances", Arrays.asList(columns), new InstanceDataProvider(admin), 20));
+        add(new BaseDataTable<Instance>("instances", Arrays.asList(columns), new InstanceDataProvider(admin), 20));
     }
 
 }
index 80bca50..dbb287f 100644 (file)
@@ -23,13 +23,13 @@ import java.util.List;
 
 import org.apache.karaf.admin.AdminService;
 import org.apache.karaf.admin.Instance;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
 import org.apache.wicket.model.IModel;
 
 /**
  * Data provider for instances list.
  */
-public class InstanceDataProvider extends SortableDataProvider<Instance> {
+public class InstanceDataProvider extends BaseDataProvider<Instance> {
 
     private static final long serialVersionUID = 1L;
 
@@ -39,13 +39,13 @@ public class InstanceDataProvider extends SortableDataProvider<Instance> {
         this.admin = admin;
     }
 
-    public Iterator<? extends Instance> iterator(int first, int count) {
+    public Iterator<? extends Instance> iterator(long first, long count) {
         List<Instance> list = new ArrayList<Instance>();
         Collections.addAll(list, admin.getInstances());
-        return list.subList(first, count).iterator();
+        return list.subList((int) first, (int) count).iterator();
     }
 
-    public int size() {
+    public long size() {
         return admin.getInstances().length;
     }
 
index fa4c397..190a3d1 100644 (file)
@@ -25,14 +25,14 @@ import java.util.List;
 
 import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeaturesService;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
 import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
 import org.apache.wicket.model.IModel;
 
 /**
  * Feature list data provider.
  */
-public class FeaturesProvider extends SortableDataProvider<Feature> {
+public class FeaturesProvider extends BaseDataProvider<Feature> {
 
     private static final long serialVersionUID = 1L;
 
@@ -44,7 +44,7 @@ public class FeaturesProvider extends SortableDataProvider<Feature> {
         setSort("name", SortOrder.ASCENDING);
     }
 
-    public Iterator<Feature> iterator(int first, int count) {
+    public Iterator<Feature> iterator(long first, long count) {
         List<Feature> data = new ArrayList<Feature>();
         try {
             data = Arrays.asList(service.listFeatures());
@@ -69,11 +69,11 @@ public class FeaturesProvider extends SortableDataProvider<Feature> {
                 return 0;
             }
         });
-        return data.subList(first, Math.min(first + count, data.size()))
+        return data.subList((int) first, (int) Math.min(first + count, data.size()))
             .iterator();
     }
 
-    public int size() {
+    public long size() {
         try {
             return service.listFeatures().length;
         } catch (Exception e) {
index 155b130..4e3e446 100644 (file)
@@ -21,14 +21,14 @@ import java.util.Iterator;
 
 import org.apache.karaf.features.FeaturesService;
 import org.apache.karaf.features.Repository;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
 import org.apache.karaf.webconsole.karaf.feature.model.RepositoryModel;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
 import org.apache.wicket.model.IModel;
 
 /**
  * Data provider for repository list.
  */
-public class RepositoriesProvider extends SortableDataProvider<Repository> {
+public class RepositoriesProvider extends BaseDataProvider<Repository> {
 
     private static final long serialVersionUID = 1L;
 
@@ -36,19 +36,19 @@ public class RepositoriesProvider extends SortableDataProvider<Repository> {
 
     public RepositoriesProvider(FeaturesService service) {
         this.service = service;
-
     }
 
-    public Iterator<Repository> iterator(int first, int count) {
+    public Iterator<Repository> iterator(long first, long count) {
         return Arrays.asList(service.listRepositories())
-            .subList(first, first + count).iterator();
+            .subList((int) first, (int) first + (int) count).iterator();
     }
 
-    public int size() {
+    public long size() {
         return service.listRepositories().length;
     }
 
     public IModel<Repository> model(Repository object) {
         return new RepositoryModel(service, object);
     }
-}
\ No newline at end of file
+
+}
index e989728..d52e8d4 100644 (file)
@@ -24,11 +24,11 @@ import java.util.Map;
 import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.Repository;
 import org.apache.karaf.webconsole.core.behavior.CssBehavior;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.karaf.webconsole.karaf.feature.FeaturesProvider;
 import org.apache.karaf.webconsole.karaf.feature.KarafFeaturesPage;
 import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
 import org.apache.wicket.markup.html.basic.Label;
@@ -66,27 +66,27 @@ public class FeaturesPage extends KarafFeaturesPage {
         IModel repository = Model.of("repository");
         IModel description = Model.of("description");
 
-        List<IColumn<Feature>> columns = new ArrayList<IColumn<Feature>>();
-        columns.add(new PropertyColumn<Feature>(new StringResourceModel("table.version", this, version), "version", "version"));
-        columns.add(new PropertyColumn<Feature>(new StringResourceModel("table.name", this, name), "name", "name"));
-        columns.add(new AbstractColumn<Feature>(new StringResourceModel("table.repository", this, repository), "repository") {
+        List<IColumn<Feature, String>> columns = new ArrayList<IColumn<Feature, String>>();
+        columns.add(new PropertyColumn<Feature, String>(new StringResourceModel("table.version", this, version), "version", "version"));
+        columns.add(new PropertyColumn<Feature, String>(new StringResourceModel("table.name", this, name), "name", "name"));
+        columns.add(new AbstractColumn<Feature, String>(new StringResourceModel("table.repository", this, repository), "repository") {
             public void populateItem(Item<ICellPopulator<Feature>> cellItem, String componentId, IModel<Feature> rowModel) {
                 cellItem.add(new Label(componentId, feature2repo.get(rowModel.getObject().getId())));
             }
         });
-        columns.add(new PropertyColumn<Feature>(new StringResourceModel("table.description", this, description), "description", "description"));
-        columns.add(new AbstractColumn<Feature>(new StringResourceModel("table.state", this, state), "state") {
+        columns.add(new PropertyColumn<Feature, String>(new StringResourceModel("table.description", this, description), "description", "description"));
+        columns.add(new AbstractColumn<Feature, String>(new StringResourceModel("table.state", this, state), "state") {
             public void populateItem(Item<ICellPopulator<Feature>> cellItem, String componentId, IModel<Feature> rowModel) {
                 cellItem.add(new Label(componentId, featuresService.isInstalled(rowModel.getObject()) ? "Installed" : "Uninstalled"));
             }
         });
-        columns.add(new AbstractColumn<Feature>(new ResourceModel("table.actions")) {
+        columns.add(new AbstractColumn<Feature, String>(new ResourceModel("table.actions")) {
             public void populateItem(Item<ICellPopulator<Feature>> cellItem, String componentId, IModel<Feature> model) {
                cellItem.add(new FeaturesActionsPanel(componentId, model));
             }
         });
 
-        add(new DefaultDataTable<Feature>("features", columns, new FeaturesProvider(featuresService), 20));
+        add(new BaseDataTable<Feature>("features", columns, new FeaturesProvider(featuresService), 20));
 
     }
 
index 2754a9c..ecf1cdb 100644 (file)
@@ -33,6 +33,7 @@ public class RepositoryModel extends LoadableDetachableModel<Repository> {
     private URI uri;
 
     public RepositoryModel(FeaturesService service, Repository object) {
+        super(object);
         this.service = service;
         this.uri = object.getURI();
     }
index 097fd20..82c66cf 100644 (file)
@@ -20,13 +20,13 @@ import java.util.Arrays;
 
 import org.apache.karaf.features.Repository;
 import org.apache.karaf.webconsole.core.table.OrdinalColumn;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.karaf.webconsole.karaf.feature.KarafFeaturesPage;
 import org.apache.karaf.webconsole.karaf.feature.RepositoriesProvider;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
 import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
 import org.apache.wicket.markup.repeater.Item;
@@ -45,12 +45,12 @@ public class RepositoriesPage extends KarafFeaturesPage {
 
     @SuppressWarnings({"rawtypes", "serial", "unchecked"})
     public RepositoriesPage() {
-        IColumn<Repository>[] columns = new IColumn[] {
+        IColumn<Repository, String>[] columns = new IColumn[] {
             new OrdinalColumn<Repository>(),
-            new PropertyColumn<Repository>(Model.of("name"), "name", "name"),
-            new PropertyColumn<Repository>(Model.of("URI"), "URI", "URI"),
-            new PropertyColumn<Repository>(Model.of("valid"), "valid", "valid"),
-            new AbstractColumn<Repository>(Model.of("Operations")) {
+            new PropertyColumn<Repository, String>(Model.of("name"), "name", "name"),
+            new PropertyColumn<Repository, String>(Model.of("URI"), "URI", "URI"),
+            new PropertyColumn<Repository, String>(Model.of("valid"), "valid", "valid"),
+            new AbstractColumn<Repository, String>(Model.of("Operations")) {
                 public void populateItem(Item<ICellPopulator<Repository>> cellItem, String componentId, IModel<Repository> rowModel) {
                     cellItem.add(new RepositoriesActionPanel(componentId, rowModel));
                 }
@@ -68,7 +68,7 @@ public class RepositoriesPage extends KarafFeaturesPage {
             }
         });
 
-        add(new DefaultDataTable<Repository>("repositories", Arrays.asList(columns), new RepositoriesProvider(featuresService), 20));
+        add(new BaseDataTable<Repository>("repositories", Arrays.asList(columns), new RepositoriesProvider(featuresService), 20));
     }
 
 }
index a39ad63..8effe94 100644 (file)
@@ -20,15 +20,15 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
 import org.apache.karaf.webconsole.osgi.core.shared.ServiceReferenceModel;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
 import org.apache.wicket.model.IModel;
 import org.osgi.framework.ServiceReference;
 
 /**
  * Data provider for bundle list.
  */
-public class BlueprintDataProvider extends SortableDataProvider<ServiceReference> {
+public class BlueprintDataProvider extends BaseDataProvider<ServiceReference> {
 
     private static final long serialVersionUID = 1L;
 
@@ -38,15 +38,15 @@ public class BlueprintDataProvider extends SortableDataProvider<ServiceReference
         this.containers = containers;
     }
 
-    public Iterator<ServiceReference> iterator(int first, int count) {
-        return new ArrayList<ServiceReference>(containers).subList(first, first+count).iterator();
+    public Iterator<ServiceReference> iterator(long first, long count) {
+        return new ArrayList<ServiceReference>(containers).subList((int) first, (int) first + (int) count).iterator();
     }
 
     public IModel<ServiceReference> model(ServiceReference object) {
         return new ServiceReferenceModel(object);
     }
 
-    public int size() {
+    public long size() {
         return containers.size();
     }
 
index 787cc2c..e063d49 100644 (file)
@@ -27,7 +27,7 @@ import org.osgi.framework.Bundle;
 /**
  * Column representing items blueprint state.
  */
-class BlueprintColumn extends AbstractColumn<Bundle> {
+class BlueprintColumn extends AbstractColumn<Bundle, String> {
 
     private static final long serialVersionUID = 1L;
 
index 430dc78..7ea6fa9 100644 (file)
@@ -25,7 +25,7 @@ import org.osgi.framework.Bundle;
  */
 public class BlueprintColumnProvider implements IColumnProvider {
 
-    public IColumn<Bundle> getColumn() {
+    public IColumn<Bundle, String> getColumn() {
         return new BlueprintColumn();
     }
 
index 13c3936..19ef5ac 100644 (file)
@@ -19,10 +19,10 @@ package org.apache.karaf.webconsole.osgi.blueprint.view;
 import java.util.Arrays;
 import java.util.List;
 
+import org.apache.karaf.webconsole.core.table.advanced.AdvancedDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
 import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
@@ -31,16 +31,16 @@ import org.osgi.framework.ServiceReference;
 /**
  * Table with blueprint containers.
  */
-public class BlueprintDataTable extends DefaultDataTable<ServiceReference> {
+public class BlueprintDataTable extends BaseDataTable<ServiceReference> {
 
     private static final long serialVersionUID = 1L;
 
-    @SuppressWarnings({"rawtypes", "unchecked", "serial"})
+    @SuppressWarnings({"rawtypes", "serial"})
     private static final List COLUMNS = Arrays.asList(
         new DefaultServiceReferencePropertyColumn("Id", "service.id"),
         new DefaultServiceReferencePropertyColumn("Container", "osgi.blueprint.container.symbolicname"),
         new DefaultServiceReferencePropertyColumn("Version", "osgi.blueprint.container.version"),
-        new AbstractColumn<ServiceReference>(Model.of("Operations")) {
+        new AbstractColumn<ServiceReference, String>(Model.of("Operations")) {
             public void populateItem(Item<ICellPopulator<ServiceReference>> cellItem, String componentId, IModel<ServiceReference> rowModel) {
                 cellItem.add(new BlueprintActionsPanel(componentId, rowModel));
             }
@@ -48,7 +48,7 @@ public class BlueprintDataTable extends DefaultDataTable<ServiceReference> {
     );
 
     @SuppressWarnings("unchecked")
-    public BlueprintDataTable(String id, ISortableDataProvider<ServiceReference> dataProvider, int rowsPerPage) {
+    public BlueprintDataTable(String id, AdvancedDataProvider<ServiceReference> dataProvider, int rowsPerPage) {
         super(id, COLUMNS, dataProvider, rowsPerPage);
     }
 
index 0841b64..9960c9a 100644 (file)
@@ -27,7 +27,7 @@ import org.osgi.framework.ServiceReference;
 /**
  * Column representing single service reference property.
  */
-public abstract class ServiceReferencePropertyColumn extends AbstractColumn<ServiceReference> {
+public abstract class ServiceReferencePropertyColumn extends AbstractColumn<ServiceReference, String> {
 
     private static final long serialVersionUID = 1L;
 
index a6945f6..ec03494 100644 (file)
@@ -19,9 +19,9 @@ package org.apache.karaf.webconsole.osgi.config;
 import java.util.Arrays;
 import java.util.Iterator;
 
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
 import org.apache.karaf.webconsole.osgi.config.model.ConfigurationModel;
 import org.apache.karaf.webconsole.osgi.config.model.ConfigurationNotFoundException;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
 import org.apache.wicket.model.IModel;
 import org.osgi.service.cm.Configuration;
 import org.osgi.service.cm.ConfigurationAdmin;
@@ -29,7 +29,7 @@ import org.osgi.service.cm.ConfigurationAdmin;
 /**
  * Data provider for configuration list.
  */
-public class ConfigurationProvider extends SortableDataProvider<Configuration> {
+public class ConfigurationProvider extends BaseDataProvider<Configuration> {
 
     private static final long serialVersionUID = 1L;
 
@@ -40,15 +40,15 @@ public class ConfigurationProvider extends SortableDataProvider<Configuration> {
         this.configurationAdmin = configurationAdmin;
     }
 
-    public Iterator<? extends Configuration> iterator(int from, int count) {
-        return Arrays.asList(Arrays.copyOfRange(getConfigurations(), from, from + count)).iterator();
+    public Iterator<? extends Configuration> iterator(long from, long count) {
+        return Arrays.asList(Arrays.copyOfRange(getConfigurations(), (int) from, (int) from + (int) count)).iterator();
     }
 
     public IModel<Configuration> model(Configuration object) {
         return new ConfigurationModel(object, configurationAdmin);
     }
 
-    public int size() {
+    public long size() {
         return getConfigurations().length;
     }
 
index 4911867..ee273e1 100644 (file)
@@ -19,11 +19,11 @@ package org.apache.karaf.webconsole.osgi.config.view;
 import java.util.Arrays;
 import java.util.List;
 
+import org.apache.karaf.webconsole.core.table.PropertyColumnExt;
+import org.apache.karaf.webconsole.core.table.advanced.AdvancedDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
 import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
@@ -33,14 +33,14 @@ import org.osgi.service.cm.ConfigurationAdmin;
 /**
  * Datatable which shows list of configurations from OSGi {@link ConfigurationAdmin}.
  */
-public class ConfigurationsDataTable extends DefaultDataTable<Configuration> {
+public class ConfigurationsDataTable extends BaseDataTable<Configuration> {
 
     private static final long serialVersionUID = 1L;
 
     @SuppressWarnings({"rawtypes", "serial", "unchecked"})
     private static List COLUMNS = Arrays.asList(
-        new PropertyColumn<Configuration>(Model.of("pid"), "pid"),
-        new AbstractColumn<Configuration>(Model.of("operations")) {
+        new PropertyColumnExt<Configuration>("pid"),
+        new AbstractColumn<Configuration, String>(Model.of("operations")) {
             public void populateItem(Item<ICellPopulator<Configuration>> cellItem, String componentId, IModel<Configuration> model) {
                 cellItem.add(new ConfigurationsActionPanel(componentId, model));
             }
@@ -48,13 +48,12 @@ public class ConfigurationsDataTable extends DefaultDataTable<Configuration> {
     );
 
     @SuppressWarnings("unchecked")
-    public ConfigurationsDataTable(String id, ISortableDataProvider<Configuration> dataProvider, int rowsPerPage) {
+    public ConfigurationsDataTable(String id, AdvancedDataProvider<Configuration> dataProvider, int rowsPerPage) {
         super(id, COLUMNS, dataProvider, rowsPerPage);
     }
 
     @Override
-    protected Item<Configuration> newRowItem(String id, int index,
-            IModel<Configuration> model) {
+    protected Item<Configuration> newRowItem(String id, int index, IModel<Configuration> model) {
         Configuration cfg = model.getObject();
 
         if (cfg.getFactoryPid() != null) {
index 33e9ad7..5e589cc 100644 (file)
@@ -22,6 +22,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.karaf.webconsole.core.table.PropertyColumnExt;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.karaf.webconsole.osgi.core.bundle.install.InstallBundlePage;
 import org.apache.karaf.webconsole.osgi.core.shared.BundleDataProvider;
 import org.apache.karaf.webconsole.osgi.core.shared.OsgiPage;
@@ -31,7 +32,6 @@ import org.apache.karaf.webconsole.osgi.core.spi.IDecorationProvider;
 import org.apache.wicket.Page;
 import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;
@@ -61,8 +61,8 @@ public class BundlePage extends OsgiPage {
     private StartLevel startLevel;
 
     public BundlePage() {
-        List<IColumn<Bundle>> columns = new ArrayList<IColumn<Bundle>>();
-        columns.add(new AbstractColumn<Bundle>(of("")) {
+        List<IColumn<Bundle, String>> columns = new ArrayList<IColumn<Bundle, String>>();
+        columns.add(new AbstractColumn<Bundle, String>(of("")) {
             private static final long serialVersionUID = 1L;
 
             public void populateItem(Item<ICellPopulator<Bundle>> cellItem, final String componentId, final IModel<Bundle> rowModel) {
@@ -70,7 +70,7 @@ public class BundlePage extends OsgiPage {
             }
         });
         columns.add(new PropertyColumnExt<Bundle>("Bundle Id", "bundleId"));
-        columns.add(new AbstractColumn<Bundle>(of("State")) {
+        columns.add(new AbstractColumn<Bundle, String>(of("State")) {
             private static final long serialVersionUID = 1L;
 
             public void populateItem(Item<ICellPopulator<Bundle>> cellItem, final String componentId, final IModel<Bundle> rowModel) {
@@ -78,7 +78,7 @@ public class BundlePage extends OsgiPage {
             }
             
         });
-        columns.add(new AbstractColumn<Bundle>(of("Start level")) {
+        columns.add(new AbstractColumn<Bundle, String>(of("Start level")) {
             private static final long serialVersionUID = 1L;
 
             public void populateItem(Item<ICellPopulator<Bundle>> cellItem, final String componentId, final IModel<Bundle> rowModel) {
@@ -93,7 +93,7 @@ public class BundlePage extends OsgiPage {
 
         columns.add(new PropertyColumnExt<Bundle>("Name", "symbolicName"));
         columns.add(new PropertyColumnExt<Bundle>("Version", "version.toString"));
-        columns.add(new AbstractColumn<Bundle>(Model.of("Operations")) {
+        columns.add(new AbstractColumn<Bundle, String>(Model.of("Operations")) {
             private static final long serialVersionUID = 1L;
 
             public void populateItem(Item<ICellPopulator<Bundle>> cellItem, final String componentId, final IModel<Bundle> rowModel) {
@@ -101,7 +101,7 @@ public class BundlePage extends OsgiPage {
             }
         });
 
-        add(new DefaultDataTable<Bundle>("bundles", columns, new BundleDataProvider(context), 100));
+        add(new BaseDataTable<Bundle>("bundles", columns, new BundleDataProvider(context), 100));
 
         add(new BookmarkablePageLink<Page>("install", InstallBundlePage.class));
     }
index c602ca4..d5b22dd 100644 (file)
@@ -30,7 +30,7 @@ public class ExportPackageTable extends HeaderTable {
        private static final long serialVersionUID = 1L;
 
        @SuppressWarnings("unchecked")
-       static IColumn<Clause>[] columns = new IColumn[] {
+       static IColumn<Clause, String>[] columns = new IColumn[] {
                new OrdinalColumn<Clause>(),
                new PackageColumn("Export"),
 //             new ResolutionColumn("Resolution"),
index a0d9789..7607a57 100644 (file)
@@ -23,14 +23,14 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.apache.felix.utils.manifest.Clause;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
 import org.apache.karaf.webconsole.osgi.core.manifest.ManifestUtil;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
 import org.apache.wicket.model.IModel;
 import org.osgi.framework.Bundle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class HeaderDataProvider extends SortableDataProvider<Clause> {
+public class HeaderDataProvider extends BaseDataProvider<Clause> {
 
     private static final long serialVersionUID = 1L;
     private transient Logger logger = LoggerFactory.getLogger(getClass());
@@ -50,13 +50,13 @@ public class HeaderDataProvider extends SortableDataProvider<Clause> {
         }
     }
 
-    public Iterator<? extends Clause> iterator(int first, int count) {
+    public Iterator<? extends Clause> iterator(long first, long count) {
         List<Clause> clauses = new ArrayList<Clause>();
         clauses.addAll(Arrays.asList(this.clauses));
-        return clauses.subList(first, count).iterator();
+        return clauses.subList((int) first, (int) count).iterator();
     }
 
-    public int size() {
+    public long size() {
         return clauses.length;
     }
 
index 99aacca..f1c787c 100644 (file)
@@ -19,16 +19,16 @@ package org.apache.karaf.webconsole.osgi.core.pkg;
 import java.util.Arrays;
 
 import org.apache.felix.utils.manifest.Clause;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.osgi.framework.Bundle;
 
-public class HeaderTable extends DefaultDataTable<Clause> {
+public class HeaderTable extends BaseDataTable<Clause> {
 
-       private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-       public HeaderTable(String id, IColumn<Clause>[] columns, Bundle bundle, String header) {
-               super(id, Arrays.asList(columns), new HeaderDataProvider(bundle, header), Integer.MAX_VALUE);
-       }
+    public HeaderTable(String id, IColumn<Clause, String>[] columns, Bundle bundle, String header) {
+        super(id, Arrays.asList(columns), new HeaderDataProvider(bundle, header), Integer.MAX_VALUE);
+    }
 
 }
index 3b7e14e..ba6b788 100644 (file)
@@ -32,7 +32,7 @@ public class ImportPackageTable extends HeaderTable {
     private static final long serialVersionUID = 1L;
 
     @SuppressWarnings("unchecked")
-    static IColumn<Clause>[] columns = new IColumn[] {
+    static IColumn<Clause, String>[] columns = new IColumn[] {
         new OrdinalColumn<Clause>(),
         new PackageColumn("Import"),
         new ResolutionColumn("Resolution"),
index 01bcc47..f02e810 100644 (file)
@@ -21,13 +21,13 @@ import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
 import org.apache.wicket.model.IModel;
 import org.osgi.framework.Bundle;
 import org.osgi.service.packageadmin.ExportedPackage;
 import org.osgi.service.packageadmin.PackageAdmin;
 
-public class PackageDataProvider extends SortableDataProvider<ExportedPackage> {
+public class PackageDataProvider extends BaseDataProvider<ExportedPackage> {
 
     private static final long serialVersionUID = 1L;
 
@@ -40,13 +40,13 @@ public class PackageDataProvider extends SortableDataProvider<ExportedPackage> {
         packages = admin.getExportedPackages((Bundle) null);
     }
 
-    public Iterator<? extends ExportedPackage> iterator(int first, int count) {
+    public Iterator<? extends ExportedPackage> iterator(long first, long count) {
         List<ExportedPackage> list = new ArrayList<ExportedPackage>();
         Collections.addAll(list, packages);
-        return list.subList(first, count).iterator();
+        return list.subList((int) first, (int) count).iterator();
     }
 
-    public int size() {
+    public long size() {
         return packages.length;
     }
 
index 219d345..eeed03b 100644 (file)
@@ -21,8 +21,8 @@ import java.util.List;
 
 import org.apache.karaf.webconsole.core.table.OrdinalColumn;
 import org.apache.karaf.webconsole.core.table.PropertyColumnExt;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.karaf.webconsole.osgi.core.shared.OsgiPage;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 import org.ops4j.pax.wicket.api.PaxWicketBean;
@@ -42,12 +42,12 @@ public class PackagePage extends OsgiPage {
     private PackageAdmin admin;
 
     public PackagePage(PageParameters params) {
-        List<IColumn<ExportedPackage>> columns = new ArrayList<IColumn<ExportedPackage>>();
+        List<IColumn<ExportedPackage, String>> columns = new ArrayList<IColumn<ExportedPackage, String>>();
         columns.add(new OrdinalColumn<ExportedPackage>());
         columns.add(new PropertyColumnExt<ExportedPackage>("Package name", "name"));
         columns.add(new PropertyColumnExt<ExportedPackage>("Version", "version.toString"));
         columns.add(new PropertyColumnExt<ExportedPackage>("Provider", "exportingBundle.symbolicName"));
-        add(new DefaultDataTable<ExportedPackage>("packages", columns, new PackageDataProvider(admin), Integer.MAX_VALUE));
+        add(new BaseDataTable<ExportedPackage>("packages", columns, new PackageDataProvider(admin), Integer.MAX_VALUE));
     }
 
 }
index 794d6e3..aa1682a 100644 (file)
@@ -18,22 +18,22 @@ package org.apache.karaf.webconsole.osgi.core.service;
 
 import java.util.Arrays;
 
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.karaf.webconsole.osgi.core.service.column.ObjectClassColumn;
 import org.apache.karaf.webconsole.osgi.core.service.column.ServiceConsumerColumn;
 import org.apache.karaf.webconsole.osgi.core.service.column.ServicePropertyColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.model.Model;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 
-public class ExportServiceTable extends DefaultDataTable<ServiceReference> {
+public class ExportServiceTable extends BaseDataTable<ServiceReference> {
 
     private static final long serialVersionUID = 1L;
 
     @SuppressWarnings("unchecked")
-    private static IColumn<ServiceReference>[] columns = new IColumn[] {
+    private static IColumn<ServiceReference, String>[] columns = new IColumn[] {
         new ServicePropertyColumn("Service Id", Constants.SERVICE_ID),
         new ObjectClassColumn(Model.of("Object classes")),
         new ServiceConsumerColumn("Consumers"),
index a7d3366..60ea5d9 100644 (file)
@@ -18,22 +18,22 @@ package org.apache.karaf.webconsole.osgi.core.service;
 
 import java.util.Arrays;
 
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.karaf.webconsole.osgi.core.service.column.ObjectClassColumn;
 import org.apache.karaf.webconsole.osgi.core.service.column.ServicePropertyColumn;
 import org.apache.karaf.webconsole.osgi.core.service.column.ServiceProviderColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.model.Model;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 
-public class ImportServiceTable extends DefaultDataTable<ServiceReference> {
+public class ImportServiceTable extends BaseDataTable<ServiceReference> {
 
     private static final long serialVersionUID = 1L;
 
     @SuppressWarnings("unchecked")
-    private static IColumn<ServiceReference>[] columns = new IColumn[] {
+    private static IColumn<ServiceReference, String>[] columns = new IColumn[] {
         new ServicePropertyColumn("Service Id", Constants.SERVICE_ID),
         new ObjectClassColumn(Model.of("Object classes")),
         new ServiceProviderColumn(Model.of("Provider")),
index 32d8c56..af03eb2 100644 (file)
@@ -22,7 +22,7 @@ import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.model.IModel;
 import org.osgi.framework.ServiceReference;
 
-public class ObjectClassColumn extends AbstractColumn<ServiceReference> {
+public class ObjectClassColumn extends AbstractColumn<ServiceReference, String> {
 
     private static final long serialVersionUID = 1L;
 
index 2c5998e..08726b1 100644 (file)
@@ -22,7 +22,7 @@ import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.model.IModel;
 import org.osgi.framework.ServiceReference;
 
-public class ServiceProviderColumn extends AbstractColumn<ServiceReference> {
+public class ServiceProviderColumn extends AbstractColumn<ServiceReference, String> {
 
     private static final long serialVersionUID = 1L;
 
index b295062..af29927 100644 (file)
@@ -19,13 +19,13 @@ package org.apache.karaf.webconsole.osgi.core.service.list;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.karaf.webconsole.osgi.core.service.column.ObjectClassColumn;
 import org.apache.karaf.webconsole.osgi.core.service.column.ServiceConsumerColumn;
 import org.apache.karaf.webconsole.osgi.core.service.column.ServicePropertyColumn;
 import org.apache.karaf.webconsole.osgi.core.service.column.ServiceProviderColumn;
 import org.apache.karaf.webconsole.osgi.core.shared.OsgiPage;
 import org.apache.karaf.webconsole.osgi.core.shared.ServiceDataProvider;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.model.Model;
 import org.ops4j.pax.wicket.api.PaxWicketMountPoint;
@@ -41,13 +41,13 @@ public class ServicePage extends OsgiPage {
     private static final long serialVersionUID = 1L;
 
     public ServicePage() {
-        List<IColumn<ServiceReference>> columns = new ArrayList<IColumn<ServiceReference>>();
+        List<IColumn<ServiceReference, String>> columns = new ArrayList<IColumn<ServiceReference, String>>();
         columns.add(new ServicePropertyColumn("Service Id", Constants.SERVICE_ID));
         columns.add(new ObjectClassColumn(Model.of("Object classes")));
         columns.add(new ServiceProviderColumn(Model.of("Provider")));
         columns.add(new ServiceConsumerColumn("Consumers"));
 
-        add(new DefaultDataTable<ServiceReference>("services", columns, new ServiceDataProvider(context, (String) null), Integer.MAX_VALUE));
+        add(new BaseDataTable<ServiceReference>("services", columns, new ServiceDataProvider(context, (String) null), Integer.MAX_VALUE));
     }
 
 }
index f0bdcbd..71eeb54 100644 (file)
@@ -20,7 +20,7 @@ import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
 import org.apache.wicket.model.IModel;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -28,7 +28,7 @@ import org.osgi.framework.BundleContext;
 /**
  * Data provider to which lists all installed bundles.
  */
-public class BundleDataProvider extends SortableDataProvider<Bundle> {
+public class BundleDataProvider extends BaseDataProvider<Bundle> {
 
     private static final long serialVersionUID = 1L;
     private BundleContext context;
@@ -37,17 +37,17 @@ public class BundleDataProvider extends SortableDataProvider<Bundle> {
         this.context = context;
     }
 
-    public Iterator<? extends Bundle> iterator(int first, int count) {
+    public Iterator<? extends Bundle> iterator(long first, long count) {
         List<Bundle> bundles = Arrays.asList(context.getBundles());
 
-        return bundles.subList(first, first + count).iterator();
+        return bundles.subList((int) first, (int) first + (int) count).iterator();
     }
 
     public IModel<Bundle> model(Bundle object) {
         return new BundleModel(context, object);
     }
 
-    public int size() {
+    public long size() {
         return context.getBundles().length;
     }
 
index 549013f..253259d 100644 (file)
@@ -21,7 +21,7 @@ import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
 import org.apache.wicket.model.IModel;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.InvalidSyntaxException;
@@ -32,7 +32,7 @@ import org.osgi.framework.ServiceReference;
  * given criteria.
  * <strong>The service list might be outdated before model is used!</strong>
  */
-public class ServiceDataProvider extends SortableDataProvider<ServiceReference> {
+public class ServiceDataProvider extends BaseDataProvider<ServiceReference> {
 
     private static final long serialVersionUID = 1L;
 
@@ -81,16 +81,16 @@ public class ServiceDataProvider extends SortableDataProvider<ServiceReference>
         this(context, clazz.getName());
     }
 
-    // provide methods
-    public Iterator<? extends ServiceReference> iterator(int first, int count) {
-        return services.subList(first, count).iterator();
+    // provider methods
+    public Iterator<? extends ServiceReference> iterator(long first, long count) {
+        return services.subList((int) first, (int) count).iterator();
     }
 
     public IModel<ServiceReference> model(ServiceReference object) {
         return new ServiceReferenceModel(object);
     }
 
-    public int size() {
+    public long size() {
         return services.size();
     }
 
index 096b32b..884be3f 100644 (file)
@@ -36,6 +36,7 @@ public class ServiceReferenceModel extends LoadableDetachableModel<ServiceRefere
     }
 
     public ServiceReferenceModel(ServiceReference object, Bundle bundle) {
+        super(object);
         this.bundle = bundle;
         serviceId = (Long) object.getProperty(Constants.SERVICE_ID);
     }
index a74a81e..7f7ca0b 100644 (file)
@@ -21,10 +21,10 @@ import java.util.List;
 
 import org.apache.karaf.webconsole.core.table.OrdinalColumn;
 import org.apache.karaf.webconsole.core.table.PropertyColumnExt;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.karaf.webconsole.osgi.core.shared.OsgiPage;
 import org.apache.karaf.webconsole.osgi.event.model.EventTopicInfo;
 import org.apache.karaf.webconsole.osgi.event.model.EventTopicsProvider;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.ops4j.pax.wicket.api.PaxWicketMountPoint;
 
@@ -37,12 +37,12 @@ public class EventsPage extends OsgiPage {
     private static final long serialVersionUID = 1L;
 
     public EventsPage() {
-        List<IColumn<EventTopicInfo>> columns = new ArrayList<IColumn<EventTopicInfo>>();
+        List<IColumn<EventTopicInfo, String>> columns = new ArrayList<IColumn<EventTopicInfo, String>>();
         columns.add(new OrdinalColumn<EventTopicInfo>());
         columns.add(new PropertyColumnExt<EventTopicInfo>("Topic", "topic"));
         columns.add(new PropertyColumnExt<EventTopicInfo>("Number of consumers", "consumers"));
 
-        add(new DefaultDataTable<EventTopicInfo>("topics", columns, new EventTopicsProvider(context), 100));
+        add(new BaseDataTable<EventTopicInfo>("topics", columns, new EventTopicsProvider(context), 100));
     }
 
 }
index 8df9cfe..a24da9a 100644 (file)
@@ -20,7 +20,7 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 import org.osgi.framework.BundleContext;
@@ -32,7 +32,7 @@ import org.osgi.service.event.EventHandler;
 /**
  * Simple data provider which collects topic names from a registered listeners.
  */
-public class EventTopicsProvider  extends SortableDataProvider<EventTopicInfo> {
+public class EventTopicsProvider  extends BaseDataProvider<EventTopicInfo> {
 
     private static final long serialVersionUID = 1L;
 
@@ -69,11 +69,11 @@ public class EventTopicsProvider  extends SortableDataProvider<EventTopicInfo> {
         topics.get(topic).addConsumer();
     }
 
-    public Iterator<? extends EventTopicInfo> iterator(int first, int count) {
+    public Iterator<? extends EventTopicInfo> iterator(long first, long count) {
         return topics.values().iterator();
     }
 
-    public int size() {
+    public long size() {
         return topics.size();
     }
 
index 1e61090..c00e214 100644 (file)
@@ -21,8 +21,8 @@ import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
 import org.apache.karaf.webconsole.osgi.log.search.Matcher;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
 import org.apache.wicket.model.IModel;
 import org.osgi.service.log.LogEntry;
 import org.osgi.service.log.LogReaderService;
@@ -30,7 +30,7 @@ import org.osgi.service.log.LogReaderService;
 /**
  * Data provider for log table.
  */
-final class LogEntriesDataProvider extends SortableDataProvider<LogEntry> {
+final class LogEntriesDataProvider extends BaseDataProvider<LogEntry> {
 
     private static final long serialVersionUID = 1L;
 
@@ -48,8 +48,8 @@ final class LogEntriesDataProvider extends SortableDataProvider<LogEntry> {
         this.matchers = matchers;
     }
 
-    public Iterator<? extends LogEntry> iterator(int first, int count) {
-        return getEntries().subList(first, first + count).iterator();
+    public Iterator<? extends LogEntry> iterator(long first, long count) {
+        return getEntries().subList((int) first, (int) first + (int) count).iterator();
     }
 
     private List<LogEntry> getEntries() {
@@ -78,7 +78,7 @@ final class LogEntriesDataProvider extends SortableDataProvider<LogEntry> {
         return new LogEntryModel(this.logReader, object);
     }
 
-    public int size() {
+    public long size() {
         return getEntries().size();
     }
 
index 838d8f5..3aaef7c 100644 (file)
@@ -22,11 +22,11 @@ import java.util.Date;
 import java.util.List;
 
 import org.apache.karaf.webconsole.core.table.PropertyColumnExt;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.karaf.webconsole.osgi.core.shared.OsgiPage;
 import org.apache.karaf.webconsole.osgi.log.search.Matcher;
 import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.repeater.Item;
@@ -61,15 +61,15 @@ public class LogsPage extends OsgiPage {
         setDefaultModel(model);
 
         @SuppressWarnings("unchecked")
-        IColumn<LogEntry>[] columns = new IColumn[] {
-            new AbstractColumn<LogEntry>(Model.of("time")) {
+        IColumn<LogEntry, String>[] columns = new IColumn[] {
+            new AbstractColumn<LogEntry, String>(Model.of("time")) {
                 public void populateItem(Item<ICellPopulator<LogEntry>> cellItem, String componentId, IModel<LogEntry> rowModel) {
                     long time = rowModel.getObject().getTime();
                     DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.FULL);
                     cellItem.add(new Label(componentId, format.format(new Date(time))));
                 }
             },
-            new AbstractColumn<LogEntry>(Model.of("level")) {
+            new AbstractColumn<LogEntry, String>(Model.of("level")) {
                 public void populateItem(Item<ICellPopulator<LogEntry>> cellItem, String componentId, IModel<LogEntry> rowModel) {
                     cellItem.add(new Label(componentId, Priority.valueOf(rowModel.getObject()).name()));
                 }
@@ -80,12 +80,9 @@ public class LogsPage extends OsgiPage {
             new PropertyColumnExt<LogEntry>("Exception", "exception"),
         };
 
-        OptionsForm form = new OptionsForm("filters", model);
+        add(new OptionsForm("filters", model));
 
         LogEntriesDataProvider provider = new LogEntriesDataProvider(logReader, options, matchers);
-        DefaultDataTable<LogEntry> table = new DefaultDataTable<LogEntry>("logs", Arrays.asList(columns), provider, 20);
-
-        add(table);
-        add(form);
+        add(new BaseDataTable<LogEntry>("logs", Arrays.asList(columns), provider, 20));
     }
 }
index 44dfb53..52b48eb 100644 (file)
@@ -30,7 +30,7 @@ import org.osgi.framework.Bundle;
 /**
  * A dedicated column to display scr component states.
  */
-public class ScrColumn extends AbstractColumn<Bundle> {
+public class ScrColumn extends AbstractColumn<Bundle, String> {
 
     private static final long serialVersionUID = 1L;
 
index b4bdd3e..029b266 100644 (file)
@@ -25,7 +25,7 @@ import org.osgi.framework.Bundle;
  */
 public class ScrColumnProvider implements IColumnProvider {
 
-    public IColumn<Bundle> getColumn() {
+    public IColumn<Bundle, String> getColumn() {
         return new ScrColumn("SCR");
     }
 
diff --git a/pom.xml b/pom.xml
index 9e3f661..73312ba 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <pax-exam-karaf.version>0.5.0</pax-exam-karaf.version>
         <pax-exam-junit.version>2.3.0</pax-exam-junit.version>
         <pax-logging.version>1.6.4</pax-logging.version>
-        <pax-wicket.version>1.1.0</pax-wicket.version>
+        <pax-wicket.version>2.0.1</pax-wicket.version>
         <scala.version>2.9.1</scala.version>
         <scala-plugin.version>2.15.2</scala-plugin.version>
         <servicemix-nmr.version>1.4.0</servicemix-nmr.version>
         <slf4j.version>1.6.1</slf4j.version>
+        <!-- should be in sync with pax-wicket dependencies -->
+        <wicket.version>6.2.0</wicket.version>
     </properties>
 
     <modules>
index 8ee4ebf..12397ce 100644 (file)
@@ -24,12 +24,12 @@ import java.util.Map;
 
 import org.apache.karaf.webconsole.core.table.OrdinalColumn;
 import org.apache.karaf.webconsole.core.table.PropertyColumnExt;
+import org.apache.karaf.webconsole.core.table.advanced.AdvancedDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.servicemix.nmr.api.Endpoint;
 import org.apache.servicemix.nmr.api.EndpointRegistry;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 
@@ -42,7 +42,7 @@ public class EndpointsPage extends ServiceMixPage {
 
     @SuppressWarnings({"unchecked", "serial"})
     public EndpointsPage() {
-        IColumn<Map<String, Object>>[] columns = new IColumn[] {
+        IColumn<Map<String, Object>, String>[] columns = new IColumn[] {
             new OrdinalColumn<Map<String, Object>>(),
             new PropertyColumnExt<Map<String, Object>>("Name", Endpoint.NAME),
             new PropertyColumnExt<Map<String, Object>>("Version", Endpoint.VERSION),
@@ -54,9 +54,9 @@ public class EndpointsPage extends ServiceMixPage {
             new PropertyColumnExt<Map<String, Object>>("Wsdl url", Endpoint.WSDL_URL)
         };
 
-        ISortableDataProvider<Map<String, Object>> provider = new SortableDataProvider<Map<String, Object>>() {
+        AdvancedDataProvider<Map<String, Object>> provider = new BaseDataProvider<Map<String, Object>>() {
 
-            public Iterator<? extends Map<String, Object>> iterator(int first, int count) {
+            public Iterator<? extends Map<String, Object>> iterator(long first, long count) {
                 List<Map<String, Object>> props = new ArrayList<Map<String,Object>>();
 
                 EndpointRegistry endpointRegistry = nmr.getEndpointRegistry();
@@ -64,10 +64,10 @@ public class EndpointsPage extends ServiceMixPage {
                     props.add((Map<String, Object>) endpointRegistry.getProperties(endpoint));
                 }
 
-                return props.subList(first, count).iterator();
+                return props.subList((int) first, (int) count).iterator();
             }
 
-            public int size() {
+            public long size() {
                 return nmr.getEndpointRegistry().getServices().size();
             }
 
@@ -76,7 +76,7 @@ public class EndpointsPage extends ServiceMixPage {
             }
         };
 
-        add(new DefaultDataTable<Map<String, Object>>("endpoints", Arrays.asList(columns), provider, 20));
+        add(new BaseDataTable<Map<String, Object>>("endpoints", Arrays.asList(columns), provider, 20));
     }
 
 }
index e3f7905..5bd2984 100644 (file)
@@ -21,13 +21,13 @@ import java.util.Arrays;
 import java.util.Iterator;
 
 import org.apache.karaf.webconsole.core.table.PropertyColumnExt;
+import org.apache.karaf.webconsole.core.table.advanced.AdvancedDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataProvider;
+import org.apache.karaf.webconsole.core.table.advanced.BaseDataTable;
 import org.apache.servicemix.nmr.api.Exchange;
 import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
 import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
@@ -45,26 +45,26 @@ public class TrackNmrPage extends ServiceMixPage {
 
     @SuppressWarnings({"unchecked", "serial", "rawtypes"})
     public TrackNmrPage() {
-        IColumn<Exchange>[] columns = new IColumn[] {
+        IColumn<Exchange, String>[] columns = new IColumn[] {
             new PropertyColumnExt<Exchange>("Id", "id"),
             new PropertyColumnExt<Exchange>("Role", "role"),
             new PropertyColumnExt<Exchange>("Status", "status"),
             new PropertyColumnExt<Exchange>("Pattern", "pattern"),
             new PropertyColumnExt<Exchange>("Operation", "operation"),
-            new AbstractColumn<Exchange>(Model.of("Operations")) {
+            new AbstractColumn<Exchange, String>(Model.of("Operations")) {
                 public void populateItem(Item<ICellPopulator<Exchange>> cellItem, String componentId, IModel<Exchange> rowModel) {
                     cellItem.add(new ExchangeActionsPanel(componentId, rowModel));
                 }
             }
         };
 
-        ISortableDataProvider<Exchange> dataProvider = new SortableDataProvider<Exchange>() {
+        AdvancedDataProvider<Exchange> dataProvider = new BaseDataProvider<Exchange>() {
 
-            public Iterator<? extends Exchange> iterator(int first, int count) {
-                return new ArrayList(listener.getExchanges()).subList(first, first + count).iterator();
+            public Iterator<? extends Exchange> iterator(long first, long count) {
+                return new ArrayList(listener.getExchanges()).subList((int) first, (int) first + (int) count).iterator();
             }
 
-            public int size() {
+            public long size() {
                 return listener.getExchanges().size();
             }
 
@@ -74,7 +74,7 @@ public class TrackNmrPage extends ServiceMixPage {
 
         };
 
-        add(new DefaultDataTable<Exchange>("exchanges", Arrays.asList(columns), dataProvider, 20));
+        add(new BaseDataTable<Exchange>("exchanges", Arrays.asList(columns), dataProvider, 20));
 
     }