[REVIEW REQUEST] RT-24088 Add API to JavaFX to allow vetoing the closing of a Tab in a TabPane

Tom Eugelink tbee at tbee.org
Wed Dec 5 22:08:22 PST 2012


Just a remark to see if we can make this more reusable; would it be an idea to actually veto the close action? Like veto the removal of a tab from a list? In that way veto-ing would be available to other usages of such lists as well, a uniform API.

Tom



On 2012-12-06 01:57, Tom Schindl wrote:
> Hi,
>
> On behalf of Jonathan Giles and myself I'd like to request the review
> for a new api we'd like to add to javafx.scene.control.Tab.
>
> The API we propose is to allow developers to veto the closing of a Tab
> we'd like you to comment also on our naming pattern the new API we
> propose is:
>
> + ObjectProperty<Callback<Tab, Boolean>> onClosingVetoHandlerProperty()
> + Callback<Tab, Boolean> getOnClosingVetoHandler()
> + void setOnClosingVetoHandler(Callback<Tab, Boolean> callback)
>
> Usage of the API would look like this:
>
> Tab tab1 = new Tab("Hello");
> tab1.setOnClosingVetoHandler(new Callback<Tab, Boolean>() {
>
>    @Override
>    public Boolean call(Tab param) {
>      // Veto the closing
>      return Boolean.TRUE;
>    }
> });
>
>
> Tom
>



More information about the openjfx-dev mailing list