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

Richard Bair richard.bair at oracle.com
Wed Dec 5 17:23:41 PST 2012


+1 to the API, not sure on the name. I'm just looking at http://docs.oracle.com/javafx/2/api/javafx/scene/web/WebEngine.html, where there are callbacks with "Handler" in the name. I wonder if just "closeVetoHandler" would be more consistent with this naming convention?

Are there any other places in the API where we have this kind of callback? We have callbacks that are used as factories, and in WebEngine we have callbacks that are used as responses to "events". Are there other such places we can draw from to find a consistent nomenclature / convention?

Richard


On Dec 5, 2012, at 4:57 PM, Tom Schindl <tom.schindl at bestsolution.at> 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
> 
> -- 
> B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
> ------------------------------------------------------------------------
> tom schindl                 geschäftsführer/CEO
> ------------------------------------------------------------------------
> eduard-bodem-gasse 5-7/1   A-6020 innsbruck     fax      ++43 512 935833
> http://www.BestSolution.at                      phone    ++43 512 935834



More information about the openjfx-dev mailing list