Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 1027 → Rev 1028

/hostadmiral/trunk/src/ak/hostadmiral/core/taglib/list/PageIterateTag.java
34,6 → 34,18
this.infoProperty = infoProperty;
}
 
protected int max = 0;
 
public String getMax()
{
return Integer.toString(this.max);
}
 
public void setMax(String max)
{
this.max = Integer.parseInt(max);
}
 
protected int displayPage;
 
public int getDisplayPage()
50,8 → 62,9
 
public int doStartTag() throws JspException
{
displayPage = 0;
collectionInfo = findCollectionInfo();
displayPage = (max == 0) ? 0
: Math.max(0, collectionInfo.getCurrentPage() - max/2);
 
if(collectionInfo == null) return SKIP_BODY;
 
69,10 → 82,19
bodyContent.clearBody();
}
 
if(++displayPage < collectionInfo.getTotalPages())
displayPage++;
 
if(max == 0 && displayPage < collectionInfo.getTotalPages()) {
return EVAL_BODY_TAG;
else
}
else if(max > 0 && displayPage < collectionInfo.getTotalPages()
&& displayPage < collectionInfo.getCurrentPage() + max/2)
{
return EVAL_BODY_TAG;
}
else {
return SKIP_BODY;
}
}
 
public int doEndTag() throws JspException
92,5 → 114,6
super.release();
infoBean = null;
infoProperty = null;
max = 0;
}
}