如何在Eclipse中强制JFace向导的最小高度? [英] How to force a minimum height of a JFace Wizard in Eclipse?
问题描述
我正在展示一个向导(代码这里)太低了,所以内容没有完全显示(见下面的截图):
I'm presenting a wizard (code here) that gets too low, so the content does not show completely (see screenshot below):
我该怎么办?强制向导具有最小高度?
How can I force the wizard to have a minimum height?
According to the answer on this question here on StackOverflow, the wizard will be the same height as the largest wizardpage in the wizard, but my wizard obvilusly does not get resized according to at least the content of the largest page, and I also tried to set the minimum height of the first visible wizard page with code like this in the WizardPage class:
@Override
public void createControl(Composite parent) {
// create the composite to hold the widgets
Composite composite = new Composite(parent, SWT.NULL);
composite.setSize(300, 1024); // TODO: Does this work?
GridData gridData = new GridData(300, 1024);
gridData.heightHint = 1024;
gridData.minimumHeight = 1024;
composite.setLayoutData(gridData);
...但到目前为止没有成功。
... but without success so far.
任何提示?
推荐答案
尝试设置
parent.setLayout(new GridLayout());
到你的 createControl()
实施你的第一页。
to your createControl()
implementation of your first page.
看来你在该方法中得到的父作为 PageContainerFillLayout
的实例作为布局,而不是 GridLayout
。
It appears the parent you get in that method has an instance of PageContainerFillLayout
as layout, not GridLayout
.
如果您可以访问WizardDialog,还可以调用
If you have access to your WizardDialog, you could also call
wizardDialog.setMinimumPageSize(300, 1024)
这篇关于如何在Eclipse中强制JFace向导的最小高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!