1 4 package com.nightlabs.rcp.exceptionhandler.wizard; 5 6 import org.eclipse.swt.SWT; 7 import org.eclipse.swt.custom.SashForm; 8 import org.eclipse.swt.events.ModifyEvent; 9 import org.eclipse.swt.events.ModifyListener; 10 import org.eclipse.swt.layout.GridData; 11 import org.eclipse.swt.widgets.Composite; 12 import org.eclipse.swt.widgets.Control; 13 import org.eclipse.swt.widgets.Text; 14 import org.eclipse.ui.forms.widgets.ExpandableComposite; 15 16 import com.nightlabs.rcp.composite.TightWrapperComposite; 17 import com.nightlabs.rcp.wizard.DynamicPathWizardPage; 18 import com.nightlabs.rcp.wizard.DynamicPathWizard; 19 20 23 public class ExceptionSummaryPage extends DynamicPathWizardPage 24 { 25 26 private ExpandableComposite wrapContainer; 27 28 private Text tfield1; 29 30 private Text tfield2; 31 32 33 public ExceptionSummaryPage() 34 { 35 super(UserCommentPage.class.getName(), "Summary"); 36 setDescription("Summary of Exception" + "\n" + "Click <Finish> to send Error Report"); 37 } 38 39 private UserCommentPage sendExceptionPage; 40 41 44 public Control createPageContents(Composite parent) 45 { 46 47 ExceptionHandlerWizard wizard = (ExceptionHandlerWizard) getWizard(); 48 final ErrorReport errorReport = wizard.getErrorReport();; 49 50 TightWrapperComposite epage = new TightWrapperComposite(parent, SWT.NONE, true); 51 epage.setLayoutData(new GridData(GridData.FILL_BOTH)); 52 SashForm sform = new SashForm (epage, SWT.VERTICAL); 53 sform.setLayoutData(new GridData(GridData.FILL_BOTH)); 54 55 tfield1 = new Text(sform, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP | SWT.READ_ONLY); 56 tfield1.setToolTipText("Summary of the Error Report being sent."); 57 tfield1.setLayoutData(new GridData(GridData.FILL_BOTH)); 58 tfield1.setText(errorReport.getThrownException().getLocalizedMessage() + "\n\n\n\n" +"User Comment:\n" + errorReport.getUserComment()); 59 tfield1.addModifyListener(new ModifyListener() { 60 public void modifyText(ModifyEvent e) 61 { 62 ((DynamicPathWizard)getWizard()).updateDialog(); 63 } 64 }); 65 66 67 tfield2 = new Text(sform, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.READ_ONLY); 68 tfield2.setLayoutData(new GridData(GridData.FILL_BOTH)); 69 tfield2.setText(errorReport.getCurrentTimeAsString()+ "\n" + errorReport.getErrorStackTraceAsString() ); 70 tfield2.addModifyListener(new ModifyListener() { 71 public void modifyText(ModifyEvent e) 72 { 73 ((DynamicPathWizard)getWizard()).updateDialog(); 74 } 75 }); 76 sform.setWeights(new int [] {70,30} ); 77 { 78 79 } 80 81 82 83 95 return epage; 96 } 97 98 101 102 103 106 107 } 108 | Popular Tags |