Changeset 1183
- Timestamp:
- 05/29/08 04:27:12 (7 months ago)
- Files:
-
- trunk/descent.building/src/descent/building/IDescentBuilderConstants.java (modified) (1 diff)
- trunk/descent.building/src/descent/building/compiler/IValidatableOption.java (added)
- trunk/descent.building/src/descent/building/compiler/StringOption.java (modified) (2 diffs)
- trunk/descent.building/src/descent/internal/building/compiler/DmdCompilerInterface.java (modified) (13 diffs)
- trunk/descent.building/src/descent/internal/building/compiler/IDmdCompilerConstants.java (modified) (2 diffs)
- trunk/descent.building/src/descent/internal/building/ui/AbstractBuilderTab.java (modified) (7 diffs)
- trunk/descent.building/src/descent/internal/building/ui/CompilerTab.java (modified) (25 diffs)
- trunk/descent.building/src/descent/internal/building/ui/GeneralTab.java (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/descent.building/src/descent/building/IDescentBuilderConstants.java
r1180 r1183 82 82 public static final String ATTR_OUTPUT_FILE = "descent.building.debuild.output_file"; 83 83 84 // TODO comment 84 /** 85 * Add unit tests to the generated executable? 86 * 87 * Type: String of "true" or "false" 88 */ 85 89 public static final String ATTR_ADD_UNITTESTS = "descent.building.debuild.add_unittests"; 90 91 /** 92 * Disable asserts and contracts (in DMD this is called "release mode"). In 93 * other compilers, if asserions, contracts, and array bounds errors can be 94 * disabled separately, this option should only be for disabling asserts, 95 * however clients should be aware that other features may be disabled as well 96 * in generated code. 97 * 98 * If the compiler does not support disabling of assertions, this option 99 * should be ignored. If the compiler does not support assertions at all, but 100 * this attribute was specified outside the UI to be explicitly "false", an error 101 * should be marked. 102 * 103 * Type: String of "true" or "false" 104 */ 86 105 public static final String ATTR_DISABLE_ASSERTS = "descent.building.debuild.disable_asserts"; 106 107 /** 108 * Include debugging symbols in the generated executable. 109 * 110 * If the compiler supports multiple kinds of debugging symbols, the system 111 * default should be used. If a default cannot be determined or the compiler 112 * does not support adding of debugging symbols, an error should be marked. 113 * 114 * Type: String of "true" or "false" 115 */ 87 116 public static final String ATTR_ADD_DEBUG_INFO = "descent.building.debuild.add_debug_info"; 117 118 /** 119 * Include code allowing code coverage to be tracked in the generated 120 * executable. 121 * 122 * If the compiler does not support debug symbols, an error should be marked. 123 * 124 * Type: String of "true" or "false" 125 */ 88 126 public static final String ATTR_INSTRUMENT_FOR_COVERAGE = "descent.building.debuild.instrument_for_coverage"; 127 128 /** 129 * Include code for profiling the executable. 130 * 131 * If the compiler supports multiple kinds of profile information, the system 132 * default should be used. If a default cannot be determined or the compiler 133 * does not support adding of profile information, an error should be marked. 134 * 135 * Type: String of "true" or "false" 136 */ 89 137 public static final String ATTR_INSTRUMENT_FOR_PROFILE = "descent.building.debuild.instrument_for_profile"; 138 139 /** 140 * A set of additional compiler arguments that should be added to 141 * the command line when calling the compiler. 142 * 143 * Type: String 144 */ 145 public static final String ATTR_ADDITIONAL_COMPILER_ARGS = "descent.building.debuild.compiler_args"; 146 147 /** 148 * A set of additional linker arguments that should be added to 149 * the command line when calling the linker. 150 * 151 * Type: String 152 */ 153 public static final String ATTR_ADDITIONAL_LINKER_ARGS = "descent.building.debuild.linker_args"; 90 154 91 155 /** trunk/descent.building/src/descent/building/compiler/StringOption.java
r1180 r1183 1 1 package descent.building.compiler; 2 2 3 public class StringOption extends CompilerOption 3 public class StringOption extends CompilerOption implements IValidatableOption 4 4 { 5 5 public StringOption(String attributeId, String defaultValue, … … 8 8 super(attributeId, defaultValue, label, groupLabel, helpText); 9 9 } 10 11 public String isValid(String value) 12 { 13 return null; 14 } 10 15 } trunk/descent.building/src/descent/internal/building/compiler/DmdCompilerInterface.java
r1180 r1183 268 268 269 269 // TODO file options for header & doc generation 270 // TODO Only Windows uses OPTLINK, make a separate list of linker 271 // options for Linux 270 272 uiOptions = new CompilerOption[] 271 273 { … … 273 275 // Features 274 276 275 new BooleanOption( 277 new BooleanOption 278 ( 276 279 ATTR_ADD_DEBUG_INFO, 277 280 true, … … 282 285 "Adds debugging symbols. These make the generated objects " + 283 286 "slightly larger but is needed to use a debugger with the " + 284 "program."), 287 "program." 288 ), 285 289 286 new BooleanOption( 290 new BooleanOption 291 ( 287 292 ATTR_DISABLE_ASSERTS, 288 293 false, 289 "Release mode (disable asserts & contracts)",294 "Release mode", 290 295 GROUP_FEATURES, 291 296 "-release", … … 294 299 "blocks on functions, and checking for array bounds errors. This " + 295 300 "makes the code run faster, so is a good choice for releasing the " + 296 "application, but are often useful for development."), 301 "application, but are often useful for development." 302 ), 297 303 298 299 new BooleanOption(304 new BooleanOption 305 ( 300 306 ATTR_ADD_UNITTESTS, 301 307 false, … … 305 311 "", 306 312 "Adds code so that unittest {} blocks in your code are run before " + 307 "the program launches and enables version(unitttest) {} blocks."), 313 "the program launches and enables version(unitttest) {} blocks." 314 ), 308 315 309 new BooleanOption( 316 new BooleanOption 317 ( 310 318 ATTR_INSTRUMENT_FOR_COVERAGE, 311 319 false, … … 317 325 "a file containing code coverage information after the program " + 318 326 "has been run. This is useful for seeing if unit tests execute " + 319 "all paths in your code."), 327 "all paths in your code." 328 ), 320 329 321 new BooleanOption( 330 new BooleanOption 331 ( 322 332 ATTR_INSTRUMENT_FOR_PROFILE, 323 333 false, … … 328 338 "Adds code to the generated objects so they can be prodiled. " + 329 339 "This helps find bottlenecks that could be slowing down your " + 330 "application."), 340 "application." 341 ), 331 342 332 343 //------------------------------------------------------------------ 333 344 // Warnings 334 345 335 new BooleanOption( 346 new BooleanOption 347 ( 336 348 ATTR_ALLOW_DEPRECATED, 337 349 true, … … 341 353 "", 342 354 "Allows code marked with the \"deprecated\" tags to be included " + 343 "in your program."), 344 345 new BooleanOption( 355 "in your program." 356 ), 357 358 new BooleanOption 359 ( 346 360 ATTR_SHOW_WARNINGS, 347 361 false, … … 352 366 "Adds warnings for potentially unsafe or error-prone code. In " + 353 367 "DMD, if warnings are encountered, the program will not be " + 354 "compiled."), 368 "compiled." 369 ), 355 370 356 371 … … 358 373 // Optimization 359 374 360 new BooleanOption( 375 new BooleanOption 376 ( 361 377 ATTR_OPTIMIZE_CODE, 362 378 false, … … 365 381 "-O", 366 382 "", 367 "Optimizes the generated code for best efficiency."), 383 "Optimizes the generated code for best efficiency." 384 ), 368 385 369 new BooleanOption( 386 new BooleanOption 387 ( 370 388 ATTR_INLINE_CODE, 371 389 false, … … 375 393 "", 376 394 "Allows inlining of short functions for increased code efficiency. " + 377 "This may cause issues with some debuggers."), 378 379 new BooleanOption( 395 "This may cause issues with some debuggers." 396 ), 397 398 new BooleanOption 399 ( 380 400 ATTR_NOFLOAT, 381 401 false, … … 386 406 "Prevents the emission of the __fltused reference in object files, " + 387 407 "even if floating point code is present. This is useful in library " + 388 "files."), 408 "files." 409 ), 389 410 }; 390 411 } trunk/descent.building/src/descent/internal/building/compiler/IDmdCompilerConstants.java
r1180 r1183 4 4 { 5 5 // TODO comment 6 7 // Compiler 6 8 public static final String ATTR_ALLOW_DEPRECATED = "descent.building.compiler.dmd.allow_deprectaed"; 7 9 public static final String ATTR_SHOW_WARNINGS = "descent.building.compiler.dmd.show_warnings"; … … 9 11 public static final String ATTR_OPTIMIZE_CODE = "descent.building.compiler.dmd.optimize_code"; 10 12 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. 11 18 } trunk/descent.building/src/descent/internal/building/ui/AbstractBuilderTab.java
r1177 r1183 3 3 import java.util.ArrayList; 4 4 import java.util.List; 5 import java.util.Map; 6 import java.util.Set; 5 7 6 8 import org.eclipse.core.resources.IWorkspaceRoot; … … 193 195 private final boolean fEditable; 194 196 195 protected Label fLabel;196 197 protected Text fText; 197 protected Button fButton;198 198 199 199 /** … … 203 203 * @param label the text of the label 204 204 * @param numColumns the number of columns the three controls should 205 * take up. Must be >= 2 if no browse button and 206 * >= 3 if there is a browse button 205 * take up. 207 206 * @param browseButton should there be a browse button? if this is true, 208 * numColumns must be >= 3 and {@link #browse()} must 209 * be implemented in the subclass. 207 * {@link #browse()} must be implemented in the subclass. 210 208 * @param editable sets whether or not the text field is editable. 211 209 * This should only be false if browseButton is true, … … 224 222 public final void addToControl(Composite comp) 225 223 { 226 fLabel = new Label(comp, SWT.NONE); 227 fLabel.setText(fLabelString); 228 GridData gd = new GridData(); 224 comp = new Composite(comp, SWT.NONE); 225 GridData gd = new GridData(GridData.FILL_HORIZONTAL); 226 gd.horizontalSpan = fNumColumns; 227 comp.setLayoutData(gd); 228 229 GridLayout layout = new GridLayout(); 230 layout.numColumns = fBrowseButton ? 3 : 2; 231 comp.setLayout(layout); 232 233 Label label = new Label(comp, SWT.NONE); 234 label.setText(fLabelString); 235 gd = new GridData(); 229 236 gd.horizontalSpan = 1; 230 fLabel.setLayoutData(gd);237 label.setLayoutData(gd); 231 238 232 239 fText = new Text(comp, SWT.SINGLE | SWT.BORDER); 233 240 gd = new GridData(GridData.FILL_HORIZONTAL); 234 gd.horizontalSpan = fNumColumns - (fBrowseButton ? 2 : 1);241 gd.horizontalSpan = 1; 235 242 fText.setLayoutData(gd); 236 243 fText.setEditable(fEditable); … … 246 253 if(fBrowseButton) 247 254 { 248 fButton = new Button(comp, SWT.PUSH);249 fButton.setText("Browse...");255 Button button = new Button(comp, SWT.PUSH); 256 button.setText("Browse..."); 250 257 gd = new GridData(); 251 258 gd.horizontalSpan = 1; 252 fButton.setLayoutData(gd);253 setButtonDimensionHint( fButton);254 fButton.addSelectionListener(new SelectionAdapter()259 button.setLayoutData(gd); 260 setButtonDimensionHint(button); 261 button.addSelectionListener(new SelectionAdapter() 255 262 { 256 263 public void widgetSelected(SelectionEvent evt) … … 276 283 277 284 public final void initializeFrom(ILaunchConfiguration config) 278 { 279 String value = ""; 280 try 281 { 282 value = config.getAttribute(fAttribute, ""); 283 } 284 catch(CoreException e) { } 285 286 fText.setText(value); 285 { 286 fText.setText(getAttribute(config, fAttribute, "")); 287 287 } 288 288 … … 586 586 return ResourcesPlugin.getWorkspace().getRoot(); 587 587 } 588 589 //-------------------------------------------------------------------------- 590 // Wrappers for ILaunchConfiguration methods which hide the exceptions, 591 // since the exception will never be thrown 592 593 protected static String getAttribute(ILaunchConfiguration config, String id, 594 String defaultValue) 595 { 596 String value = defaultValue; 597 try 598 { 599 value = config.getAttribute(id, defaultValue); 600 } 601 catch(CoreException e) { } 602 return value; 603 } 604 605 protected static boolean getAttribute(ILaunchConfiguration config, String id, 606 boolean defaultValue) 607 { 608 boolean value = defaultValue; 609 try 610 { 611 value = config.getAttribute(id, defaultValue); 612 } 613 catch(CoreException e) { } 614 return value; 615 } 616 617 protected static int getAttribute(ILaunchConfiguration config, String id, 618 int defaultValue) 619 { 620 int value = defaultValue; 621 try 622 { 623 value = config.getAttribute(id, defaultValue); 624 } 625 catch(CoreException e) { } 626 return value; 627 } 628 629 @SuppressWarnings("unchecked") 630 protected static List getAttribute(ILaunchConfiguration config, String id, 631 List defaultValue) 632 { 633 List value = defaultValue; 634 try 635 { 636 value = config.getAttribute(id, defaultValue); 637 } 638 catch(CoreException e) { } 639 return value; 640 } 641 642 @SuppressWarnings("unchecked") 643 protected static Map getAttribute(ILaunchConfiguration config, String id, 644 Map defaultValue) 645 { 646 Map value = defaultValue; 647 try 648 { 649 value = config.getAttribute(id, defaultValue); 650 } 651 catch(CoreException e) { } 652 return value; 653 } 654 655 @SuppressWarnings("unchecked") 656 protected static Set getAttribute(ILaunchConfiguration config, String id, 657 Set defaultValue) 658 { 659 Set value = defaultValue; 660 try 661 { 662 value = config.getAttribute(id, defaultValue); 663 } 664 catch(CoreException e) { } 665 return value; 666 } 588 667 } trunk/descent.building/src/descent/internal/building/ui/CompilerTab.java
r1180 r1183 6 6 import java.util.TreeMap; 7 7 8 import org.eclipse.core.runtime.CoreException;9 8 import org.eclipse.debug.core.ILaunchConfiguration; 10 9 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; … … 31 30 import org.eclipse.swt.events.SelectionAdapter; 32 31 import org.eclipse.swt.events.SelectionEvent; 32 import org.eclipse.swt.graphics.Font; 33 import org.eclipse.swt.graphics.FontData; 33 34 import org.eclipse.swt.graphics.Image; 34 35 import org.eclipse.swt.layout.GridData; … … 40 41 import org.eclipse.swt.widgets.Layout; 41 42 import org.eclipse.swt.widgets.Link; 43 import org.eclipse.swt.widgets.Text; 42 44 import org.eclipse.ui.dialogs.PreferencesUtil; 43 45 … … 47 49 import descent.building.compiler.EnumOption; 48 50 import descent.building.compiler.ICompilerInterface; 51 import descent.building.compiler.IValidatableOption; 49 52 import descent.building.compiler.StringOption; 50 53 import descent.internal.building.compiler.DmdCompilerInterface; … … 77 80 78 81 fHelpText = new Link(comp, SWT.LEFT | SWT.WRAP); 79 fHelpText.setText("Select the compiler/standard library set to use " + 80 "for this build configuration. Use the <a>Compilers " + 81 "preference page</a> to set up compiler/standard library " + 82 "configurations."); 82 fHelpText.setText("Use the <a>Compilers preference page</a> to set up " + 83 "compiler/standard library configurations"); 83 84 gd = new GridData(GridData.FILL_BOTH); 84 85 gd.horizontalSpan = 2; … … 102 103 103 104 fCombo = new Combo(comp, SWT.DROP_DOWN | SWT.READ_ONLY); 104 gd = new GridData(GridData.HORIZONTAL_ALIGN_ BEGINNING);105 gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); 105 106 gd.horizontalSpan = 1; 106 gd.grabExcessHorizontalSpace = true;107 107 fCombo.addModifyListener(new ModifyListener() 108 108 { … … 167 167 public void initializeFrom(ILaunchConfiguration config) 168 168 { 169 String compilerTypeId = ""; 170 try 171 { 172 compilerTypeId = config.getAttribute(IDescentBuilderConstants.ATTR_COMPILER_TYPE_ID, ""); 173 } 174 catch(CoreException e) { } 175 176 String compilerId = ""; 177 try 178 { 179 compilerId = config.getAttribute(IDescentBuilderConstants.ATTR_COMPILER_ID, ""); 180 } 181 catch(CoreException e) { } 169 String compilerTypeId = getAttribute(config, 170 IDescentBuilderConstants.ATTR_COMPILER_TYPE_ID, ""); 171 String compilerId = getAttribute(config, 172 IDescentBuilderConstants.ATTR_COMPILER_ID, ""); 182 173 183 174 for(int i = 0; i < fCompilers.length; i++) … … 238 229 } 239 230 240 p ublicclass CompilerOptions implements ISetting231 private final class CompilerOptions implements ISetting 241 232 { 242 233 private abstract class CompilerUIOption … … 250 241 public abstract String getText(); 251 242 public abstract void initializeTo(String value); 252 public abstract void applyTo(ILaunchConfigurationWorkingCopy config);243 public abstract String getStringValue(); 253 244 } 254 245 … … 304 295 305 296 @Override 306 public void applyTo(ILaunchConfigurationWorkingCopy config) 307 { 308 config.setAttribute(option.getAttributeId(), 309 selected ? "true" : "false"); 297 public String getStringValue() 298 { 299 return selected ? "true" : "false"; 310 300 } 311 301 } … … 373 363 374 364 @Override 375 public void applyTo(ILaunchConfigurationWorkingCopy config) 376 { 377 config.setAttribute(getOption().getAttributeId(), 378 option.getOptionValues()[selected.intValue()]); 365 public String getStringValue() 366 { 367 return option.getOptionValues()[selected.intValue()]; 379 368 } 380 369 } … … 431 420 432 421 @Override 433 public void applyTo(ILaunchConfigurationWorkingCopy config)434 { 435 config.setAttribute(getOption().getAttributeId(), selected);422 public String getStringValue() 423 { 424 return selected; 436 425 } 437 426 } … … 497 486 private TreeEntry[] fEntries; 498 487 private Group fHelpGroup; 488 private Label fHelpHeader; 499 489 private Label fHelpText; 500 490 … … 528 518 529 519 column = new TreeViewerColumn(fViewer, SWT.NONE); 530 column.getColumn().setWidth( 200);520 column.getColumn().setWidth(175); 531 521 column.getColumn().setText("Value"); 532 522 column.setLabelProvider(new ColumnLabelProvider() … … 593 583 gd = new GridData(GridData.FILL_VERTICAL); 594 584 gd.horizontalSpan = 1; 595 gd.widthHint = 2 00; // PERHAPS use PixelConverter or something...?585 gd.widthHint = 225; // PERHAPS use PixelConverter or something...? 596 586 fHelpGroup.setLayoutData(gd); 597 587 … … 599 589 groupLayout.numColumns = 1; 600 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); 601 598 602 599 fHelpText = new Label(fHelpGroup, SWT.LEFT | SWT.WRAP); … … 613 610 if(0 == paths.length) 614 611 { 615 fHelpText.setText(""); 616 fHelpText.update(); 612 unsetHelp(); 617 613 return; 618 614 } … … 621 617 if(!(selected instanceof CompilerUIOption)) 622 618 { 623 fHelpText.setText(""); 624 fHelpText.update(); 619 unsetHelp(); 625 620 return; 626 621 } 627 622 623 624 fHelpHeader.setText(((CompilerUIOption) selected).getOption(). 625 getLabel()); 628 626 fHelpText.setText(((CompilerUIOption) selected).getOption(). 629 627 getHelpText()); 628 updateHelp(); 629 } 630 631 private void unsetHelp() 632 { 633 fHelpHeader.setText(""); 634 fHelpText.setText(""); 635 updateHelp(); 636 } 637 638 private void updateHelp() 639 { 640 fHelpHeader.update(); 630 641 fHelpText.update(); 631 642 } … … 704 715 CompilerOption opt = uiOpt.getOption(); 705 716 String defaultValue = opt.getDefaultValue(); 706 String value = defaultValue; 707 try 708 { 709 value = config.getAttribute(opt.getAttributeId(), defaultValue); 710 } 711 catch(CoreException e) { } 717 String value = getAttribute(config, opt.getAttributeId(), defaultValue); 712 718 uiOpt.initializeTo(value); 713 719 fViewer.update(uiOpt, null); … … 723 729 for(CompilerUIOption uiOpt : group.children) 724 730 { 725 uiOpt.applyTo(config); 731 CompilerOption opt = uiOpt.getOption(); 732 config.setAttribute(opt.getAttributeId(), uiOpt.getStringValue()); 726 733 } 727 734 } … … 743 750 public String validate() 744 751 { 745 // PERHAPS should we allow options to validate themselves? 752 for(TreeEntry group : fEntries) 753 { 754 for(CompilerUIOption uiOpt : group.children) 755 { 756 CompilerOption opt = uiOpt.getOption(); 757 if(opt instanceof IValidatableOption) 758 { 759 String msg = ((IValidatableOption) opt).isValid(uiOpt.getStringValue()); 760 if(null != msg) 761 return msg; 762 } 763 } 764 } 746 765 return null; 747 766 } … … 749 768 750 769 //-------------------------------------------------------------------------- 751 // Icon management 770 // Additional arguments 771 772 private final class ArgumentsSetting implements ISetting 773 { 774 private Text fCompilerText; 775 private Text fLinkerText; 776 777 public final void addToControl(Composite comp) 778 { 779 comp = new Composite(comp, SWT.NONE); 780 GridData gd = new GridData(GridData.FILL_HORIZONTAL); 781 gd.horizontalSpan = 2; 782 comp.setLayoutData(gd); 783 784 GridLayout layout = new GridLayout(); 785 layout.numColumns = 2; 786 comp.setLayout(layout); 787 788 addLabel(comp, "Additional compiler args:"); 789 fCompilerText = addText(comp); 790 791 addLabel(comp, "Additional linker args:"); 792 fLinkerText = addText(comp); 793 } 794 795 private Label addLabel(Composite comp, String str) 796 { 797 Label label = new Label(comp, SWT.NONE); 798 label.setText(str); 799 GridData gd = new GridData(); 800 gd.horizontalSpan = 1; 801 label.setLayoutData(gd); 802 return label; 803 } 804 805 private Text addText(Composite comp) 806 { 807 Text text = new Text(comp, SWT.SINGLE | SWT.BORDER); 808 GridData gd = new GridData(GridData.FILL_HORIZONTAL); 809 gd.horizontalSpan = 1; 810 text.setLayoutData(gd); 811 text.addModifyListener(new ModifyListener() 812 { 813 public void modifyText(ModifyEvent evt) 814 { 815 validatePage(); 816 updateLaunchConfigurationDialog(); 817 } 818 }); 819 return text; 820 } 821 822 public void setDefaults(ILaunchConfigurationWorkingCopy config) 823 { 824 config.setAttribute(IDescentBuilderConstants.ATTR_ADDITIONAL_COMPILER_ARGS, ""); 825 config.setAttribute(IDescentBuilderConstants.ATTR_ADDITIONAL_LINKER_ARGS, ""); 826 } 827 828 public void initializeFrom(ILaunchConfiguration config) 829 { 830 fCompilerText.setText(getAttribute(config, IDescentBuilderConstants.ATTR_ADDITIONAL_COMPILER_ARGS, "")); 831 fLinkerText.setText(getAttribute(config, IDescentBuilderConstants.ATTR_ADDITIONAL_LINKER_ARGS, "")); 832 } 833 834 public void performApply(ILaunchConfigurationWorkingCopy config) 835 { 836 config.setAttribute(IDescentBuilderConstants.ATTR_ADDITIONAL_COMPILER_ARGS, fCompilerText.getText()); 837 config.setAttribute(IDescentBuilderConstants.ATTR_ADDITIONAL_LINKER_ARGS, fLinkerText.getText()); 838 } 839 840 public String validate() 841 { 842 // Assume anything is valid... this setting is for advanced users who 843 // should know what they're doing 844 return null; 845 } 846 } 847 848 //-------------------------------------------------------------------------- 849 // Resource management 752 850 753 851 // This needs to be done at the tab level to allow for disposing) … … 755 853 private Image fCheckedIcon = createImage("obj16/checked.png"); 756 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 } 757 868 758 869 public void dispose() … … 761 872 fCheckedIcon.dispose(); 762 873 fUncheckedIcon.dispose(); 874 if(null != fBoldFont) 875 fBoldFont.dispose(); 763 876 } 764 877 … … 782 895 new CompilerSetting(), 783 896 compilerOptions, 897 new ArgumentsSetting(), 784 898 }; 785 899 } trunk/descent.building/src/descent/internal/building/ui/GeneralTab.java
r1177 r1183 1 1 package descent.internal.building.ui; 2 2 3 import java.util.ArrayList; 3 4 import java.util.List; 4 5 … … 6 7 import org.eclipse.core.resources.IResource; 7 8 import org.eclipse.core.resources.ResourcesPlugin; 8 import org.eclipse.core.runtime.CoreException;9 9 import org.eclipse.core.runtime.IPath; 10 10 import org.eclipse.core.runtime.IStatus; … … 13 13 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; 14 14 import org.eclipse.jface.viewers.ILabelProvider; 15 import org.eclipse.jface.viewers.LabelProvider; 15 16 import org.eclipse.jface.window.Window; 16 17 import org.eclipse.swt.SWT; 17 18 import org.eclipse.swt.events.SelectionAdapter; 18 19 import org.eclipse.swt.events.SelectionEvent; 20 import org.eclipse.swt.graphics.Image; 19 21 import org.eclipse.swt.layout.GridData; 20 22 import org.eclipse.swt.layout.GridLayout; … … 27 29 import org.eclipse.ui.dialogs.ElementListSelectionDialog; 28 30 31 import descent.core.IJavaElement; 29 32 import descent.core.IJavaProject; 30 33 import descent.core.JavaCore; … … 174 177 private final class OutputTypeSetting implements ISetting 175 178 { 176 private Label fLabel;177 179 private Button fExecutableRadio; 178 180 private Button fStaticLibRadio; … … 183 185 public void addToControl(Composite comp) 184 186 { 185 fLabel = new Label(comp, SWT.LEFT);186 fLabel.setText("Target type:");187 Label label = new Label(comp, SWT.LEFT); 188 label.setText("Target type:"); 187 189 GridData gd = new GridData(); 188 190 gd.horizontalSpan = 3; 189 fLabel.setLayoutData(gd);191 label.setLayoutData(gd); 190 192 191 193 fExecutableRadio = createRadioButton(comp, 3, "Executable", 25, … … 221 223 } 222 224 }); 223 createSpacer(comp, 3);224 225 } 225 226 226 227 public void initializeFrom(ILaunchConfiguration config) 227 228 { 228 String outputType = OUTPUT_TYPE_EXECUTABLE; 229 try 230 { 231 outputType = config.getAttribute(ATTR_OUTPUT_TYPE, OUTPUT_TYPE_EXECUTABLE); 232 } 233 catch(CoreException e) { } 229 String outputType = getAttribute(config, ATTR_OUTPUT_TYPE, 230 OUTPUT_TYPE_EXECUTABLE); 234 231 235 232 if(outputType.equals(OUTPUT_TYPE_STATIC_LIBRARY)) … … 431 428 private final class ModulesSetting implements ISetting 432 429 { 433 private Group fGroup;
