Second Page in Wizard is Blank (Composite) [message #464313] |
Mon, 21 November 2005 08:11  |
Eclipse User |
|
|
|
Originally posted by: sascha.goldsmith.flagstar.com
Gurus,
I have been attempting for several hours to get a simple wizard to work.
I am trying to have the user select one of two radio buttons prior to
picking 'next' in a Wizard. Once this is done, the wizard flow will
proceed normally. The first page of my Wizard displays fine. However,
regardless of which radio button I select, the next Wizard page is gray.
I know that the createControl() method is being called because the call to
setTitle() in that method is working fine. No matter what type of
controls I add to the Composite, nothing is shown. When I click 'back',
the previous Wizard page displays fine. I have attached the call from the
first Wizard page (SelectActionPage) and the next Wizard page
(SelectSearchTypePage). I would appreciate any help that you can offer.
My thanks in advance.
- Sascha
// First Wizard Page (displays fine)
public class SelectActionPage extends WizardPage {
final IWizardPage searchPage;
final IWizardPage statusPage;
IWizardPage activePage;
final public void createControl(Composite parent) {
setTitle("Main Menu");
Composite main = new Composite(parent, SWT.NONE);
setControl(main);
GridLayout layout = new GridLayout();
main.setLayout(layout);
layout.numColumns = 1;
layout.verticalSpacing = 20;
GridData itemLayout = new GridData();
itemLayout.widthHint = 200;
itemLayout.horizontalAlignment = SWT.LEFT;
Button searchButton = new Button(main, SWT.RADIO);
searchButton.setText("Search Repository");
searchButton.setLayoutData(itemLayout);
searchButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent evt) {
activePage = searchPage;
getWizard().getContainer().updateButtons();
}
});
Button statusButton = new Button(main, SWT.RADIO);
statusButton.setText("ISPT Status");
statusButton.setLayoutData(itemLayout);
statusButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent evt) {
activePage = statusPage;
getWizard().getContainer().updateButtons();
}
});
}
final public boolean canFlipToNextPage() {
return (activePage != null);
}
final public IWizardPage getNextPage() {
return activePage;
}
}
// Second Wizard page (title gets set but no controls appear)
public class SelectSearchTypePage extends WizardPage {
final public void createControl(Composite parent) {
setTitle("Select Search Type");
Composite main = new Composite(parent, SWT.NONE);
setControl(main);
GridLayout layout = new GridLayout();
layout.numColumns = 1;
layout.verticalSpacing = 10;
main.setLayoutData(layout);
GridData itemLayout = new GridData();
itemLayout.widthHint = 100;
Button untaggedButton = new Button(main, SWT.RADIO);
untaggedButton.setText("Untagged Files");
untaggedButton.setLayoutData(itemLayout);
Button advancedButton = new Button(main, SWT.RADIO);
advancedButton.setText("Advanced Search");
advancedButton.setLayoutData(itemLayout);
main.layout(true);
}
}
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.09086 seconds