Hi all,
Personally, I would prefer to see that class divided in more specialized
classes like :
XhtmlElements
{
public static final String DIV = "div"; (or could be DIVISION)
public static final String TABLE = "table";
public static final String TABLE_BODY = "tbody";
public static final String TABLE_DATA_CELL = "td";
public static final String TABLE_HEADER_CELL = "th";
public static final String TABLE_ROW = "tr";
// ...
}
XhtmlAttributes
{
public static final String HANDLER_CLICK = "onclick";
public static final String STYLE_CLASS = "class";
// ...
}
And so on. This kind of separation often make the constant names clearer (no
need to prefix the constant type like ELEMENT_ or ATTR_).
About the general idea to move such constants to the API, I'm +1 though.
Regards,
~ Simon
On Mon, Oct 19, 2009 at 8:35 AM, Scott O'Bryan <[email protected]> wrote:
> Why is this being done again?
>
> Sent from my iPhone
>
>
> On Oct 18, 2009, at 10:32 PM, Blake Sullivan <[email protected]>
> wrote:
>
> +1
>>
>> -- Blake Sullivan
>>
>> On Oct 18, 2009, at 9:11 PM, Matthias Wessendorf wrote:
>>
>> Maybe we should also rename the "old" XhtmlConstants class ?
>>> Would make sense, as all the (x)html stuff is about to be moved to API.
>>>
>>> Since this class is containing misc things, like HTML (gone), events,
>>> params
>>> and other rendering stuff (e.g. the ***** for the inputText
>>> (secret:true)), we could
>>> be lazy by renaming it to something like:
>>>
>>> TrinidadRenderingConstants
>>>
>>> We could also try to clean it up even more, by making it multiple
>>> classes...
>>> From looking at the comments it looks like it has been copied from
>>> multiple
>>> places to a single class; So not sure if we really wanna go to split it
>>> up even
>>> more...
>>>
>>> -Matthias
>>>
>>> On Fri, Oct 16, 2009 at 11:21 AM, Blake Sullivan
>>> <[email protected]> wrote:
>>>
>>>> +1
>>>>
>>>> -- Blake Sullivan
>>>>
>>>> Matthias Wessendorf said the following On 10/16/2009 11:12 AM PT:
>>>>
>>>> On Thu, Oct 15, 2009 at 6:12 PM, Blake Sullivan
>>>> <[email protected]> wrote:
>>>>
>>>>
>>>> Matthias Wessendorf said the following On 10/15/2009 5:48 PM PT:
>>>>
>>>>
>>>> Hi,
>>>>
>>>> I'd like to move the XhtmlConstants class to the API.
>>>> The only dependency on another IMPL class is very simple.
>>>> It is a constant, that resolves to a String ("portlet").
>>>>
>>>> If nobody disagrees, I will move on with the move.
>>>> Yeah, just on trunk (Trinidad 1.2.x)
>>>>
>>>> Thx,
>>>> Matthias
>>>>
>>>>
>>>>
>>>>
>>>> Matthias,
>>>>
>>>> A bunch of the constants appear to be implementation-dependent. Rather
>>>> than
>>>> making the entire class public, I think you should come up with a
>>>> proposal
>>>> for which constants you want to move to a public class.
>>>>
>>>>
>>>> took a more detailed look and noticed that a bunch of mixed things are
>>>> in that class.
>>>>
>>>> I think we should maybe just move the XHTML specific stuff to be an
>>>> API part, b/c
>>>> some of the stuff *can* be useful one other (renderer) implementations
>>>> as
>>>> well.
>>>>
>>>> Here is a list, of what I have in mind:
>>>> public static final String FACET_PORTLET = "portlet";
>>>> public static final String SCRIPT_NAME = "script";
>>>> public static final String H_ALIGN_END = "end";
>>>> public static final String V_ALIGN_MIDDLE = "middle";
>>>> public static final String V_ALIGN_TOP = "top";
>>>> public static final String DIV_ELEMENT = "div";
>>>> public static final List<String> HEADER_ELEMENTS =
>>>> Arrays.asList(new String[]{"h1", "h2", "h3",
>>>> "h4", "h5", "h6"});
>>>> public static final String LINK_ELEMENT = "a";
>>>> public static final String PARAGRAPH_ELEMENT = "p";
>>>> public static final String SCRIPT_ELEMENT = "script";
>>>> public static final String SPAN_ELEMENT = "span";
>>>> public static final String TABLE_DATA_ELEMENT = "td";
>>>> public static final String TABLE_BODY_ELEMENT = "tbody";
>>>> public static final String TABLE_ELEMENT = "table";
>>>> public static final String TABLE_HEADER_ELEMENT = "th";
>>>> public static final String TABLE_ROW_ELEMENT = "tr";
>>>>
>>>> public static final String FIELDSET_ELEMENT = "fieldset";
>>>> public static final String LEGEND_ELEMENT = "legend";
>>>> public static final char NBSP_CHAR = 0xA0;
>>>> public static final String NBSP_STRING = String.valueOf(NBSP_CHAR);
>>>>
>>>> public static final String ALIGN_ATTRIBUTE = "align";
>>>> public static final String COLS_ATTRIBUTE = "cols";
>>>> public static final String COLSPAN_ATTRIBUTE = "colspan";
>>>> public static final String HEIGHT_ATTRIBUTE = "height";
>>>> public static final String HREF_ATTRIBUTE = "href";
>>>> public static final String ID_ATTRIBUTE = "id";
>>>> public static final String NOWRAP_ATTRIBUTE = "nowrap";
>>>> public static final String ONCLICK_ATTRIBUTE = "onclick";
>>>> public static final String ROWS_ATTRIBUTE = "rows";
>>>> public static final String ROWSPAN_ATTRIBUTE = "rowspan";
>>>> public static final String SIZE_ATTRIBUTE = "size";
>>>> public static final String STYLE_ATTRIBUTE = "style";
>>>> public static final String VALIGN_ATTRIBUTE = "valign";
>>>> public static final String WIDTH_ATTRIBUTE = "width";
>>>>
>>>> public static final String DIR_ATTRIBUTE_VALUE = "dir";
>>>> public static final String EMPTY_STRING_ATTRIBUTE_VALUE = "";
>>>> public static final String LEFT_ATTRIBUTE_VALUE = "left";
>>>> public static final String MIDDLE_ATTRIBUTE_VALUE =
>>>> "middle";
>>>> public static final String ONE_HUNDRED_PERCENT_ATTRIBUTE_VALUE = "100%";
>>>> public static final String RIGHT_ATTRIBUTE_VALUE =
>>>> "right";
>>>>
>>>> most of the other things are really more specific to internal stuff,
>>>> e.g. event param names etc.
>>>>
>>>> For the package, I think that the new XhtmlConstants.java could sit in
>>>> here:
>>>> org.apache.myfaces.trinidad.render
>>>>
>>>>
>>>> -Matthias
>>>>
>>>>
>>>>
>>>> -- Blake Sullivan
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Matthias Wessendorf
>>>
>>> blog: http://matthiaswessendorf.wordpress.com/
>>> sessions: http://www.slideshare.net/mwessendorf
>>> twitter: http://twitter.com/mwessendorf
>>>
>>
>>