#1728 BufferTabs reorders the tabs

open
nobody
None
5
2013-08-13
2013-08-13
drvdrv
No
0 up votes | 0 down votes | 0%
5 comments

jEdit version number:
5.0.0

BufferTabs plugin and version numbers:
1.2.3

platform:
windows (win 7)

Java version:
1.6.0_29

currently the tabs are reordered without any reason (or is it a java feature?)

steps to reproduce:
1. open files to fill 1 line BufferTabs on top of the screen
2. open one more file

expected result:
- the older file's tab should be remained on their place
- only the new file's tab should be appeared in the new tab line

Discussion

  • drvdrv
    drvdrv
    2013-08-13

    tabs before and after open new file

     
    Attachments
  • Alan Ezust
    Alan Ezust
    2013-11-16

    Under Global options - View, do you have the option 'Sort buffer sets' un-checked?
    What bufferset scope do you use? Did you have multiple views or editpanes open?

     
  • drvdrv
    drvdrv
    2013-11-18

    Hi,
    Maybe the title of bug is not correct. So there is no real reordering just new (and older existing tab(s)) are moved to the next row.
    It does not matter if 'Sort buffer sets' is checked or un-checked. And the scope is also irrelevant.

    I did some experiments, and now I am sure that this is the java default behavior (but why???). Try the code bellow. Start it and re-size the window (decrease the width). When there is no space enough for all tabs, not only the last tab will be moved to the next row but more. In forums I have found some hint how to solve this but it is beyond my java knowledge.

    I hope now it is clear what I mean. (Anyway, this is still really annoying. When opening/closing tabs and this happens, I usually lost and I have to start finding the wanted tabs again)

    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JTabbedPane;

    public class TestTabbedPane extends JTabbedPane {
    public static void main(String[] args) {
    JFrame test = new JFrame("Tab test");
    test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    test.setSize(600, 400);

    TestTabbedPane tabs = new TestTabbedPane();

    tabs.addTab("One 11111111", new JButton("One"));
    tabs.addTab("Two 2222", new JButton("Two"));
    tabs.addTab("Three 33333", new JButton("Three"));
    tabs.addTab("Four 4444444444", new JButton("Four"));
    tabs.addTab("Five 555", new JButton("Four"));
    test.add(tabs);
    test.setVisible(true);
    }
    }

     
  • It is a feature of tabs in java, we have the choice to wrap taps on new line or add a scrolling when there are too many tabs.

     
  • drvdrv
    drvdrv
    2013-11-18

    or, as far as understood, implement a tabbedPane with custom behavior (rendering or sg).
    But of course I know that easy to say (write) this.

     
  • drvdrv
    drvdrv
    2013-11-27

    Meanwhile I install the LookAndFeel plugin. With Jgoodies L&F the tabbedPane works as I expect, however I do not like its look.
    So the solution is somewhere there.