The minimum size of the wizard page is set in the WizardDialog
which shows the wizard.
The default value is 300 x 225 pixels. WizardDialog
has a setMinimumPageSize
method to change this which is used by a lot of Eclipse wizards.
Вопрос
I coded the following wizard:
package try_eclipsewizardlayout_02;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
public class TryWizard extends Wizard {
abstract class TableLabelProvider extends LabelProvider implements ITableLabelProvider {
}
public class Page1 extends WizardPage {
protected Page1() {
super("Page 1");
}
@Override
public void createControl(Composite parent) {
Composite control = new Composite(parent, SWT.NONE) {
@Override
public String toString() {
return super.toString() + ": control of Page1";
}
};
control.setLayout(new FillLayout());
Button button = new Button(control, SWT.PUSH);
button.setText("Option 1");
setControl(control);
}
}
Page1 page1 = new Page1();
@Override
public void addPages() {
addPage(page1);
// getShell().setSize(640, 480);
}
@Override
public boolean performFinish() {
return false;
}
}
I appears with some size. Which this size is? How to know it? It can't be the size of largest control, because it is a button and apparently grown.
Решение
The minimum size of the wizard page is set in the WizardDialog
which shows the wizard.
The default value is 300 x 225 pixels. WizardDialog
has a setMinimumPageSize
method to change this which is used by a lot of Eclipse wizards.