如何重命名文本确定并取消org.eclipse.jface.dialogs.MessageDialog

时间:2014-08-07 10:35:59

标签: java eclipse eclipse-plugin

我正在使用org.eclipse.jface.dialogs的Message Dialog,我需要在显示的按钮中重命名'Ok'和'Cancel'文本。怎么去?

1 个答案:

答案 0 :(得分:2)

MessageDialog requestRestartDialog = new MessageDialog(window.getShell()," Title",null,                             "要显示的消息",MessageDialog.CONFIRM,new String [] {" String 1"," String 2" },0);                     int index = requestRestartDialog.open();

index将返回指定标签的数组索引。