jsp使用自定义标签taglib分页系列——ContentBase.java

15 篇文章 0 订阅

package com.avantouch.common.web.struts.taglib;

import com.avantouch.common.web.struts.taglib.table.TDTag;

/**
 * <p>Title ContentBase.java</p>
 * <p>Description  </p>
 * <p>Copyright:  Copyright (c) 2004 AvanTouch,Inc</p>
 * <p>Company:  AvanTouch,Inc</p>
 * @author:  david 2004-12-7
 * @modifier:
 * @version  1.0
 */
public abstract class ContentBase extends TDTag {

 // Mouse Events

 /** Mouse click event. */
 private String onClick = null;

 /** Mouse double click event. */
 private String onDblClick = null;

 /** Mouse over component event. */
 private String onMouseOver = null;

 /** Mouse exit component event. */
 private String onMouseOut = null;

 /** Mouse moved over component event. */
 private String onMouseMove = null;

 /** Mouse pressed on component event. */
 private String onMouseDown = null;

 /** Mouse released on component event. */
 private String onMouseUp = null;

 //  Keyboard Events

 /** Key down in component event. */
 private String onKeyDown = null;

 /** Key released in component event. */
 private String onKeyUp = null;

 /** Key down and up together in component event. */
 private String onKeyPress = null;

 // Mouse Events

 /** Sets the onClick event handler. */
 public void setOnClick(String onClick) {
  this.onClick = onClick;
 }

 /** Returns the onClick event handler. */
 public String getOnClick() {
  return onClick;
 }

 /** Sets the onDblClick event handler. */
 public void setOnDblClick(String onDblClick) {
  this.onDblClick = onDblClick;
 }

 /** Returns the onDblClick event handler. */
 public String getOnDblClick() {
  return onDblClick;
 }

 /** Sets the onMouseDown event handler. */
 public void setOnMouseDown(String onMouseDown) {
  this.onMouseDown = onMouseDown;
 }

 /** Returns the onMouseDown event handler. */
 public String getOnMouseDown() {
  return onMouseDown;
 }

 /** Sets the onMouseUp event handler. */
 public void setOnMouseUp(String onMouseUp) {
  this.onMouseUp = onMouseUp;
 }

 /** Returns the onMouseUp event handler. */
 public String getOnMouseUp() {
  return onMouseUp;
 }

 /** Sets the onMouseMove event handler. */
 public void setOnMouseMove(String onMouseMove) {
  this.onMouseMove = onMouseMove;
 }

 /** Returns the onMouseMove event handler. */
 public String getOnMouseMove() {
  return onMouseMove;
 }

 /** Sets the onMouseOver event handler. */
 public void setOnMouseOver(String onMouseOver) {
  this.onMouseOver = onMouseOver;
 }

 /** Returns the onMouseOver event handler. */
 public String getOnMouseOver() {
  return onMouseOver;
 }

 /** Sets the onMouseOut event handler. */
 public void setOnMouseOut(String onMouseOut) {
  this.onMouseOut = onMouseOut;
 }

 /** Returns the onMouseOut event handler. */
 public String getOnMouseOut() {
  return onMouseOut;
 }

 // Keyboard Events

 /** Sets the onKeyDown event handler. */
 public void setOnKeyDown(String onKeyDown) {
  this.onKeyDown = onKeyDown;
 }

 /** Returns the onKeyDown event handler. */
 public String getOnKeyDown() {
  return onKeyDown;
 }

 /** Sets the onKeyUp event handler. */
 public void setOnKeyUp(String onKeyUp) {
  this.onKeyUp = onKeyUp;
 }

 /** Returns the onKeyUp event handler. */
 public String getOnKeyUp() {
  return onKeyUp;
 }

 /** Sets the onKeyPress event handler. */
 public void setOnKeyPress(String onKeyPress) {
  this.onKeyPress = onKeyPress;
 }

 /** Returns the onKeyPress event handler. */
 public String getOnKeyPress() {
  return onKeyPress;
 }

 /**
 * Prepares the mouse event handlers, appending them to the the given
 * StringBuffer.
 * @param handlers The StringBuffer that output will be appended to.
 */
 public void prepareMouseEvents(StringBuffer handlers) {
  if (onClick != null) {
   handlers.append(" onClick=/"");
   handlers.append(getOnClick());
   handlers.append("/"");
  }

  if (onDblClick != null) {
   handlers.append(" onDblclick=/"");
   handlers.append(getOnDblClick());
   handlers.append("/"");
  }

  if (onMouseOver != null) {
   handlers.append(" onMouseOver=/"");
   handlers.append(getOnMouseOver());
   handlers.append("/"");
  }

  if (onMouseOut != null) {
   handlers.append(" onMouseOut=/"");
   handlers.append(getOnMouseOut());
   handlers.append("/"");
  }

  if (onMouseMove != null) {
   handlers.append(" onMouseMove=/"");
   handlers.append(getOnMouseMove());
   handlers.append("/"");
  }

  if (onMouseDown != null) {
   handlers.append(" onMouseDown=/"");
   handlers.append(getOnMouseDown());
   handlers.append("/"");
  }

  if (onMouseUp != null) {
   handlers.append(" onMouseUp=/"");
   handlers.append(getOnMouseUp());
   handlers.append("/"");
  }
 } // end prepareMouseEvents

 /**
 * Prepares the keyboard event handlers, appending them to the the given
 * StringBuffer.
 * @param handlers The StringBuffer that output will be appended to.
 */
 public void prepareKeyEvents(StringBuffer handlers) {

  if (onKeyDown != null) {
   handlers.append(" onKeyDown=/"");
   handlers.append(getOnKeyDown());
   handlers.append("/"");
  }

  if (onKeyUp != null) {
   handlers.append(" onKeyUp=/"");
   handlers.append(getOnKeyUp());
   handlers.append("/"");
  }

  if (onKeyPress != null) {
   handlers.append(" onKeyPress=/"");
   handlers.append(getOnKeyPress());
   handlers.append("/"");
  }
 } // end prepareKeyEvents

 /**
 * Prepares all event handlers, appending them to the the given StringBuffer.    
 * <p><code>prepareEvents</code></p>
 * @param handlers
 * @author david 2004-12-6
 * @Since 1.0
 */
 public void prepareEvents(StringBuffer handlers) {
  prepareKeyEvents(handlers);
  prepareMouseEvents(handlers);
 } // end prepareEvents

 /**
  * Release all allocated resources.
  */
 public void release() {
  super.release();
  onClick = null;
  onDblClick = null;
  onKeyDown = null;
  onKeyPress = null;
  onKeyUp = null;
  onMouseDown = null;
  onMouseMove = null;
  onMouseOut = null;
  onMouseOver = null;
  onMouseUp = null;
 } // end release
}
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值