1 19 20 21 package ca.mcgill.sable.soot.ui; 22 23 import org.eclipse.jface.dialogs.Dialog; 24 import org.eclipse.jface.dialogs.*; 25 import org.eclipse.core.runtime.*; 26 import org.eclipse.swt.widgets.*; 27 import org.eclipse.swt.*; 28 import ca.mcgill.sable.soot.*; 29 30 31 32 33 public class SootOptionsLauncherDialog extends Dialog { 34 protected IAdaptable input; 35 private Text text_input; 36 private Label text_label; 37 38 public SootOptionsLauncherDialog(Shell parentShell, IAdaptable input) { 39 super(parentShell); 40 this.input = input; 41 } 42 43 protected Control createDialogArea(Composite parent) { 44 Composite composite = (Composite)super.createDialogArea(parent); 45 46 text_label = new Label(composite, SWT.LEFT); 47 text_label.setText("Set Soot Command Line:"); 48 49 text_input = new Text(composite, SWT.CENTER); 50 IDialogSettings settings = null; 51 try { 52 settings = SootPlugin.getDefault().getDialogSettings(); 53 } 54 catch (Exception e1) { 55 System.out.println(e1.getMessage()); 56 } 57 if (settings != null) { 58 String input = settings.get("text_input"); 59 if (input != null) { 60 text_input.setText(input); 61 } 62 } 63 text_input.setSize(200,20); 64 65 return composite; 66 67 } 68 69 protected void okPressed() { 70 IDialogSettings settings = SootPlugin.getDefault().getDialogSettings(); 71 settings.put("text_input", text_input.getText()); 72 super.okPressed(); 73 74 } 75 76 77 } 78 | Popular Tags |