1 19 20 package ca.mcgill.sable.soot.testing; 21 22 import org.eclipse.jface.dialogs.*; 24 import org.eclipse.swt.widgets.*; 28 import org.eclipse.swt.*; 29 import org.eclipse.swt.custom.SashForm; 30 import org.eclipse.swt.layout.*; 31 32 50 51 54 public class SootOptionsTreeDialog extends TitleAreaDialog { 55 56 private SashForm sashForm; 57 58 public SootOptionsTreeDialog(Shell parentShell) { 59 super(parentShell); 60 } 61 62 private Composite createSelectionComposite(Composite parent) { 63 Composite composite = new Composite(parent, SWT.NONE); 64 Tree optionsTree = new Tree(parent, SWT.SINGLE); 66 67 TreeItem test1 = new TreeItem(optionsTree, SWT.NONE); 68 test1.setText("Jimple Body Creation"); 69 TreeItem test2 = new TreeItem(optionsTree, SWT.NONE); 70 test2.setText("Jimple Optimization Pack"); 71 TreeItem test3 = new TreeItem(test2, SWT.NONE); 72 test3.setText("Busy Code Motion"); 73 74 return parent; 75 } 76 77 private Composite createDataComposite(Composite parent) { 78 Label l1 = new Label(parent, SWT.NONE); 81 l1.setText("Smile"); 82 83 return parent; 84 } 85 86 protected Control createDialogArea(Composite parent) { 87 GridData gd; 88 89 Composite dialogComp = (Composite)super.createDialogArea(parent); 90 Composite topComp = new Composite(dialogComp, SWT.NONE); 91 92 gd = new GridData(GridData.FILL_BOTH); 93 topComp.setLayoutData(gd); 94 GridLayout topLayout = new GridLayout(); 95 topLayout.numColumns = 2; 96 topLayout.marginHeight = 5; 97 topLayout.marginWidth = 0; 98 topComp.setLayout(topLayout); 99 100 setTitle("Soot Launching Options"); 102 setMessage(""); 103 104 105 setSashForm(new SashForm(topComp, SWT.NONE)); 108 getSashForm().setOrientation(SWT.HORIZONTAL); 109 gd = new GridData(GridData.FILL_BOTH); 110 gd.horizontalSpan = 2; 111 getSashForm().setLayoutData(gd); 112 113 Composite selection = createSelectionComposite(getSashForm()); 114 gd = new GridData(GridData.FILL_VERTICAL); 115 selection.setLayoutData(gd); 116 117 Composite data = createDataComposite(getSashForm()); 118 gd = new GridData(GridData.FILL_BOTH); 119 data.setLayoutData(gd); 120 121 Label separator = new Label(topComp, SWT.HORIZONTAL | SWT.SEPARATOR); 122 gd = new GridData(GridData.FILL_HORIZONTAL); 123 gd.horizontalSpan = 2; 124 separator.setLayoutData(gd); 125 126 dialogComp.layout(true); 127 128 return dialogComp; 129 } 130 131 132 133 134 138 public SashForm getSashForm() { 139 return sashForm; 140 } 141 142 146 public void setSashForm(SashForm sashForm) { 147 this.sashForm = sashForm; 148 } 149 150 151 } 152 | Popular Tags |