如何在Eclipse中强制JFace向导的最小高度? [英] How to force a minimum height of a JFace Wizard in Eclipse?

查看:289
本文介绍了如何在Eclipse中强制JFace向导的最小高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在展示一个向导(代码这里)太低了,所以内容没有完全显示(见下面的截图):

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?

根据这个问题在StackOverflow上,这个向导与向导中最大的向导页面的高度相同,但我的向导似乎没有根据内容<调整大小最大页面的/ em>,我还试图在WizardPage类中使用这样的代码设置第一个可见向导页面的最小高度:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆