1
/*******************************************************************************
2
* Copyright (C) 2003-2007, 2013, Guillaume Brocker
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
10
* Guillaume Brocker - Initial API and implementation
12
******************************************************************************/
14
package eclox.ui.editor.basic;
16
import org.eclipse.swt.widgets.Composite;
17
import org.eclipse.ui.forms.widgets.FormToolkit;
19
import eclox.core.doxyfiles.Doxyfile;
22
* Implements the form part that provides edition of mode related settings.
24
* @author Guillaume Brocker
26
public class ModePart extends Part {
29
* state for the entities editor
31
private static final String ENTITIES_DOCUMENTED = "documented entities only";
34
* state for the entities editor
36
private static final String ENTITIES_ALL = "all entities";
39
* state for the optimized langage editor
41
private static final String CXX = "C++";
44
* state for the optimized langage editor
46
private static final String JAVA = "Java";
49
* state for the optimized langage editor
51
private static final String C = "C";
54
* state for the optimized langage editor
56
private static final String C_SHARP = "C#";
59
* the editor used to configure entities whose documentation will be extracted
61
private RadioMultiEditor entities = new RadioMultiEditor( new String[] {ENTITIES_DOCUMENTED, ENTITIES_ALL} );
64
* the editor used to configure cross-referenced source code inclusion
66
private CheckMultiEditor crossReferenced = new CheckMultiEditor( "Include cross-referenced source code in the output" );
69
* the editor used to selected the optimized ouput langage
71
private RadioMultiEditor optimizedLangage = new RadioMultiEditor( new String[] {CXX, JAVA, C, C_SHARP} );
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
80
public ModePart( Composite parent, FormToolkit toolkit, Doxyfile doxyfile ) {
81
super( parent, toolkit, "Mode", doxyfile );
83
// Creates the content.
84
addLabel("Select the desired extraction mode:");
86
addEditor(crossReferenced);
88
addLabel("Optimize results for:");
89
addEditor( optimizedLangage );
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") );
104
entities.setEnabled( false );
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") );
117
crossReferenced.setEnabled(false);
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") );
130
optimizedLangage.setEnabled(false);