Bon alors les mixins...
Ceci ne compile plus :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| public class Selectable {
/**
* Indicates whether this <code>Selectable</code> is selectable.
* <br/>Default value is {@value}.
*/
public var selectable:Boolean = true on replace {
onSelectableChanged(selectable);
}
/**
* Called whether the selectable status has changed.
* @param selectable The current selectable status.
*/
public var onSelectableChanged:function(selectable:Boolean);
/**
* Indicates whether this <code>Selectable</code> is selected.
* <br/>Default value is {@value}.
*/
public var selected:Boolean = false on replace {
onSelectedChanged(selected);
}
/**
* Called whether the selected status has changed.
* @param selected The current selected status.
*/
public var onSelectedChanged:function(selected:Boolean);
} |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
public class Enablable {
/**
* Indicates whether this enablabled is enabled.
* <br/>Default value is {@value}.
*/
public var enabled:Boolean = true on replace {
onEnabledChanged(enabled);
}
/**
* Called whether the enabled status has changed.
* @param selected The current enabled status.
*/
public var onEnabledChanged:function(enabled:Boolean);
} |
public class MenuToggleButton extends CustomNode, Selectable, Enablable {
Il faut desormais ecrire :
1 2
| public mixin class Selectable {
[...] |
1 2
| public mixin class Enablable {
[...] |
Ce que je trouve un peu etrange. Pourquoi le declarer au niveau de la classe-mere ? Ca serait plutot au niveau de la class-fille de le declarer (du meme style que extends ... implements ... en Java)
Partager