Mercurial > projects > dwt-addons
comparison dwtx/jface/action/Action.d @ 70:46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 22 May 2008 01:36:46 +0200 |
parents | e0f0aaf75edd |
children | c3583c6ec027 |
comparison
equal
deleted
inserted
replaced
69:07b9d96fd764 | 70:46a6e0e6ccd4 |
---|---|
270 */ | 270 */ |
271 private String toolTipText; | 271 private String toolTipText; |
272 | 272 |
273 /** | 273 /** |
274 * Holds the action's menu creator (an IMenuCreator) or checked state (a | 274 * Holds the action's menu creator (an IMenuCreator) or checked state (a |
275 * bool for toggle button, or an Integer for radio button), or | 275 * Boolean for toggle button, or an Integer for radio button), or |
276 * <code>null</code> if neither have been set. | 276 * <code>null</code> if neither have been set. |
277 * <p> | 277 * <p> |
278 * The value of this field affects the value of <code>getStyle()</code>. | 278 * The value of this field affects the value of <code>getStyle()</code>. |
279 * </p> | 279 * </p> |
280 */ | 280 */ |
493 * <code>false</code> if the action failed or was not completed | 493 * <code>false</code> if the action failed or was not completed |
494 * @see IAction#RESULT | 494 * @see IAction#RESULT |
495 * @since 3.0 | 495 * @since 3.0 |
496 */ | 496 */ |
497 public final void notifyResult(bool success) { | 497 public final void notifyResult(bool success) { |
498 // avoid bool.valueOf(bool) to allow compilation against JCL | 498 // avoid Boolean.valueOf(bool) to allow compilation against JCL |
499 // Foundation (bug 80059) | 499 // Foundation (bug 80059) |
500 firePropertyChange(RESULT, null, new ValueWrapperBool(success)); | 500 firePropertyChange(RESULT, null, success ? Boolean.TRUE : Boolean.FALSE); |
501 } | 501 } |
502 | 502 |
503 /** | 503 /** |
504 * The default implementation of this <code>IAction</code> method does | 504 * The default implementation of this <code>IAction</code> method does |
505 * nothing. Subclasses should override this method if they do not need | 505 * nothing. Subclasses should override this method if they do not need |
557 } | 557 } |
558 | 558 |
559 if (newValue !is value) { | 559 if (newValue !is value) { |
560 value = newValue; | 560 value = newValue; |
561 if (checked) { | 561 if (checked) { |
562 firePropertyChange(CHECKED, new ValueWrapperBool(false), new ValueWrapperBool(true)); | 562 firePropertyChange(CHECKED, Boolean.FALSE, Boolean.TRUE); |
563 } else { | 563 } else { |
564 firePropertyChange(CHECKED, new ValueWrapperBool(true), new ValueWrapperBool(false)); | 564 firePropertyChange(CHECKED, Boolean.TRUE, Boolean.FALSE); |
565 } | 565 } |
566 } | 566 } |
567 } | 567 } |
568 | 568 |
569 /* | 569 /* |
595 /* | 595 /* |
596 * (non-Javadoc) Method declared on IAction. | 596 * (non-Javadoc) Method declared on IAction. |
597 */ | 597 */ |
598 public void setEnabled(bool enabled) { | 598 public void setEnabled(bool enabled) { |
599 if (enabled !is this.enabled) { | 599 if (enabled !is this.enabled) { |
600 Boolean oldVal = this.enabled ? Boolean.TRUE : Boolean.FALSE; | |
601 Boolean newVal = enabled ? Boolean.TRUE : Boolean.FALSE; | |
600 this.enabled = enabled; | 602 this.enabled = enabled; |
601 firePropertyChange(ENABLED, new ValueWrapperBool(this.enabled), new ValueWrapperBool(enabled)); | 603 firePropertyChange(ENABLED, oldVal, newVal); |
602 } | 604 } |
603 } | 605 } |
604 | 606 |
605 /* | 607 /* |
606 * (non-Javadoc) Method declared on IAction. | 608 * (non-Javadoc) Method declared on IAction. |