Return-Path: X-Original-To: apmail-tapestry-commits-archive@minotaur.apache.org Delivered-To: apmail-tapestry-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 72D88D201 for ; Tue, 20 Nov 2012 00:52:22 +0000 (UTC) Received: (qmail 32885 invoked by uid 500); 20 Nov 2012 00:52:22 -0000 Delivered-To: apmail-tapestry-commits-archive@tapestry.apache.org Received: (qmail 32841 invoked by uid 500); 20 Nov 2012 00:52:22 -0000 Mailing-List: contact commits-help@tapestry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tapestry.apache.org Delivered-To: mailing list commits@tapestry.apache.org Received: (qmail 32834 invoked by uid 99); 20 Nov 2012 00:52:22 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Nov 2012 00:52:22 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 017F3314F9B; Tue, 20 Nov 2012 00:52:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hlship@apache.org To: commits@tapestry.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: Change the Label component to automatically emit the class="control-label" attribute by default Message-Id: <20121120005222.017F3314F9B@tyr.zones.apache.org> Date: Tue, 20 Nov 2012 00:52:21 +0000 (UTC) Updated Branches: refs/heads/5.4-js-rewrite 65056e868 -> b927ceb14 Change the Label component to automatically emit the class="control-label" attribute by default Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/b927ceb1 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/b927ceb1 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/b927ceb1 Branch: refs/heads/5.4-js-rewrite Commit: b927ceb149dd72d444c7ea398ff92435e7a33a3c Parents: 65056e8 Author: Howard M. Lewis Ship Authored: Mon Nov 19 16:51:03 2012 -0800 Committer: Howard M. Lewis Ship Committed: Mon Nov 19 16:51:03 2012 -0800 ---------------------------------------------------------------------- .../apache/tapestry5/corelib/components/Label.java | 15 +++++++-------- .../tapestry5/corelib/pages/PropertyEditBlocks.tml | 14 +++++++------- tapestry-core/src/test/app1/AutocompleteDemo.tml | 2 +- 3 files changed, 15 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/b927ceb1/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Label.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Label.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Label.java index fd1abc5..828b06b 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Label.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Label.java @@ -1,4 +1,4 @@ -// Copyright 2006, 2007, 2008, 2009, 2010, 2011 The Apache Software Foundation +// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,11 +14,7 @@ package org.apache.tapestry5.corelib.components; -import org.apache.tapestry5.BindingConstants; -import org.apache.tapestry5.ComponentResources; -import org.apache.tapestry5.Field; -import org.apache.tapestry5.MarkupWriter; -import org.apache.tapestry5.ValidationDecorator; +import org.apache.tapestry5.*; import org.apache.tapestry5.annotations.Environmental; import org.apache.tapestry5.annotations.HeartbeatDeferred; import org.apache.tapestry5.annotations.Parameter; @@ -28,13 +24,14 @@ import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.ioc.internal.util.InternalUtils; /** - * Generates a <label> element for a particular field. + * Generates a <label> element for a particular field. It writes the CSS class "control-label", unless + * an informal parameter writes a class attribute. *

* A Label will render its body, if it has one. However, in most cases it will not have a body, and will render its * {@linkplain org.apache.tapestry5.Field#getLabel() field's label} as it's body. Remember, however, that it is the * field label that will be used in any error messages. The Label component allows for client- and server-side * validation error decorations. - * + * * @tapestrydoc */ @SupportsInformalParameters @@ -72,6 +69,8 @@ public class Label resources.renderInformalParameters(writer); + writer.attributes("class", "control-label"); + // Since we don't know if the field has rendered yet, we need to defer writing the for and id // attributes until we know the field has rendered (and set its clientId property). That's // exactly what Heartbeat is for. http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/b927ceb1/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PropertyEditBlocks.tml ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PropertyEditBlocks.tml b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PropertyEditBlocks.tml index e7096ef..5e827b2 100644 --- a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PropertyEditBlocks.tml +++ b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PropertyEditBlocks.tml @@ -1,14 +1,14 @@

- +
- +
@@ -17,7 +17,7 @@ - +
@@ -37,7 +37,7 @@ - +
@@ -46,7 +46,7 @@ - +
@@ -55,7 +55,7 @@ - +
@@ -63,7 +63,7 @@
- +