You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by sv...@apache.org on 2012/07/27 19:02:35 UTC
[2/3] git commit: Add a very simple example for beginners.
Add a very simple example for beginners.
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/1cd66536
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/1cd66536
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/1cd66536
Branch: refs/heads/master
Commit: 1cd665366e9865a65d148e9752401815bc8ebe7d
Parents: ade856d
Author: svenmeier <sv...@apache.org>
Authored: Fri Jul 27 18:30:44 2012 +0200
Committer: svenmeier <sv...@apache.org>
Committed: Fri Jul 27 18:30:44 2012 +0200
----------------------------------------------------------------------
.../wicket/examples/tree/AbstractTreePage.html | 38 +++++++++++
.../wicket/examples/tree/AbstractTreePage.java | 29 ++++++++
.../wicket/examples/tree/BeginnersTreePage.html | 28 ++++++++
.../wicket/examples/tree/BeginnersTreePage.java | 52 +++++++++++++++
4 files changed, 147 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/1cd66536/wicket-examples/src/main/java/org/apache/wicket/examples/tree/AbstractTreePage.html
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/tree/AbstractTreePage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/tree/AbstractTreePage.html
new file mode 100644
index 0000000..c9d4832
--- /dev/null
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/tree/AbstractTreePage.html
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd" >
+ <head>
+ <title>Wicket Examples - trees</title>
+ <link rel="stylesheet" type="text/css" href="style.css"/>
+ </head>
+ <body>
+ <span wicket:id = "mainNavigation"/>
+
+ <h2>Welcome to Tree Examples</h2>
+
+ <wicket:link>
+ <a href="BeginnersTreePage.html">Beginner's tee</a>
+ <a href="NestedTreePage.html">Advanced nested tree</a>
+ <a href="TableTreePage.html">Advanced tabular tree</a>
+ </wicket:link>
+
+ <wicket:child/>
+ </body>
+</html>
+
http://git-wip-us.apache.org/repos/asf/wicket/blob/1cd66536/wicket-examples/src/main/java/org/apache/wicket/examples/tree/AbstractTreePage.java
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/tree/AbstractTreePage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/tree/AbstractTreePage.java
new file mode 100644
index 0000000..edf44b0
--- /dev/null
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/tree/AbstractTreePage.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.examples.tree;
+
+import org.apache.wicket.examples.WicketExamplePage;
+
+/**
+ * @author Sven Meier
+ */
+public abstract class AbstractTreePage extends WicketExamplePage
+{
+
+ private static final long serialVersionUID = 1L;
+
+}
http://git-wip-us.apache.org/repos/asf/wicket/blob/1cd66536/wicket-examples/src/main/java/org/apache/wicket/examples/tree/BeginnersTreePage.html
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/tree/BeginnersTreePage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/tree/BeginnersTreePage.html
new file mode 100644
index 0000000..3db78ae
--- /dev/null
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/tree/BeginnersTreePage.html
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd" >
+ <head>
+ </head>
+ <body>
+ <wicket:extend>
+ <div wicket:id="tree">[tree]</div>
+ </wicket:extend>
+ </body>
+</html>
+
http://git-wip-us.apache.org/repos/asf/wicket/blob/1cd66536/wicket-examples/src/main/java/org/apache/wicket/examples/tree/BeginnersTreePage.java
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/tree/BeginnersTreePage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/tree/BeginnersTreePage.java
new file mode 100644
index 0000000..f93ee43
--- /dev/null
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/tree/BeginnersTreePage.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.examples.tree;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.extensions.markup.html.repeater.tree.DefaultNestedTree;
+import org.apache.wicket.model.IModel;
+
+/**
+ * A very simple page containing a {@link DefaultNestedTree} only.
+ *
+ * @author Sven Meier
+ */
+public class BeginnersTreePage extends AbstractTreePage
+{
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Construct.
+ */
+ public BeginnersTreePage()
+ {
+ add(new DefaultNestedTree<Foo>("tree", new FooProvider())
+ {
+
+ /**
+ * To use a custom component for the representation of a node's content we would
+ * override this method.
+ */
+ @Override
+ protected Component newContentComponent(String id, IModel<Foo> node)
+ {
+ return super.newContentComponent(id, node);
+ }
+ });
+ }
+}