Thanks for all your reply.
I'v find a perfect solution, here they are, hope this would help other
peoples:
public class OrderedList extends ComplexPanel {
public OrderedList() {
setElement(DOM.createElement("OL"));
}
public void add(Widget w) {
super.add(w, getElement());
}
public void insert(Widget w, int beforeIndex) {
super.insert(w, getElement(), beforeIndex, true);
}
}
public class ListItem extends ComplexPanel implements HasText {
public ListItem() {
setElement(DOM.createElement("LI"));
}
public void add(Widget w) {
super.add(w, getElement());
}
public void insert(Widget w, int beforeIndex) {
super.insert(w, getElement(), beforeIndex, true);
}
public String getText() {
return DOM.getInnerText(getElement());
}
public void setText(String text) {
DOM.setInnerText(getElement(), (text == null) ? "" : text);
}
}
On 1月16日, 下午7时31分, luisfpg <[email protected]> wrote:
> Create a class like this:
>
> public class ULPanel extends ComplexPanel {
>
> private UListElement list;
>
> public BulletPanel() {
> list = Document.get().createULElement();
> setElement(list);
> }
>
> @Override
> public void add(Widget child) {
> Element li = Document.get().createLIElement().cast();
> list.appendChild(li);
> super.add(child, li);
> }
>
>
>
> }- 隐藏被引用文字 -
>
> - 显示引用的文字 -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---