public boolean promptForSave() throws KettleException {
    List<TabMapEntry> list = delegates.tabs.getTabs();

    for ( TabMapEntry mapEntry : list ) {
      TabItemInterface itemInterface = mapEntry.getObject();

      if ( !itemInterface.canBeClosed() ) {
        // Show the tab
        tabfolder.setSelected( mapEntry.getTabItem() );

        // Unsaved work that needs to changes to be applied?
        //
        int reply = itemInterface.showChangedWarning();
        if ( reply == SWT.YES ) {
          itemInterface.applyChanges();
        } else if ( reply == SWT.CANCEL ) {
          return false;
        }
      }
    }
    return true;
  }
@Test
  public void testCanClosePromptToSave() throws Exception {
    setPromptToSave( SWT.YES, true );
    assertTrue( spoon.promptForSave() );
  }