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