eclipse jface组件中如何隐藏TitleAreaDialog对话框右上方的关闭按钮

请教一个问题,eclipse jface对话框组件中要想隐藏 TitleAreaDialog 类型对话框右上方的关闭按钮要如何处理。现在我是用的

@Override
protected boolean canHandleShellCloseEvent() {
    return false;
}

来处理的,当用户点击关闭按钮时使之对应的关闭对话框的event失效。但是感觉很别扭,希望指点。谢谢!

直接上代码了.

[code="java"]public class TDialog extends TitleAreaDialog {
public TDialog (Shell parentShell) {
super(parentShell);
this.setShellStyle(getDialogStyleWithOutClose(this.getShellStyle()));
}
...
}

public int getDialogStyleWithOutClose(int oldDialogStyle) {
    int oldStyle = oldDialogStyle;
    String oldString = Integer.toBinaryString(oldStyle);
    String newString = oldString;
    if (oldString.length() == 6) {
        newString = oldString.substring(0, oldString.length() - 7) + "0" + oldString.substring(oldString.length() - 6);
    } else if (oldString.length() > 6){
        newString = "0" + oldString.substring(oldString.length() - 6);
    }
    int newStyle = Integer.parseInt(newString, 2);
    return newStyle;
}[/code]

重写getShellStyle()方法:
[code="java"]
TitleAreaDialog d = new TitleAreaDialog(shell) {
@Override
protected int getShellStyle() {

            return SWT.TITLE;
        }
    };
    d.open();

[/code]