我有一个自定义 RCP 应用程序,您知道如何从“关于”对话框中隐藏“安装详细信息”按钮吗?
问问题
522 次
2 回答
2
I haven't found the way to hide that button, I think the only possibility is to extend AboutDialog and make a new command for your plugin.
public class DAboutHandler extends AbstractHandler {
private class DAboutDialog extends AboutDialog
{
public final static int DETAILS_ID = IDialogConstants.CLIENT_ID + 1;
public DAboutDialog(Shell parentShell) {
super(parentShell);
}
@Override
protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
if(id==DETAILS_ID) return null;
return super.createButton(parent, id, label, defaultButton);
}
}
/*
* (non-Javadoc)
*
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
public DAboutDialog execute(ExecutionEvent event) throws ExecutionException {
new DAboutDialog(HandlerUtil.getActiveShellChecked(event)).open();
return null;
}
}
于 2012-08-23T14:52:32.917 回答
0
我不认为你可以......安装详细信息按钮是在 AboutDialog createButtonsForButtonBar 方法中创建的......看起来它是无条件的。
于 2012-07-13T19:36:08.290 回答