KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > lifl > eclipse > plugin > project > OpenCCM > utils > OpenCCMConfigChooser


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2003 USTL - LIFL - GOAL
5 Contact: openccm-team@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): offroy ________________________.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26 /*
27  * Created on 23 mai 2003 by jerome OFFROY (offroy@lifl.fr)
28  *
29  */

30
31 package org.omg.lifl.eclipse.plugin.project.OpenCCM.utils;
32
33 import org.eclipse.core.runtime.IConfigurationElement;
34 import org.eclipse.swt.SWT;
35 import org.eclipse.swt.layout.RowLayout;
36 import org.eclipse.swt.widgets.Composite;
37 import org.eclipse.swt.widgets.Group;
38 import org.omg.lifl.eclipse.plugin.project.utils.AttributeManager;
39 import org.omg.lifl.eclipse.plugin.project.utils.SWT.CheckGroup;
40 import org.omg.lifl.eclipse.plugin.project.utils.SWT.DirectoryChooser;
41 import org.omg.lifl.eclipse.plugin.project.utils.SWT.DirectoryChooserCheckRadioButtonSetter;
42 import org.omg.lifl.eclipse.plugin.project.utils.SWT.DirectoryChooserCheckTextSetter;
43 import org.omg.lifl.eclipse.plugin.project.utils.SWT.DirectoryChooserNoCheckTextSetter;
44 import org.omg.lifl.eclipse.plugin.project.utils.SWT.SetterGroupPreference;
45
46 /**
47  * This class deals with OpenCCM build.properties configuration file
48  * - store preferences
49  * - create SWT widget to change preferences
50  *
51  * @author LIFL
52  *
53  * @version 0.1
54  */

55 public class OpenCCMConfigChooser {
56
57     private String JavaDoc groupTitle;
58
59     private Group group_ORB_Chooser;
60     private CheckGroup checkGroup;
61     private String JavaDoc _ORBName;
62
63     private SetterGroupPreference _ORBpreference;
64     private SetterGroupPreference _InstallOpenCCM;
65     private SetterGroupPreference _TransactionpreferenceHome;
66     private SetterGroupPreference _TransactionpreferenceJar;
67     private SetterGroupPreference _NSDirPreference;
68     private SetterGroupPreference _PreprocessorPreference;
69     private SetterGroupPreference _JavaccPreference;
70     private SetterGroupPreference _CompilationOptionDebugPreference;
71     private SetterGroupPreference _CompilationOptionDeprecationPreference;
72     private SetterGroupPreference _CompilationOptionOptimizePreference;
73     
74     /**
75      * Construct the preference needed for configuring the
76      * OpenCCM build.properties configuration file
77      * @param elem the element which contains needed configuration
78      */

79     public OpenCCMConfigChooser(IConfigurationElement elem) {
80         groupTitle = AttributeManager.getAttribute(elem, "ORBConfigGroupLabel");
81
82         // get the ORB Name
83
_ORBName = AttributeManager.getAttribute(elem, "ORBName");
84
85         // to set ORB Path
86
_ORBpreference = AttributeManager.getAllAttribute(elem, "OB");
87
88         // to set The directory where the OpenCCM Platform will be installed.
89
_InstallOpenCCM =
90             AttributeManager.getAllAttribute(elem, "InstallOpenCCM");
91
92         // to set Transaction Home directory and Jar directory
93
_TransactionpreferenceHome =
94             AttributeManager.getAllAttribute(elem, "TransactionHome");
95         _TransactionpreferenceJar =
96             AttributeManager.getAllAttribute(elem, "TransactionJar");
97         _NSDirPreference = AttributeManager.getAllAttribute(elem, "NShomeDir");
98         _PreprocessorPreference =
99             AttributeManager.getAllAttribute(elem, "CppDir");
100         _JavaccPreference = AttributeManager.getAllAttribute(elem, "JavaccDir");
101         //TODO change class to store preference (no String but boolean )
102
_CompilationOptionDebugPreference =
103             AttributeManager.getAllAttribute(elem, "CompilationOptionDebug");
104         _CompilationOptionDeprecationPreference =
105             AttributeManager.getAllAttribute(
106                 elem,
107                 "CompilationOptionDeprecation");
108         _CompilationOptionOptimizePreference =
109             AttributeManager.getAllAttribute(elem, "CompilationOptionOptimize");
110     }
111
112     /**
113      * create a SWT group which a check
114      * to set OpenCCM build.properties configuration file
115      * @param composite the parent Composite
116      */

117     public void viewToSetCCMConfig(Composite composite) {
118         checkGroup = new CheckGroup(composite, groupTitle);
119
120         Group parent_group = new Group(checkGroup.getGroup(), SWT.NONE);
121         parent_group.setLayout(new RowLayout(SWT.VERTICAL));
122         checkGroup.setSubGroup(parent_group);
123
124         // area to choose the location of the ORB
125
DirectoryChooser dcORB =
126             new DirectoryChooserNoCheckTextSetter(parent_group, _ORBpreference);
127
128         // area to choose The directory where the OpenCCM Platform will be installed.
129
DirectoryChooser dcInstallOpenCCM =
130             new DirectoryChooserCheckTextSetter(parent_group, _InstallOpenCCM);
131
132         // area to choose the location of the Transaction Home Directory and jar directory
133
DirectoryChooser dcTransactionHome =
134             new DirectoryChooserCheckTextSetter(
135                 parent_group,
136                 _TransactionpreferenceHome);
137         DirectoryChooser dcTransactionJar =
138             new DirectoryChooserCheckTextSetter(
139                 parent_group,
140                 _TransactionpreferenceJar);
141
142         // area to choose the location of the NS
143
DirectoryChooser dcNSDir =
144             new DirectoryChooserCheckTextSetter(parent_group, _NSDirPreference);
145
146         // area to choose the location of the Preprocessor to use
147
DirectoryChooser dcCppDir =
148             new DirectoryChooserCheckTextSetter(
149                 parent_group,
150                 _PreprocessorPreference);
151
152         // area to choose the location of the JavaCC
153
DirectoryChooser dcJavaCC =
154             new DirectoryChooserCheckTextSetter(
155                 parent_group,
156                 _JavaccPreference);
157
158         // area to choose the ant compilation option Debug value
159
DirectoryChooser dcCompilDebug =
160             new DirectoryChooserCheckRadioButtonSetter(
161                 parent_group,
162                 _CompilationOptionDebugPreference);
163         // area to choose the ant compilation option Deprecation value
164
DirectoryChooser dcCompilDeprecation =
165             new DirectoryChooserCheckRadioButtonSetter(
166                 parent_group,
167                 _CompilationOptionDeprecationPreference);
168         // area to choose the ant compilation option Optimize value
169
DirectoryChooser dcCompilOptimize =
170             new DirectoryChooserCheckRadioButtonSetter(
171                 parent_group,
172                 _CompilationOptionOptimizePreference);
173     }
174
175     /**
176      * @return a the ORB's name
177      */

178     public String JavaDoc get_ORBName() {
179         return _ORBName;
180     }
181
182     /**
183      * @param string to set ORB's name
184      */

185     public void set_ORBName(String JavaDoc string) {
186         _ORBName = string;
187     }
188
189     /**
190      * @return the main SWT CheckGroup
191      */

192     public CheckGroup getCheckGroup() {
193         return checkGroup;
194     }
195
196     /**
197      * @param group is used to set main SWT CheckGroup
198      */

199     public void setCheckGroup(CheckGroup group) {
200         checkGroup = group;
201     }
202
203     /**
204      * @return a SetterGroupPreference which contains the value of
205      * the ORB's location
206      */

207     public SetterGroupPreference get_ORBpreference() {
208         return _ORBpreference;
209     }
210
211     /**
212      * @param preference SetterGroupPreference to set ORB's location
213      */

214     public void set_ORBpreference(SetterGroupPreference preference) {
215         _ORBpreference = preference;
216     }
217
218     /**
219      * @return a SetterGroupPreference which contains the value of
220      * the Transactional Service home directory
221      */

222     public SetterGroupPreference get_TransactionpreferenceHome() {
223         return _TransactionpreferenceHome;
224     }
225
226     /**
227      * @param preference SetterGroupPreference to set
228      * Transactional Service Home directory
229      */

230     public void set_TransactionpreferenceHome(SetterGroupPreference preference) {
231         _TransactionpreferenceHome = preference;
232     }
233
234     /**
235      * @return a SetterGroupPreference which contains the value of
236      * Transactional Service Jar location
237      */

238     public SetterGroupPreference get_TransactionpreferenceJar() {
239         return _TransactionpreferenceJar;
240     }
241
242     /**
243      * @param preference SetterGroupPreference to set
244      * Transactional Service Jar location
245      */

246     public void set_TransactionpreferenceJar(SetterGroupPreference preference) {
247         _TransactionpreferenceJar = preference;
248     }
249
250     /**
251      * @return a SetterGroupPreference which contains the value of
252      * NameService's location
253      */

254     public SetterGroupPreference get_NSDirPreference() {
255         return _NSDirPreference;
256     }
257
258     /**
259      * @param preference SetterGroupPreference to set
260      * NameService's location
261      */

262     public void set_NSDirPreference(SetterGroupPreference preference) {
263         _NSDirPreference = preference;
264     }
265
266     /**
267      * @return a SetterGroupPreference which contains the value of
268      * OpenCCM Ant Compilation Option Debug
269      */

270     public SetterGroupPreference get_CompilationOptionDebugPreference() {
271         return _CompilationOptionDebugPreference;
272     }
273
274     /**
275      * @param preference SetterGroupPreference to set
276      * OpenCCM Ant Compilation Option Debug
277      */

278     public void set_CompilationOptionDebugPreference(SetterGroupPreference preference) {
279         _CompilationOptionDebugPreference = preference;
280     }
281
282     /**
283      * @return a SetterGroupPreference which contains the value of
284      * OpenCCM Ant Compilation Option Deprecation
285      */

286     public SetterGroupPreference get_CompilationOptionDeprecationPreference() {
287         return _CompilationOptionDeprecationPreference;
288     }
289
290     /**
291      * @param preference SetterGroupPreference to set
292      * OpenCCM Ant Compilation Option Deprecation
293      */

294     public void set_CompilationOptionDeprecationPreference(SetterGroupPreference preference) {
295         _CompilationOptionDeprecationPreference = preference;
296     }
297
298     /**
299      * @return a SetterGroupPreference which contains the value of
300      * OpenCCM Ant Compilation Option Optimize
301      */

302     public SetterGroupPreference get_CompilationOptionOptimizePreference() {
303         return _CompilationOptionOptimizePreference;
304     }
305
306     /**
307      * @param preference SetterGroupPreference to set
308      * OpenCCM Ant Compilation Option Optimize
309      */

310     public void set_CompilationOptionOptimizePreference(SetterGroupPreference preference) {
311         _CompilationOptionOptimizePreference = preference;
312     }
313
314     /**
315      * @return a SetterGroupPreference which contains the value of
316      * JavaCC's location
317      */

318     public SetterGroupPreference get_JavaccPreference() {
319         return _JavaccPreference;
320     }
321
322     /**
323      * @param preference SetterGroupPreference to set
324      * JavaCC's location
325      */

326     public void set_JavaccPreference(SetterGroupPreference preference) {
327         _JavaccPreference = preference;
328     }
329
330     /**
331      * @return a SetterGroupPreference which contains the value of
332      * Preprocessor's location
333      */

334     public SetterGroupPreference get_PreprocessorPreference() {
335         return _PreprocessorPreference;
336     }
337
338     /**
339      * @param preference SetterGroupPreference to set
340      * Preprocessor's location
341      */

342     public void set_PreprocessorPreference(SetterGroupPreference preference) {
343         _PreprocessorPreference = preference;
344     }
345
346     /**
347      * @return a SetterGroupPreference which contains the value of
348      * the directory where the OpenCCM Platform will be installed.
349      */

350     public SetterGroupPreference get_InstallOpenCCM() {
351         return _InstallOpenCCM;
352     }
353
354     /**
355      * @param preference SetterGroupPreference to set
356      * the directory where the OpenCCM Platform will be installed.
357      */

358     public void set_InstallOpenCCM(SetterGroupPreference preference) {
359         _InstallOpenCCM = preference;
360     }
361 }
362
Popular Tags