/* * (non-Javadoc) * * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) */ protected Control createDialogArea(Composite parent) { getShell().setText("New Regex"); // $NON-NLS-1$ // getShell().setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_WHITE)); Composite composite = (Composite) super.createDialogArea(parent); composite.setLayout(new FillLayout()); FormToolkit toolkit = new FormToolkit(Display.getDefault()); form = toolkit.createForm(composite); form.getBody().setLayout(new GridLayout()); toolkit.decorateFormHeading(form); sec = toolkit.createSection(form.getBody(), Section.TITLE_BAR); sec.setText("Regular Expression"); // $NON-NLS-1$ sec.setLayoutData(new GridData(SWT.FILL, SWT.Expand, true, false, 1, 1)); Composite compo = toolkit.createComposite(sec); GridLayout layout = new GridLayout(2, false); layout.marginWidth = 0; layout.marginHeight = 0; compo.setLayout(layout); sec.setClient(compo); createContent(toolkit, compo); // Create field for Regex toolkit.createLabel(compo, "Regex: "); // $NON-NLS-1$ String helpText = Messages.PopupRegexDialog_REGEX; componentHelpTextField = new ComponentHelpTextField(this, compo, toolkit, SWT.NONE, helpText); GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); componentHelpTextField.setLayoutData(data); // Add regex viewer component to the dialog regex = new RegexViewerComposite( form.getBody(), SWT.NONE, RegexViewerComposite.EXPANDABLE | RegexViewerComposite.MATCH | RegexViewerComposite.DESCRIPTION | RegexViewerComposite.GROUP, Pattern.MULTILINE | patterns); regex.setDescription("Regex Test Area"); // $NON-NLS-1$ regex.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1)); return composite; }