public boolean remove ( final Tab tab , boolean ignoreTabDirty ) { checkIfTabsBelongsToThisPane ( tab ) ; if ( ignoreTabDirty ) { return removeTab ( tab ) ; } if ( tab . isDirty ( ) && mainTable . getStage ( ) != null ) { Dialogs . showOptionDialog ( mainTable . getStage ( ) , Text . UNSAVED_DIALOG_TITLE . get ( ) , Text . UNSAVED_DIALOG_TEXT . get ( ) , OptionDialogType . YES_NO_CANCEL , new OptionDialogAdapter ( ) { @ Override public void yes ( ) { tab . save ( ) ; removeTab ( tab ) ; } @ Override public void no ( ) { removeTab ( tab ) ; } } ) ; } else { return removeTab ( tab ) ; } return false ; }
Removes tab from pane if tab is dirty and ignoreTabDirty == false this will cause to display Unsaved changes dialog!