KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ca > mcgill > sable > soot > testing > SootOptionsTreeDialog


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2003 Jennifer Lhotak
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */

19
20 package ca.mcgill.sable.soot.testing;
21
22 //import org.eclipse.core.runtime.*;
23
import org.eclipse.jface.dialogs.*;
24 //import org.eclipse.jface.dialogs.IDialogSettings;
25
//import org.eclipse.jface.preference.PreferenceDialog;
26
//import org.eclipse.jface.preference.PreferenceManager;
27
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 /**
33  * @author jlhotak
34  *
35  * This library is free software; you can redistribute it and/or
36  * modify it under the terms of the GNU Lesser General Public
37  * License as published by the Free Software Foundation; either
38  * version 2.1 of the License, or (at your option) any later version.
39  *
40  * This library is distributed in the hope that it will be useful,
41  * but WITHOUT ANY WARRANTY; without even the implied warranty of
42  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
43  * Lesser General Public License for more details.
44  *
45  * You should have received a copy of the GNU Lesser General Public
46  * License along with this library; if not, write to the
47  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
48  * Boston, MA 02111-1307, USA.
49  */

50
51 /*
52  * this class is not used
53  */

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         //System.out.println("creating selection composite");
65
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         //Composite composite = new Composite(parent, SWT.NONE);
79
//System.out.println("creating data composite");
80
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         // Set the things that TitleAreaDialog takes care of
101
setTitle("Soot Launching Options");
102         setMessage("");
103         
104
105         // Create the SashForm that contains the selection area on the left,
106
// and the edit area on the right
107
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     /**
135      * Returns the sashForm.
136      * @return SashForm
137      */

138     public SashForm getSashForm() {
139         return sashForm;
140     }
141
142     /**
143      * Sets the sashForm.
144      * @param sashForm The sashForm to set
145      */

146     public void setSashForm(SashForm sashForm) {
147         this.sashForm = sashForm;
148     }
149
150     
151 }
152
Popular Tags