You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ja...@apache.org on 2010/07/13 15:49:10 UTC
svn commit: r963714 - in
/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite:
AttributeHandler.java FacetHandler.java InterfaceHandler.java
Author: jakobk
Date: Tue Jul 13 13:49:10 2010
New Revision: 963714
URL: http://svn.apache.org/viewvc?rev=963714&view=rev
Log:
MYFACES-2814 Implement "hidden" attribute for composite tags (spec rev A)
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttributeHandler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/FacetHandler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/InterfaceHandler.java
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttributeHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttributeHandler.java?rev=963714&r1=963713&r2=963714&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttributeHandler.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttributeHandler.java Tue Jul 13 13:49:10 2010
@@ -110,6 +110,15 @@ public class AttributeHandler extends Ta
private final TagAttribute _type;
/**
+ * The "hidden" flag is used to identify features that are intended only
+ * for tool use, and which should not be exposed to humans.
+ */
+ @JSFFaceletAttribute(name="hidden",
+ className="javax.el.ValueExpression",
+ deferredValueType="boolean")
+ protected final TagAttribute _hidden;
+
+ /**
* Check if the PropertyDescriptor instance created by this handler
* can be cacheable or not.
*/
@@ -137,6 +146,7 @@ public class AttributeHandler extends Ta
_shortDescription = getAttribute("shortDescription");
_methodSignature = getAttribute("method-signature");
_type = getAttribute("type");
+ _hidden = getAttribute("hidden");
// We can reuse the same PropertyDescriptor only if the properties
// that requires to be evaluated when apply (build view time)
@@ -145,7 +155,8 @@ public class AttributeHandler extends Ta
(_displayName == null || _displayName.isLiteral() ) &&
(_preferred == null || _preferred.isLiteral() ) &&
(_expert == null || _expert.isLiteral() ) &&
- (_shortDescription == null || _shortDescription.isLiteral() ) )
+ (_shortDescription == null || _shortDescription.isLiteral() ) &&
+ (_hidden == null || _hidden.isLiteral() ) )
{
// Unfortunately its not possible to create the required
// PropertyDescriptor instance here, because there is no way
@@ -234,7 +245,11 @@ public class AttributeHandler extends Ta
if (_shortDescription != null)
{
attributeDescriptor.setShortDescription(_shortDescription.getValue());
- }
+ }
+ if (_hidden != null)
+ {
+ attributeDescriptor.setHidden(Boolean.valueOf(_hidden.getValue()));
+ }
return attributeDescriptor;
}
catch (IntrospectionException e)
@@ -293,6 +308,10 @@ public class AttributeHandler extends Ta
{
attributeDescriptor.setValue("type", _type.getValueExpression(ctx, String.class));
}
+ if (_hidden != null)
+ {
+ attributeDescriptor.setHidden(_hidden.getBoolean(ctx));
+ }
return attributeDescriptor;
}
catch (IntrospectionException e)
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/FacetHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/FacetHandler.java?rev=963714&r1=963713&r2=963714&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/FacetHandler.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/FacetHandler.java Tue Jul 13 13:49:10 2010
@@ -108,6 +108,15 @@ public class FacetHandler extends TagHan
private final TagAttribute _shortDescription;
/**
+ * The "hidden" flag is used to identify features that are intended only
+ * for tool use, and which should not be exposed to humans.
+ */
+ @JSFFaceletAttribute(name="hidden",
+ className="javax.el.ValueExpression",
+ deferredValueType="boolean")
+ protected final TagAttribute _hidden;
+
+ /**
* Check if the PropertyDescriptor instance created by this handler
* can be cacheable or not.
*/
@@ -131,6 +140,7 @@ public class FacetHandler extends TagHan
_preferred = getAttribute("preferred");
_expert = getAttribute("expert");
_shortDescription = getAttribute("shortDescription");
+ _hidden = getAttribute("hidden");
// We can reuse the same PropertyDescriptor only if the properties
// that requires to be evaluated when apply (build view time)
@@ -139,7 +149,8 @@ public class FacetHandler extends TagHan
(_displayName == null || _displayName.isLiteral() ) &&
(_preferred == null || _preferred.isLiteral() ) &&
(_expert == null || _expert.isLiteral() ) &&
- (_shortDescription == null || _shortDescription.isLiteral() ) )
+ (_shortDescription == null || _shortDescription.isLiteral() ) &&
+ (_hidden == null || _hidden.isLiteral() ) )
{
// Unfortunately its not possible to create the required
// PropertyDescriptor instance here, because there is no way
@@ -236,7 +247,11 @@ public class FacetHandler extends TagHan
if (_shortDescription != null)
{
facetPropertyDescriptor.setShortDescription(_shortDescription.getValue());
- }
+ }
+ if (_hidden != null)
+ {
+ facetPropertyDescriptor.setHidden(Boolean.valueOf(_hidden.getValue()));
+ }
return facetPropertyDescriptor;
}
catch (IntrospectionException e)
@@ -277,6 +292,10 @@ public class FacetHandler extends TagHan
{
facetPropertyDescriptor.setShortDescription(_shortDescription.getValue(ctx));
}
+ if (_hidden != null)
+ {
+ facetPropertyDescriptor.setHidden(_hidden.getBoolean(ctx));
+ }
return facetPropertyDescriptor;
}
catch (IntrospectionException e)
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/InterfaceHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/InterfaceHandler.java?rev=963714&r1=963713&r2=963714&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/InterfaceHandler.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/InterfaceHandler.java Tue Jul 13 13:49:10 2010
@@ -97,6 +97,15 @@ public class InterfaceHandler extends Ta
private final TagAttribute _shortDescription;
/**
+ * The "hidden" flag is used to identify features that are intended only
+ * for tool use, and which should not be exposed to humans.
+ */
+ @JSFFaceletAttribute(name="hidden",
+ className="javax.el.ValueExpression",
+ deferredValueType="boolean")
+ protected final TagAttribute _hidden;
+
+ /**
* Check if the BeanInfo instance created by this handler
* can be cacheable or not.
*/
@@ -114,13 +123,15 @@ public class InterfaceHandler extends Ta
_preferred = getAttribute("preferred");
_expert = getAttribute("expert");
_shortDescription = getAttribute("shortDescription");
+ _hidden = getAttribute("hidden");
if ( (_name == null || _name.isLiteral() ) &&
(_componentType == null || _componentType.isLiteral() ) &&
(_displayName == null || _displayName.isLiteral() ) &&
(_preferred == null || _preferred.isLiteral() ) &&
(_expert == null || _expert.isLiteral() ) &&
- (_shortDescription == null || _shortDescription.isLiteral() ) )
+ (_shortDescription == null || _shortDescription.isLiteral() ) &&
+ (_hidden == null || _hidden.isLiteral() ) )
{
_cacheable = true;
// Check if all attributes are cacheable. If that so, we can cache this
@@ -202,6 +213,10 @@ public class InterfaceHandler extends Ta
{
descriptor.setShortDescription(_shortDescription.getValue(ctx));
}
+ if (_hidden != null)
+ {
+ descriptor.setHidden(_hidden.getBoolean(ctx));
+ }
nextHandler.apply(ctx, parent);
}