/******************************************************************************* * Copyright (c) 2008 Red Hat, Inc. * Distributed under license by Red Hat, Inc. All rights reserved. * This program is made available under the terms of the * Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red Hat, Inc. - initial API and implementation ******************************************************************************/ package org.jboss.tools.smooks.edimap.editor; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.window.IShellProvider; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; /** * @author Dart (dpeng@redhat.com) * */ public class EDIMappingResultDialog extends Dialog { private Text text; public EDIMappingResultDialog(IShellProvider parentShell) { super(parentShell); // TODO Auto-generated constructor stub } public EDIMappingResultDialog(Shell parentShell) { super(parentShell); } /* * (non-Javadoc) * * @see * org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse * .swt.widgets.Composite) */ @Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); } /* * (non-Javadoc) * * @see * org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets * .Composite) */ @Override protected Control createDialogArea(Composite parent) { // TODO Auto-generated method stub Composite mainComposite = (Composite) super.createDialogArea(parent); org.eclipse.swt.layout.GridData gd = new GridData(GridData.FILL_BOTH); text = new Text(mainComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.READ_ONLY | SWT.BORDER); gd.heightHint = 400; gd.widthHint = 400; text.setLayoutData(gd); if (content != null) { text.setText(content); } this.getShell().setText(Messages.EDIMappingResultDialog_Window_Title); return mainComposite; } private String content = null; public void setText(String content) { this.content = content; } }