001// Copyright 2008 The Apache Software Foundation 002// 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 at 006// 007// http://www.apache.org/licenses/LICENSE-2.0 008// 009// Unless required by applicable law or agreed to in writing, software 010// 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 and 013// limitations under the License. 014 015package org.apache.tapestry5.services; 016 017import org.apache.tapestry5.dom.Element; 018import org.apache.tapestry5.ioc.annotations.UsesMappedConfiguration; 019 020/** 021 * Provides some assistance in determining <em>where</em> to place a hidden field based on standard (X)HTML elements. 022 * <p/> 023 * The service works based on a mapped service contribution; keys are the element names, values area {@link 024 * org.apache.tapestry5.services.RelativeElementPosition}. 025 */ 026@UsesMappedConfiguration(RelativeElementPosition.class) 027public interface HiddenFieldLocationRules 028{ 029 /** 030 * Checks the element to see if a hidden field may be placed inside the element. 031 */ 032 boolean placeHiddenFieldInside(Element element); 033 034 /** 035 * Checks the element to see if a hidden field may be placed after the element (as a sibling element). 036 */ 037 boolean placeHiddenFieldAfter(Element element); 038}