#3786 Options dialog contains empty node

minor bug
closed-fixed
Alan Ezust
6
2013-03-17
2013-03-17
Marco Hunsicker
No

The first node of the options dialog does not display any text which makes the tree look somewhat out of place and (depending on the used L&F) leaves more or less artifacts. I'm attaching a screenshot under Windows 8 where you can see that the tree is strangely indented and the angle dots for the first node are only halfway printed (because of the missing text).

It's also possible to hide the tree completely if you click on the first node (which might confuse users).

Discussion

  • Options dialog

     
    Attachments
  • Dialog with hidden tree after clicking first (empty) node

     
    Attachments
  • The problem here seems to be that the first OptionGroup of the tree model should actually not be displayed at all. The offending file is org.jedit.options.OptionGroupPane within its _init() method.

    Instead of:

    rootGroup.addOptionGroup(optionGroup);

    one might rather use something like this:

    for (Enumeration<Object> members = optionGroup.getMembers(); members.hasMoreElements();)
    {
    rootGroup.addOptionGroup((OptionGroup)members.nextElement());
    }

    to skip the first OptionGroup (either Global Options or Plugin Options)

     
  • Apparently one has to check the type:

    for (Enumeration<Object> members = optionGroup.getMembers(); members.hasMoreElements();)
    {
    Object member = members.nextElement();
    if (member instanceof OptionGroup)
    rootGroup.addOptionGroup((OptionGroup)member);
    }

     
  • Alan Ezust
    Alan Ezust
    2013-03-17

    Would you mind submitting a patch to the patches tracker?

     
  • Thanks much for taking a look!

    In its current form the code would probably hurt more than it helps. I would first have to fully analyze the situation as there seem to be other entries beside OptionsGroups that must be added to the root node. I will take a look next week.

     
  • Alan Ezust
    Alan Ezust
    2013-03-17

    Applied patch in rev 22854 (5.1pre1)
    Thank you!

     
  • Alan Ezust
    Alan Ezust
    2013-03-17

    • assigned_to: nobody --> ezust
    • status: open --> closed-fixed