You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2010/05/27 09:01:20 UTC

svn commit: r948693 - in /myfaces/tobago/trunk: tobago-example/tobago-example-test/src/main/webapp/tc/toolBar/ tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ tobago-theme/tobago-th...

Author: lofwyr
Date: Thu May 27 07:01:20 2010
New Revision: 948693

URL: http://svn.apache.org/viewvc?rev=948693&view=rev
Log:
TOBAGO-881: Make ToolBar work with new LayoutManager
 - disabled attribute
 - rendered attribute

Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/toolBar/toolBar-fragment.xhtml
    myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
    myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/toolBar/toolBar-fragment.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/toolBar/toolBar-fragment.xhtml?rev=948693&r1=948692&r2=948693&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/toolBar/toolBar-fragment.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/toolBar/toolBar-fragment.xhtml Thu May 27 07:01:20 2010
@@ -30,5 +30,7 @@
       </tc:menu>
     </f:facet>
   </tc:toolBarCommand>
+  <tc:toolBarCommand label="disabled" image="pidgeon-point.jpg" disabled="true"/>
+  <tc:toolBarCommand label="not rendered" image="pidgeon-point.jpg" rendered="false"/>
 
 </ui:composition>

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java?rev=948693&r1=948692&r2=948693&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java Thu May 27 07:01:20 2010
@@ -354,10 +354,17 @@ public abstract class ToolBarRendererBas
     
     // start rendering
     writer.startElement(HtmlConstants.SPAN, command);
-    writer.writeClassAttribute(
-        selected ? "tobago-toolBar-item tobago-toolBar-item-selected" : "tobago-toolBar-item");
+    String itemClass = "tobago-toolBar-item";
+    if (selected) {
+      itemClass += " tobago-toolBar-item-selected";
+    }
+    if (disabled) {
+      itemClass += " tobago-toolBar-item-disabled";
+    }
+    writer.writeClassAttribute(itemClass);
     HtmlRendererUtils.renderTip(command, writer);
     writer.writeStyleAttribute(itemStyle);
+    writer.writeAttribute(HtmlAttributes.DISABLED, disabled);
 
     writer.startElement(HtmlConstants.SPAN, command);
     writer.writeClassAttribute(

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css?rev=948693&r1=948692&r2=948693&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css Thu May 27 07:01:20 2010
@@ -1067,6 +1067,7 @@ span.tobago-progress {
   border: 2px groove #F6FAFF;
   position: relative;
   overflow: hidden;
+  white-space: nowrap;
 }
 
 .tobago-toolBar-item {
@@ -1079,6 +1080,10 @@ span.tobago-progress {
   top: 0;
 }
 
+.tobago-toolBar-item-disabled {
+  color: #778899;
+}
+
 .tobago-toolBar-button, .tobago-toolBar-menu {
   position: absolute;
   border-width: 0;

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css?rev=948693&r1=948692&r2=948693&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css Thu May 27 07:01:20 2010
@@ -658,6 +658,10 @@ a:link.tab, a:visited.tab, a:active.tab 
   margin: 0;
 }
 
+.tobago-toolBar-item-disabled {
+  color: #808080;
+}
+
 .tobago-toolBar-button-selected {
   background-color: #EEEEEE;
 }

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=948693&r1=948692&r2=948693&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Thu May 27 07:01:20 2010
@@ -2445,14 +2445,14 @@ Tobago.Updater = {
 // todo: namespace etc.
 
 $(document).ready(function() {
-  $(".tobago-toolBar-item")
+  $(".tobago-toolBar-item[disabled!=disabled]")
       .mouseenter(function() {
     $(this).addClass("tobago-toolBar-item-hover");
   })
       .mouseleave(function() {
     $(this).removeClass("tobago-toolBar-item-hover");
   });
-  $(".tobago-toolBar-button, .tobago-toolBar-menu")
+  $(".tobago-toolBar-item[disabled!=disabled]").children(".tobago-toolBar-button, .tobago-toolBar-menu")
       .mouseenter(function() {
     $(this).addClass("tobago-toolBar-button-hover");})
       .mouseleave(function() {