Package org.fordprefect.struts2jscalendarplugin.views.jsp.ui

Source Code of org.fordprefect.struts2jscalendarplugin.views.jsp.ui.JSCalendarTag

/*
*  This file is part of Struts2JSCalendarPlugin.
*
*  Struts2JSCalendarPlugin is free software: you can redistribute it and/or modify
*  it under the terms of the GNU Lesser General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  Foobar is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU Lesser General Public License for more details.
*
*  You should have received a copy of the GNU Lesser General Public License
*  along with Struts2JSCalendarPlugin.  If not, see <http://www.gnu.org/licenses/>.
*
*  This work is based on the webwork datepicker plugin copyright (c) 2002-2006 by OpenSymphony
*
*  Copyright � 2007 - 2010 by Derik Vercueil, Philipp Leusmann
*/
package org.fordprefect.struts2jscalendarplugin.views.jsp.ui;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ui.TextFieldTag;
import org.fordprefect.struts2jscalendarplugin.components.JSCalendar;

import com.opensymphony.xwork2.util.ValueStack;

/**
* @see org.fordprefect.struts2jscalendarplugin.components.JSCalendar
*/
@SuppressWarnings("serial")
public class JSCalendarTag extends TextFieldTag {

  protected String format;
  protected String showstime;
  protected String singleclick;
  protected String flat;
  protected String flatCallback;

  @Override
  public Component getBean(ValueStack stack, HttpServletRequest req,
      HttpServletResponse res) {
    return new JSCalendar(stack, req, res);
  }

  @Override
  protected void populateParams() {
    super.populateParams();
    final JSCalendar jsCalendar = (JSCalendar) component;
    jsCalendar.setFormat(format);
    jsCalendar.setShowstime(showstime);
    jsCalendar.setSingleclick(singleclick);
    jsCalendar.setFlat(flat);
    jsCalendar.setFlatCallback(flatCallback);
    jsCalendar.setReadonly(readonly);
  }

  public void setFormat(String format) {
    this.format = format;
  }

  public void setShowstime(String showstime) {
    this.showstime = showstime;
  }

  public void setSingleclick(String singleclick) {
    this.singleclick = singleclick;
  }

  public void setFlat(String flat) {
    this.flat = flat;
  }

  public void setFlatCallback(String flatCallback) {
    this.flatCallback = flatCallback;
  }

}
TOP

Related Classes of org.fordprefect.struts2jscalendarplugin.views.jsp.ui.JSCalendarTag

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.