Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated file description, minor bugfix #391

Merged
merged 1 commit into from Sep 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion zul/src/org/zkoss/zul/AbstractListModel.java
Expand Up @@ -27,7 +27,6 @@
import org.zkoss.io.Serializables;
import org.zkoss.lang.Objects;
import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.event.ListDataEvent;
import org.zkoss.zul.event.ListDataListener;
import org.zkoss.zul.event.PagingEvent;
Expand Down Expand Up @@ -287,6 +286,7 @@ private synchronized void writeObject(java.io.ObjectOutputStream s)

writeSelection(s);
Serializables.smartWrite(s, _listeners);
Serializables.smartWrite(s, _pagingListeners);
}
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
Expand All @@ -295,6 +295,8 @@ private void readObject(java.io.ObjectInputStream s)
readSelection(s);
_listeners = new ArrayList<ListDataListener>();
Serializables.smartRead(s, _listeners);
_pagingListeners = new ArrayList<PagingListener>();
Serializables.smartRead(s, _pagingListeners);
}

@SuppressWarnings("unchecked")
Expand All @@ -306,6 +308,7 @@ public Object clone() {
throw new InternalError();
}
clone._listeners = new ArrayList<ListDataListener>();
clone._pagingListeners = new ArrayList<PagingListener>();
clone._selection = clone.newEmptySelection();
clone._selection.addAll(_selection);
return clone;
Expand Down
4 changes: 2 additions & 2 deletions zul/src/org/zkoss/zul/Grid.java
Expand Up @@ -549,7 +549,7 @@ private void newInternalPaging() {
if (_pgi != null)
addPagingListener(_pgi);
}
private class PGListener extends PagingListener {
private class PGListener implements PagingListener {
public void onEvent(Event event) {
if (event instanceof PagingEvent) {
PagingEvent pe = (PagingEvent) event;
Expand All @@ -571,7 +571,7 @@ public Object willClone(Component comp) {
return null; // skip to clone
}
}
private class PGImpListener extends PagingListener {
private class PGImpListener implements PagingListener {
public void onEvent(Event event) {
if (_rows != null && _model != null && inPagingMold()) {
//theoretically, _rows shall not be null if _model is not null when
Expand Down
4 changes: 2 additions & 2 deletions zul/src/org/zkoss/zul/Listbox.java
Expand Up @@ -1291,7 +1291,7 @@ private void newInternalPaging() {
}

@SuppressWarnings("serial")
private class PGListener extends PagingListener {
private class PGListener implements PagingListener {
public void onEvent(Event event) {
//Bug ZK-1622: reset anchor position after changing page
_anchorTop = 0;
Expand All @@ -1318,7 +1318,7 @@ public Object willClone(Component comp) {
}
}
@SuppressWarnings("serial")
private class PGImpListener extends PagingListener {
private class PGImpListener implements PagingListener {
public void onEvent(Event event) {
if (_model != null && inPagingMold()) {
final Paginal pgi = getPaginal();
Expand Down
41 changes: 39 additions & 2 deletions zul/src/org/zkoss/zul/PagingEventPublisher.java
@@ -1,9 +1,46 @@
/* PagingEventPublisher.java

Purpose:

Description:

History:
Wed Sep 23 18:23:15 2015, Created by Christopher

Copyright (C) 2015 Potix Corporation. All Rights Reserved.

{{IS_RIGHT
This program is distributed under LGPL Version 2.1 in the hope that
it will be useful, but WITHOUT ANY WARRANTY.
}}IS_RIGHT
*/
package org.zkoss.zul;

import org.zkoss.zul.event.PagingEvent;
import org.zkoss.zul.event.PagingListener;

/**
* Provide methods to manage PagingListeners
* @author Christopher
* @see PagingEvent
* @since 8.0.0
*/
public interface PagingEventPublisher {
/**
* A flag different from standard PagingEvent, differentiating standard
* PagingEvent from Paging component and PagingEvent from PagingEventPublisher
*/
public static final String INTERNAL_EVENT = "internalModelEvent";
public void addPagingEventListener(PagingListener l);
public void removePagingEventListener(PagingListener l);
/**
* Adds a listener to the list of listeners to be notified when a PagingEvent
* happens outside of standard Paging component
* @param listener
*/
public void addPagingEventListener(PagingListener listener);
/**
* Removes a listener from the list of listeners to be notified when a PagingEvent
* happens outside of standard Paging component
* @param listener
*/
public void removePagingEventListener(PagingListener listener);
}
16 changes: 8 additions & 8 deletions zul/src/org/zkoss/zul/event/PagingListener.java
@@ -1,13 +1,13 @@
/* ListDataListener.java
/* PagingListener.java

Purpose:

Description:

History:
Wed Aug 17 18:05:15 2005, Created by tomyeh
Wed Sep 23 18:05:15 2015, Created by Christopher

Copyright (C) 2005 Potix Corporation. All Rights Reserved.
Copyright (C) 2015 Potix Corporation. All Rights Reserved.

{{IS_RIGHT
This program is distributed under LGPL Version 2.1 in the hope that
Expand All @@ -22,15 +22,15 @@
import org.zkoss.zk.ui.event.SerializableEventListener;

/**
* Defines the methods used to listener when the content of
* {@link org.zkoss.zul.ListModel} is changed.
* Provide a shortcut for PagingEventListener
*
* @author Christopher
* @see org.zkoss.zul.ListModel
* @see PagingEvent
* @see SerializableEventListener
* @see CloneableEventListener
* @since 8.0.0
*/
@SuppressWarnings("serial")
public abstract class PagingListener implements SerializableEventListener<Event>, CloneableEventListener<Event>{
public interface PagingListener extends SerializableEventListener<Event>, CloneableEventListener<Event>{
public abstract void onEvent(Event event) throws Exception;
public abstract Object willClone(Component comp);
}