UprootLabs / swing-htabs

Hierarchical tabs for Swing
Apache License 2.0
11 stars 3 forks source link

Listener for tab close #14

Open hrj opened 9 years ago

hrj commented 9 years ago

It should be possible to register a listener than gets called whenever a tab is about to be closed. And, it should be possible to cancel the closure through the listener.

Use cases

  1. a tab with child tabs is being closed
    1. is collapsed -- could close only self or all children as well (possibly after confirmation)
    2. is not collapsed -- close only self if normal click, but close children also if Shift+Click, for example.
  2. a tab has dirty content a tab could have unsaved changes, and hence require confirmation before closing.

To cover all these use-cases, various contexts need to be available to the listener:

  1. tab is collapsed or not
  2. state of keyboard modifiers like SHIFT.