@Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; layout.verticalSpacing = 1; container.setLayout(layout); container.setLayoutData(new GridData(GridData.FILL_BOTH)); super.createControl(container); Label categoryLabel = new Label(container, SWT.NONE); categoryCb = new Combo(container, SWT.DROP_DOWN | SWT.READ_ONLY); categoryLabel.setText(BundleInternationalization.getString("CategoryLabel") + ":"); String[] items = new String[Categories.values().length]; for (int i = 0; i < Categories.values().length; i++) items[i] = Categories.values()[i].name(); categoryCb.setItems(items); categoryCb.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { wizardChanged(); } }); container.layout(); wizardChanged(); }
protected void wizardChanged() { super.wizardChanged(); boolean valid = isValid(); // Must select a category if (valid && categoryCb.getSelectionIndex() == -1) { updateStatus(BundleInternationalization.getString("ErrorMessage.CategoryNotSelected")); valid = false; } if (valid) super.updateStatus(null); }
public ProposalViewWP(String pageName) { super(pageName); setTitle(BundleInternationalization.getString("NewProposalWizardPageTitle")); setDescription(BundleInternationalization.getString("NewProposalWizardPageDescription")); }