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 static org.apache.myfaces.tobago.TobagoConstants.ATTR_ICON_SIZE; 023 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LABEL_POSITION; 024 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ORIENTATION; 025 import org.apache.myfaces.tobago.component.ComponentUtil; 026 import org.apache.myfaces.tobago.component.UIToolBar; 027 028 import javax.faces.component.UIComponent; 029 030 /* 031 * Created 29.07.2003 at 15:09:53. 032 * $Id: ToolBarTag.java 1368577 2012-08-02 16:20:31Z lofwyr $ 033 */ 034 public class ToolBarTag extends PanelTag 035 implements ToolBarTagDeclaration { 036 037 public static final String LABEL_BOTTOM = UIToolBar.LABEL_BOTTOM; 038 public static final String LABEL_RIGHT = UIToolBar.LABEL_RIGHT; 039 public static final String LABEL_OFF = UIToolBar.LABEL_OFF; 040 041 public static final String ICON_SMALL = UIToolBar.ICON_SMALL; 042 public static final String ICON_BIG = UIToolBar.ICON_BIG; 043 public static final String ICON_OFF = UIToolBar.ICON_OFF; 044 045 private String labelPosition = LABEL_BOTTOM; 046 private String iconSize = ICON_SMALL; 047 private String orientation = UIToolBar.ORIENTATION_LEFT; 048 049 050 public String getComponentType() { 051 return UIToolBar.COMPONENT_TYPE; 052 } 053 054 protected void setProperties(UIComponent component) { 055 super.setProperties(component); 056 ComponentUtil.setStringProperty(component, ATTR_LABEL_POSITION, labelPosition); 057 ComponentUtil.setStringProperty(component, ATTR_ICON_SIZE, iconSize); 058 ComponentUtil.setStringProperty(component, ATTR_ORIENTATION, orientation); 059 } 060 061 public void release() { 062 super.release(); 063 labelPosition = LABEL_BOTTOM; 064 iconSize = ICON_SMALL; 065 } 066 067 public void setLabelPosition(String labelPosition) { 068 this.labelPosition = labelPosition; 069 } 070 071 public void setIconSize(String iconSize) { 072 this.iconSize = iconSize; 073 } 074 075 public void setOrientation(String orientation) { 076 this.orientation = orientation; 077 } 078 }