Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Java9/ModularityOptions/UIProposal SH
See also:
Implemented. | |
Deferred, candidate for second iteration. | |
Deferred, investigation needed. |
All modules
This compartment lists all modules that are contained in the module graph. The module defined by the current project is pinned to the top of the list. Other modules are sorted alphabetically.
It shows the following additional information:
- icon decorations:
-
the origin- not enough space here, perhaps under Details - ...
Possible actions:
- (Actions are en/disabled depending on selection)
- Add a module (from those contained in JRE but not included by default, or previously removed)
- Remove a module (applies only to JRE modules, other modules should be removed on the Libraries or Projects tab)
- Is that restriction confusing? Alternative: when removing a module explicitly listed on the Modulepath, warn before removing.
- Select any module for additional tweaking, see next.
Details
For the selected module we can
- Inspect the declared details (from module-info: exports/opens/requires). Collapsed in the mockup.
- Add any of the following tweaks:
- Icon decorations:
UX Discussion
- We still need second level dialogs for details for each of the actions (except remove :) ), but we no longer need the three levels of dialogs that we currently use.
- I've been thinking about making "All modules" a full dependency tree => option is nice-to-have, deferred.
- Confer: M2e has both: a tree starting from a fixed set of roots plus a flat list of transitive dependencies
- Roots are currently implicit in JDT
- Could possibly be made a view option later
- Filtering could be added later:
- only modified modules
- only main modules (i.e., no test-only dependencies)
- The two compartments are essentially master-detail
- withdrawn:
I played with arrow up/down icons to signify the two directions: exposing packages to other modules, and reading from other another module. Import/Export wizards, e.g., use diagonal arrows, is that better? - withdrawn:
The Details compartment is a table, 2nd column being initially filled from tiny dialogs behind the buttons Expose Package / Read Module.... - Qualifications of exports / opens are listed as child nodes (modules), has-child indicator should suffice to signal the qualification
- For patching, I would intuitively expect only one pattern: add a source folder of the current project into a given module on the module path.
- For maximum flexibility we could also support to patch a module with another project, or just a source folder of that project.
- Till suggested to only support project (meaning: all its source folders)
- when patching a module, that patched module should move to the top of the LHS list (it is now the current module)
Tests
- Many aspects of the above should consider the distinction main/test sources, how exactly is a tricky question.
- Each modification dialog will have a checkbox "[x] Test only". (agreed but not implemented)
- Alternatively, the entire page could have two filtered views, selectable by a drop down [main/test] - deferred / may not be needed due to individual checkboxes in dialogs
- Changes made in view "main" are global
- Changes made in view "test" are not visible in view "main"
- Use dark gray icons like in Package Explorer (agreed but not implemented)
Functionality Discussion
I do hope that this one page can eventually fully replace the existing Module dialog (hidden behind "Is modular"), and also cover the additional use cases discussed above.
- We are loosing the visualization of explicitly and implicitly included modules. Instead the "Remove" button triggers computing the minimal closure for removal (and asks for confirmation). Similarly "Add System Module..." auto-selects all required modules.
-
--add-reads
is now universally applicable, we just need to add support for the "module" ALL-UNNAMED. (agreed but not implemented) - Test code could read ALL-UNNAMED by default, with the option to remove this.
- To reflect "--add-modules ALL-SYSTEM" the "Add System Module" dialog will have a checkbox "[x] All System Modules".
- Currently spelling out all modules in the classpath attribute -- may want to reduce it to the constant ALL-SYSTEM, indeed.
- Still missing: a location to specify the Main Class :(
Future
For test specific tweaks (which are in general not migration tools, but part of the architecture) I would still wish we had s.t. that looks like source code, easily compared in git etc. Is the proposed design blocking such future development?
- One might think of making the "test" view read-only in the dialog, and redirect to a special module-info.java for editing (comparable to compiler-jpms-test/src/test/java/module-info.java)