Bug Hunting Session
Bug 102782 - Should radio buttons be used in the java runtime selection widget
Summary: Should radio buttons be used in the java runtime selection widget
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Java-Runtime-JRE
  Show dependency treegraph
 
Reported: 2016-09-29 07:07 UTC by Butch
Modified: 2019-04-03 07:24 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Java disabled (9.33 KB, image/png)
2016-09-29 09:24 UTC, Heiko Tietze
Details
Java enabled (9.23 KB, image/png)
2016-09-29 09:25 UTC, Heiko Tietze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Butch 2016-09-29 07:07:13 UTC
This is a basic usability and convenience issue which is relevant to every average user and therefore should be fixed:

In Options > LibreOffice > Advanced > Java Options in most cases the user sees only one item (Oracle Corporation ...) in the main window. As consequence of this the user is mislead to oversee that there is a very small circle which must be checked first to select the installed JRE...the user thinks the displayed JRE is already activated for LO.

I believe this circle is not checked automatically if there is only one item in the list. Maybe this should be fixed. But at least the visibility of the checking control should be improved.
Comment 1 Heiko Tietze 2016-09-29 09:22:19 UTC
I believe the circle is a radio button to select what java machine is used. On my system (QT5/Breeze dark) it looks indeed just like a circle but when I uncheck java above the (now disabled) radio button becomes clear.

needsDevEval: Please check that those controls are ordinary radio buttons.
Comment 2 Heiko Tietze 2016-09-29 09:24:50 UTC
Created attachment 127718 [details]
Java disabled

Qt5/Breeze dark
Comment 3 Heiko Tietze 2016-09-29 09:25:45 UTC
Created attachment 127719 [details]
Java enabled

Qt5/Breeze dark
Comment 4 Samuel Mehrbrodt (CIB) 2016-09-29 09:32:24 UTC
(In reply to Heiko Tietze from comment #1)
> I believe the circle is a radio button to select what java machine is used.
> On my system (QT5/Breeze dark) it looks indeed just like a circle but when I
> uncheck java above the (now disabled) radio button becomes clear.
> 
> needsDevEval: Please check that those controls are ordinary radio buttons.

I think the problem is that we misuse radio buttons here. Radio buttons are usually used when at least one option must be checked. So there will always be a default selection which you can change to something else.

But in this case, there might be no selection at all. Maybe a simple dropdown listbox would be a better fit in this case?
Comment 5 Heiko Tietze 2016-09-29 10:10:31 UTC
(In reply to Samuel Mehrbrodt (CIB) from comment #4)
> But in this case, there might be no selection at all. Maybe a simple
> dropdown listbox would be a better fit in this case?

Really? Isn't the checkbox above used to disable Java, and the radio buttons below to select the version when the checkbox is active? If I'm wrong another entry "(o) None" (either as radio button or an item in the dropdown) would make sense.
Comment 6 Samuel Mehrbrodt (CIB) 2016-09-30 06:18:22 UTC
(In reply to Heiko Tietze from comment #5)
> Really? Isn't the checkbox above used to disable Java, and the radio buttons
> below to select the version when the checkbox is active? If I'm wrong
> another entry "(o) None" (either as radio button or an item in the dropdown)
> would make sense.

Yes, but according to comment 0, there are cases where the checkbox is enabled, but none of the radio buttons is active.

I also experienced this earlier, but have no quick way to reproduce atm. Maybe deleting the selected JRE from disk?
Comment 7 Yousuf Philips (jay) (retired) 2016-10-07 16:22:11 UTC
(In reply to Samuel Mehrbrodt (CIB) from comment #4)
> I think the problem is that we misuse radio buttons here. Radio buttons are
> usually used when at least one option must be checked. So there will always
> be a default selection which you can change to something else.

Yes i believe i've encountered times where i only had a single entry and it wasnt selected until i selected it.

> But in this case, there might be no selection at all. Maybe a simple
> dropdown listbox would be a better fit in this case?

The simplest solution would be just to check if no selection is set and then select the first entry in the list.

Also think that most users wont have more than 3 jre versions, so the widget definitely can be shrunk and maybe we can use the empty space to put other advanced option checkboxes.
Comment 8 Aron Budea 2016-10-29 09:45:42 UTC
(In reply to Yousuf Philips (jay) from comment #7)
> Yes i believe i've encountered times where i only had a single entry and it
> wasnt selected until i selected it.

I think the (automatic) selection only happens when you use something that requires Java.
Comment 9 Stephan Bergmann 2016-10-31 08:32:19 UTC
(In reply to Aron Budea from comment #8)
> (In reply to Yousuf Philips (jay) from comment #7)
> > Yes i believe i've encountered times where i only had a single entry and it
> > wasnt selected until i selected it.
> 
> I think the (automatic) selection only happens when you use something that
> requires Java.

Yes, opening the 'Advanced' options page causes a list of all installed Java runtimes to be obtained (and displays the selected one, if any, with a pressed radio button), but doesn't itself cause a Java runtime to be selected automatically.  (Doing anything in LO that requires a Java runtime should cause one to be automatically selected, if none was already selected.)
Comment 10 Heiko Tietze 2019-04-02 10:50:43 UTC
Let's add a None radio button on top and select this by default.
Comment 11 Stephan Bergmann 2019-04-02 11:34:48 UTC
(In reply to Heiko Tietze from comment #10)
> Let's add a None radio button on top and select this by default.

The caption of that table reads "Java runtime environments (JRE) already installed:", so "None" looks like a wrong kind of entry for that table.
Comment 12 Heiko Tietze 2019-04-02 18:02:39 UTC
(In reply to Stephan Bergmann from comment #11)
> The caption of that table reads "Java runtime environments (JRE) already
> installed:", so "None" looks like a wrong kind of entry for that table.

Okay, we could remove the checkbox "[ ] Use a Java runtime environment" in favor of the "(o) None" radio button and label the list "Java Runtime Environment (JRE)". Or remove this label too and use "(o) Don't use any JRE" instead.
Comment 13 Stephan Bergmann 2019-04-02 19:48:49 UTC
The current logic in LO's code distinguishes two different states: the user having disabled use of Java vs. no JRE having been selected yet.  Be careful when changing the UI in a way that would conflate those two states.
Comment 14 Heiko Tietze 2019-04-03 07:24:42 UTC
(In reply to Stephan Bergmann from comment #13)
> The current logic in LO's code distinguishes two different states: the user
> having disabled use of Java vs. no JRE having been selected yet.  Be careful
> when changing the UI in a way that would conflate those two states.

And that's exactly the crux with None - it sounds weird because of this implementation. No complains to find a better term but ideally we do not distinguish between "No, I don't have Java installed" and "No, I have Java but don't want to use it".