Author: ldywicki Date: Thu Aug 18 14:31:33 2011 New Revision: 1159246 URL: http://svn.apache.org/viewvc?rev=1159246&view=rev Log: Extension of configuration page (in progress)
Modified: karaf/sandbox/pieber/karaf-webconsole/trunk/osgi/src/main/java/org/apache/karaf/webconsole/osgi/internal/configuration/ConfigurationsPage.java karaf/sandbox/pieber/karaf-webconsole/trunk/osgi/src/main/resources/org/apache/karaf/webconsole/osgi/internal/configuration/ConfigurationsPage.html Modified: karaf/sandbox/pieber/karaf-webconsole/trunk/osgi/src/main/java/org/apache/karaf/webconsole/osgi/internal/configuration/ConfigurationsPage.java URL: http://svn.apache.org/viewvc/karaf/sandbox/pieber/karaf-webconsole/trunk/osgi/src/main/java/org/apache/karaf/webconsole/osgi/internal/configuration/ConfigurationsPage.java?rev=1159246&r1=1159245&r2=1159246&view=diff ============================================================================== --- karaf/sandbox/pieber/karaf-webconsole/trunk/osgi/src/main/java/org/apache/karaf/webconsole/osgi/internal/configuration/ConfigurationsPage.java (original) +++ karaf/sandbox/pieber/karaf-webconsole/trunk/osgi/src/main/java/org/apache/karaf/webconsole/osgi/internal/configuration/ConfigurationsPage.java Thu Aug 18 14:31:33 2011 @@ -5,9 +5,13 @@ import java.util.ArrayList; import java.util.List; import org.apache.karaf.webconsole.osgi.internal.OsgiPage; +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; +import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import org.ops4j.pax.wicket.api.PaxWicketBean; @@ -26,20 +30,29 @@ public class ConfigurationsPage extends try { configurations = configurationAdmin.listConfigurations(null); } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); } catch (InvalidSyntaxException e) { - // TODO Auto-generated catch block e.printStackTrace(); } + final boolean empty = configurations.length == 0; IModel<String> pid = Model.of("pid"); List<IColumn<Configuration>> columns = new ArrayList<IColumn<Configuration>>(); columns.add(new PropertyColumn<Configuration>(pid, "pid")); + columns.add(new AbstractColumn<Configuration>(Model.of("operations")) { + public void populateItem(Item<ICellPopulator<Configuration>> cellItem, String componentId, IModel<Configuration> model) { + cellItem.add(new Label("info", "operation")); + } + }); add(new DefaultDataTable<Configuration>("configurations", columns, new ConfigurationProvider(configurations), 20)); + add(new Label("noData", "No configuration found. " + (configurationAdmin == null ? "Configuration Admin not found" : "")) { + @Override + public boolean isVisible() { + return empty; + } + }); } } Modified: karaf/sandbox/pieber/karaf-webconsole/trunk/osgi/src/main/resources/org/apache/karaf/webconsole/osgi/internal/configuration/ConfigurationsPage.html URL: http://svn.apache.org/viewvc/karaf/sandbox/pieber/karaf-webconsole/trunk/osgi/src/main/resources/org/apache/karaf/webconsole/osgi/internal/configuration/ConfigurationsPage.html?rev=1159246&r1=1159245&r2=1159246&view=diff ============================================================================== --- karaf/sandbox/pieber/karaf-webconsole/trunk/osgi/src/main/resources/org/apache/karaf/webconsole/osgi/internal/configuration/ConfigurationsPage.html (original) +++ karaf/sandbox/pieber/karaf-webconsole/trunk/osgi/src/main/resources/org/apache/karaf/webconsole/osgi/internal/configuration/ConfigurationsPage.html Thu Aug 18 14:31:33 2011 @@ -10,6 +10,10 @@ <h1>Configurations</h1> <table wicket:id="configurations" class="dataview" /> + + <wicket:enclosure> + <span wicket:id="noData">Info goes here</span> + </wicket:enclosure> </wicket:extend> </body> </html>