@Override
protected Composite doCreatePreviewPane(Composite composite, int numColumns) {
createLabel(numColumns - 1, composite, FormatterMessages.ModifyDialogTabPage_preview_label_text);
fShowInvisibleButton= new Button(composite, SWT.CHECK);
fShowInvisibleButton.setText(FormatterMessages.FormatterTabPage_ShowInvisibleCharacters_label);
fShowInvisibleButton.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, true, false));
fShowInvisibleButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
fPreview.showInvisibleCharacters(fShowInvisibleButton.getSelection());
fDialogSettings.put(SHOW_INVISIBLE_PREFERENCE_KEY, fShowInvisibleButton.getSelection());
doUpdatePreview();
}
});
fShowInvisibleButton.setSelection(isShowInvisible());
fPreview= doCreateJavaPreview(composite);
fDefaultFocusManager.add(fPreview.getControl());
fPreview.showInvisibleCharacters(fShowInvisibleButton.getSelection());
final GridData gd= createGridData(numColumns, GridData.FILL_BOTH, 0);
gd.widthHint= 0;
gd.heightHint=0;
fPreview.getControl().setLayoutData(gd);
return composite;
}