001/* 002 * Copyright 2014 Anyware Services 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.ametys.core.ui.widgets; 017 018import java.util.Map; 019 020import org.ametys.core.ui.ClientSideElement; 021 022/** 023 * This class is a particular client side element that stands for widgets 024 */ 025public interface ClientSideWidget extends ClientSideElement 026{ 027 /** 028 * Returns the supported types 029 * @param contextParameters Contextuals parameters transmitted by the environment. 030 * @return An non null and non empty list of supported types 031 */ 032 public String[] getFormTypes(Map<String, Object> contextParameters); 033 /** 034 * Determine if the widget can handle enumerated values 035 * @param contextParameters Contextuals parameters transmitted by the environment. 036 * @return true if it does 037 */ 038 public boolean supportsEnumerated(Map<String, Object> contextParameters); 039 /** 040 * Determine if the widget can handle non-enumerated values 041 * @param contextParameters Contextuals parameters transmitted by the environment. 042 * @return true if it does 043 */ 044 public boolean supportsNonEnumerated(Map<String, Object> contextParameters); 045 /** 046 * Determine if the widget can handle multiple values 047 * @param contextParameters Contextuals parameters transmitted by the environment. 048 * @return true if it does 049 */ 050 public boolean supportsMultiple(Map<String, Object> contextParameters); 051 /** 052 * Determine if the widget can handle non-multiple values 053 * @param contextParameters Contextuals parameters transmitted by the environment. 054 * @return true if it does 055 */ 056 public boolean supportsNonMultiple(Map<String, Object> contextParameters); 057}