Bug 575496 - Allow for bulk editing of launcher environment variables
Summary: Allow for bulk editing of launcher environment variables
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.22   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Nitin Dahyabhai CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-19 00:26 EDT by Nitin Dahyabhai CLA
Modified: 2022-05-17 18:30 EDT (History)
3 users (show)

See Also:


Attachments
before (1.02 MB, image/png)
2021-08-26 20:41 EDT, Nitin Dahyabhai CLA
no flags Details
after,1 (1.08 MB, image/png)
2021-08-26 20:41 EDT, Nitin Dahyabhai CLA
no flags Details
after,2 (954.63 KB, image/png)
2021-08-26 20:41 EDT, Nitin Dahyabhai CLA
no flags Details
UI on Linux with the patch (156.30 KB, image/png)
2021-09-07 16:04 EDT, Alexander Kurtakov CLA
no flags Details
Current Patch (13.40 KB, application/octet-stream)
2022-03-24 03:37 EDT, Sarika Sinha CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nitin Dahyabhai CLA 2021-08-19 00:26:09 EDT
When working with a launch configuration holding a large number of
environment variables, the table controls aren't as quick to work
with as possible. Although it's possible to remove multiple variables
and paste new pairs in, sometimes it's just more straightforward
to have a big text field with everything in it.
Comment 1 Jörg Kubitz CLA 2021-08-24 07:35:33 EDT
Can you please add a screenshot as attachment how it looks like after your proposed change?
Comment 2 Nitin Dahyabhai CLA 2021-08-26 20:41:19 EDT
Created attachment 287031 [details]
before
Comment 3 Nitin Dahyabhai CLA 2021-08-26 20:41:42 EDT
Created attachment 287032 [details]
after,1
Comment 4 Nitin Dahyabhai CLA 2021-08-26 20:41:58 EDT
Created attachment 287033 [details]
after,2
Comment 5 Jörg Kubitz CLA 2021-08-26 23:44:48 EDT
I like the Idea. I always used 
 crtl+A (select all)
 "Copy" Button
 Paste into Texteditor
 (Edit)
 Copy from Texteditor
 "Paste" Button
for that.

The centered Table/Text switch looks unusual. Would it not feel more eclipse-like to have a "Edit as Text" Button below the "Edit.." Button on the right to open a modal Text Edit Dialog instead? (Like the "Show Command Line" in the bottom)
Comment 6 Nitin Dahyabhai CLA 2021-08-27 00:29:31 EDT
(In reply to Jörg Kubitz from comment #5)
> The centered Table/Text switch looks unusual. 

The centered switching is a style of the macOS platform; the same control is used on the API Errors/Warnings preference page.

> Would it not feel more
> eclipse-like to have a "Edit as Text" Button below the "Edit.." Button on
> the right to open a modal Text Edit Dialog instead? (Like the "Show Command
> Line" in the bottom)

The intent is to present this as two different ways of looking at, and modifying, the same information. Clicking a button and opening a model dialog over the already model launch config dialog is not really the user experience I'm going for. Granted, the tab folder might not be the right control for that.
Comment 7 Alexander Kurtakov CLA 2021-09-07 16:03:10 EDT
If one tries to use same key in text mode twice content is lost with "!ENTRY org.eclipse.ui 4 0 2021-09-07 23:01:20.948
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.IllegalStateException: Duplicate key fds (attempted merging values fdadf and fadsf)
	at java.base/java.util.stream.Collectors.duplicateKeyException(Collectors.java:133)
	at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:180)
	at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
	at org.eclipse.debug.ui.EnvironmentTab.addVariables(EnvironmentTab.java:674)
	at org.eclipse.debug.ui.EnvironmentTab.updateTableFromText(EnvironmentTab.java:892)
	at org.eclipse.debug.ui.EnvironmentTab.lambda$0(EnvironmentTab.java:301)"
Comment 8 Alexander Kurtakov CLA 2021-09-07 16:04:13 EDT
Created attachment 287104 [details]
UI on Linux with the patch
Comment 9 Alexander Kurtakov CLA 2021-09-07 16:06:00 EDT
(In reply to Alexander Kurtakov from comment #8)
> Created attachment 287104 [details]
> UI on Linux with the patch

I like the idea but the TabFolder looks even more weird on Linux(and it's most likely not centered on Windows too). Once acceptable "switcher" is found this would be very nice addition.
Comment 10 Alexander Kurtakov CLA 2021-09-07 16:17:39 EDT
The most common choice is either Combo or Radio button but none of them is pretty (not that tabfolder is)
Comment 11 Alexander Kurtakov CLA 2021-09-07 16:21:21 EDT
E.g. on the Keys preference page Combo is used to switch between schemes. This looks like closest to this case.
Comment 12 Sarika Sinha CLA 2021-10-18 13:40:52 EDT
We have so many tabbed pages in preference page, any configuration to make it look good on linux on those? 
Can we do apply the same here?
Combo I feel is not so intuitive and does not appeal that there exists 2 ways in the first view.
Radio button at least will show the options but may not look good either.

@Nitin,
Can you add the duplicate key check?
Comment 13 Nitin Dahyabhai CLA 2021-10-27 18:01:23 EDT
(In reply to Sarika Sinha from comment #12)
> @Nitin,
> Can you add the duplicate key check?

What should happen on a duplicate?
Comment 14 Sarika Sinha CLA 2021-10-28 08:51:05 EDT
(In reply to Nitin Dahyabhai from comment #13)
> (In reply to Sarika Sinha from comment #12)
> > @Nitin,
> > Can you add the duplicate key check?
> 
> What should happen on a duplicate?

In the table view, we don't allow 2 variables with same name, so here also we cannot allow. We can show an error for "Duplicate variable name" and disable the "Apply" button till the error is resolved.
Comment 15 Sarika Sinha CLA 2022-03-24 03:37:19 EDT
Created attachment 288280 [details]
Current Patch

Moving to Github, gerrit needs to be migrated.
Comment 16 Sarika Sinha CLA 2022-05-17 14:48:14 EDT
@Nitin,
Do you plan to take this forward?
github repo is https://github.com/eclipse-platform/eclipse.platform.debug
Comment 17 Nitin Dahyabhai CLA 2022-05-17 18:30:06 EDT
(In reply to Sarika Sinha from comment #16)
> @Nitin,
> Do you plan to take this forward?
> github repo is https://github.com/eclipse-platform/eclipse.platform.debug

I have every intention, but no plan at the moment. I'm swamped on my own project.