Close all tabs in TabPane

I have this code this is very basic and it's used to close all tabs in a TabPane.
MenuItem item4 = new MenuItem("Close All Tabs");
  item4.setOnAction(new EventHandler<ActionEvent>()
   @Override
   public void handle(ActionEvent e)
   System.out.println("Close All Tabs");
   int ee = tabPane.getTabs().size();
  tabPane.getTabs().remove(0, ee);
I want to optimize this part of the code:
int ee = tabPane.getTabs().size();
  tabPane.getTabs().remove(0, ee);
Is there any other clear and optimized solution?

tabPane.getTabs().clear();

Similar Messages

  • Closing one of the opening windows tries to close all tabs on another window

    I opened two windows, one with multiple tabs and another is no tab, when closing a window with no tab, a prompt window appears and ask if I want to close all tabs on another window. Prompt window appeared twice. Is this a bug?

    I also had this issue and disabling the Awesome Screenshot add-on fixed it for me too. Its not doing it anymore after disabling that plugin. Thanks for the tip!!!

  • How do I close all tabs at one time without closing Firefox completely?

    How do I close all tabs at one time without closing Firefox completely?

    Open a new window. Go to the other window with all the tab. Close it. You now only have that newly open window.
    Hub

  • On I-Mac, how can I close all tabs at the same time?

    On I-Mac, how can I close all tabs at the same time?
    I use Mozilla Firefox for internet.

    Not an Apple product, have you visited:
    https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-qu ickly

  • In the previous version of Firefox I could close the window and still have my tabs intact when I reopened it. Why does FF 4 closes all tabs and doesn't give me an option to save them? (And if it does, where do I change the setting?)

    In the previous version of Firefox, before closing a window with tabs still open, it asked if I would like to "save and close", "close all tabs" or "cancel" the operation. FF4 will just alert me that I am closing those tabs and ask me is I want to continue, without giving the option to save my research for a later use.

    Firefox 4 saves the previous session automatically.<br />
    You can use "Firefox > History > Restore Previous Session" to get the previous session.<br />
    There is also a "Restore Previous Session" button on the default <b>about:home</b> Home page.<br />
    Another possibility is to use:
    *Tools > Options > General > Startup: "When Firefox Starts": "Show my windows and tabs from last time"

  • Multible tabs open when i clik a link to a new tab; then do not open or even show up when i try to close them with 'close all tabs'..they are like 'ghost tabs'

    This has been happening for several days now...the tabs are shown on the tab bar, but do not open up or close when i try to close them....when i tried 'close all tabs', which then says 'you are trying to close 2 tabs', they are not counted as being open....only way i can get rid of them is to close FireFox completely, then it starts all over again. Ghost Tabs!

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that turns off some settings, disables most add-ons (extensions and themes).
    If Firefox is open, you can restart in Firefox Safe Mode from the Help menu:
    * Click the menu button [[Image:New Fx Menu]], click Help [[Image:Help-29]] and select ''Restart with Add-ons Disabled''.
    If Firefox is not running, you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    When the Firefox Safe Mode window appears, select "Start in Safe Mode".<br>
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

  • How to close all tabs XP/FF6

    How do I close all tabs without existing FF6? I can close every tab except the final tab that is opened.

    Set the pref browser.tabs.closeWindowWithLastTab to false on the about:config page to prevent closing the last tab from closing the browser and make a close button appear if only one tab is open.
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />
    *Use the Filter bar at to top of the about:config page to locate a preference more easily.
    *Preferences that have been modified show as bold(user set).
    *Preferences can be reset to the default or changed via the right-click context menu.

  • With multi tabs open I go to close Firefox 5.0 and it will not keep the tabs there it closes all tabs

    With multi tabs open I go to close Firefox 5.0 and it will not keep the tabs there it closes all tabs so when I restart I have to re-open the tabs. I was using 3.6 firefox and had the option to close but keep the tabs so they would open when I re-started firefox.

    upgrade your browser to Firefox 8 and check
    * getfirefox.com

  • There used to be a extension for Safari called "close all tabs". It is no longer on the extension list. Does anybody know why it was removed?

    There used to be a extension for Safari called "close all tabs". It is no longer on the extension list. Does anybody know why it was removed?

    Mr. Davis answer is essentially what that extension did.  I thank Mr. Davis for this answer as I was not aware of this method.  I only brought this up becasue in Lion there is a nasty habit of Safari opening all previous tabs that where not closed when shuting down the computer.  This can cause a long delay in opening Safari becasue of all the tabs opening up.  The "close all tabs" exstension stopped all this opening process.  I have to assume that Apple replaced the extension with the process that Mr. Davis describes, however, the extension was a lot faster. By the way, I have this extension still and I still use it. I just wanted to pass it on to some other users, but guess I will have to give up on that idea.

  • How do I avoid closing out all my tabs by accident? a box used to come up asking "are you sure you want to close all tabs". Now I click on the X and it automatically closes all my open tabs.

    Sometimes I, by accident, click on the X and close out ALL of my tabs that were open. A box used to come up asking "ARE YOU SURE YOU WANT TO CLOSE ALL TABS?" Now, it just closes them all and I lose all my tabs that I had open. Is there a way to fix that?

    You can set the warn prefs on the <b>about:config</b> page to <b>true</b> via the right-click context menu or toggle the value with a double left-click.
    * browser.showQuitWarning, see http://blog.zpao.com/post/3174360617/about-that-quit-dialog
    * browser.tabs.warnOnClose, see http://kb.mozillazine.org/About%3Aconfig_entries
    * browser.warnOnQuit , see http://kb.mozillazine.org/browser.warnOnQuit
    * browser.warnOnRestart , see http://kb.mozillazine.org/browser.warnOnRestart
    *http://kb.mozillazine.org/about:config

  • How do I enable 'close all tabs' warning in Safari 5.1/Lion OS?

    Before upgrading to Lion OS, there was a warning asking to confirm close all tabs. Now the warning is gone and I would like it back. There is no setting in Preferences, Tabs to enable this warning. Thank you.

    Well, the plist key is ConfirmClosingMultiplePages in com.apple.Safari.plist.  Unfortunately, it is set to <true/> just like in 10.6 and it doesn't work.  It could be a bug, but given that is removed from the UI, they might have just dropped this feature and the key in the plist is just a leftover from 5.0.
    I've filed bug rdar://9844047 on it, we'll see if it gets closed.  I guess I just need to get out of the habit of using CMD-SHIFT-W.  Of course, the other thing I used it for was as a confirmation before quitting Safari in case I accidentally hit CMD-Q instead of CMD-W.  Although that isn't really the intended use case, that is what I miss the most (Reopen All Windows $ucks when you have a lot of them).
    (Really, I can't use the word s-u-c-k-s?)

  • Though I updated my preferences, Firefox 4.0.1 doesn't warn me about closing tabs before I quit, and closes all tabs after I quit.

    I updated to Firefox 4 yesterday. I updated my preferences, including checking the box that commands Firefox to "warn me when closing multiple tabs." Despite this, Firefox does not warn me and closes all tabs at quit. In short, I lose all my tabs whenever I quit Firefox. Please advise.

    Firefox 4 saves the previous session automatically, so there is no longer need for the dialog asking if you want to save the current session.<br />
    Use "Firefox > Quit Firefox" if you want to restore multiple windows.<br />
    You can use "Firefox > History > Restore Previous Session" to get the previous session at any time.<br />
    There is also a "Restore Previous Session" button on the default <b>about:home</b> Home page.<br />
    Another possibility is to use:
    * [http://kb.mozillazine.org/Menu_differences Firefox > Preferences] > General > Startup: "When Firefox Starts": "Show my windows and tabs from last time"
    You can set the warn prefs on the <b>about:config</b> page to <b>true</b> via the right-click context menu or toggle the value with a double left-click.
    * browser.showQuitWarning, see http://blog.zpao.com/post/3174360617/about-that-quit-dialog
    * browser.tabs.warnOnClose, see http://kb.mozillazine.org/About%3Aconfig_entries
    * browser.warnOnQuit , see http://kb.mozillazine.org/browser.warnOnQuit
    * browser.warnOnRestart , see http://kb.mozillazine.org/browser.warnOnRestart
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />
    You can use the Filter bar at to top of the about:config page to locate a pref more easily.

  • Can I set Thunderbird to close all tabs when I shut it down so the next session starts fresh.

    I would prefer to have a clear work platform each time I start Thunderbird and only see tabs relevant to that session. If the program could be set to close all tabs automatically when I shut down, that would solve my problem.
    Thanks,
    Keith Marshall.

    I guess your best bet is to right-click the most left tab - 'Close Other Tabs' before shutting down Thunderbird.

  • Middle click on a tab closes all tabs.

    Ok I just installed Firefox 4 final release, fresh and whenever I middle click on a tab, all the tabs close immediately. If I turn on the message box asking me to "close all tabs?" the box pops up when I middle click on it. I had this same problem on RC1 and RC2, even with tab-mix plus installed I couldn't control the behaviour of middle click on a tab. I have tried this on RC1 and RC2 clean install and with tab mix plus but whatever I do firefox tries to close all the other tabs when I middle click on one.
    I have Firefox running on a XP system but I havent faced any issue on that. The system that has problems is the one with Windows 7 and I may have to mention this, Logitech's Set point software to configure the different buttons on the wireless mouse. I have check the configuration in the software and Middle Click is set to Middle click. This configuration was working fine on the same system when I was running firefox 3.6.* and started when I upgraded to FF4.

    I use a laptop wit Win 7 and only meet this problem if the FF is in full screen mode, and because of it the tabs are in the header - in line with the Firefox button. If I change to windowed mode the tabs goes on row lower and middle click works as it should.
    I use the software "SecondShell" to remap the caps lock into middle button - if I "click" with it the FF works fine, just the mouse cause the problem.

  • If I open a PDF doc in a new tab and then try and close the tab with ctrl-w it will try and close all tabs unless I switch to another tab and back again.

    Running Firefox beta and Adobe Acrobat 10. If I open a PDF document in a new tab, say http://support.avaya.com/css/P8/documents/100146419, and then try and close the tab using ctrl-w, I get the message warning me about closing all tabs. If I switch to another tab and then back to the PDF document and then hit ctrl-w, it will just close that one tab and not all tabs.
    Cheers.

    I've just been playing around and I set dom.ipc.plugins.enabled to true and now it closes the PDF document but not the tab. I have to do ctrl-w again to close the tab. However, leaving that set to true ruins the scroll mouse functionality as Acroread seems to want it all to itself.

Maybe you are looking for

  • Get  max100 requests from request manager

    Hello! I'm requesting requests for a user from the RequestManager over the ContentServices-API. Now I've the question if there is possibility to get maximal 100 requests? I've tried to set the Options.RETURN_COUNT and give that to the request manager

  • More Feedback: Why I chose Nokia and why it won'...

    This is more feedback for Nokia, following up to my previous post.  I would like everyone to share their thoughts too.  I'd like to see Nokia Listen to customers for once. I bought an E7 due the following: Unlocked phone = no capped data plan that co

  • Exadata and Out of the Box Software

    Hello I would like to know does exadata servers come with 11gR2 software pre-installed ? What about the Grid Control ? Regards Senthil

  • My windows are never complete after dragging them down from others in full screen...

    When I want to extract a tab from an app in full screen to create a new window, the window that is created is never complete... a bit is always missing at the bottom... Has anyone noticed the same problem?

  • Problems with Disk Utility backup & restore via DMG disk images

    I attempted to backup and restore a 2TB external raid storage device using the recommended Disk Utility procedure for 10.6.6. One of the HDDs in the raid enclosure had started to fail. First step was to create a new image from the 2TB device. I accep