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.
Difference between revisions of "Eclipse and Jigsaw modules"
(Eclipse and Jigsaw modules) |
|||
Line 2: | Line 2: | ||
== Modules == | == Modules == | ||
− | * A module (binary/source) in Eclipse is represented by an IPackageFragmentRoot. | + | * A module (binary/source) in Eclipse is represented by an IPackageFragmentRoot. ('''Note:''' It will be represented by others too, for e.g. ClasspathEntry, ClasspathDirectory etc. depending on the context) |
− | * API: IPackageFragmentRoot#isModule. | + | * API: IPackageFragmentRoot#isModule. ('''Note:''' Clearly this API needs rethinking. Perhaps it should denote whether or not it is a named module) |
* Binary modules (as JARs): Above API returns true for ModulePackageFragmentRoot | * Binary modules (as JARs): Above API returns true for ModulePackageFragmentRoot | ||
* Source modules (as source folders): | * Source modules (as source folders): |
Revision as of 04:54, 18 November 2015
See also: bug 479483 - [1.9] Define what is Module in Eclipse
Contents
Modules
- A module (binary/source) in Eclipse is represented by an IPackageFragmentRoot. (Note: It will be represented by others too, for e.g. ClasspathEntry, ClasspathDirectory etc. depending on the context)
- API: IPackageFragmentRoot#isModule. (Note: Clearly this API needs rethinking. Perhaps it should denote whether or not it is a named module)
- Binary modules (as JARs): Above API returns true for ModulePackageFragmentRoot
- Source modules (as source folders):
- What is the criterion for a source folder to be a module (for the API to return true)? - Presence of module-info.java file in it?
- If some source folder in a project does not contain a module-info.java file, is it considered as an "unnamed module"?
- In that case, will the API return true for all source folders? Then, how do we differentiate between named and unnamed modules via API, or we don't need to?
- Can we have multiple source folders in a project, each having its own module-info.java file? Hence, having multiple modules in a project.
module-info.java file
- How to create a module-info.java file in a source folder?
1) File > New > File > Select the source folder and create file.
2) A new option on "New Source Folder" dialog to create it along with the source folder? (Similar to package-info.java on "New Java Package" dialog.)
- Place the module-info.java file in the default package of that source folder.
- The file will have the normal "J" icon of a .java file.
Functionality required in module-info.java editor
- Formatter
- Content assist for keywords, packages, types etc.
- Syntax coloring for keywords, packages, types etc.
- Mark occurrences
- ...
Handling modulepath
...
Representing layers
...