[JFace]自定义Dialog的按钮

  1. /**
  2. * 重载默认的按钮建立方法,让其在本地的执行失效
  3. */ 
  4. protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
  5.     return null;
  6. }
  7.  
  8. /**
  9. * 利用父类的createButton方法建立按钮
  10. */
  11. protected void initializeBounds() {
  12.     /*
  13.      * 参数1:取得放按钮的面板,
  14.      * 参数2:按钮的id值
  15.      * 参数3:按钮上的文字
  16.      * 参数4:是否为Dialog的默认按钮
  17.      */
  18.     super.createButton((Composite) this.getButtonBar(),
  19.     IDialogConstants.OK_ID, "保存", true);
  20.     super.createButton((Composite) this.getButtonBar(),
  21.     IDialogConstants.OK_ID, "重填", false);
  22.     super.createButton((Composite) this.getButtonBar(),
  23.     IDialogConstants.CANCEL_ID, "退出", true);
  24.     super.initializeBounds();
  25. }
17fav 收藏本文
标签:

随机文章

Comments

2 Responses to “[JFace]自定义Dialog的按钮”

  1. bianbian on 2006-10-22 3:56 pm

    这个是干嘛的?做GUI的,还是WEB GUI?

    [Reply]

  2. Sunshow on 2006-10-22 5:31 pm

    gui

    [Reply]

Leave a Reply




请输入验证码

Use "<coolcode></coolcode>" to publish your code.

Line breaks and paragraphs are automatically converted.

Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.

京ICP备05059555号

收藏 & 分享

Powered by 17fav.com