Changeset 1184

Show
Ignore:
Timestamp:
06/02/08 10:51:03 (5 months ago)
Author:
fraserofthenight
Message:

More builder UI work

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/descent.building/META-INF/MANIFEST.MF

    r1174 r1184  
    1111 descent.core, 
    1212 descent.ui, 
    13  descent.launching 
     13 descent.launching, 
     14 org.eclipse.ui.forms 
    1415Eclipse-LazyStart: true 
  • trunk/descent.building/src/descent/building/IDescentBuilderConstants.java

    r1183 r1184  
    1717public interface IDescentBuilderConstants 
    1818{ 
     19    //-------------------------------------------------------------------------- 
     20    // Eclipse IDs 
     21     
    1922    /** 
    2023     * The ID of the default descent builder. 
     
    2831     */ 
    2932    public static final String ID_LAUNCH_CONFIGURATION_TYPE = "descent.building.builders.debuild"; 
     33     
     34    //-------------------------------------------------------------------------- 
     35    // Launch configuration attributes 
    3036     
    3137    /** 
     
    154160     
    155161    /** 
     162     * Identifies the source from which version/debug arguments should be taken. 
     163     * The versions will always be taken from the launch configuration but may 
     164     * also be seeded by another project. Possible values are  
     165     * {@link #SOURCE_ACTIVE_PROJECT}, {@link #SOURCE_SELECTED_PROJECT} and 
     166     * {@link #SOURCE_LAUNCH_CONFIG} (see their javadoc for details about their 
     167     * meanings). 
     168     *  
     169     * Type: String 
     170     */ 
     171    public static final String ATTR_VERSION_SOURCE = "descent.building.debuild.version_source"; 
     172     
     173    /** 
     174     * Turn on code in unqualified debug {} blocks? This corresponds to the "-debug" 
     175     * setting in DMD/GDC. 
     176     *  
     177     * Type: Boolean 
     178     */ 
     179    public static final String ATTR_DEBUG_MODE = "descent.building.debuild.debug_mode"; 
     180     
     181    /** 
     182     * Level to be used in version= or the empty string if no such level should 
     183     * be specified. If the string is not a blank string, it should be a valid 
     184     * base 10 integer. 
     185     *  
     186     * Type: String 
     187     */ 
     188    public static final String ATTR_VERSION_LEVEL = "descent.building.debuild.version_level"; 
     189     
     190    /** 
     191     * Level to be used in debug= or the empty string if no such level should 
     192     * be specified. If the string is not a blank string, it should be a valid 
     193     * base 10 integer. 
     194     *  
     195     * Type: String 
     196     */ 
     197    public static final String ATTR_DEBUG_LEVEL = "descent.building.debuild.debug_level"; 
     198     
     199    /** 
     200     * A list of (non-predefined) version identifiers to be specified in version= 
     201     * on the command line. 
     202     *  
     203     * Type: List<String> 
     204     */ 
     205    public static final String ATTR_VERSION_IDENTS = "descent.building.debuild.version_idents"; 
     206     
     207    /** 
     208     * A list of (non-predefined) debug identifiers to be specified in debug= 
     209     * on the command line. 
     210     *  
     211     * Type: List<String> 
     212     */ 
     213    public static final String ATTR_DEBUG_IDENTS = "descent.building.debuild.debug_idents"; 
     214     
     215    //-------------------------------------------------------------------------- 
     216    // Output types 
     217     
     218    /** 
    156219     * Constant used for {@link #ATTR_OUTPUT_TYPE} to specify the output target 
    157220     * should be an executable file. 
     
    164227     */ 
    165228    public static final String OUTPUT_TYPE_STATIC_LIBRARY = "static_library"; 
     229     
     230    //-------------------------------------------------------------------------- 
     231    // Version sources 
     232     
     233    /** 
     234     * Constant used for {@link #ATTR_VERSION_SOURCE} to indicate versions should 
     235     * be taken from the project specified in {@link #ATTR_PROJECT_NAME} and the 
     236     * launch configuration. 
     237     */ 
     238    public static final String SOURCE_SELECTED_PROJECT = "selected_project"; 
     239     
     240    /** 
     241     * Constant used for {@link #ATTR_VERSION_SOURCE} to indicate versions should 
     242     * be taken from the workspace active project and the launch configuration. 
     243     */ 
     244    public static final String SOURCE_ACTIVE_PROJECT = "active_project"; 
     245     
     246    /** 
     247     * Constant used for {@link #ATTR_VERSION_SOURCE} to indicate versions should 
     248     * only be taken from the launch configuration. 
     249     */ 
     250    public static final String SOURCE_LAUNCH_CONFIG = "launch_configuration"; 
    166251} 
  • trunk/descent.building/src/descent/building/compiler/EnumOption.java

    r1180 r1184  
    11package descent.building.compiler; 
    22 
    3 public class EnumOption extends CompilerOption 
     3public final class EnumOption extends CompilerOption 
    44{ 
    55    private final String[] optionValues; 
  • trunk/descent.building/src/descent/internal/building/BuilderUtil.java

    r1175 r1184  
    11package descent.internal.building; 
     2 
     3import java.util.Arrays; 
    24 
    35import org.eclipse.core.resources.IResource; 
     
    4345     
    4446    /** 
     47     * List of all predefined versions in sorted order (according to 
     48     * {@link java.lang.String#compareTo(String)} which means that it can be 
     49     * searched using {@link java.util.Arrays#binarySearch(Object[], Object)}). 
     50     */ 
     51    public static final String[] PREDEFINED_VERSIONS = new String[] 
     52    { 
     53        "BigEndian",  
     54        "D_Coverage",  
     55        "D_InlineAsm",  
     56        "D_InlineAsm_X86",  
     57        "D_Version2",  
     58        "DigitalMars",  
     59        "LittleEndian",  
     60        "Win32",  
     61        "Win64",  
     62        "Windows",  
     63        "X86",  
     64        "X86_64",  
     65        "all",  
     66        "linux",  
     67        "none",  
     68        "unittest", 
     69    }; 
     70     
     71    /** 
     72     * Returns true if and only if the given version identifier is a predefined 
     73     * version identifier (case-sensitive). Keywords are also illegal version 
     74     * identifiers, but the compielr should sort that out. 
     75     *  
     76     * @param id the identifier to check 
     77     * @return   true if id is predefined, false otherwise 
     78     */ 
     79    public static final boolean isPredefinedVersion(String id) 
     80    { 
     81        return Arrays.binarySearch(PREDEFINED_VERSIONS, id) >= 0; 
     82    } 
     83     
     84    /** 
    4585     * Gets the absolute OS path for the given Eclipse path (with portable 
    4686     * separarators, etc.). 
     
    5797        return path.toString(); 
    5898    } 
     99 
     100    public static boolean isValidIdentifier(String id) 
     101    { 
     102        int len = id.length(); 
     103        if(0 == len) 
     104            return false; 
     105         
     106        for(int i = 0; i < len; i++) 
     107            if(!isValidIdChar(id.charAt(i))) 
     108                return false; 
     109        return true; 
     110    } 
     111     
     112    private static boolean isValidIdChar(char c) 
     113    { 
     114        return  
     115            (c >= 'a' && c <= 'z') ||  
     116            (c >= 'A' && c <= 'Z') ||  
     117            (c >= '0' && c <= '9') || 
     118            c == '_' || 
     119            c >= 128; // Assume anything in unicode is OK 
     120    } 
    59121} 
  • trunk/descent.building/src/descent/internal/building/compiler/DmdCompilerInterface.java

    r1183 r1184  
    22 
    33import java.io.File; 
     4import java.util.ArrayList; 
     5import java.util.List; 
    46import java.util.regex.Pattern; 
    57 
    68import descent.building.compiler.AbstractCompileCommand; 
    79import descent.building.compiler.AbstractLinkCommand; 
    8 import descent.building.compiler.BooleanOption; 
    910import descent.building.compiler.CompilerOption; 
    1011import descent.building.compiler.ICompileCommand; 
     
    1314import descent.building.compiler.IResponseInterpreter; 
    1415import descent.building.compiler.BuildResponse; 
    15  
    16 import static descent.building.IDescentBuilderConstants.*; 
    17 import static descent.internal.building.compiler.IDmdCompilerConstants.*; 
     16import descent.internal.building.compiler.ui.GdcUIOptions; 
     17 
     18import static descent.internal.building.compiler.ui.DmdUIOptions.*; 
    1819 
    1920public class DmdCompilerInterface implements ICompilerInterface 
     
    263264    static 
    264265    { 
    265         final String GROUP_FEATURES = "Features"; 
    266         final String GROUP_WARNINGS = "Warnings"; 
    267         final String GROUP_OPTIMIZATION = "Optimization"; 
    268          
    269         // TODO file options for header & doc generation 
    270         // TODO Only Windows uses OPTLINK, make a separate list of linker 
    271         // options for Linux 
    272         uiOptions = new CompilerOption[] 
    273         {            
    274             //------------------------------------------------------------------ 
    275             // Features 
    276              
    277             new BooleanOption 
    278             ( 
    279                     ATTR_ADD_DEBUG_INFO, 
    280                     true, 
    281                     "Add debugging symbols", 
    282                     GROUP_FEATURES, 
    283                     "-g", 
    284                     "", 
    285                     "Adds debugging symbols. These make the generated objects " + 
    286                     "slightly larger but is needed to use a debugger with the " + 
    287                     "program." 
    288             ), 
    289                      
    290             new BooleanOption 
    291             ( 
    292                     ATTR_DISABLE_ASSERTS, 
    293                     false, 
    294                     "Release mode", 
    295                     GROUP_FEATURES, 
    296                     "-release", 
    297                     "", 
    298                     "Turns off assert() statements in the code, in {} and out {} " + 
    299                     "blocks on functions, and checking for array bounds errors. This " + 
    300                     "makes the code run faster, so is a good choice for releasing the " + 
    301                     "application, but are often useful for development." 
    302             ), 
    303                      
    304             new BooleanOption 
    305             ( 
    306                     ATTR_ADD_UNITTESTS, 
    307                     false, 
    308                     "Add unit tests", 
    309                     GROUP_FEATURES, 
    310                     "-unittest", 
    311                     "", 
    312                     "Adds code so that unittest {} blocks in your code are run before " + 
    313                     "the program launches and enables version(unitttest) {} blocks." 
    314             ), 
    315                              
    316             new BooleanOption 
    317             ( 
    318                     ATTR_INSTRUMENT_FOR_COVERAGE, 
    319                     false, 
    320                     "Instrument for coverage analysis", 
    321                     GROUP_FEATURES, 
    322                     "-cov", 
    323                     "", 
    324                     "Adds code to the generated objects so that they will generate " + 
    325                     "a file containing code coverage information after the program " + 
    326                     "has been run. This is useful for seeing if unit tests execute " + 
    327                     "all paths in your code." 
    328             ), 
    329                                      
    330             new BooleanOption 
    331             ( 
    332                     ATTR_INSTRUMENT_FOR_PROFILE, 
    333                     false, 
    334                     "Instrument for profiling", 
    335                     GROUP_FEATURES, 
    336                     "-profile", 
    337                     "", 
    338                     "Adds code to the generated objects so they can be prodiled. " + 
    339                     "This helps find bottlenecks that could be slowing down your " + 
    340                     "application." 
    341             ), 
    342              
    343             //------------------------------------------------------------------ 
    344             // Warnings 
    345              
    346             new BooleanOption 
    347             ( 
    348                     ATTR_ALLOW_DEPRECATED, 
    349                     true, 
    350                     "Allow deprecated code", 
    351                     GROUP_WARNINGS, 
    352                     "-d", 
    353                     "", 
    354                     "Allows code marked with the \"deprecated\" tags to be included " + 
    355                     "in your program." 
    356             ), 
    357              
    358             new BooleanOption 
    359             ( 
    360                     ATTR_SHOW_WARNINGS, 
    361                     false, 
    362                     "Show warnings", 
    363                     GROUP_WARNINGS, 
    364                     "-w", 
    365                     "", 
    366                     "Adds warnings for potentially unsafe or error-prone code. In " + 
    367                     "DMD, if warnings are encountered, the program will not be " + 
    368                     "compiled." 
    369             ), 
    370              
    371                
    372             //------------------------------------------------------------------ 
    373             // Optimization 
    374              
    375             new BooleanOption 
    376             ( 
    377                     ATTR_OPTIMIZE_CODE, 
    378                     false, 
    379                     "Optimize code", 
    380                     GROUP_OPTIMIZATION, 
    381                     "-O", 
    382                     "", 
    383                     "Optimizes the generated code for best efficiency." 
    384             ), 
    385              
    386             new BooleanOption 
    387             ( 
    388                     ATTR_INLINE_CODE, 
    389                     false, 
    390                     "Inline functions", 
    391                     GROUP_OPTIMIZATION, 
    392                     "-inline", 
    393                     "", 
    394                     "Allows inlining of short functions for increased code efficiency. " + 
    395                     "This may cause issues with some debuggers." 
    396              ), 
    397              
    398             new BooleanOption 
    399             ( 
    400                     ATTR_NOFLOAT, 
    401                     false, 
    402                     "Don't generate __fltused reference", 
    403                     GROUP_OPTIMIZATION, 
    404                     "-nofloat", 
    405                     "", 
    406                     "Prevents the emission of the __fltused reference in object files, " + 
    407                     "even if floating point code is present. This is useful in library " + 
    408                     "files." 
    409             ), 
    410         }; 
     266        List<CompilerOption> options = new ArrayList<CompilerOption>(); 
     267         
     268        // Features 
     269        options.add(OPTION_ADD_DEBUG_INFO); 
     270        options.add(OPTION_DISABLE_ASSERTS); 
     271        options.add(OPTION_ADD_UNITTESTS); 
     272        options.add(OPTION_INSTRUMENT_FOR_COVERAGE); 
     273        options.add(OPTION_INSTRUMENT_FOR_PROFILE); 
     274         
     275        // Optimization 
     276        options.add(OPTION_OPTIMIZE_CODE); 
     277        options.add(OPTION_INLINE_CODE); 
     278        options.add(OPTION_NOFLOAT); 
     279         
     280        // Warnings 
     281        options.add(OPTION_ALLOW_DEPRECATED); 
     282        options.add(OPTION_SHOW_WARNINGS); 
     283         
     284        // TODO testing 
     285        options.add(GdcUIOptions.OPTION_EMIT_TEMPLATES); 
     286         
     287        uiOptions = options.toArray(new CompilerOption[options.size()]); 
    411288    } 
    412289     
  • trunk/descent.building/src/descent/internal/building/compiler/IDmdCompilerConstants.java

    r1183 r1184  
    11package descent.internal.building.compiler; 
    22 
    3 public interface IDmdCompilerConstants 
     3public interface IDmdCompilerConstants extends IDmdfeCompilerConstants 
    44{ 
    5     // TODO comment 
    6      
    7     // Compiler 
    8     public static final String ATTR_ALLOW_DEPRECATED = "descent.building.compiler.dmd.allow_deprectaed"; 
    9     public static final String ATTR_SHOW_WARNINGS = "descent.building.compiler.dmd.show_warnings"; 
    10     public static final String ATTR_INLINE_CODE = "descent.building.compiler.dmd.inline_code"; 
    11     public static final String ATTR_OPTIMIZE_CODE = "descent.building.compiler.dmd.optimize_code"; 
    125    public static final String ATTR_NOFLOAT = "descent.building.compiler.dmd.nofloat"; 
    13      
    14     // TODO linker options (both optlink and ld). Many of these options will be 
    15     // passed by the compiler, and about half of OPTLINK's options are ignored or 
    16     // apply to 16-bit code anyways. It may be fine to just have a box for "additional 
    17     // arguments" somewhere and allow the user to put them in as they want. 
    186} 
  • trunk/descent.building/src/descent/internal/building/debuild/BuildRequest.java

    r1174 r1184  
    272272    }; 
    273273     
     274    // TODO use BuilderUtil.predefinedversions instead 
    274275    // Predefined identifiers 
    275276    private static final HashSet<String> predefinedVersions = new HashSet<String>(); 
  • trunk/descent.building/src/descent/internal/building/ui/AbstractBuilderTab.java

    r1183 r1184  
    120120        private final int fWidth; 
    121121        private final int fNumColumns; 
     122        private final int fGridFill; 
    122123        private final ISetting[] fChildren; 
    123124         
     
    132133         * @param numColumns  the number of columns the resulting group should 
    133134         *                    have. 
     135         * @param gridFill    the value to pass to the GridData constructor 
    134136         * @param subSettings the settings within the group 
    135137         */ 
    136138        public GroupSetting(String label, int width, int numColumns, 
    137                 ISetting[] subSettings) 
     139                int gridFill, ISetting[] subSettings) 
    138140        { 
    139141             
     
    141143            fWidth = width; 
    142144            fNumColumns = numColumns; 
     145            fGridFill = gridFill; 
    143146            fChildren = subSettings; 
    144147        } 
     
    146149        public void addToControl(Composite comp) 
    147150        { 
    148             fGroup = createGroup(comp, fLabel, fWidth, fNumColumns); 
     151            fGroup = createGroup(comp, fLabel, fWidth, fNumColumns, fGridFill); 
    149152            for(ISetting setting : fChildren) 
    150153                setting.addToControl(fGroup); 
     
    418421     * internalized by the JVM). 
    419422     */ 
    420     protected static final List EMPTY_LIST = new ArrayList(0); 
     423    protected static final List<?> EMPTY_LIST = new ArrayList<Object>(0); 
    421424     
    422425    /** 
     
    434437     * @param columnsUsed the number of columns the group should take up 
    435438     * @param columns     the number of columns the new group will have 
     439     * @param gridFill    the value to pass to the GridData constructor 
    436440     * @return            the new group 
    437441     */ 
    438442    protected Group createGroup(Composite comp, String text, int columnsUsed,  
    439             int columns
     443            int columns, int gridFill
    440444    { 
    441445        Group group = new Group(comp, SWT.NONE); 
    442446        group.setText(text); 
    443447         
    444         GridData gd = new GridData(GridData.FILL_HORIZONTAL); 
     448        GridData gd = new GridData(gridFill); 
    445449        gd.horizontalSpan = columnsUsed; 
    446450        group.setLayoutData(gd); 
  • trunk/descent.building/src/descent/internal/building/ui/CompilerTab.java

    r1183 r1184  
    1111import org.eclipse.jface.viewers.CheckboxCellEditor; 
    1212import org.eclipse.jface.viewers.ColumnLabelProvider; 
    13 import org.eclipse.jface.viewers.ColumnViewerEditor; 
    14 import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy; 
    1513import org.eclipse.jface.viewers.ComboBoxCellEditor; 
    1614import org.eclipse.jface.viewers.EditingSupport; 
     15import org.eclipse.jface.viewers.ICellEditorListener; 
    1716import org.eclipse.jface.viewers.ISelectionChangedListener; 
    1817import org.eclipse.jface.viewers.ITreeContentProvider; 
     
    2322import org.eclipse.jface.viewers.TreeViewer; 
    2423import org.eclipse.jface.viewers.TreeViewerColumn; 
    25 import org.eclipse.jface.viewers.TreeViewerEditor; 
    2624import org.eclipse.jface.viewers.Viewer; 
    2725import org.eclipse.swt.SWT; 
     
    3028import org.eclipse.swt.events.SelectionAdapter; 
    3129import org.eclipse.swt.events.SelectionEvent; 
    32 import org.eclipse.swt.graphics.Font; 
    33 import org.eclipse.swt.graphics.FontData; 
    3430import org.eclipse.swt.graphics.Image; 
    3531import org.eclipse.swt.layout.GridData; 
     
    4339import org.eclipse.swt.widgets.Text; 
    4440import org.eclipse.ui.dialogs.PreferencesUtil; 
     41import org.eclipse.ui.forms.widgets.ScrolledFormText; 
    4542 
    4643import descent.building.IDescentBuilderConstants; 
     
    234231        { 
    235232            public TreeEntry parent; 
     233            public CellEditor editor; 
    236234             
    237235            public abstract CompilerOption getOption(); 
     
    248246            private BooleanOption option; 
    249247            public Boolean selected = Boolean.FALSE; 
    250             private CheckboxCellEditor editor; 
    251248             
    252249            public CheckboxUIOption(BooleanOption option) 
     
    265262            { 
    266263                if(null == editor) 
     264                { 
    267265                    editor = new CheckboxCellEditor(fViewer.getTree()); 
     266                    editor.addListener(fCellEditorListener); 
     267                } 
    268268                 
    269269                return editor; 
     
    305305            private EnumOption option; 
    306306            public Integer selected = Integer.valueOf(0); 
    307             private ComboBoxCellEditor editor; 
    308307             
    309308            public ComboUIOption(EnumOption option) 
     
    325324                    editor = new ComboBoxCellEditor(fViewer.getTree(),  
    326325                            option.getOptionEditLabels()); 
     326                    editor.addListener(fCellEditorListener); 
    327327                } 
    328328                 
     
    354354                for(int i = 0; i < optionValues.length; i++) 
    355355                { 
    356                     if(optionValues[i].equals(i)) 
     356                    if(optionValues[i].equals(value)) 
    357357                    { 
    358358                        selected = Integer.valueOf(i); 
     
    369369        } 
    370370         
    371         private final class TextUIOption extends CompilerUIOption 
    372         { 
    373             private StringOption option; 
     371        private class TextUIOption extends CompilerUIOption 
     372        { 
     373            protected StringOption option; 
    374374            public String selected = ""; 
    375             private TextCellEditor editor; 
    376375             
    377376            public TextUIOption(StringOption option) 
     
    390389            { 
    391390                if(null == editor) 
     391                { 
    392392                    editor = new TextCellEditor(fViewer.getTree()); 
     393                    editor.addListener(fCellEditorListener); 
     394                } 
    393395                 
    394396                return editor; 
     
    482484        } 
    483485         
     486        private final ICellEditorListener fCellEditorListener = 
     487            new ICellEditorListener() 
     488            { 
     489                public void applyEditorValue() 
     490                { 
     491                    validatePage(); 
     492                    updateLaunchConfigurationDialog(); 
     493                } 
     494 
     495                public void cancelEditor() 
     496                { 
     497                    // Ignore 
     498                } 
     499 
     500                public void editorValueChanged(boolean oldValidState, 
     501                        boolean newValidState) 
     502                { 
     503                    // Ignore; the user hasn't finished editing yet 
     504                } 
     505            }; 
     506         
    484507        private IVMInstall fSelectedCompiler; 
    485508        private TreeViewer fViewer; 
    486509        private TreeEntry[] fEntries; 
    487         private Group fHelpGroup; 
    488         private Label fHelpHeader; 
    489         private Label fHelpText; 
    490510         
    491511        public void addToControl(Composite comp) 
     
    497517            fViewer.getTree().setHeaderVisible(true); 
    498518            fViewer.getTree().setLinesVisible(true); 
    499             TreeViewerEditor.create(fViewer, 
    500                     // Here comes the world's most unnecessarily long class name... 
    501                     new ColumnViewerEditorActivationStrategy(fViewer), 
    502                     ColumnViewerEditor.DEFAULT); 
    503519             
    504520            TreeViewerColumn column = new TreeViewerColumn(fViewer, SWT.NONE); 
     
    580596            fViewer.getControl().setLayoutData(gd); 
    581597             
    582             fHelpGroup = new Group(comp, SWT.SHADOW_IN); 
     598            Group helpGroup = new Group(comp, SWT.SHADOW_IN); 
    583599            gd = new GridData(GridData.FILL_VERTICAL); 
    584600            gd.horizontalSpan = 1; 
    585601            gd.widthHint = 225; // PERHAPS use PixelConverter or something...? 
    586             fHelpGroup.setLayoutData(gd); 
    587              
    588             GridLayout groupLayout = new GridLayout(); 
    589             groupLayout.numColumns = 1; 
    590             fHelpGroup.setLayout(groupLayout); 
    591              
    592             fHelpHeader = new Label(fHelpGroup, SWT.LEFT); 
    593             gd = new GridData(GridData.FILL_HORIZONTAL); 
    594             gd.horizontalSpan = 1; 
    595             fHelpHeader.setText(""); 
    596             fHelpHeader.setFont(getBoldFont(comp)); 
    597             fHelpHeader.setLayoutData(gd); 
    598              
    599             fHelpText = new Label(fHelpGroup, SWT.LEFT | SWT.WRAP); 
     602            helpGroup.setLayoutData(gd); 
     603            GridLayout layout = new GridLayout(); 
     604            layout.numColumns = 1; 
     605            helpGroup.setLayout(layout); 
     606             
     607            final ScrolledFormText helpForm = new ScrolledFormText(helpGroup, true); 
     608            final String NO_TEXT = "<form></form>"; 
    600609            gd = new GridData(GridData.FILL_BOTH); 
    601610            gd.horizontalSpan = 1; 
    602             fHelpText.setText(""); 
    603             fHelpText.setLayoutData(gd); 
     611            helpForm.setLayoutData(gd); 
     612            helpForm.setAlwaysShowScrollBars(true); 
     613            helpForm.setExpandVertical(true); 
     614            helpForm.setExpandHorizontal(false); 
     615            helpForm.setText(NO_TEXT); 
    604616             
    605617            fViewer.addSelectionChangedListener(new ISelectionChangedListener() 
    606             { 
     618            {    
    607619                public void selectionChanged(SelectionChangedEvent event) 
    608620                {    
     
    610622                    if(0 == paths.length) 
    611623                    { 
    612                         unsetHelp(); 
     624                        helpForm.setText(NO_TEXT); 
    613625                        return; 
    614626                    } 
     
    617629                    if(!(selected instanceof CompilerUIOption)) 
    618630                    { 
    619                         unsetHelp(); 
     631                        helpForm.setText(NO_TEXT); 
    620632                        return; 
    621633                    } 
    622634                     
    623                      
    624                     fHelpHeader.setText(((CompilerUIOption) selected).getOption(). 
    625                             getLabel()); 
    626                     fHelpText.setText(((CompilerUIOption) selected).getOption(). 
    627                             getHelpText()); 
    628                     updateHelp(); 
     635                    CompilerOption opt = ((CompilerUIOption) selected).getOption(); 
     636                    helpForm.setText(makeFormText(opt.getLabel(), opt.getHelpText())); 
    629637                } 
    630638                 
    631                 private void unsetHelp() 
    632                 { 
    633                     fHelpHeader.setText(""); 
    634                     fHelpText.setText(""); 
    635                     updateHelp(); 
    636                 } 
    637                  
    638                 private void updateHelp() 
    639                 { 
    640                     fHelpHeader.update(); 
    641                     fHelpText.update(); 
     639                private String makeFormText(String label, String helpText) 
     640                { 
     641                    StringBuilder content = new StringBuilder(); 
     642                    content.append("<form><p><b>"); 
     643                    content.append(label); 
     644                    content.append("</b></p><br></br>"); 
     645                    content.append(helpText); 
     646                    content.append("</form>"); 
     647                    return content.toString(); 
    642648                } 
    643649            }); 
     
    680686            if(opt instanceof BooleanOption) 
    681687                return new CheckboxUIOption((BooleanOption) opt); 
     688            else if(opt instanceof EnumOption) 
     689                return new ComboUIOption((EnumOption) opt); 
    682690            else if(opt instanceof StringOption) 
    683691                return new TextUIOption((StringOption) opt); 
    684             else if(opt instanceof EnumOption) 
    685                 return new ComboUIOption((EnumOption) opt); 
    686692            else 
    687693                throw new UnsupportedOperationException(); 
     
    852858     
    853859    private Image fCheckedIcon = createImage("obj16/checked.png"); 
    854     private Image fUncheckedIcon = createImage("obj16/unchecked.png"); 
    855     private Font fBoldFont; 
    856      
    857     private Font getBoldFont(Composite comp) 
    858     { 
    859         if(null == fBoldFont) 
    860         { 
    861             FontData[] fontData = comp.getFont().getFontData(); 
    862             for(FontData dataItem : fontData) 
    863                 dataItem.setStyle(dataItem.getStyle() | SWT.BOLD); 
    864             fBoldFont = new Font(comp.getDisplay(), fontData); 
    865         } 
    866         return fBoldFont; 
    867     } 
     860    private Image fUncheckedIcon = createImage("obj16/unchecked.png");  
    868861     
    869862    public void dispose() 
     
    872865        fCheckedIcon.dispose(); 
    873866        fUncheckedIcon.dispose(); 
    874         if(null != fBoldFont) 
    875             fBoldFont.dispose(); 
    876867    } 
    877868     
  • trunk/descent.building/src/descent/internal/building/ui/DebuildTabGroup.java

    r1175 r1184  
    1414             new GeneralTab(), 
    1515             new CompilerTab(), 
     16             new VersionTab(), 
    1617             new EnvironmentTab(), 
    1718        }; 
  • trunk/descent.building/src/descent/internal/building/ui/GeneralTab.java

    r1183 r1184  
    11package descent.internal.building.ui; 
    2  
    3 import java.util.ArrayList; 
    4 import java.util.List; 
    52 
    63import org.eclipse.core.resources.IProject; 
     
    1310import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; 
    1411import org.eclipse.jface.viewers.ILabelProvider; 
    15 import org.eclipse.jface.viewers.LabelProvider; 
    1612import org.eclipse.jface.window.Window; 
    1713import org.eclipse.swt.SWT; 
    1814import org.eclipse.swt.events.SelectionAdapter; 
    1915import org.eclipse.swt.events.SelectionEvent; 
    20 import org.eclipse.swt.graphics.Image; 
    2116import org.eclipse.swt.layout.GridData; 
    2217import org.eclipse.swt.layout.GridLayout; 
     
    2419import org.eclipse.swt.widgets.Composite; 
    2520import org.eclipse.swt.widgets.FileDialog; 
    26 import org.eclipse.swt.widgets.Group; 
    2721import org.eclipse.swt.widgets.Label; 
    2822import org.eclipse.swt.widgets.Layout; 
    2923import org.eclipse.ui.dialogs.ElementListSelectionDialog; 
    3024 
    31 import descent.core.IJavaElement; 
    3225import descent.core.IJavaProject; 
    3326import descent.core.JavaCore; 
     
    473466             
    474467            // Create the group 
    475             comp = createGroup(comp, "Included modules", 3, 3); 
     468            comp = createGroup(comp, "Included modules", 3, 3, GridData.FILL_HORIZONTAL); 
    476469             
    477470            // Add the label 
     
    532525        public String validate() 
    533526        { 
     527            return null; 
     528            /* 
    534529            List<String> modules = fList.getElementsNoCopy(); 
    535530             
     
    540535            // have a check button, since this can be a lengthy operation?) 
    541536             
    542             return null; 
     537            return null;*/ 
    543538        } 
    544539    } 
     
    569564        { 
    570565            new ProjectSetting(), 
    571             new GroupSetting("Output target", 3, 3, new ISetting[] 
    572             { 
    573                 outputTypeSetting, 
    574                 outputFileSetting, 
    575             }), 
     566            new GroupSetting("Output target", 3, 3, GridData.FILL_HORIZONTAL, 
     567                new ISetting[] 
     568                {