001 // Copyright 2008, 2010, 2011 The Apache Software Foundation002 //003 // Licensed under the Apache License, Version 2.0 (the "License");004 // you may not use this file except in compliance with the License.005 // You may obtain a copy of the License at006 //007 // http://www.apache.org/licenses/LICENSE-2.0008 //009 // Unless required by applicable law or agreed to in writing, software010 // distributed under the License is distributed on an "AS IS" BASIS,011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.012 // See the License for the specific language governing permissions and013 // limitations under the License.014015 package org.apache.tapestry5;016017 /**018 * Used to determine which field on a page should receive focus, based on its status.019 *020 * @see org.apache.tapestry5.services.javascript.JavaScriptSupport#autofocus(FieldFocusPriority, String)021 */022 public enum FieldFocusPriority023 {024 /**025 * An optional field, the lowest priority.026 */027 OPTIONAL,028029 /**030 * A field whose input is required, which takes higher priority than optional.031 */032 REQUIRED,033034 /**035 * A field that contains a validation error, the highest normal priority.036 */037 IN_ERROR,038039 /**040 * Used to allow field focus to be manually overridden; this would be selected in user code and is higher priority041 * than {@link #IN_ERROR}.042 *043 * @since 5.1.0.4044 * @see org.apache.tapestry5.corelib.mixins.FormFieldFocus045 */046 OVERRIDE;047 }