~ubuntu-branches/ubuntu/utopic/eclipse-eclox/utopic

« back to all changes in this revision

Viewing changes to eclox.ui/src/eclox/ui/editor/basic/ModePart.java

  • Committer: Package Import Robot
  • Author(s): Graham Inggs
  • Date: 2013-07-07 20:33:10 UTC
  • Revision ID: package-import@ubuntu.com-20130707203310-a44yw80gqtc2s9ob
Tags: upstream-0.10.0
ImportĀ upstreamĀ versionĀ 0.10.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************************
 
2
 * Copyright (C) 2003-2007, 2013, Guillaume Brocker
 
3
 * 
 
4
 * All rights reserved. This program and the accompanying materials
 
5
 * are made available under the terms of the Eclipse Public License v1.0
 
6
 * which accompanies this distribution, and is available at
 
7
 * http://www.eclipse.org/legal/epl-v10.html
 
8
 *
 
9
 * Contributors:
 
10
 *     Guillaume Brocker - Initial API and implementation
 
11
 *
 
12
 ******************************************************************************/ 
 
13
 
 
14
package eclox.ui.editor.basic;
 
15
 
 
16
import org.eclipse.swt.widgets.Composite;
 
17
import org.eclipse.ui.forms.widgets.FormToolkit;
 
18
 
 
19
import eclox.core.doxyfiles.Doxyfile;
 
20
 
 
21
/**
 
22
 * Implements the form part that provides edition of mode related settings.
 
23
 * 
 
24
 * @author Guillaume Brocker
 
25
 */
 
26
public class ModePart extends Part {
 
27
        
 
28
        /**
 
29
         * state for the entities editor
 
30
         */
 
31
        private static final String ENTITIES_DOCUMENTED = "documented entities only";
 
32
 
 
33
        /**
 
34
         * state for the entities editor
 
35
         */
 
36
        private static final String ENTITIES_ALL = "all entities";
 
37
        
 
38
        /**
 
39
         * state for the optimized langage editor
 
40
         */
 
41
        private static final String CXX = "C++";
 
42
        
 
43
        /**
 
44
         * state for the optimized langage editor
 
45
         */
 
46
        private static final String JAVA = "Java";
 
47
        
 
48
        /**
 
49
         * state for the optimized langage editor
 
50
         */
 
51
        private static final String C = "C";
 
52
        
 
53
        /**
 
54
         * state for the optimized langage editor
 
55
         */
 
56
        private static final String C_SHARP = "C#";
 
57
        
 
58
        /**
 
59
         * the editor used to configure entities whose documentation will be extracted
 
60
         */
 
61
        private RadioMultiEditor entities = new RadioMultiEditor( new String[] {ENTITIES_DOCUMENTED, ENTITIES_ALL} );
 
62
        
 
63
        /**
 
64
         * the editor used to configure cross-referenced source code inclusion
 
65
         */
 
66
        private CheckMultiEditor crossReferenced = new CheckMultiEditor( "Include cross-referenced source code in the output" );
 
67
        
 
68
        /**
 
69
         * the editor used to selected the optimized ouput langage
 
70
         */
 
71
        private RadioMultiEditor optimizedLangage = new RadioMultiEditor( new String[] {CXX, JAVA, C, C_SHARP} );
 
72
 
 
73
        /**
 
74
         * Constructor
 
75
         * 
 
76
         * @param parent        the parent control for the part control's
 
77
         * @param toolkit       the toolkit to use for control creation
 
78
         * @param doxyfile      the doxyfile being edited
 
79
         */
 
80
        public ModePart( Composite parent, FormToolkit toolkit, Doxyfile doxyfile ) {
 
81
                super( parent, toolkit, "Mode", doxyfile );
 
82
                
 
83
                // Creates the content.
 
84
                addLabel("Select the desired extraction mode:");
 
85
                addEditor(entities);
 
86
                addEditor(crossReferenced);
 
87
                addSperator();
 
88
                addLabel("Optimize results for:");
 
89
                addEditor( optimizedLangage );
 
90
                
 
91
                // Initializes the editors.
 
92
                if( doxyfile.hasSetting("HIDE_UNDOC_MEMBERS") 
 
93
                                && doxyfile.hasSetting("HIDE_UNDOC_CLASSES")
 
94
                                && doxyfile.hasSetting("EXTRACT_ALL")
 
95
                                && doxyfile.hasSetting("EXTRACT_PRIVATE")
 
96
                                && doxyfile.hasSetting("EXTRACT_STATIC") ) {
 
97
                        entities.addSetting(ENTITIES_DOCUMENTED, doxyfile.getSetting("HIDE_UNDOC_MEMBERS") );
 
98
                        entities.addSetting(ENTITIES_DOCUMENTED, doxyfile.getSetting("HIDE_UNDOC_CLASSES") );
 
99
                        entities.addSetting(ENTITIES_ALL, doxyfile.getSetting("EXTRACT_ALL") );
 
100
                        entities.addSetting(ENTITIES_ALL, doxyfile.getSetting("EXTRACT_PRIVATE") );
 
101
                        entities.addSetting(ENTITIES_ALL, doxyfile.getSetting("EXTRACT_STATIC") );
 
102
                }
 
103
                else {
 
104
                        entities.setEnabled( false );
 
105
                }
 
106
                
 
107
                if( doxyfile.hasSetting("SOURCE_BROWSER")
 
108
                                && doxyfile.hasSetting("REFERENCED_BY_RELATION")
 
109
                                && doxyfile.hasSetting("REFERENCES_RELATION")
 
110
                                && doxyfile.hasSetting("VERBATIM_HEADERS") ) {
 
111
                        crossReferenced.addSetting(CheckMultiEditor.SELECTED, doxyfile.getSetting("SOURCE_BROWSER") );
 
112
                        crossReferenced.addSetting(CheckMultiEditor.SELECTED, doxyfile.getSetting("REFERENCED_BY_RELATION") );
 
113
                        crossReferenced.addSetting(CheckMultiEditor.SELECTED, doxyfile.getSetting("REFERENCES_RELATION") );
 
114
                        crossReferenced.addSetting(CheckMultiEditor.SELECTED, doxyfile.getSetting("VERBATIM_HEADERS") );
 
115
                }
 
116
                else {
 
117
                        crossReferenced.setEnabled(false);
 
118
                }
 
119
                
 
120
                if( doxyfile.hasSetting("OPTIMIZE_OUTPUT_JAVA")
 
121
                                && doxyfile.hasSetting("OPTIMIZE_OUTPUT_FOR_C")
 
122
                                && doxyfile.hasSetting("OPTIMIZE_OUTPUT_JAVA")
 
123
                                && doxyfile.hasSetting("EXTRACT_STATIC") ) {
 
124
                        optimizedLangage.addSetting(JAVA,    doxyfile.getSetting("OPTIMIZE_OUTPUT_JAVA") );
 
125
                        optimizedLangage.addSetting(C,       doxyfile.getSetting("OPTIMIZE_OUTPUT_FOR_C") );
 
126
                        optimizedLangage.addSetting(C_SHARP, doxyfile.getSetting("OPTIMIZE_OUTPUT_JAVA") );
 
127
                        optimizedLangage.addSetting(C_SHARP, doxyfile.getSetting("EXTRACT_STATIC") );
 
128
                }
 
129
                else {
 
130
                        optimizedLangage.setEnabled(false);
 
131
                }
 
132
        }
 
133
}