diff options
Diffstat (limited to 'src/com/ibm/ServerWizard2/view/LogViewerDialog.java')
-rw-r--r-- | src/com/ibm/ServerWizard2/view/LogViewerDialog.java | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/com/ibm/ServerWizard2/view/LogViewerDialog.java b/src/com/ibm/ServerWizard2/view/LogViewerDialog.java new file mode 100644 index 0000000..7777a1c --- /dev/null +++ b/src/com/ibm/ServerWizard2/view/LogViewerDialog.java @@ -0,0 +1,63 @@ +package com.ibm.ServerWizard2.view; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.wb.swt.SWTResourceManager; + +public class LogViewerDialog extends Dialog { + + /** + * Create the dialog. + * @param parentShell + */ + private String data=""; + + public LogViewerDialog(Shell parentShell) { + super(parentShell); + setShellStyle(SWT.BORDER | SWT.MIN | SWT.MAX | SWT.RESIZE | SWT.TITLE | SWT.APPLICATION_MODAL); + } + public void setData(String data) { + this.data=data; + } + /** + * Create contents of the dialog. + * @param parent + */ + @Override + protected Control createDialogArea(Composite parent) { + Composite container = (Composite) super.createDialogArea(parent); + FillLayout fl_container = new FillLayout(SWT.HORIZONTAL); + fl_container.marginHeight = 20; + fl_container.marginWidth = 20; + container.setLayout(fl_container); + + StyledText styledText = new StyledText(container, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.READ_ONLY); + styledText.setFont(SWTResourceManager.getFont("Courier New", 8, SWT.NORMAL)); + styledText.setText(data); + return container; + } + /** + * Create contents of the button bar. + * @param parent + */ + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); + } + + /** + * Return the initial size of the dialog. + */ + @Override + protected Point getInitialSize() { + return new Point(723, 629); + } + +} |