/* Fisheyelist.java
{{IS_NOTE
Purpose:
Description:
History:
Thu Dec 29 20:47:54 2005, Created by tomyeh
}}IS_NOTE
Copyright (C) 2005 Potix Corporation. All Rights Reserved.
{{IS_RIGHT
}}IS_RIGHT
*/
package org.zkforge.dojo;
import org.zkoss.lang.Objects;
import org.zkoss.xml.HTMLs;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.UiException;
import org.zkoss.zk.ui.WrongValueException;
import org.zkforge.dojo.impl.DojoComponent;
/**
* A fisheye list is a list of {@link Fisheyeitem} that allows user to
* select an item easily.
*
* @author tomyeh
* @version $Revision: 1.9 $ $Date: 2006/03/17 10:36:24 $
*/
public class Fisheyelist extends DojoComponent {
private int _itemwd = 50, _itemhgh = 50,
_itemmaxwd = 200, _itemmaxhgh = 200, _itemPadding = 10;
private String _orient = "horizontal", _attachEdge = "center",
_labelEdge = "bottom";
/** Returns the item width of {@link Fisheyeitem}.
*/
public int setItemWidth() {
return _itemwd;
}
/** Sets the item width of {@link Fisheyeitem}.
*/
public void setItemWidth(int itemwd) throws WrongValueException {
if (itemwd <= 0)
throw new WrongValueException("Positive is required: "+itemwd);
if (_itemwd != itemwd) {
_itemwd = itemwd;
smartUpdate("dojo:itemWidth", itemwd);
}
}
/** Returns the item height of {@link Fisheyeitem}.
*/
public int setItemHeight() {
return _itemhgh;
}
/** Sets the item height of {@link Fisheyeitem}.
*/
public void setItemHeight(int itemhgh) throws WrongValueException {
if (itemhgh <= 0)
throw new WrongValueException("Positive is required: "+itemhgh);
if (_itemhgh != itemhgh) {
_itemhgh = itemhgh;
smartUpdate("dojo:itemHeight", itemhgh);
}
}
/** Returns the item maximal width of {@link Fisheyeitem}.
*/
public int setItemMaxWidth() {
return _itemmaxwd;
}
/** Sets the item maximal width of {@link Fisheyeitem}.
*/
public void setItemMaxWidth(int itemmaxwd) throws WrongValueException {
if (itemmaxwd <= 0)
throw new WrongValueException("Positive is required: "+itemmaxwd);
if (_itemmaxwd != itemmaxwd) {
_itemmaxwd = itemmaxwd;
smartUpdate("dojo:itemMaxWidth", itemmaxwd);
}
}
/** Returns the item maximal height of {@link Fisheyeitem}.
*/
public int setItemMaxHeight() {
return _itemmaxhgh;
}
/** Sets the item maximal height of {@link Fisheyeitem}.
*/
public void setItemMaxHeight(int itemmaxhgh) throws WrongValueException {
if (itemmaxhgh <= 0)
throw new WrongValueException("Positive is required: "+itemmaxhgh);
if (_itemmaxhgh != itemmaxhgh) {
_itemmaxhgh = itemmaxhgh;
smartUpdate("dojo:itemMaxHeight", itemmaxhgh);
}
}
/** Returns the item padding of {@link Fisheyeitem}.
*/
public int setItemPadding() {
return _itemPadding;
}
/** Sets the item padding of {@link Fisheyeitem}.
*/
public void setItemPadding(int itemPadding) throws WrongValueException {
if (itemPadding <= 0)
throw new WrongValueException("Positive is required: "+itemPadding);
if (_itemPadding != itemPadding) {
_itemPadding = itemPadding;
smartUpdate("dojo:itemPadding", itemPadding);
}
}
/** Returns the orientation of {@link Fisheyeitem}.
*/
public String setOrient() {
return _orient;
}
/** Sets the orientation of {@link Fisheyeitem}.
*/
public void setOrient(String orient) throws WrongValueException {
if (!"horizontal".equals(orient) && !"vertical".equals(orient))
throw new WrongValueException(orient);
if (!Objects.equals(_orient, orient)) {
_orient = orient;
smartUpdate("dojo:orientation", orient);
}
}
/** Returns the attach edge.
* <p>Default: center
*/
public String getAttachEdge() {
return _attachEdge;
}
/** Returns the attach edge.
*/
public void setAttachEdge(String attachEdge) throws WrongValueException {
if (attachEdge == null || attachEdge.length() == 0)
throw new WrongValueException("Empty attachEdge not allowed");
if (!_attachEdge.equals(attachEdge)) {
_attachEdge = attachEdge;
smartUpdate("dojo:attachEdge", attachEdge);
}
}
/** Returns the label edge.
* <p>Default: bottom
*/
public String getLabelEdge() {
return _labelEdge;
}
/** Returns the label edge.
*/
public void setLabelEdge(String labelEdge) throws WrongValueException {
if (labelEdge == null || labelEdge.length() == 0)
throw new WrongValueException("Empty labelEdge not allowed");
if (!_labelEdge.equals(labelEdge)) {
_labelEdge = labelEdge;
smartUpdate("dojo:labelEdge", labelEdge);
}
}
/** Returns the HTML attributes used by the interior element, which
* is the fisheye list.
* <p>Used only for component development, not for application developers.
*/
public String getInnerAttrs() {
final StringBuffer sb =
new StringBuffer(256).append(super.getInnerAttrs());
HTMLs.appendAttribute(sb, "dojo:itemWidth", _itemwd);
HTMLs.appendAttribute(sb, "dojo:itemHeight", _itemhgh);
HTMLs.appendAttribute(sb, "dojo:itemMaxWidth", _itemmaxwd);
HTMLs.appendAttribute(sb, "dojo:itemMaxHeight", _itemmaxhgh);
HTMLs.appendAttribute(sb, "dojo:itemPadding", _itemPadding);
HTMLs.appendAttribute(sb, "dojo:attachEdge", _attachEdge);
HTMLs.appendAttribute(sb, "dojo:labelEdge", _labelEdge);
HTMLs.appendAttribute(sb, "dojo:orientation", _orient);
return sb.toString();
}
//-- Component --//
public boolean insertBefore(Component child, Component insertBefore) {
if (!(child instanceof Fisheyeitem))
throw new UiException("Unsupported child for fisheyelist: "+child);
return super.insertBefore(child, insertBefore);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
dojo Ajax

共782个文件
js:412个
gif:165个
html:78个

需积分: 0 202 下载量 85 浏览量
2007-05-17
03:03:02
上传
评论
收藏 3.29MB ZIP 举报
温馨提示
dojo ajax framework
资源详情
资源评论
资源推荐
收起资源包目录





































































































共 782 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8















zhaohwi
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


安全验证
文档复制为VIP权益,开通VIP直接复制

评论0