001 /* 002 * This file is part of the Echo Point Project. This project is a collection 003 * of Components that have extended the Echo Web Application Framework. 004 * 005 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 006 * 007 * The contents of this file are subject to the Mozilla Public License Version 008 * 1.1 (the "License"); you may not use this file except in compliance with 009 * the License. You may obtain a copy of the License at 010 * http://www.mozilla.org/MPL/ 011 * 012 * Software distributed under the License is distributed on an "AS IS" basis, 013 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 014 * for the specific language governing rights and limitations under the 015 * License. 016 * 017 * Alternatively, the contents of this file may be used under the terms of 018 * either the GNU General Public License Version 2 or later (the "GPL"), or 019 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 020 * in which case the provisions of the GPL or the LGPL are applicable instead 021 * of those above. If you wish to allow use of your version of this file only 022 * under the terms of either the GPL or the LGPL, and not to allow others to 023 * use your version of this file under the terms of the MPL, indicate your 024 * decision by deleting the provisions above and replace them with the notice 025 * and other provisions required by the GPL or the LGPL. If you do not delete 026 * the provisions above, a recipient may use your version of this file under 027 * the terms of any one of the MPL, the GPL or the LGPL. 028 */ 029 package echopoint.able; 030 031 import nextapp.echo.app.Component; 032 import nextapp.echo.app.Extent; 033 034 /** 035 * The <code>{@link Stretchable}</code> interface is used to indicate that a 036 * <code>{@link Component}</code> should "stretch" itself to use all left over 037 * space inside a parent component. 038 * <p> 039 * By default most component try to minimize the space they use, but components 040 * that implement this interface can be made to maximize the space they use. 041 */ 042 public interface Stretchable extends Delegateable { 043 044 public static final String PROPERTY_HEIGHT_STRETCHED = "heightStretched"; 045 046 public static final String PROPERTY_MINIMUM_STRETCHED_HEIGHT = "minimumStretchedHeight"; 047 048 public static final String PROPERTY_MAXIMUM_STRETCHED_HEIGHT = "maximumStretchedHeight"; 049 050 /** 051 * @return true if the height should be stretched to use all available space 052 * of its parent. 053 */ 054 public boolean isHeightStretched(); 055 056 /** 057 * Set to true if the height should be stretched to use all available space 058 * of its parent. 059 * 060 * @param newValue - 061 * a boolean flag indicating whether the height should be 062 * stretched to use all available space of its parent or not. 063 */ 064 public void setHeightStretched(boolean newValue); 065 066 /** 067 * @return - the minimum height that the component should stretch itself 068 * down to in pixels. 069 */ 070 public Extent getMinimumStretchedHeight(); 071 072 /** 073 * Sets the minimum height that the component should stretch itself down to 074 * in pixels. 075 * 076 * @param newValue - 077 * a new Extent value that MUST be in pixel units. 078 */ 079 public void setMinimumStretchedHeight(Extent newValue); 080 081 /** 082 * @return - the maximum height that the component should stretch itself up 083 * to in pixels. 084 */ 085 public Extent getMaximumStretchedHeight(); 086 087 /** 088 * Sets the maximum height that the component should stretch itself up to in 089 * pixels. 090 * 091 * @param newValue - 092 * a new Extent value that MUST be in pixel units. 093 */ 094 public void setMaximumStretchedHeight(Extent newValue); 095 096 }