JFace/SWT: Change the labels for buttons in InputDialog
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to create an InputDialog with custom labels for the OK/Cancel buttons. I'm using org.eclipse.jface.dialogs.InputDialog . I tried to override the button creation method: @Override protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); getButton(IDialogConstants.OK_ID).setText(myOkText); getButton(IDialogConstants.CANCEL_ID).setText(myCancelText); } and it works, but the buttons are not resized (and the custom text results cropped). I guess it's too late to set the text here, because the