pagingcommand.java

来自「非常接近C/S操作方式的Java Ajax框架-ZK 用ZK框架使你的B/S应」· Java 代码 · 共 58 行

JAVA
58
字号
/* PagingCommand.java{{IS_NOTE	Purpose:			Description:			History:		Fri Aug 18 09:12:45     2006, Created by tomyeh}}IS_NOTECopyright (C) 2006 Potix Corporation. All Rights Reserved.{{IS_RIGHT	This program is distributed under GPL Version 2.0 in the hope that	it will be useful, but WITHOUT ANY WARRANTY.}}IS_RIGHT*/package org.zkoss.zul.au.impl;import org.zkoss.lang.Objects;import org.zkoss.zk.mesg.MZk;import org.zkoss.zk.ui.Component;import org.zkoss.zk.ui.UiException;import org.zkoss.zk.ui.event.Events;import org.zkoss.zk.au.AuRequest;import org.zkoss.zk.au.Command;import org.zkoss.zul.event.PagingEvent;import org.zkoss.zul.ext.Paginal;/** * Used only by {@link AuRequest} to implement the {@link PagingEvent} * relevant command. *  * @author tomyeh */public class PagingCommand extends Command {	public PagingCommand(String evtnm, int flags) {		super(evtnm, flags);	}	//-- super --//	protected void process(AuRequest request) {		final Component comp = request.getComponent();		if (comp == null)			throw new UiException(MZk.ILLEGAL_REQUEST_COMPONENT_REQUIRED, this);		final String[] data = request.getData();		if (data == null || data.length != 1)			throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA,				new Object[] {Objects.toString(data), this});		final int pg = Integer.parseInt(data[0]);		((Paginal)comp).setActivePage(pg);			//Don't send the onPaging event since setActivePage will do	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?