Search code examples
netbeans6.8

netbeans: API Versioning tab, public packages org.demo.textfilter not automatically imported


following the tutorial at

http://platform.netbeans.org/tutorials/nbm-quick-start.html#lookup

"Right-click the "TextFilter" module, choose Properties, and use the "API Versioning" tab so specify that the package containing the interface should be available throughout the application: " (org.demo.textfilter is set to public)

the problem is, this public package is not automatically imported by another class in another module with dependency on the TextFilter module. Whenever the dependencies are added, shouldn't the dependent classes/modules automatically import the dependencies ?


Solution

  • Your question is a bit hard to interpret, so I will tell you what I think you are asking and then provide an answer....

    I assume that you have a couple netbeans module projects: TextFilter and MyModule.

    Initially, MyModule depends on TextFilter.

    There is a third module, let's call it Filter... that has a public, exported class org.filter.BaseClass.

    You have made TextFilter dependent on Filter, so you can use the org.filter.BaseClass in the TextFilter module.

    You are now attempting to use org.filter.BaseClass in MyModule and that is not working.

    Module dependency defines the visibility of classes. That visibility does not span modules.

    If you want MyModule to be able to use org.filter.BaseClass, you need to explicitly define the dependency between the module Filter and MyModule.