/******************************************************************************* * Copyright 2015 xWic group (http://www.xwic.de) * * Licensed 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 de.jwic.base; /** * Interface for the Control object. This interface has been (re-)implemented * to make the usage of Interfaces for custom controls easier. * * @author Florian Lippisch * @version $Revision: 1.1 $ */ public interface IControl { /** * A user has clicked on a link that was generated by this control. * Links are generated with the <code>createActionURL</code> function. */ public abstract void actionPerformed(String actionId, String parameter); /** * This method is invoked when the control is removed from the container. */ public abstract void destroy(); /** * Removes the field with the given name. * @param name */ public abstract void removeField(String name); /** * Removes the field from the fieldlist. * @param field */ public abstract void removeField(Field field); /** * Returns the field with the specified name. * @param name * @return */ public abstract Field getField(String name); /** * Create an URL with the specified action and parameter. If the user * clicks on this link, the <code>actionPerformed(..)</code> method is * invoked. * @param action * @param acpara */ public abstract String createActionURL(String action, String acpara); /** * Returns the container where this control is nested in. */ public abstract IControlContainer getContainer(); /** * Returns the ID of the control. * @return String */ public abstract java.lang.String getControlID(); /** * Returns the SessionContext object, this control lives in. */ public abstract SessionContext getSessionContext(); /** * Returns true if the control has been changed since the last rendering * and must be rendered again to reflect the last changes. * @return boolean */ public abstract boolean isRequireRedraw(); /** * Returns true if the control should be rendered. * @return boolean */ public abstract boolean isVisible(); /** * Set to true if the control needs to be rendered again to reflect the changes * of the control since it was last rendered. * @param requireRedraw */ public abstract void setRequireRedraw(boolean requireRedraw); /** * Set the visibility flag of this control. * @param newVisible boolean */ public abstract void setVisible(boolean newVisible); /** * Returns the name of the Control. */ public abstract String getName(); /** * Returns the renderer implementation. * @return Returns the renderer. */ public abstract String getRendererId(); /** * Sets the renderer used to render this control into HTML code. * @param renderer The renderer to set. */ public abstract void setRendererId(String rendererId); /** * Returns the name of the template used to render this control. * By default, the name of the template is the name of the control class. * @return Returns the templateName. */ public abstract String getTemplateName(); /** * Sets the name of the template used to render this control. * @param templateName The templateName to set. */ public abstract void setTemplateName(String templateName); }