package kcc.com.cmm;

import javax.servlet.ServletContext;

import org.springframework.web.context.ServletContextAware;

import egovframework.rte.ptl.mvc.tags.ui.pagination.AbstractPaginationRenderer;
/**
 * ImagePaginationRenderer.java 클래스
 *
 * @author 서준식
 * @since 2011. 9. 16.
 * @version 1.0
 * @see
 *
 * <pre>
 * << 개정이력(Modification Information) >>
 *
 *   수정일      수정자           수정내용
 *  -------    -------------    ----------------------
 *   2011. 9. 16.   서준식       이미지 경로에 ContextPath추가
 * </pre>
 */
public class ImagePaginationRenderer extends AbstractPaginationRenderer implements ServletContextAware{

	private ServletContext servletContext;

	public ImagePaginationRenderer() {
		// no-op
	}

	public void initVariables(){
		/*firstPageLabel    = "<li>&#160;</li><li><a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() +  "/images/egovframework/com/cmm/mod/icon/icon_prevend.gif\" alt=\"처음\"   border=\"0\"/></a></li>";
        previousPageLabel = "<li><a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() +  "/images/egovframework/com/cmm/mod/icon/icon_prev.gif\"    alt=\"이전\"   border=\"0\"/></a></li>";
        currentPageLabel  = "<li><strong>{0}</strong></li>";
        otherPageLabel    = "<li><a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \">{2}</a></li>";
        nextPageLabel     = "<li>&#160;<a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() +  "/images/egovframework/com/cmm/mod/icon/icon_next.gif\"    alt=\"다음\"   border=\"0\"/></a></li>";
        lastPageLabel     = "<li><a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() +  "/images/egovframework/com/cmm/mod/icon/icon_nextend.gif\" alt=\"마지막\" border=\"0\"/></a></li>";*/

		/*firstPageLabel    = "<li><input type='button' class='pageFirst' onclick=\"{0}({1});return false;\"></li>";
        previousPageLabel = "<li><input type='button' class='pageBefore' onclick=\"{0}({1});return false;\"></li>";
        currentPageLabel  = "<li><strong style='font-weight:bold;'>{0}</strong></li>";
        otherPageLabel    = "<li onclick=\"{0}({1});return false;\" style='cursor:pointer'>{2}</li>";
        nextPageLabel     = "<li><input type='button' class='pageNext' onclick=\"{0}({1});return false;\"></li>";
        lastPageLabel     = "<li><input type='button' class='pageLast' onclick=\"{0}({1});return false;\"></li>";*/
		
		firstPageLabel    = "<button class='btn_page_first' title='첫 페이지 이동' onclick=\"{0}({1});return false;\"><i></i></button>";
        previousPageLabel = "<button class='btn_page_prev' title='이전 페이지 이동' onclick=\"{0}({1});return false;\"><i></i></button>";
        currentPageLabel  = "<button class='on' title=\"현재 {0}페이지\" onclick='return false;' readonly='readonly'>{0}</button>";
        otherPageLabel    = "<button title=\"{1} 페이지 이동\" onclick=\"{0}({1});return false;\">{2}</button>";
        nextPageLabel     = "<button class='btn_page_next' title='다음 페이지 이동' onclick=\"{0}({1});return false;\"><i></i></button>";
        lastPageLabel     = "<button class='btn_page_last' title='마지막 페이지 이동' onclick=\"{0}({1});return false;\"><i></i></button>";
	}

	
	
	@Override
	public void setServletContext(ServletContext servletContext) {
		this.servletContext = servletContext;
		initVariables();
	}

}
