001// Copyright 2007, 2008, 2009, 2010, 2012 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.internal.services;
016
017import org.apache.tapestry5.Field;
018import org.apache.tapestry5.Link;
019import org.apache.tapestry5.corelib.data.InsertPosition;
020import org.apache.tapestry5.services.ClientBehaviorSupport;
021
022public class ClientBehaviorSupportImpl implements ClientBehaviorSupport
023{
024    private void unsupported(String name, String message)
025    {
026        throw new UnsupportedOperationException(String.format("ClientBehaviorSupport.%s is not longer supported. %s",
027                name, message));
028    }
029
030    public void addZone(String clientId, String showFunctionName, String updateFunctionName)
031    {
032        unsupported("addZone", "Use the data-container-type attribute set to 'zone'.");
033    }
034
035    public void linkZone(String linkId, String elementId, Link eventLink)
036    {
037        unsupported("linkZone", "Use the data-update-zone attribute on the triggering element, instead.");
038    }
039
040    public void addFormFragment(String clientId, String showFunctionName, String hideFunctionName)
041    {
042        addFormFragment(clientId, false, showFunctionName, hideFunctionName, null);
043    }
044
045    public void addFormFragment(String clientId, boolean alwaysSubmit, String showFunctionName, String hideFunctionName)
046    {
047        addFormFragment(clientId, false, showFunctionName, hideFunctionName, null);
048    }
049
050    public void addFormFragment(String clientId, boolean alwaysSubmit, String showFunctionName, String hideFunctionName, String visibilityBoundFunctionName)
051    {
052        unsupported("addFormFragment", "Use the core/form-fragment module instead.");
053    }
054
055    public void addFormInjector(String clientId, Link link, InsertPosition insertPosition, String showFunctionName)
056    {
057        unsupported("addFormInjector", "A replacement is forthcoming.");
058    }
059
060    public void addValidation(Field field, String validationName, String message, Object constraint)
061    {
062        unsupported("addFormInjector", "Encode client field validation as attributes and document-level event handlers. See the core/validation module.");
063    }
064}