Author: simoneg
Date: Mon Oct 19 22:03:44 2009
New Revision: 826830

URL: http://svn.apache.org/viewvc?rev=826830&view=rev
Log:
Generic layout components

Added:
    labs/magma/trunk/website-layouts/pom.xml
    labs/magma/trunk/website-layouts/src/
    labs/magma/trunk/website-layouts/src/main/
    labs/magma/trunk/website-layouts/src/main/java/
    labs/magma/trunk/website-layouts/src/main/java/org/
    labs/magma/trunk/website-layouts/src/main/java/org/apache/
    labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/
    labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/
    
labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/
    
labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/Accordion.java
    
labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/NamedContainerProducer.java
    
labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/Tabs.java
    labs/magma/trunk/website-layouts/src/main/resources/
    labs/magma/trunk/website-layouts/src/test/
    labs/magma/trunk/website-layouts/src/test/java/
    labs/magma/trunk/website-layouts/src/test/resources/

Added: labs/magma/trunk/website-layouts/pom.xml
URL: 
http://svn.apache.org/viewvc/labs/magma/trunk/website-layouts/pom.xml?rev=826830&view=auto
==============================================================================
--- labs/magma/trunk/website-layouts/pom.xml (added)
+++ labs/magma/trunk/website-layouts/pom.xml Mon Oct 19 22:03:44 2009
@@ -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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <parent>
+    <artifactId>magma-parent</artifactId>
+    <groupId>org.apache.magma</groupId>
+    <version>2</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.magma</groupId>
+  <artifactId>website-layouts</artifactId>
+  <name>Magma website layouts</name>
+  <version>0.0.2-SNAPSHOT</version>
+  <description/>
+  <packaging>magma</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.magma</groupId>
+      <artifactId>foundation-website</artifactId>
+      <version>0.0.2-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+</project>

Added: 
labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/Accordion.java
URL: 
http://svn.apache.org/viewvc/labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/Accordion.java?rev=826830&view=auto
==============================================================================
--- 
labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/Accordion.java
 (added)
+++ 
labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/Accordion.java
 Mon Oct 19 22:03:44 2009
@@ -0,0 +1,62 @@
+/*
+ * 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.magma.website.layouts;
+
+import org.apache.magma.website.HtmlProducer;
+
+
+public class Accordion extends NamedContainerProducer {
+       
+       private boolean multiple;
+       private boolean animated;
+       private boolean fast;
+       
+
+       public boolean isMultiple() {
+               return multiple;
+       }
+
+       public Accordion setMultiple(boolean multiple) {
+               this.multiple = multiple;
+               return this;
+       }
+
+       public boolean isAnimated() {
+               return animated;
+       }
+
+       public Accordion setAnimated(boolean animated) {
+               this.animated = animated;
+               return this;
+       }
+
+       public boolean isFast() {
+               return fast;
+       }
+
+       public Accordion setFast(boolean fast) {
+               this.fast = fast;
+               return this;
+       }
+       
+       @Override
+       public Accordion addPanel(String name, HtmlProducer producer) {
+               super.addPanel(name, producer);
+               return this;
+       }
+       
+}

Added: 
labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/NamedContainerProducer.java
URL: 
http://svn.apache.org/viewvc/labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/NamedContainerProducer.java?rev=826830&view=auto
==============================================================================
--- 
labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/NamedContainerProducer.java
 (added)
+++ 
labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/NamedContainerProducer.java
 Mon Oct 19 22:03:44 2009
@@ -0,0 +1,88 @@
+/*
+ * 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.magma.website.layouts;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.magma.website.Head;
+import org.apache.magma.website.HtmlProducer;
+
+public class NamedContainerProducer extends HtmlProducer {
+
+       private List<String> panelNames = new ArrayList<String>();
+       private List<HtmlProducer> panelProducers = new 
ArrayList<HtmlProducer>();
+       protected int opened;
+
+       @Override
+       public void head(Head head) {
+               for (HtmlProducer prod : panelProducers) {
+                       prod.head(head);
+               }
+       }
+
+       @Override
+       public void produce(Writer stream) throws IOException {
+               openContainer(stream);
+               for (int i = 0; i < panelNames.size(); i++) {
+                       String name = panelNames.get(i);
+                       HtmlProducer prod = panelProducers.get(i);
+                       openPanel(stream, name);
+                       prod.produce(stream);
+                       closePanel(stream, name);
+               }
+               closeContainer(stream);
+       }
+       
+       protected void openContainer(Writer stream) throws IOException {
+       }
+       
+       protected void closeContainer(Writer stream) throws IOException {
+       }
+       
+       protected void openPanel(Writer stream, String name) throws IOException 
{
+       }
+       
+       protected void closePanel(Writer stream, String name) throws 
IOException {
+       }
+       
+       public NamedContainerProducer addPanel(String name, HtmlProducer 
producer) {
+               this.panelNames.add(name);
+               this.panelProducers.add(producer);
+               return this;
+       }
+       
+       public void setOpened(int index) {
+               this.opened = index;
+       }
+               
+       public int getOpened() {
+               return this.opened;
+       }
+
+       public List<String> getPanelNames() {
+               return panelNames;
+       }
+
+       public List<HtmlProducer> getPanelProducers() {
+               return panelProducers;
+       }
+       
+}

Added: 
labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/Tabs.java
URL: 
http://svn.apache.org/viewvc/labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/Tabs.java?rev=826830&view=auto
==============================================================================
--- 
labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/Tabs.java
 (added)
+++ 
labs/magma/trunk/website-layouts/src/main/java/org/apache/magma/website/layouts/Tabs.java
 Mon Oct 19 22:03:44 2009
@@ -0,0 +1,23 @@
+/*
+ * 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.magma.website.layouts;
+
+
+public class Tabs extends NamedContainerProducer {
+       
+       
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to