comparison dwtx/jface/wizard/WizardDialog.d @ 43:ea8ff534f622

Fix override and super aliases
author Frank Benoit <benoit@tionex.de>
date Fri, 11 Apr 2008 01:24:25 +0200
parents 644f1334b451
children 46a6e0e6ccd4
comparison
equal deleted inserted replaced
42:4567a6f54939 43:ea8ff534f622
202 } 202 }
203 203
204 /* 204 /*
205 * (non-Javadoc) Method declared on Layout. 205 * (non-Javadoc) Method declared on Layout.
206 */ 206 */
207 public Point computeSize(Composite composite, int wHint, int hHint, 207 public override Point computeSize(Composite composite, int wHint, int hHint,
208 bool force) { 208 bool force) {
209 if (wHint !is DWT.DEFAULT && hHint !is DWT.DEFAULT) { 209 if (wHint !is DWT.DEFAULT && hHint !is DWT.DEFAULT) {
210 return new Point(wHint, hHint); 210 return new Point(wHint, hHint);
211 } 211 }
212 Point result = null; 212 Point result = null;
253 } 253 }
254 254
255 /* 255 /*
256 * (non-Javadoc) Method declared on Layout. 256 * (non-Javadoc) Method declared on Layout.
257 */ 257 */
258 public void layout(Composite composite, bool force) { 258 public override void layout(Composite composite, bool force) {
259 Rectangle rect = getClientArea(composite); 259 Rectangle rect = getClientArea(composite);
260 Control[] children = composite.getChildren(); 260 Control[] children = composite.getChildren();
261 for (int i = 0; i < children.length; i++) { 261 for (int i = 0; i < children.length; i++) {
262 children[i].setBounds(rect); 262 children[i].setBounds(rect);
263 } 263 }
370 } 370 }
371 371
372 /* 372 /*
373 * (non-Javadoc) Method declared on Dialog. 373 * (non-Javadoc) Method declared on Dialog.
374 */ 374 */
375 protected void buttonPressed(int buttonId) { 375 protected override void buttonPressed(int buttonId) {
376 switch (buttonId) { 376 switch (buttonId) {
377 case IDialogConstants.HELP_ID: { 377 case IDialogConstants.HELP_ID: {
378 helpPressed(); 378 helpPressed();
379 break; 379 break;
380 } 380 }
419 } 419 }
420 420
421 /* 421 /*
422 * (non-Javadoc) Method declared on Dialog. 422 * (non-Javadoc) Method declared on Dialog.
423 */ 423 */
424 protected void cancelPressed() { 424 protected override void cancelPressed() {
425 if (activeRunningOperations <= 0) { 425 if (activeRunningOperations <= 0) {
426 // Close the dialog. The check whether the dialog can be 426 // Close the dialog. The check whether the dialog can be
427 // closed or not is done in <code>okToClose</code>. 427 // closed or not is done in <code>okToClose</code>.
428 // This ensures that the check is also evaluated when the user 428 // This ensures that the check is also evaluated when the user
429 // presses the window's close button. 429 // presses the window's close button.
437 /* 437 /*
438 * (non-Javadoc) 438 * (non-Javadoc)
439 * 439 *
440 * @see dwtx.jface.window.Window#close() 440 * @see dwtx.jface.window.Window#close()
441 */ 441 */
442 public bool close() { 442 public override bool close() {
443 if (okToClose()) { 443 if (okToClose()) {
444 return hardClose(); 444 return hardClose();
445 } 445 }
446 return false; 446 return false;
447 } 447 }
448 448
449 /* 449 /*
450 * (non-Javadoc) Method declared on Window. 450 * (non-Javadoc) Method declared on Window.
451 */ 451 */
452 protected void configureShell(Shell newShell) { 452 protected override void configureShell(Shell newShell) {
453 super.configureShell(newShell); 453 super.configureShell(newShell);
454 // Register help listener on the shell 454 // Register help listener on the shell
455 newShell.addHelpListener(new class HelpListener { 455 newShell.addHelpListener(new class HelpListener {
456 public void helpRequested(HelpEvent event) { 456 public void helpRequested(HelpEvent event) {
457 // call perform help on the current page 457 // call perform help on the current page
471 * </p> 471 * </p>
472 * 472 *
473 * @param parent 473 * @param parent
474 * the parent composite to contain the buttons 474 * the parent composite to contain the buttons
475 */ 475 */
476 protected void createButtonsForButtonBar(Composite parent) { 476 protected override void createButtonsForButtonBar(Composite parent) {
477 (cast(GridLayout) parent.getLayout()).makeColumnsEqualWidth = false; 477 (cast(GridLayout) parent.getLayout()).makeColumnsEqualWidth = false;
478 if (wizard.isHelpAvailable()) { 478 if (wizard.isHelpAvailable()) {
479 helpButton = createButton(parent, IDialogConstants.HELP_ID, 479 helpButton = createButton(parent, IDialogConstants.HELP_ID,
480 IDialogConstants.HELP_LABEL, false); 480 IDialogConstants.HELP_LABEL, false);
481 } 481 }
490 /* 490 /*
491 * (non-Javadoc) 491 * (non-Javadoc)
492 * 492 *
493 * @see dwtx.jface.dialogs.Dialog#setButtonLayoutData(dwt.widgets.Button) 493 * @see dwtx.jface.dialogs.Dialog#setButtonLayoutData(dwt.widgets.Button)
494 */ 494 */
495 protected void setButtonLayoutData(Button button) { 495 protected override void setButtonLayoutData(Button button) {
496 GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); 496 GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
497 int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); 497 int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
498 498
499 // On large fonts this can make this dialog huge 499 // On large fonts this can make this dialog huge
500 widthHint = Math.min(widthHint, 500 widthHint = Math.min(widthHint,
532 * 532 *
533 * @param id 533 * @param id
534 * the button id 534 * the button id
535 * @return the button corresponding to the button id 535 * @return the button corresponding to the button id
536 */ 536 */
537 protected Button getButton(int id) { 537 protected override Button getButton(int id) {
538 if (id is IDialogConstants.CANCEL_ID) { 538 if (id is IDialogConstants.CANCEL_ID) {
539 return cancelButton; 539 return cancelButton;
540 } 540 }
541 return super.getButton(id); 541 return super.getButton(id);
542 } 542 }
548 * <code>super.createContents</code> to create the controls. It then calls 548 * <code>super.createContents</code> to create the controls. It then calls
549 * <code>IWizard.createPageControls</code> to allow the wizard to 549 * <code>IWizard.createPageControls</code> to allow the wizard to
550 * pre-create their page controls prior to opening, so that the wizard opens 550 * pre-create their page controls prior to opening, so that the wizard opens
551 * to the correct size. And finally it shows the first page. 551 * to the correct size. And finally it shows the first page.
552 */ 552 */
553 protected Control createContents(Composite parent) { 553 protected override Control createContents(Composite parent) {
554 // Allow the wizard to add pages to itself 554 // Allow the wizard to add pages to itself
555 // Need to call this now so page count is correct 555 // Need to call this now so page count is correct
556 // for determining if next/previous buttons are needed 556 // for determining if next/previous buttons are needed
557 wizard.addPages(); 557 wizard.addPages();
558 Control contents = super.createContents(parent); 558 Control contents = super.createContents(parent);
564 } 564 }
565 565
566 /* 566 /*
567 * (non-Javadoc) Method declared on Dialog. 567 * (non-Javadoc) Method declared on Dialog.
568 */ 568 */
569 protected Control createDialogArea(Composite parent) { 569 protected override Control createDialogArea(Composite parent) {
570 Composite composite = cast(Composite) super.createDialogArea(parent); 570 Composite composite = cast(Composite) super.createDialogArea(parent);
571 // Build the Page container 571 // Build the Page container
572 pageContainer = createPageContainer(composite); 572 pageContainer = createPageContainer(composite);
573 GridData gd = new GridData(GridData.FILL_BOTH); 573 GridData gd = new GridData(GridData.FILL_BOTH);
574 gd.widthHint = pageWidth; 574 gd.widthHint = pageWidth;