KickJava   Java API By Example, From Geeks To Geeks.

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


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.DirectoryChooserCheckTextSetter;
42 import org.omg.lifl.eclipse.plugin.project.utils.SWT.SetterGroupPreference;
43
44 /**
45  * This class deals with OpenCCM build.properties configuration file
46  * - store preferences
47  * - create SWT widget to change preferences
48  *
49  * @author LIFL
50  *
51  * @version 0.1
52  */

53 public class EclipseConfigChooser {
54
55     private String JavaDoc groupTitle;
56
57     private Group group_ORB_Chooser;
58     private CheckGroup checkGroup;
59
60     private SetterGroupPreference _ImportWorkbenchPreference;
61
62     /**
63      * Construct the preference needed for configuring the
64      * OpenCCM build.properties configuration file
65      * @param elem the element which contains needed configuration
66      */

67     public EclipseConfigChooser(IConfigurationElement elem) {
68         groupTitle = AttributeManager.getAttribute(elem, "EclipseConfigGroupLabel");
69         // to set Eclipse Workbench Preference
70
_ImportWorkbenchPreference =
71             AttributeManager.getAllAttribute(elem, "ImportPreference");
72
73     }
74
75     /**
76      * create a SWT group which a check
77      * to set OpenCCM build.properties configuration file
78      * @param composite the parent Composite
79      */

80     public void viewToSetEclipseConfig(Composite composite) {
81         checkGroup = new CheckGroup(composite, groupTitle);
82
83         Group parent_group = new Group(checkGroup.getGroup(), SWT.NONE);
84         parent_group.setLayout(new RowLayout(SWT.VERTICAL));
85         checkGroup.setSubGroup(parent_group);
86
87         // area to choose to import or not Eclipse Workbench preferences (with Backup)
88
DirectoryChooser dcImportWorkbenchPreference =
89             new DirectoryChooserCheckTextSetter(parent_group, _ImportWorkbenchPreference);
90     }
91
92     /**
93      * @return the main SWT CheckGroup
94      */

95     public CheckGroup getCheckGroup() {
96         return checkGroup;
97     }
98
99     /**
100      * @param group is used to set main SWT CheckGroup
101      */

102     public void setCheckGroup(CheckGroup group) {
103         checkGroup = group;
104     }
105
106     /**
107      * @param preference SetterGroupPreference to set
108      * the workbench preference file to import
109      */

110     public void set_ImportWorkbenchPreference(SetterGroupPreference preference) {
111         _ImportWorkbenchPreference = preference;
112     }
113
114     /**
115      * @return
116      */

117     public SetterGroupPreference get_ImportWorkbenchPreference() {
118         return _ImportWorkbenchPreference;
119     }
120
121 }
122
Popular Tags