org.apache.myfaces.shared.renderkit.html.HTML Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of myfaces-impl Show documentation
Show all versions of myfaces-impl Show documentation
The private implementation classes of the Apache MyFaces Core JSF-2.1 Implementation
/*
* 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.shared.renderkit.html;
import org.apache.myfaces.shared.util.ArrayUtils;
/**
* Constant declarations for HTML rendering.
* @author Manfred Geiler
* @author Anton Koinov
* @version $Revision: 1187701 $ $Date: 2011-10-22 07:21:54 -0500 (Sat, 22 Oct 2011) $
*/
public interface HTML
{
// Deprecated attributes
@Deprecated String DATAFLD_ATTR = "datafld";
@Deprecated String DATASRC_ATTR = "datasrc";
@Deprecated String DATAFORMATAS_ATTR = "dataformatas";
// Common attributes
String ALIGN_ATTR = "align";
String BORDER_ATTR = "border";
String WIDTH_ATTR = "width";
String READONLY_ATTR = "readonly";
String FILE_ATTR = "file";
String ACCEPT_ATTR = "accept";
// Common event handler attributes
String ONCLICK_ATTR = "onclick";
String ONDBLCLICK_ATTR = "ondblclick";
String ONMOUSEDOWN_ATTR = "onmousedown";
String ONMOUSEUP_ATTR = "onmouseup";
String ONMOUSEOVER_ATTR = "onmouseover";
String ONMOUSEMOVE_ATTR = "onmousemove";
String ONMOUSEOUT_ATTR = "onmouseout";
String ONKEYPRESS_ATTR = "onkeypress";
String ONKEYDOWN_ATTR = "onkeydown";
String ONKEYUP_ATTR = "onkeyup";
String ONFOCUS_ATTR = "onfocus";
String ONBLUR_ATTR = "onblur";
String[] EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK =
{
ONDBLCLICK_ATTR,
ONMOUSEDOWN_ATTR,
ONMOUSEUP_ATTR,
ONMOUSEOVER_ATTR,
ONMOUSEMOVE_ATTR,
ONMOUSEOUT_ATTR,
ONKEYPRESS_ATTR,
ONKEYDOWN_ATTR,
ONKEYUP_ATTR
};
String[] EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONMOUSEOVER_AND_ONMOUSEOUT =
{
ONDBLCLICK_ATTR,
ONMOUSEDOWN_ATTR,
ONMOUSEUP_ATTR,
ONMOUSEMOVE_ATTR,
ONKEYPRESS_ATTR,
ONKEYDOWN_ATTR,
ONKEYUP_ATTR,
ONCLICK_ATTR
};
String[] EVENT_HANDLER_ATTRIBUTES =
(String[]) org.apache.myfaces.shared.util.ArrayUtils.concat(
EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK,
new String[] {ONCLICK_ATTR});
// Input field event handler attributes
String ONSELECT_ATTR = "onselect";
String ONCHANGE_ATTR = "onchange";
String[] COMMON_FIELD_EVENT_ATTRIBUTES =
{
ONFOCUS_ATTR,
ONBLUR_ATTR,
ONSELECT_ATTR,
ONCHANGE_ATTR
};
String[] COMMON_FIELD_EVENT_ATTRIBUTES_WITHOUT_ONFOCUS =
{
ONBLUR_ATTR,
ONSELECT_ATTR,
ONCHANGE_ATTR
};
String[] COMMON_FIELD_EVENT_ATTRIBUTES_WITHOUT_ONSELECT_AND_ONCHANGE =
{
ONFOCUS_ATTR,
ONBLUR_ATTR
};
// universal attributes
String DIR_ATTR = "dir";
String LANG_ATTR = "lang";
String STYLE_ATTR = "style";
String TITLE_ATTR = "title";
String STYLE_CLASS_ATTR = "styleClass"; //"class" cannot be used as property name
String[] UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE =
{
DIR_ATTR,
LANG_ATTR,
TITLE_ATTR,
//NOTE: if changed, please verify universal attributes in HtmlMessageRenderer !
};
String[] UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE_AND_TITLE =
{
DIR_ATTR,
LANG_ATTR,
};
String[] UNIVERSAL_ATTRIBUTES =
(String[]) org.apache.myfaces.shared.util.ArrayUtils.concat(
UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE,
new String[] {STYLE_ATTR, STYLE_CLASS_ATTR});
//universal, but not the same property-name -
//styleClass attribute is rendered as such
String CLASS_ATTR = "class";
// common form field attributes
String ACCESSKEY_ATTR = "accesskey";
String TABINDEX_ATTR = "tabindex";
String DISABLED_ATTR = "disabled";
String[] COMMON_FIELD_ATTRIBUTES_WITHOUT_DISABLED =
{
ACCESSKEY_ATTR,
TABINDEX_ATTR
};
String[] COMMON_FIELD_ATTRIBUTES =
(String[]) ArrayUtils.concat(
COMMON_FIELD_ATTRIBUTES_WITHOUT_DISABLED,
new String[] {DISABLED_ATTR});
// Common Attributes
String[] COMMON_PASSTROUGH_ATTRIBUTES =
(String[]) org.apache.myfaces.shared.util.ArrayUtils.concat(
EVENT_HANDLER_ATTRIBUTES,
UNIVERSAL_ATTRIBUTES);
String[] COMMON_PASSTROUGH_ATTRIBUTES_WITHOUT_STYLE =
(String[]) org.apache.myfaces.shared.util.ArrayUtils.concat(
EVENT_HANDLER_ATTRIBUTES,
UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE);
String[] COMMON_PASSTROUGH_ATTRIBUTES_WITHOUT_ONCLICK =
(String[]) ArrayUtils.concat(
EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK,
UNIVERSAL_ATTRIBUTES);
String[] COMMON_PASSTROUGH_ATTRIBUTES_WITHOUT_ONCLICK_WITHOUT_STYLE =
(String[]) ArrayUtils.concat(
EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK,
UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE);
String[] COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED =
(String[]) ArrayUtils.concat(
COMMON_PASSTROUGH_ATTRIBUTES,
COMMON_FIELD_ATTRIBUTES_WITHOUT_DISABLED,
COMMON_FIELD_EVENT_ATTRIBUTES);
String[] COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_STYLE =
(String[]) ArrayUtils.concat(
COMMON_PASSTROUGH_ATTRIBUTES_WITHOUT_STYLE,
COMMON_FIELD_ATTRIBUTES_WITHOUT_DISABLED,
COMMON_FIELD_EVENT_ATTRIBUTES);
String[] COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS =
(String[]) org.apache.myfaces.shared.util.ArrayUtils.concat(
COMMON_PASSTROUGH_ATTRIBUTES,
COMMON_FIELD_ATTRIBUTES_WITHOUT_DISABLED,
COMMON_FIELD_EVENT_ATTRIBUTES_WITHOUT_ONFOCUS);
String[] COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS_AND_ONCLICK =
(String[]) ArrayUtils.concat(
COMMON_PASSTROUGH_ATTRIBUTES_WITHOUT_ONCLICK,
COMMON_FIELD_ATTRIBUTES_WITHOUT_DISABLED,
COMMON_FIELD_EVENT_ATTRIBUTES_WITHOUT_ONFOCUS);
String[] COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONCLICK =
(String[]) org.apache.myfaces.shared.util.ArrayUtils.concat(
COMMON_PASSTROUGH_ATTRIBUTES_WITHOUT_ONCLICK,
COMMON_FIELD_ATTRIBUTES_WITHOUT_DISABLED,
COMMON_FIELD_EVENT_ATTRIBUTES);
String[] COMMON_PASSTROUGH_ATTRIBUTES_WITHOUT_ONMOUSEOVER_AND_ONMOUSEOUT =
(String[]) org.apache.myfaces.shared.util.ArrayUtils.concat(
EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONMOUSEOVER_AND_ONMOUSEOUT,
UNIVERSAL_ATTRIBUTES);
String[] COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS =
(String[]) ArrayUtils.concat(
UNIVERSAL_ATTRIBUTES,
COMMON_FIELD_ATTRIBUTES_WITHOUT_DISABLED);
String[] COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_STYLE_AND_EVENTS =
(String[]) ArrayUtils.concat(
UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE,
COMMON_FIELD_ATTRIBUTES_WITHOUT_DISABLED);
//
String TARGET_ATTR = "target"; //used by and