can DialogBox has a "x" close button in the upper right hand corner like most window have?

已查看 258 次
跳至第一个未读帖子

tong123123

未读,
2012年5月31日 04:54:442012/5/31
收件人 google-we...@googlegroups.com
I think it is very difficult if not impossible, just requested by my company and try to ask here.

Andrea Boscolo

未读,
2012年5月31日 08:12:282012/5/31
收件人 google-we...@googlegroups.com
DialogBox uses a Caption element for the header. By default the caption is simply text.
Extend it to provide all the buttons you need.
Search in the groups to find out some samples.

jhulford

未读,
2012年5月31日 11:22:212012/5/31
收件人 google-we...@googlegroups.com
Where it was a pain in the past to do this, it's actually pretty straightforward now.  Just extend DialogBox and provide your own Caption implementation in your constructor's super call.  Our Caption is just a simple 2 column Grid extension with an "X" Image in the right column.

tong123123

未读,
2012年6月1日 05:05:402012/6/1
收件人 google-we...@googlegroups.com
from http://google-web-toolkit.googlecode.com/svn/javadoc/2.4/com/google/gwt/user/client/ui/DialogBox.html
I think I need create a class that implements DialogBox.Caption and then use the constructor
DialogBox(DialogBox.Caption captionWidget)
?
but the difficulty is how to implement all the method in the interface DialogBox.Caption?

let said I name the class customCaption and implements all the interface method in DialogBox.Caption and then inside the customCaption class I use flextable to add a "x" image in a column of flextable?


On Thursday, May 31, 2012 4:54:44 PM UTC+8, tong123123 wrote:
I think it is very difficult if not impossible, just requested by my company and try to ask here.

jhulford

未读,
2012年6月1日 09:27:112012/6/1
收件人 google-we...@googlegroups.com
Yes, that would be exactly how you'd do it.  There's really not much to actually implement. All of the handler methods are just simple variants of "addHandler", so you really end up with having to actually write are the get/set HTML/Text methods.

tong123123

未读,
2012年6月2日 11:32:502012/6/2
收件人 google-we...@googlegroups.com
if the source checked out is not wrong, I see the following
public static class CaptionImpl extends HTML implements Caption {

    public CaptionImpl() {
      super();
      setStyleName("Caption");
    }
  }

in class DialogBox source file,
but

com.google.gwt.user.client.ui.DialogBox.Caption has the following interface

addMouseDownHandler,addMouseUpHandler,addMouseOutHandler,addMouseOverHandler
addMouseMoveHandler,fireEvent, getHTML, setHTML, getText, setText,
setHTML, asWidget
so how could the com.google.gwt.user.client.ui.DialogBox.CaptionImpl implement Caption Inteface???


jhulford於 2012年6月1日星期五UTC+8下午9時27分11秒寫道:

Thomas Broyer

未读,
2012年6月2日 13:15:242012/6/2
收件人 google-we...@googlegroups.com


On Saturday, June 2, 2012 5:32:50 PM UTC+2, tong123123 wrote:
if the source checked out is not wrong, I see the following
public static class CaptionImpl extends HTML implements Caption {

    public CaptionImpl() {
      super();
      setStyleName("Caption");
    }
  }

in class DialogBox source file,
but

com.google.gwt.user.client.ui.DialogBox.Caption has the following interface

addMouseDownHandler,addMouseUpHandler,addMouseOutHandler,addMouseOverHandler
addMouseMoveHandler,fireEvent, getHTML, setHTML, getText, setText,
setHTML, asWidget
so how could the com.google.gwt.user.client.ui.DialogBox.CaptionImpl implement Caption Inteface???

All those methods are inherited from the com.google.gwt.user.client.ui.HTML super-class.
回复全部
回复作者
转发
0 个新帖子