You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by ld...@apache.org on 2012/02/10 15:11:49 UTC

svn commit: r1242778 [1/3] - in /karaf/webconsole/trunk/core/src/main: java/org/apache/karaf/webconsole/core/behavior/ java/org/apache/karaf/webconsole/core/brand/ resources/org/apache/karaf/webconsole/core/behavior/bootstrap/ resources/org/apache/kara...

Author: ldywicki
Date: Fri Feb 10 14:11:48 2012
New Revision: 1242778

URL: http://svn.apache.org/viewvc?rev=1242778&view=rev
Log:
Clean up behaviors and introduce bootstrap behavior.

Added:
    karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/BootstrapBehavior.java
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/css/
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/css/bootstrap.css
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/js/
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/js/bootstrap-alert.js
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/js/bootstrap-button.js
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/js/bootstrap-carousel.js
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/js/bootstrap-collapse.js
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/js/bootstrap-dropdown.js
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/js/bootstrap-modal.js
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/js/bootstrap-popover.js
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/js/bootstrap-scrollspy.js
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/js/bootstrap-tab.js
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/js/bootstrap-tooltip.js
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/js/bootstrap-transition.js
    karaf/webconsole/trunk/core/src/main/resources/org/apache/karaf/webconsole/core/behavior/bootstrap/js/bootstrap-typeahead.js
Modified:
    karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/CompositeHeaderContributor.java
    karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/DraculaBehavior.java
    karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/JQueryBehavior.java
    karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/RaphaelBehavior.java
    karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/brand/DefaultBrandProvider.java

Added: karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/BootstrapBehavior.java
URL: http://svn.apache.org/viewvc/karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/BootstrapBehavior.java?rev=1242778&view=auto
==============================================================================
--- karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/BootstrapBehavior.java (added)
+++ karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/BootstrapBehavior.java Fri Feb 10 14:11:48 2012
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.karaf.webconsole.core.behavior;
+
+import static org.apache.wicket.markup.html.JavascriptPackageResource.getHeaderContribution;
+
+import org.apache.wicket.ResourceReference;
+import org.apache.wicket.markup.html.CSSPackageResource;
+import org.apache.wicket.markup.html.IHeaderContributor;
+
+/**
+ * A Twitter bootstrap behavior which contains css and javascript resources.
+ * http://twitter.github.com/bootstrap
+ */
+public class BootstrapBehavior extends CompositeHeaderContributor {
+
+    private static final long serialVersionUID = 1L;
+
+    public BootstrapBehavior() {
+        super(new JQueryBehavior());
+    }
+
+    @Override
+    protected IHeaderContributor[] getOwnHeaderContributors() {
+        return new IHeaderContributor[] {
+            CSSPackageResource.getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/css/bootstrap.css")),
+            getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-alert.js")),
+            getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-button.js")),
+            getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-carousel.js")),
+            getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-collapse.js")),
+            getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-dropdown.js")),
+            getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-modal.js")),
+            getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-scrollspy.js")),
+            getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-tab.js")),
+            getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-tooltip.js")),
+            getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-popover.js")),
+            getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-transition.js")),
+            getHeaderContribution(new ResourceReference(BootstrapBehavior.class, "bootstrap/js/bootstrap-typeahead.js"))
+        };
+    }
+
+}

Modified: karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/CompositeHeaderContributor.java
URL: http://svn.apache.org/viewvc/karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/CompositeHeaderContributor.java?rev=1242778&r1=1242777&r2=1242778&view=diff
==============================================================================
--- karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/CompositeHeaderContributor.java (original)
+++ karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/CompositeHeaderContributor.java Fri Feb 10 14:11:48 2012
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.karaf.webconsole.core.behavior;
 
 import java.util.ArrayList;
@@ -7,8 +23,13 @@ import java.util.List;
 import org.apache.wicket.behavior.AbstractHeaderContributor;
 import org.apache.wicket.markup.html.IHeaderContributor;
 
+/**
+ * Composite behavior which collects other resources.
+ */
 public abstract class CompositeHeaderContributor extends AbstractHeaderContributor {
 
+    private static final long serialVersionUID = 1L;
+
     private IHeaderContributor[] contributors;
 
     protected CompositeHeaderContributor(IHeaderContributor ...contributors) {

Modified: karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/DraculaBehavior.java
URL: http://svn.apache.org/viewvc/karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/DraculaBehavior.java?rev=1242778&r1=1242777&r2=1242778&view=diff
==============================================================================
--- karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/DraculaBehavior.java (original)
+++ karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/DraculaBehavior.java Fri Feb 10 14:11:48 2012
@@ -1,12 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.karaf.webconsole.core.behavior;
 
 import static org.apache.wicket.markup.html.JavascriptPackageResource.getHeaderContribution;
 
 import org.apache.wicket.markup.html.IHeaderContributor;
 
+/**
+ * Dracula graphing library.
+ * http://www.graphdracula.net/
+ */
 public class DraculaBehavior extends CompositeHeaderContributor {
 
-    public DraculaBehavior() {
+    private static final long serialVersionUID = 1L;
+
+	public DraculaBehavior() {
         super(new JQueryBehavior(), new RaphaelBehavior());
     }
 

Modified: karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/JQueryBehavior.java
URL: http://svn.apache.org/viewvc/karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/JQueryBehavior.java?rev=1242778&r1=1242777&r2=1242778&view=diff
==============================================================================
--- karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/JQueryBehavior.java (original)
+++ karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/JQueryBehavior.java Fri Feb 10 14:11:48 2012
@@ -1,11 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.karaf.webconsole.core.behavior;
 
 import org.apache.wicket.behavior.AbstractHeaderContributor;
 import org.apache.wicket.markup.html.IHeaderContributor;
 import org.apache.wicket.markup.html.JavascriptPackageResource;
 
+
+/**
+ * JQuery behavior. http://jquery.com
+ */
 public class JQueryBehavior extends AbstractHeaderContributor {
 
+    private static final long serialVersionUID = 1L;
+
     @Override
     public IHeaderContributor[] getHeaderContributors() {
         return new IHeaderContributor[] {

Modified: karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/RaphaelBehavior.java
URL: http://svn.apache.org/viewvc/karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/RaphaelBehavior.java?rev=1242778&r1=1242777&r2=1242778&view=diff
==============================================================================
--- karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/RaphaelBehavior.java (original)
+++ karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/behavior/RaphaelBehavior.java Fri Feb 10 14:11:48 2012
@@ -1,11 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.karaf.webconsole.core.behavior;
 
 import org.apache.wicket.behavior.AbstractHeaderContributor;
 import org.apache.wicket.markup.html.IHeaderContributor;
 import org.apache.wicket.markup.html.JavascriptPackageResource;
 
+/**
+ * Raphael graphing library.
+ * http://raphaeljs.com/
+ */
 public class RaphaelBehavior extends AbstractHeaderContributor {
 
+    private static final long serialVersionUID = 1L;
+
     @Override
     public IHeaderContributor[] getHeaderContributors() {
         return new IHeaderContributor[] {

Modified: karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/brand/DefaultBrandProvider.java
URL: http://svn.apache.org/viewvc/karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/brand/DefaultBrandProvider.java?rev=1242778&r1=1242777&r2=1242778&view=diff
==============================================================================
--- karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/brand/DefaultBrandProvider.java (original)
+++ karaf/webconsole/trunk/core/src/main/java/org/apache/karaf/webconsole/core/brand/DefaultBrandProvider.java Fri Feb 10 14:11:48 2012
@@ -19,10 +19,11 @@ package org.apache.karaf.webconsole.core
 import static org.apache.wicket.markup.html.CSSPackageResource.getHeaderContribution;
 
 import java.io.Serializable;
-import java.util.Collections;
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.karaf.webconsole.core.BasePage;
+import org.apache.karaf.webconsole.core.behavior.BootstrapBehavior;
 import org.apache.wicket.Page;
 import org.apache.wicket.ResourceReference;
 import org.apache.wicket.behavior.IBehavior;
@@ -46,7 +47,9 @@ public class DefaultBrandProvider implem
     }
 
     public List<IBehavior> getBehaviors() {
-        return Collections.emptyList();
+        List<IBehavior> behaviors = new ArrayList<IBehavior>();
+        behaviors.add(new BootstrapBehavior());
+        return behaviors;
     }
 
     public void modify(Page page) {