/* * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. * * This library 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 2.1 of the License, or (at your option) * any later version. * * This library 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. */ package com.agiletec.apsadmin.tags.form; import javax.servlet.jsp.JspException; import com.agiletec.apsadmin.tags.util.AutoIndexingTagHelper; import com.agiletec.apsadmin.tags.util.IAutoIndexingTag; /** * This class extends the org.apache.struts2.views.jsp.ui.CheckboxTag * in order to handle auto-incrementing Tabindex * @author E.Santoboni * @deprecated Use default struts2 s:checkbox tag */ public class CheckboxTag extends org.apache.struts2.views.jsp.ui.CheckboxTag implements IAutoIndexingTag { @Override public int doStartTag() throws JspException { String currentCounter = this.getCurrentIndex(); if (null != currentCounter) { this.setTabindex(currentCounter); } return super.doStartTag(); } @Override public String getCurrentIndex() { return AutoIndexingTagHelper.getCurrentIndex(this, this.pageContext.getRequest()); } @Override public Integer getStep() { return _step; } public void setStep(Integer step) { this._step = step; } @Override public Boolean getUseTabindexAutoIncrement() { return _useTabindexAutoIncrement; } public void setUseTabindexAutoIncrement(Boolean useTabindexAutoIncrement) { this._useTabindexAutoIncrement = useTabindexAutoIncrement; } private Integer _step = 1; private Boolean _useTabindexAutoIncrement; }