myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1751276 - in /myfaces/tobago/trunk: tobago-core/src/main/java/org/apache/myfaces/tobago/event/ tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/ tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/comp...
Date Mon, 04 Jul 2016 13:21:10 GMT
Author: lofwyr
Date: Mon Jul  4 13:21:10 2016
New Revision: 1751276

URL: http://svn.apache.org/viewvc?rev=1751276&view=rev
Log:
TOBAGO 1565: Specification for "collapsible" for Popup, Box, Section, ...
- refactoring: split the state to 2 attributes:
   collapsed=true|false (default: false)
   collapsedMode=absent|hidden (default: absent)

Added:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasCollapsedMode.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/model/CollapseMode.java
    myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/CollapseModeUnitTest.java
Removed:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/CollapsibleActionEvent.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/model/CollapseState.java
    myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/CollapseStateUnitTest.java
Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICollapsiblePanel.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/BoxTagDeclaration.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PanelTagDeclaration.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PopupTagDeclaration.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SectionTagDeclaration.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/IsCollapsible.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/CollapsibleController.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/00-collapsible-box/collapsible-box.xhtml
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/10-collapsible-popup/collapsible-popup.xhtml
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/20-collapsible-panel/collapsible-panel.xhtml
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/30-collapsible-section/collapsible-section.xhtml
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/Collapse.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/BoxRenderer.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRendererBase.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SectionRenderer.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js
    myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICollapsiblePanel.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICollapsiblePanel.java?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICollapsiblePanel.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUICollapsiblePanel.java
Mon Jul  4 13:21:10 2016
@@ -20,7 +20,7 @@
 package org.apache.myfaces.tobago.internal.component;
 
 import org.apache.myfaces.tobago.component.Facets;
-import org.apache.myfaces.tobago.model.CollapseState;
+import org.apache.myfaces.tobago.model.CollapseMode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -31,7 +31,7 @@ public abstract class AbstractUICollapsi
 
   private static final Logger LOG = LoggerFactory.getLogger(AbstractUICollapsiblePanel.class);
 
-  private volatile CollapseState nextState;
+  private transient Boolean nextState;
 
   @Override
   public void processDecodes(final FacesContext facesContext) {
@@ -70,19 +70,17 @@ public abstract class AbstractUICollapsi
     }
   }
 
-  private boolean isNormalLifecycle() {
-    return !getCollapsed().isSkipLifecycle();
+  public boolean isNormalLifecycle() {
+    return getCollapsedMode() == CollapseMode.hidden || !isCollapsed();
   }
 
-  public abstract CollapseState getCollapsed();
+  public abstract boolean isCollapsed();
 
-  public abstract void setCollapsed(final CollapseState collapsed);
+  public abstract void setCollapsed(final boolean collapsed);
 
-  public CollapseState getNextState() {
-    return nextState;
-  }
+  public abstract CollapseMode getCollapsedMode();
 
-  public void setNextState(CollapseState nextState) {
+  public void setNextState(Boolean nextState) {
     this.nextState = nextState;
   }
 

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/BoxTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/BoxTagDeclaration.java?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/BoxTagDeclaration.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/BoxTagDeclaration.java
Mon Jul  4 13:21:10 2016
@@ -24,6 +24,7 @@ import org.apache.myfaces.tobago.apt.ann
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
 import org.apache.myfaces.tobago.component.Facets;
 import org.apache.myfaces.tobago.component.RendererTypes;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasCollapsedMode;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabel;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
@@ -54,6 +55,5 @@ import javax.faces.component.UIPanel;
             + "The layout manager tag should surround the content instead.")})
 
 public interface BoxTagDeclaration
-    extends HasIdBindingAndRendered, IsVisual, HasLabel, HasTip, IsCollapsible {
-
+    extends HasIdBindingAndRendered, IsVisual, HasLabel, HasTip, IsCollapsible, HasCollapsedMode
{
 }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PanelTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PanelTagDeclaration.java?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PanelTagDeclaration.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PanelTagDeclaration.java
Mon Jul  4 13:21:10 2016
@@ -24,6 +24,7 @@ import org.apache.myfaces.tobago.apt.ann
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
 import org.apache.myfaces.tobago.component.Facets;
 import org.apache.myfaces.tobago.component.RendererTypes;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasCollapsedMode;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsCollapsible;
@@ -49,5 +50,5 @@ import javax.faces.component.UIPanel;
         @Facet(name = Facets.LAYOUT, description = "Deprecated. Contains an layout manager.
"
             + "The layout manager tag should surround the content instead.")})
 public interface PanelTagDeclaration
-    extends HasIdBindingAndRendered, IsVisual, IsCollapsible, HasTip {
+    extends HasIdBindingAndRendered, IsVisual, IsCollapsible, HasCollapsedMode, HasTip {
 }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PopupTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PopupTagDeclaration.java?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PopupTagDeclaration.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PopupTagDeclaration.java
Mon Jul  4 13:21:10 2016
@@ -23,6 +23,7 @@ import org.apache.myfaces.tobago.apt.ann
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
 import org.apache.myfaces.tobago.component.RendererTypes;
 import org.apache.myfaces.tobago.internal.component.AbstractUIPopup;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasCollapsedMode;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsCollapsible;
@@ -40,5 +41,5 @@ import org.apache.myfaces.tobago.interna
     rendererType = RendererTypes.POPUP
 )
 public interface PopupTagDeclaration
-    extends HasIdBindingAndRendered, IsVisual, IsCollapsible, HasTip {
+    extends HasIdBindingAndRendered, IsVisual, IsCollapsible, HasCollapsedMode, HasTip {
 }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SectionTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SectionTagDeclaration.java?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SectionTagDeclaration.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SectionTagDeclaration.java
Mon Jul  4 13:21:10 2016
@@ -24,6 +24,7 @@ import org.apache.myfaces.tobago.apt.ann
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
 import org.apache.myfaces.tobago.component.Facets;
 import org.apache.myfaces.tobago.component.RendererTypes;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasCollapsedMode;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasImage;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabel;
@@ -47,5 +48,5 @@ import org.apache.myfaces.tobago.interna
             allowedChildComponenents = "org.apache.myfaces.tobago.Label")})
 
 public interface SectionTagDeclaration
-    extends HasIdBindingAndRendered, HasLabel, IsVisual, HasImage, IsCollapsible, HasTip
{
+    extends HasIdBindingAndRendered, HasLabel, IsVisual, HasImage, IsCollapsible, HasCollapsedMode,
HasTip {
 }

Added: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasCollapsedMode.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasCollapsedMode.java?rev=1751276&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasCollapsedMode.java
(added)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasCollapsedMode.java
Mon Jul  4 13:21:10 2016
@@ -0,0 +1,37 @@
+/*
+ * 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.myfaces.tobago.internal.taglib.declaration;
+
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.model.CollapseMode;
+
+public interface HasCollapsedMode {
+
+  /**
+   * Enum indicating the mode of the collapsed state of this component.
+   */
+  @TagAttribute
+  @UIComponentTagAttribute(
+          type = "org.apache.myfaces.tobago.model.CollapseMode",
+          defaultValue = CollapseMode.ABSENT,
+          defaultCode = "org.apache.myfaces.tobago.model.CollapseMode.absent")
+  void setCollapsedMode(String collapsed);
+}

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/IsCollapsible.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/IsCollapsible.java?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/IsCollapsible.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/IsCollapsible.java
Mon Jul  4 13:21:10 2016
@@ -21,7 +21,6 @@ package org.apache.myfaces.tobago.intern
 
 import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
-import org.apache.myfaces.tobago.model.CollapseState;
 
 public interface IsCollapsible {
 
@@ -29,9 +28,6 @@ public interface IsCollapsible {
    * Enum indicating the collapsed state of this component.
    */
   @TagAttribute
-  @UIComponentTagAttribute(
-      type = "org.apache.myfaces.tobago.model.CollapseState",
-      defaultValue = CollapseState.VISIBLE,
-      defaultCode = "org.apache.myfaces.tobago.model.CollapseState.visible")
+  @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
   void setCollapsed(String collapsed);
 }

Added: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/model/CollapseMode.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/model/CollapseMode.java?rev=1751276&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/model/CollapseMode.java
(added)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/model/CollapseMode.java
Mon Jul  4 13:21:10 2016
@@ -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.myfaces.tobago.model;
+
+public enum CollapseMode {
+
+  hidden,
+  absent;
+
+  public static final String HIDDEN = "hidden";
+  public static final String ABSENT = "absent";
+}

Added: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/CollapseModeUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/CollapseModeUnitTest.java?rev=1751276&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/CollapseModeUnitTest.java
(added)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/CollapseModeUnitTest.java
Mon Jul  4 13:21:10 2016
@@ -0,0 +1,31 @@
+/*
+ * 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.myfaces.tobago.model;
+
+import org.apache.myfaces.tobago.util.EnumUnitTest;
+import org.junit.Test;
+
+public class CollapseModeUnitTest extends EnumUnitTest {
+
+  @Test
+  public void testNames() throws IllegalAccessException, NoSuchFieldException {
+    testNames(CollapseMode.class);
+  }
+}

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/CollapsibleController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/CollapsibleController.java?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/CollapsibleController.java
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/CollapsibleController.java
Mon Jul  4 13:21:10 2016
@@ -19,7 +19,6 @@
 
 package org.apache.myfaces.tobago.example.demo;
 
-import org.apache.myfaces.tobago.model.CollapseState;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -33,7 +32,7 @@ public class CollapsibleController imple
 
   private static final Logger LOG = LoggerFactory.getLogger(CollapsibleController.class);
 
-  private CollapseState collapsed = CollapseState.hidden;
+  private boolean collapsed = true;
 
   public String action() {
     LOG.info("action(): collapsed={}", collapsed);
@@ -45,11 +44,11 @@ public class CollapsibleController imple
     return null;
   }
 
-  public CollapseState getCollapsed() {
+  public boolean isCollapsed() {
     return collapsed;
   }
 
-  public void setCollapsed(CollapseState collapsed) {
+  public void setCollapsed(boolean collapsed) {
     this.collapsed = collapsed;
   }
 }

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/00-collapsible-box/collapsible-box.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/00-collapsible-box/collapsible-box.xhtml?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/00-collapsible-box/collapsible-box.xhtml
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/00-collapsible-box/collapsible-box.xhtml
Mon Jul  4 13:21:10 2016
@@ -46,7 +46,6 @@
     </tc:box>
 
   </tc:section>
-
   <tc:section label="Collapsible section with AJAX server request" id="section2">
 
     Here we have the transitions <code>show</code> and <code>drop</code>
and there is no server request needed.
@@ -59,9 +58,9 @@
             <f:ajax execute="box2" render="box2"/>
             <tc:operation name="show" for="box2"/>
           </tc:button>
-          <tc:button label="drop" id="drop2">
+          <tc:button label="hide" id="hide2">
             <f:ajax execute="box2" render="box2"/>
-            <tc:operation name="drop" for="box2"/>
+            <tc:operation name="hide" for="box2"/>
           </tc:button>
         </tc:buttons>
       </f:facet>
@@ -84,8 +83,8 @@
           <tc:button label="show" id="show3">
             <tc:operation name="show" for="box3"/>
           </tc:button>
-          <tc:button label="drop" id="drop3">
-            <tc:operation name="drop" for="box3"/>
+          <tc:button label="hide" id="hide3">
+            <tc:operation name="hide" for="box3"/>
           </tc:button>
         </tc:buttons>
       </f:facet>

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/10-collapsible-popup/collapsible-popup.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/10-collapsible-popup/collapsible-popup.xhtml?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/10-collapsible-popup/collapsible-popup.xhtml
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/10-collapsible-popup/collapsible-popup.xhtml
Mon Jul  4 13:21:10 2016
@@ -45,7 +45,7 @@
           </tc:button>
           <tc:button label="Cancel and Close (immediate with action)" immediate="true"
                      action="#{collapsibleController.cancel}">
-            <tc:operation name="drop" for="popup"/>
+            <tc:operation name="hide" for="popup"/>
           </tc:button>
           <tc:button label="Submit and Close" action="#{collapsibleController.action}">
             <tc:operation name="hide" for="popup"/>

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/20-collapsible-panel/collapsible-panel.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/20-collapsible-panel/collapsible-panel.xhtml?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/20-collapsible-panel/collapsible-panel.xhtml
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/20-collapsible-panel/collapsible-panel.xhtml
Mon Jul  4 13:21:10 2016
@@ -52,7 +52,7 @@
     </tc:button>
     <tc:button label="drop" id="drop2">
       <f:ajax execute="panel2" render="panel2"/>
-      <tc:operation name="drop" for="panel2"/>
+      <tc:operation name="hide" for="panel2"/>
     </tc:button>
   </tc:buttons>
   <tc:panel id="panel2">
@@ -73,7 +73,7 @@
       <tc:operation name="show" for="panel3"/>
     </tc:button>
     <tc:button label="drop" id="drop3">
-      <tc:operation name="drop" for="panel3"/>
+      <tc:operation name="hide" for="panel3"/>
     </tc:button>
   </tc:buttons>
   <tc:panel id="panel3">

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/30-collapsible-section/collapsible-section.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/30-collapsible-section/collapsible-section.xhtml?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/30-collapsible-section/collapsible-section.xhtml
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/30-collapsible-section/collapsible-section.xhtml
Mon Jul  4 13:21:10 2016
@@ -56,7 +56,7 @@
         </tc:button>
         <tc:button label="drop" id="drop2">
           <f:ajax execute="section2" render="section2"/>
-          <tc:operation name="drop" for="section2"/>
+          <tc:operation name="hide" for="section2"/>
         </tc:button>
       </tc:buttons>
     </f:facet>
@@ -79,7 +79,7 @@
           <tc:operation name="show" for="section3"/>
         </tc:button>
         <tc:button label="drop" id="drop3">
-          <tc:operation name="drop" for="section3"/>
+          <tc:operation name="hide" for="section3"/>
         </tc:button>
       </tc:buttons>
     </f:facet>

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/Collapse.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/Collapse.java?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/Collapse.java
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/Collapse.java
Mon Jul  4 13:21:10 2016
@@ -38,6 +38,6 @@ public class Collapse {
   }
 
   public enum Action {
-    show, hide, drop
+    show, hide
   }
 }

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/BoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/BoxRenderer.java?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/BoxRenderer.java
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/BoxRenderer.java
Mon Jul  4 13:21:10 2016
@@ -22,7 +22,6 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.component.UIMenuBar;
 import org.apache.myfaces.tobago.internal.component.AbstractUIBox;
 import org.apache.myfaces.tobago.internal.util.Deprecation;
-import org.apache.myfaces.tobago.model.CollapseState;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
 import org.apache.myfaces.tobago.renderkit.css.Classes;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
@@ -52,10 +51,10 @@ public class BoxRenderer extends PanelRe
     final UIComponent bar = ComponentUtils.getFacet(box, Facets.bar);
 
     writer.startElement(HtmlElements.DIV);
-    final CollapseState collapsed = box.getCollapsed();
+    final boolean collapsed = box.isCollapsed();
     writer.writeClassAttribute(
         Classes.create(box),
-        collapsed == CollapseState.visible ? null : TobagoClass.COLLAPSED,
+        collapsed ? TobagoClass.COLLAPSED : null,
         BootstrapClass.CARD,
         box.getCustomClass());
     final String clientId = box.getClientId(facesContext);

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java
Mon Jul  4 13:21:10 2016
@@ -23,7 +23,6 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.component.UIPanel;
 import org.apache.myfaces.tobago.component.UIReload;
 import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
-import org.apache.myfaces.tobago.model.CollapseState;
 import org.apache.myfaces.tobago.renderkit.css.Classes;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
@@ -45,14 +44,14 @@ public class PanelRenderer extends Panel
     final UIPanel panel = (UIPanel) component;
     final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
     final String clientId = panel.getClientId(facesContext);
-    final CollapseState collapsed = panel.getCollapsed();
+    final boolean collapsed = panel.isCollapsed();
 
     writer.startElement(HtmlElements.DIV);
     writer.writeIdAttribute(clientId);
     writer.writeClassAttribute(
         Classes.create(panel),
         panel.getCustomClass(),
-        collapsed == CollapseState.visible ? null : TobagoClass.COLLAPSED);
+        collapsed ? TobagoClass.COLLAPSED : null);
     writer.writeStyleAttribute(panel.getStyle());
 
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, panel);

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRendererBase.java?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRendererBase.java
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRendererBase.java
Mon Jul  4 13:21:10 2016
@@ -21,7 +21,6 @@ package org.apache.myfaces.tobago.render
 
 import org.apache.myfaces.tobago.internal.component.AbstractUICollapsiblePanel;
 import org.apache.myfaces.tobago.internal.util.StringUtils;
-import org.apache.myfaces.tobago.model.CollapseState;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -48,18 +47,19 @@ public class PanelRendererBase extends R
     if (requestParameterMap.containsKey(hiddenId)) {
       final String newValue = requestParameterMap.get(hiddenId);
       if (StringUtils.isNotBlank(newValue)) {
-        collapsible.setNextState(CollapseState.valueOf(newValue));
+        collapsible.setNextState(Boolean.valueOf(newValue));
       }
     }
   }
 
-  protected void encodeHidden(final TobagoResponseWriter writer, final String clientId, final
CollapseState collapsed)
+  protected void encodeHidden(final TobagoResponseWriter writer, final String clientId, final
boolean collapsed)
       throws IOException {
+    final String hiddenId = clientId + ComponentUtils.SUB_SEPARATOR + "collapse";
     writer.startElement(HtmlElements.INPUT);
     writer.writeAttribute(HtmlAttributes.TYPE, HtmlInputTypes.HIDDEN);
-    writer.writeNameAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "collapse");
-    writer.writeIdAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "collapse");
-    writer.writeAttribute(HtmlAttributes.VALUE, collapsed.name(), false);
+    writer.writeNameAttribute(hiddenId);
+    writer.writeIdAttribute(hiddenId);
+    writer.writeAttribute(HtmlAttributes.VALUE, Boolean.toString(collapsed), false);
     writer.endElement(HtmlElements.INPUT);
   }
 
@@ -70,9 +70,8 @@ public class PanelRendererBase extends R
 
   @Override
   public void encodeChildren(final FacesContext facesContext, final UIComponent component)
throws IOException {
-    if (((AbstractUICollapsiblePanel) component).getCollapsed().isSkipLifecycle()) {
-      return;
+    if (((AbstractUICollapsiblePanel) component).isNormalLifecycle()) {
+      super.encodeChildren(facesContext, component);
     }
-    super.encodeChildren(facesContext, component);
   }
 }

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java
Mon Jul  4 13:21:10 2016
@@ -20,7 +20,6 @@
 package org.apache.myfaces.tobago.renderkit.html.standard.standard.tag;
 
 import org.apache.myfaces.tobago.internal.component.AbstractUIPopup;
-import org.apache.myfaces.tobago.model.CollapseState;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
@@ -41,7 +40,7 @@ public class PopupRenderer extends Panel
     final AbstractUIPopup popup = (AbstractUIPopup) component;
     final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
     final String clientId = popup.getClientId(facesContext);
-    final CollapseState collapsed = popup.getCollapsed();
+    final boolean collapsed = popup.isCollapsed();
 
     writer.startElement(HtmlElements.DIV);
     writer.writeClassAttribute(TobagoClass.POPUP, BootstrapClass.MODAL, BootstrapClass.FADE);

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SectionRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SectionRenderer.java?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SectionRenderer.java
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SectionRenderer.java
Mon Jul  4 13:21:10 2016
@@ -21,7 +21,6 @@ package org.apache.myfaces.tobago.render
 
 import org.apache.myfaces.tobago.component.Facets;
 import org.apache.myfaces.tobago.internal.component.AbstractUISection;
-import org.apache.myfaces.tobago.model.CollapseState;
 import org.apache.myfaces.tobago.renderkit.css.Classes;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -42,13 +41,13 @@ public class SectionRenderer extends Pan
     final AbstractUISection section = (AbstractUISection) component;
     final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
     final String clientId = section.getClientId(facesContext);
-    final CollapseState collapsed = section.getCollapsed();
+    final boolean collapsed = section.isCollapsed();
 
     writer.startElement(HtmlElements.DIV);
     writer.writeIdAttribute(clientId);
     writer.writeClassAttribute(
         Classes.create(section),
-        collapsed == CollapseState.visible ? null : TobagoClass.COLLAPSED,
+        collapsed ? TobagoClass.COLLAPSED : null,
         section.getCustomClass());
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, section);
 

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.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-popup.js?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js
Mon Jul  4 13:21:10 2016
@@ -20,13 +20,13 @@ Tobago.Popup = {};
 /**
  * Init popup for bootstrap
  */
-Tobago.Popup.init = function(elements) {
+Tobago.Popup.init = function (elements) {
 
   var popups = Tobago.Utils.selectWithJQuery(elements, ".modal");
-  popups.each(function() {
+  popups.each(function () {
     var $popup = jQuery(this);
     var $hidden = Tobago.Collapse.findHidden($popup);
-    if ($hidden.val() == "visible") {
+    if ($hidden.val() == "false") {
       jQuery(this).modal(); // inits and opens the popup
     } else {
       jQuery(this).modal("hide"); // inits and hides the popup
@@ -34,7 +34,7 @@ Tobago.Popup.init = function(elements) {
   });
 };
 
-Tobago.Popup.close = function(button) {
+Tobago.Popup.close = function (button) {
   jQuery(button).parents('.modal:first').modal("hide");
 
 };
@@ -53,39 +53,29 @@ Tobago.Collapse.execute = function (coll
   var $for = jQuery(Tobago.Utils.escapeClientId(collapse.forId));
   var $hidden = Tobago.Collapse.findHidden($for);
   var isPopup = $for.hasClass("tobago-popup");
-  var state = $hidden.val();
-  var newState;
+  var newCollapsed;
   switch (transition) {
     case "hide":
-      newState = "hidden";
+      newCollapsed = true;
       break;
     case "show":
-      newState = "visible";
-      break;
-    case "drop":
-      newState = "absent";
+      newCollapsed = false;
       break;
     default:
       console.error("unknown transition: '" + transition + "'");
   }
-  if (newState == "hidden") {
+  if (newCollapsed) {
     if (isPopup) {
       $for.modal("hide");
     } else {
       $for.addClass("tobago-collapsed");
     }
-  } else if (newState == "visible") {
+  } else {
     if (isPopup) {
       $for.modal("show");
     } else {
       $for.removeClass("tobago-collapsed");
     }
-  } // else (absent): nothing to do, because here comes an update from the server
-
-  var serverRequestRequired = state == "absent" || newState == "absent";
-  if (serverRequestRequired) {
-    console.info("serverRequestRequired!"); // todo: remove var serverRequestRequired: is
not needed.
-    // tbd. this this must be done be the deveopoer manually
   }
-  $hidden.val(newState);
+  $hidden.val(newCollapsed);
 };

Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg?rev=1751276&r1=1751275&r2=1751276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg
(original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component.stg
Mon Jul  4 13:21:10 2016
@@ -330,7 +330,7 @@ SanitizeModeProperty(property) ::= <<
 <NormalProperty(property)>
 >>
 
-CollapseStateProperty(property) ::= <<
+CollapseModeProperty(property) ::= <<
 <NormalProperty(property)>
 >>
 




Mime
View raw message