Changeset 1184
- Timestamp:
- 06/02/08 10:51:03 (5 months ago)
- Files:
-
- trunk/descent.building/META-INF/MANIFEST.MF (modified) (1 diff)
- trunk/descent.building/icons/full/obj16/Thumbs.db (deleted)
- trunk/descent.building/src/descent/building/IDescentBuilderConstants.java (modified) (4 diffs)
- trunk/descent.building/src/descent/building/compiler/EnumOption.java (modified) (1 diff)
- trunk/descent.building/src/descent/internal/building/BuilderUtil.java (modified) (3 diffs)
- trunk/descent.building/src/descent/internal/building/compiler/DmdCompilerInterface.java (modified) (3 diffs)
- trunk/descent.building/src/descent/internal/building/compiler/IDmdCompilerConstants.java (modified) (1 diff)
- trunk/descent.building/src/descent/internal/building/compiler/IDmdfeCompilerConstants.java (added)
- trunk/descent.building/src/descent/internal/building/compiler/IGdcCompilerConstants.java (added)
- trunk/descent.building/src/descent/internal/building/compiler/ui (added)
- trunk/descent.building/src/descent/internal/building/compiler/ui/CompilerUIOptions.java (added)
- trunk/descent.building/src/descent/internal/building/compiler/ui/DmdUIOptions.java (added)
- trunk/descent.building/src/descent/internal/building/compiler/ui/GdcUIOptions.java (added)
- trunk/descent.building/src/descent/internal/building/debuild/BuildRequest.java (modified) (1 diff)
- trunk/descent.building/src/descent/internal/building/ui/AbstractBuilderTab.java (modified) (6 diffs)
- trunk/descent.building/src/descent/internal/building/ui/CompilerTab.java (modified) (20 diffs)
- trunk/descent.building/src/descent/internal/building/ui/DebuildTabGroup.java (modified) (1 diff)
- trunk/descent.building/src/descent/internal/building/ui/GeneralTab.java (modified) (7 diffs)
- trunk/descent.building/src/descent/internal/building/ui/VersionTab.java (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/descent.building/META-INF/MANIFEST.MF
r1174 r1184 11 11 descent.core, 12 12 descent.ui, 13 descent.launching 13 descent.launching, 14 org.eclipse.ui.forms 14 15 Eclipse-LazyStart: true trunk/descent.building/src/descent/building/IDescentBuilderConstants.java
r1183 r1184 17 17 public interface IDescentBuilderConstants 18 18 { 19 //-------------------------------------------------------------------------- 20 // Eclipse IDs 21 19 22 /** 20 23 * The ID of the default descent builder. … … 28 31 */ 29 32 public static final String ID_LAUNCH_CONFIGURATION_TYPE = "descent.building.builders.debuild"; 33 34 //-------------------------------------------------------------------------- 35 // Launch configuration attributes 30 36 31 37 /** … … 154 160 155 161 /** 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 /** 156 219 * Constant used for {@link #ATTR_OUTPUT_TYPE} to specify the output target 157 220 * should be an executable file. … … 164 227 */ 165 228 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"; 166 251 } trunk/descent.building/src/descent/building/compiler/EnumOption.java
r1180 r1184 1 1 package descent.building.compiler; 2 2 3 public class EnumOption extends CompilerOption3 public final class EnumOption extends CompilerOption 4 4 { 5 5 private final String[] optionValues; trunk/descent.building/src/descent/internal/building/BuilderUtil.java
r1175 r1184 1 1 package descent.internal.building; 2 3 import java.util.Arrays; 2 4 3 5 import org.eclipse.core.resources.IResource; … … 43 45 44 46 /** 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 /** 45 85 * Gets the absolute OS path for the given Eclipse path (with portable 46 86 * separarators, etc.). … … 57 97 return path.toString(); 58 98 } 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 } 59 121 } trunk/descent.building/src/descent/internal/building/compiler/DmdCompilerInterface.java
r1183 r1184 2 2 3 3 import java.io.File; 4 import java.util.ArrayList; 5 import java.util.List; 4 6 import java.util.regex.Pattern; 5 7 6 8 import descent.building.compiler.AbstractCompileCommand; 7 9 import descent.building.compiler.AbstractLinkCommand; 8 import descent.building.compiler.BooleanOption;9 10 import descent.building.compiler.CompilerOption; 10 11 import descent.building.compiler.ICompileCommand; … … 13 14 import descent.building.compiler.IResponseInterpreter; 14 15 import descent.building.compiler.BuildResponse; 15 16 import static descent.building.IDescentBuilderConstants.*; 17 import static descent.internal.building.compiler. IDmdCompilerConstants.*;16 import descent.internal.building.compiler.ui.GdcUIOptions; 17 18 import static descent.internal.building.compiler.ui.DmdUIOptions.*; 18 19 19 20 public class DmdCompilerInterface implements ICompilerInterface … … 263 264 static 264 265 { 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()]); 411 288 } 412 289 trunk/descent.building/src/descent/internal/building/compiler/IDmdCompilerConstants.java
r1183 r1184 1 1 package descent.internal.building.compiler; 2 2 3 public interface IDmdCompilerConstants 3 public interface IDmdCompilerConstants extends IDmdfeCompilerConstants 4 4 { 5 // TODO comment6 7 // Compiler8 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";12 5 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 be15 // passed by the compiler, and about half of OPTLINK's options are ignored or16 // apply to 16-bit code anyways. It may be fine to just have a box for "additional17 // arguments" somewhere and allow the user to put them in as they want.18 6 } trunk/descent.building/src/descent/internal/building/debuild/BuildRequest.java
r1174 r1184 272 272 }; 273 273 274 // TODO use BuilderUtil.predefinedversions instead 274 275 // Predefined identifiers 275 276 private static final HashSet<String> predefinedVersions = new HashSet<String>(); trunk/descent.building/src/descent/internal/building/ui/AbstractBuilderTab.java
r1183 r1184 120 120 private final int fWidth; 121 121 private final int fNumColumns; 122 private final int fGridFill; 122 123 private final ISetting[] fChildren; 123 124 … … 132 133 * @param numColumns the number of columns the resulting group should 133 134 * have. 135 * @param gridFill the value to pass to the GridData constructor 134 136 * @param subSettings the settings within the group 135 137 */ 136 138 public GroupSetting(String label, int width, int numColumns, 137 ISetting[] subSettings)139 int gridFill, ISetting[] subSettings) 138 140 { 139 141 … … 141 143 fWidth = width; 142 144 fNumColumns = numColumns; 145 fGridFill = gridFill; 143 146 fChildren = subSettings; 144 147 } … … 146 149 public void addToControl(Composite comp) 147 150 { 148 fGroup = createGroup(comp, fLabel, fWidth, fNumColumns );151 fGroup = createGroup(comp, fLabel, fWidth, fNumColumns, fGridFill); 149 152 for(ISetting setting : fChildren) 150 153 setting.addToControl(fGroup); … … 418 421 * internalized by the JVM). 419 422 */ 420 protected static final List EMPTY_LIST = new ArrayList(0);423 protected static final List<?> EMPTY_LIST = new ArrayList<Object>(0); 421 424 422 425 /** … … 434 437 * @param columnsUsed the number of columns the group should take up 435 438 * @param columns the number of columns the new group will have 439 * @param gridFill the value to pass to the GridData constructor 436 440 * @return the new group 437 441 */ 438 442 protected Group createGroup(Composite comp, String text, int columnsUsed, 439 int columns )443 int columns, int gridFill) 440 444 { 441 445 Group group = new Group(comp, SWT.NONE); 442 446 group.setText(text); 443 447 444 GridData gd = new GridData( GridData.FILL_HORIZONTAL);448 GridData gd = new GridData(gridFill); 445 449 gd.horizontalSpan = columnsUsed; 446 450 group.setLayoutData(gd); trunk/descent.building/src/descent/internal/building/ui/CompilerTab.java
r1183 r1184 11 11 import org.eclipse.jface.viewers.CheckboxCellEditor; 12 12 import org.eclipse.jface.viewers.ColumnLabelProvider; 13 import org.eclipse.jface.viewers.ColumnViewerEditor;14 import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy;15 13 import org.eclipse.jface.viewers.ComboBoxCellEditor; 16 14 import org.eclipse.jface.viewers.EditingSupport; 15 import org.eclipse.jface.viewers.ICellEditorListener; 17 16 import org.eclipse.jface.viewers.ISelectionChangedListener; 18 17 import org.eclipse.jface.viewers.ITreeContentProvider; … … 23 22 import org.eclipse.jface.viewers.TreeViewer; 24 23 import org.eclipse.jface.viewers.TreeViewerColumn; 25 import org.eclipse.jface.viewers.TreeViewerEditor;26 24 import org.eclipse.jface.viewers.Viewer; 27 25 import org.eclipse.swt.SWT; … … 30 28 import org.eclipse.swt.events.SelectionAdapter; 31 29 import org.eclipse.swt.events.SelectionEvent; 32 import org.eclipse.swt.graphics.Font;33 import org.eclipse.swt.graphics.FontData;34 30 import org.eclipse.swt.graphics.Image; 35 31 import org.eclipse.swt.layout.GridData; … … 43 39 import org.eclipse.swt.widgets.Text; 44 40 import org.eclipse.ui.dialogs.PreferencesUtil; 41 import org.eclipse.ui.forms.widgets.ScrolledFormText; 45 42 46 43 import descent.building.IDescentBuilderConstants; … … 234 231 { 235 232 public TreeEntry parent; 233 public CellEditor editor; 236 234 237 235 public abstract CompilerOption getOption(); … … 248 246 private BooleanOption option; 249 247 public Boolean selected = Boolean.FALSE; 250 private CheckboxCellEditor editor;251 248 252 249 public CheckboxUIOption(BooleanOption option) … … 265 262 { 266 263 if(null == editor) 264 { 267 265 editor = new CheckboxCellEditor(fViewer.getTree()); 266 editor.addListener(fCellEditorListener); 267 } 268 268 269 269 return editor; … … 305 305 private EnumOption option; 306 306 public Integer selected = Integer.valueOf(0); 307 private ComboBoxCellEditor editor;308 307 309 308 public ComboUIOption(EnumOption option) … … 325 324 editor = new ComboBoxCellEditor(fViewer.getTree(), 326 325 option.getOptionEditLabels()); 326 editor.addListener(fCellEditorListener); 327 327 } 328 328 … … 354 354 for(int i = 0; i < optionValues.length; i++) 355 355 { 356 if(optionValues[i].equals( i))356 if(optionValues[i].equals(value)) 357 357 { 358 358 selected = Integer.valueOf(i); … … 369 369 } 370 370 371 private finalclass TextUIOption extends CompilerUIOption372 { 373 pr ivateStringOption option;371 private class TextUIOption extends CompilerUIOption 372 { 373 protected StringOption option; 374 374 public String selected = ""; 375 private TextCellEditor editor;376 375 377 376 public TextUIOption(StringOption option) … … 390 389 { 391 390 if(null == editor) 391 { 392 392 editor = new TextCellEditor(fViewer.getTree()); 393 editor.addListener(fCellEditorListener); 394 } 393 395 394 396 return editor; … … 482 484 } 483 485 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 484 507 private IVMInstall fSelectedCompiler; 485 508 private TreeViewer fViewer; 486 509 private TreeEntry[] fEntries; 487 private Group fHelpGroup;488 private Label fHelpHeader;489 private Label fHelpText;490 510 491 511 public void addToControl(Composite comp) … … 497 517 fViewer.getTree().setHeaderVisible(true); 498 518 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);503 519 504 520 TreeViewerColumn column = new TreeViewerColumn(fViewer, SWT.NONE); … … 580 596 fViewer.getControl().setLayoutData(gd); 581 597 582 fHelpGroup = new Group(comp, SWT.SHADOW_IN);598 Group helpGroup = new Group(comp, SWT.SHADOW_IN); 583 599 gd = new GridData(GridData.FILL_VERTICAL); 584 600 gd.horizontalSpan = 1; 585 601 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>"; 600 609 gd = new GridData(GridData.FILL_BOTH); 601 610 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); 604 616 605 617 fViewer.addSelectionChangedListener(new ISelectionChangedListener() 606 { 618 { 607 619 public void selectionChanged(SelectionChangedEvent event) 608 620 { … … 610 622 if(0 == paths.length) 611 623 { 612 unsetHelp();624 helpForm.setText(NO_TEXT); 613 625 return; 614 626 } … … 617 629 if(!(selected instanceof CompilerUIOption)) 618 630 { 619 unsetHelp();631 helpForm.setText(NO_TEXT); 620 632 return; 621 633 } 622 634 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())); 629 637 } 630 638 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(); 642 648 } 643 649 }); … … 680 686 if(opt instanceof BooleanOption) 681 687 return new CheckboxUIOption((BooleanOption) opt); 688 else if(opt instanceof EnumOption) 689 return new ComboUIOption((EnumOption) opt); 682 690 else if(opt instanceof StringOption) 683 691 return new TextUIOption((StringOption) opt); 684 else if(opt instanceof EnumOption)685 return new ComboUIOption((EnumOption) opt);686 692 else 687 693 throw new UnsupportedOperationException(); … … 852 858 853 859 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"); 868 861 869 862 public void dispose() … … 872 865 fCheckedIcon.dispose(); 873 866 fUncheckedIcon.dispose(); 874 if(null != fBoldFont)875 fBoldFont.dispose();876 867 } 877 868 trunk/descent.building/src/descent/internal/building/ui/DebuildTabGroup.java
r1175 r1184 14 14 new GeneralTab(), 15 15 new CompilerTab(), 16 new VersionTab(), 16 17 new EnvironmentTab(), 17 18 }; trunk/descent.building/src/descent/internal/building/ui/GeneralTab.java
r1183 r1184 1 1 package descent.internal.building.ui; 2 3 import java.util.ArrayList;4 import java.util.List;5 2 6 3 import org.eclipse.core.resources.IProject; … … 13 10 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; 14 11 import org.eclipse.jface.viewers.ILabelProvider; 15 import org.eclipse.jface.viewers.LabelProvider;16 12 import org.eclipse.jface.window.Window; 17 13 import org.eclipse.swt.SWT; 18 14 import org.eclipse.swt.events.SelectionAdapter; 19 15 import org.eclipse.swt.events.SelectionEvent; 20 import org.eclipse.swt.graphics.Image;21 16 import org.eclipse.swt.layout.GridData; 22 17 import org.eclipse.swt.layout.GridLayout; … … 24 19 import org.eclipse.swt.widgets.Composite; 25 20 import org.eclipse.swt.widgets.FileDialog; 26 import org.eclipse.swt.widgets.Group;27 21 import org.eclipse.swt.widgets.Label; 28 22 import org.eclipse.swt.widgets.Layout; 29 23 import org.eclipse.ui.dialogs.ElementListSelectionDialog; 30 24 31 import descent.core.IJavaElement;32 25 import descent.core.IJavaProject; 33 26 import descent.core.JavaCore; … … 473 466 474 467 // Create the group 475 comp = createGroup(comp, "Included modules", 3, 3 );468 comp = createGroup(comp, "Included modules", 3, 3, GridData.FILL_HORIZONTAL); 476 469 477 470 // Add the label … … 532 525 public String validate() 533 526 { 527 return null; 528 /* 534 529 List<String> modules = fList.getElementsNoCopy(); 535 530 … … 540 535 // have a check button, since this can be a lengthy operation?) 541 536 542 return null; 537 return null;*/ 543 538 } 544 539 } … … 569 564 { 570 565 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 {
