/** (non-Javadoc) Method declared on IDialogPage. */ public void createControl(Composite parent) { // inherit default container and name specification widgets super.createControl(parent); Composite composite = (Composite) getControl(); // WorkbenchHelp.setHelp(composite, // IReadmeConstants.CREATION_WIZARD_PAGE_CONTEXT); this.setFileName(Messages.getString("WOComponentCreationPage.newComponent.defaultName")); // new Label(composite, SWT.NONE); // vertical spacer Group javaGroup = new Group(composite, SWT.NONE); javaGroup.setText(Messages.getString("WOComponentCreationPage.creationOptions.javaFile.group")); GridLayout javaLayout = new GridLayout(); javaLayout.numColumns = 4; javaGroup.setLayout(javaLayout); javaGroup.setLayoutData( new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); PackageButtonAdapter packageButtonAdapter = new PackageButtonAdapter(); _packageDialogField = new StringButtonStatusDialogField(packageButtonAdapter); _packageDialogField.setDialogFieldListener(packageButtonAdapter); _packageDialogField.setLabelText(NewWizardMessages.NewTypeWizardPage_package_label); _packageDialogField.setButtonLabel(NewWizardMessages.NewTypeWizardPage_package_button); _packageDialogField.setStatusWidthHint(NewWizardMessages.NewTypeWizardPage_default); _packageDialogField.doFillIntoGrid(javaGroup, 4); Text packageText = _packageDialogField.getTextControl(null); LayoutUtil.setWidthHint(packageText, convertWidthInCharsToPixels(40)); LayoutUtil.setHorizontalGrabbing(packageText); // JavaPackageCompletionProcessor packageCompletionProcessor= new // JavaPackageCompletionProcessor(); // ControlContentAssistHelper.createTextContentAssistant(text, // packageCompletionProcessor); if (_currentSelection instanceof IPackageFragment) { _packageDialogField.setText(((IPackageFragment) _currentSelection).getElementName()); } else { String _package = null; IResource _resource = ResourcesPlugin.getWorkspace().getRoot().findMember(this.getContainerFullPath()); if (_resource instanceof IFolder) { _package = packageNameForComponentFolder((IFolder) _resource); } if (_package == null && (_package = packageNameForComponent("Main")) == null) { _package = ""; } _packageDialogField.setText(_package); } SuperclassButtonAdapter superclassButtonAdapter = new SuperclassButtonAdapter(); _superclassDialogField = new StringButtonStatusDialogField(superclassButtonAdapter); _superclassDialogField.setDialogFieldListener(superclassButtonAdapter); _superclassDialogField.setLabelText(NewWizardMessages.NewTypeWizardPage_superclass_label); _superclassDialogField.setButtonLabel(NewWizardMessages.NewTypeWizardPage_superclass_button); _superclassDialogField.setStatusWidthHint(NewWizardMessages.NewTypeWizardPage_default); _superclassDialogField.doFillIntoGrid(javaGroup, 4); String superclass = this.getDialogSettings().get(WOComponentCreationPage.SUPERCLASS_KEY); if (superclass == null || superclass.length() == 0) { _superclassDialogField.setText("com.webobjects.appserver.WOComponent"); } else { _superclassDialogField.setText(superclass); } Text superclassText = _superclassDialogField.getTextControl(null); LayoutUtil.setWidthHint(superclassText, convertWidthInCharsToPixels(40)); LayoutUtil.setHorizontalGrabbing(superclassText); new Label(composite, SWT.NONE); // vertical spacer /* * HTML body generation options */ Group optionalFilesGroup = new Group(composite, SWT.NONE); optionalFilesGroup.setLayout(new GridLayout(3, false)); optionalFilesGroup.setText(Messages.getString("WOComponentCreationPage.creationOptions.group")); optionalFilesGroup.setLayoutData( new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); ButtonSelectionAdaptor listener = new ButtonSelectionAdaptor(); _bodyCheckbox = new Button(optionalFilesGroup, SWT.CHECK); _bodyCheckbox.setText( Messages.getString("WOComponentCreationPage.creationOptions.bodyTag.button")); _bodyCheckbox.setSelection(this.getDialogSettings().getBoolean(BODY_CHECKBOX_KEY)); _bodyCheckbox.setAlignment(SWT.CENTER); _bodyCheckbox.addListener(SWT.Selection, this); _bodyCheckbox.addSelectionListener(listener); Label htmlLabel = new Label(optionalFilesGroup, SWT.RIGHT); htmlLabel.setText(Messages.getString("WOComponentCreationPage.creationOptions.bodyTag.label")); htmlLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); _htmlCombo = new Combo(optionalFilesGroup, SWT.DROP_DOWN); _htmlCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); populateHTMLCombo(_htmlCombo); refreshButtonSettings(_bodyCheckbox); _apiCheckbox = new Button(optionalFilesGroup, SWT.CHECK); GridData apiLayoutData = new GridData(); // apiLayoutData.horizontalSpan = 3; _apiCheckbox.setLayoutData(apiLayoutData); _apiCheckbox.setText( Messages.getString("WOComponentCreationPage.creationOptions.apiFile.button")); _apiCheckbox.setSelection(this.getDialogSettings().getBoolean(API_CHECKBOX_KEY)); _apiCheckbox.addListener(SWT.Selection, this); _apiCheckbox.addSelectionListener(listener); Label encodingLabel = new Label(optionalFilesGroup, SWT.RIGHT); encodingLabel.setText( Messages.getString("WOComponentCreationPage.creationOptions.wooFile.label")); encodingLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); _encodingCombo = new Combo(optionalFilesGroup, SWT.DROP_DOWN); _encodingCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); populateStringEncodingCombo(_encodingCombo); setPageComplete(validatePage()); }