001 package org.apache.myfaces.tobago.taglib.component; 002 003 /* 004 * Licensed to the Apache Software Foundation (ASF) under one or more 005 * contributor license agreements. See the NOTICE file distributed with 006 * this work for additional information regarding copyright ownership. 007 * The ASF licenses this file to You under the Apache License, Version 2.0 008 * (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 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 */ 019 020 import org.apache.myfaces.tobago.apt.annotation.BodyContentDescription; 021 import org.apache.myfaces.tobago.apt.annotation.Tag; 022 import org.apache.myfaces.tobago.apt.annotation.TagAttribute; 023 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag; 024 import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute; 025 import org.apache.myfaces.tobago.component.UIToolBar; 026 027 /* 028 * Date: 11.02.2006 029 * Time: 14:07:05 030 */ 031 032 /** 033 * <p/> 034 * Renders a toolbar.<p /> 035 * Allowed subcomponents are subtypes of UICommand i.e. 036 * <code>'button'</code> and <code>'link'</code> tags. 037 * These are rendered by ToolbarRenderer, so the result has 038 * no difference.<p /> 039 * To add an dropdown menu to a button add a facet <code>'menupopup'</code> 040 * containing a 041 * <a href="menu.html"><code><tc:menu></code></a> 042 * tag to the button. Label's and Image's on those menu tag's are ignored 043 * and replaced by the renderer. 044 * <pre> 045 * <tc:button onclick="alert('test 0')" 046 * label="Alert 0" > 047 * <f:facet name="menupopup"> 048 * <tc:menu> 049 * <tc:menuItem onclick="alert('test 1')" label="Alert 1"/> 050 * <tc:menuItem onclick="alert('test 2')" label="Alert 2"/> 051 * <tc:menuItem onclick="alert('test 3')" label="Alert 3"/> 052 * </tc:menu> 053 * </f:facet> 054 * </tc:button> 055 * </pre> 056 */ 057 058 @Tag(name = "toolBar") 059 @BodyContentDescription(anyTagOf = "(<tc:toolBarCommand>|<tc:toolBarSelectBoolean>|<tc:toolBarSelectOne>)* ") 060 @UIComponentTag( 061 uiComponent = "org.apache.myfaces.tobago.component.UIToolBar", 062 rendererType = "ToolBar") 063 public interface ToolBarTagDeclaration extends PanelTagDeclaration { 064 /** 065 * Position of the button label, possible values are: right, bottom, off. 066 * If toolbar is facet of box: bottom is changed to right! 067 */ 068 @TagAttribute 069 @UIComponentTagAttribute(defaultValue = UIToolBar.LABEL_BOTTOM, 070 allowedValues = {UIToolBar.LABEL_BOTTOM, UIToolBar.LABEL_RIGHT, UIToolBar.LABEL_OFF}) 071 void setLabelPosition(String labelPosition); 072 073 /** 074 * Size of button images, possible values are: small, big, off. 075 */ 076 @TagAttribute 077 @UIComponentTagAttribute(defaultValue = UIToolBar.ICON_SMALL, 078 allowedValues = {UIToolBar.ICON_SMALL, UIToolBar.ICON_BIG, UIToolBar.ICON_OFF}) 079 void setIconSize(String iconSize); 080 081 /** 082 * Orientation of toolbar 083 */ 084 @TagAttribute 085 @UIComponentTagAttribute(defaultValue = UIToolBar.ORIENTATION_LEFT, 086 allowedValues = {UIToolBar.ORIENTATION_LEFT, UIToolBar.ORIENTATION_RIGHT}) 087 void setOrientation(String orientation); 088 }