Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Java9/Use cases"

(Manipulation of module-info)
m (Using legacy JAR files in a module project)
Line 47: Line 47:
 
*Action on any types, should open the type, even those in other modules than the current one.
 
*Action on any types, should open the type, even those in other modules than the current one.
 
 
== Using legacy Jar files in a module project ==
+
== Using legacy JAR files in a module project ==
*Legacy Jar files or class folders continue to be supported by Java module projects. To be able to use them, the user
+
*Legacy JAR files or class folders continue to be supported by Java module projects. To be able to use them, the user
adds the path to the build path, as he normally would. In addition to that, he can choose to tell the compiler whether or not promote a Jar as automatic modules. The compiler seems an automatic module differently from an unnamed module. The IDE should allow the user to do this ({{bug|506878}})
+
adds the path to the build path, as he normally would. In addition to that, he can choose to tell the compiler whether or not promote a JAR as automatic modules. The compiler seems an automatic module differently from an unnamed module. The IDE should allow the user to do this ({{bug|506878}})
*Similar support would be provided in command line compiler as well, but the distinction between automatic and unnamed modules is made based on where the Jar path is found, in the -modulepath or -classpath.
+
*Similar support would be provided in command line compiler as well, but the distinction between automatic and unnamed modules is made based on where the JAR path is found, in the -modulepath or -classpath.
  
 
== Outline View ==
 
== Outline View ==
 
*Add more here
 
*Add more here

Revision as of 05:06, 10 November 2016

We will write down user scenarios and use cases related to Java modules here that will eventually become part of existing features or new features.

Creation of module-info

  • User manually creates a module-info, similar to package-info.
    • The created module info has just the module name and an empty body.
  • A new wizard/dialogue to create a blank module-info or to create one from the existing project
    • Wizard pulls out all the packages in the project (sources only) across all source folders

and also picks up the modules used by project and populates the module-info

    • If the project has a MANIFEST.MF, it should use that information (x-internal, x-friends, reexport, etc.)
  • Make sure that the Java build is updated, i.e. org.eclipse.jdt.MODULE_PATH is added automatically

Manipulation of module-info

  • change module-info in all possible ways, e.g. add/remove modules and packages
  • verify that reconciler (problems while typing), the markers after save, and the Module Source Path container is updated
  • have a way to see the module target platform

Completion

  • Completions offered on all keywords depending on context (for e.g. exports 'to', provides 'with')
  • Completions offered on all packages and types depending on the scope and context (scopes being discused in bug bug 507288)
  • Compiler allows/rejects packages and types depending on scope and context.

Quick assist

  • Fill in

Quick fix

  • Unresolved package in 'exports'
    • Offer to create the package?
  • Unresolved type in 'with' clause
    • Offer to create an empty type that implements the mentioned service.
  • Unresolved type in 'provides' clause
    • ?
  • 'with' does not implement 'provides'
    • Offer to make the implementation implement the interface
  • Unresolved import or type in a class
    • Offer to add the module to 'requires' clause

Hover

  • Hover on module names (the whole name, not just fragments) should display the module name
    • Dani: I question how useful this is if we don't show any additional information than what's already in the editor.
    • When and if the spec allows Javadoc, then the documentation should be displayed in the hover
    • PROBLEM: Modules shipped with Java 9 currently don't come with module-info.java in the src.zip
  • Hover on all package and type names should work like everywhere else.

Code navigation

  • Action on module should open the module-info.java or module-info.class
  • Action on package names should open the package-info if present.
  • Action on any types, should open the type, even those in other modules than the current one.

Using legacy JAR files in a module project

  • Legacy JAR files or class folders continue to be supported by Java module projects. To be able to use them, the user

adds the path to the build path, as he normally would. In addition to that, he can choose to tell the compiler whether or not promote a JAR as automatic modules. The compiler seems an automatic module differently from an unnamed module. The IDE should allow the user to do this (bug 506878)

  • Similar support would be provided in command line compiler as well, but the distinction between automatic and unnamed modules is made based on where the JAR path is found, in the -modulepath or -classpath.

Outline View

  • Add more here

Back to the top