01: package org.pentaho.designstudio.editors.actionsequence.mql;
02:
03: import org.eclipse.jface.dialogs.Dialog;
04: import org.eclipse.jface.dialogs.IDialogConstants;
05: import org.eclipse.swt.SWT;
06: import org.eclipse.swt.browser.Browser;
07: import org.eclipse.swt.layout.GridData;
08: import org.eclipse.swt.widgets.Composite;
09: import org.eclipse.swt.widgets.Control;
10: import org.eclipse.swt.widgets.Shell;
11: import org.pentaho.designstudio.messages.Messages;
12:
13: public class MQLPreviewDialog extends Dialog {
14:
15: String html;
16: Browser browser;
17:
18: public MQLPreviewDialog(Shell parentShell, String html) {
19: super (parentShell);
20: this .html = html;
21: }
22:
23: protected void configureShell(Shell shell) {
24: super .configureShell(shell);
25: shell.setText(Messages
26: .getString("MQLPreviewDialog.PREVIEW_TITLE")); //$NON-NLS-1$
27: }
28:
29: protected void createButtonsForButtonBar(Composite parent) {
30: createButton(parent, IDialogConstants.OK_ID,
31: IDialogConstants.OK_LABEL, true);
32: }
33:
34: protected Control createDialogArea(Composite parent) {
35: Composite composite = (Composite) super
36: .createDialogArea(parent);
37: browser = new Browser(composite, SWT.NONE);
38: browser.setLayoutData(new GridData(GridData.FILL_BOTH));
39: browser.setText(html);
40: GridData gridData = new GridData();
41: gridData.heightHint = 700;
42: gridData.widthHint = 700;
43: composite.setLayoutData(gridData);
44: return composite;
45: }
46:
47: public void dispose() {
48: }
49:
50: }
|