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

Tom Schindl tom.schindl at bestsolution.at
Thu Dec 6 05:24:45 PST 2012


Hi,

The problem with having the veto on the ObservableList is that it is
quite likely that most the cleanup code you run on the widget is most
likely already run so that the widget would be left in an inconsitent state.

Tom


Am 06.12.12 07:08, schrieb Tom Eugelink:
> 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
>>
> 


-- 
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