我正在尝试确定是否有办法从 fxml加载ListProperty, like SimpleListProperty<InteractionDefinition>, 而不包括FXCollections图层。有没有办法让案例 1 功能像案例 2 一样?
public class AppMenuItem extends MenuItem {
private SimpleListProperty<InteractionDefinition> interactions = new SimpleListProperty<>();
public void setInteractions(ObservableList<InteractionDefintion> interactionsTmp);
}
情况1
<AppMenuItem id="AppMenuItem2" menuText="View 2" fx:id="asdDefaultView2MenuItem">
<interactions>
<InteractionDefinition action="actionName" button="ACTION" device="MOUSE" event="CLICK" />
<InteractionDefinition action="actionName" button="ACTION" device="MOUSE" event="CLICK" />
<InteractionDefinition action="actionName" button="ACTION" device="MOUSE" event="CLICK" />
</interactions>
</AppMenuItem >
案例二
<AppMenuItem id="AppMenuItem2" menuText="View 2" fx:id="asdDefaultView2MenuItem">
<interactions>
<FXCollections fx:factory="observableArrayList">
<InteractionDefinition action="actionName" button="ACTION" device="MOUSE" event="CLICK" />
<InteractionDefinition action="actionName" button="ACTION" device="MOUSE" event="CLICK" />
<InteractionDefinition action="actionName" button="ACTION" device="MOUSE" event="CLICK" />
</FXCollections>
</interactions>
</AppMenuItem >
守着星空守着你
相关分类