Create a new module. Add a JPanel. Drag and drop a JLabel. Compile. Output shows that org.openide.util is needed but that it hasn't been added automatically, should be added automatically, maybe when the module is created, since you're always going to need that module sometime.
Created dir: C:\Documents and Settings\gwielenga\Desktop\packtpub-repo\new\code\ch2\TaskManager\TaskEditor\build\classes
Compiling 1 source file to C:\Documents and Settings\gwielenga\Desktop\packtpub-repo\new\code\ch2\TaskManager\TaskEditor\build\classes
C:\Documents and Settings\gwielenga\Desktop\packtpub-repo\new\code\ch2\TaskManager\TaskEditor\src\com\netbeansrcp\taskeditor\TaskEditorPanel.java:36: package org.openide.util does not exist
jLabel1.setText(org.openide.util.NbBundle.getMessage(TaskEditorPanel.class, "TaskEditorPanel.jLabel1.text")); // NOI18N
C:\Program Files\NetBeans 7.0 Beta 2\harness\common.xml:206: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)
You do not always need a dep on org.openide.util and none should be added until one is needed.
It is the responsibility of the form editor to not create code referencing org.openide.util.NbBundle when it is not accessible. In the short term, this probably means just disabling this I18N message pattern when ClassPath.getClassPath(form, COMPILE).findResource("org/openide/util/NbBundle.class") == null.
Better would be to add the dep as needed. In an Ant-based module project, ProjectClassPathModifier may be used for this purpose, if you add a Library with a classpath volume jar:nbinst://org.openide.util/lib/org-openide-util.jar!/ for example. For a Maven-based module project, I think you would need a Library with a maven-pom volume http://bits.netbeans.org/maven2/org/netbeans/api/org-openide-util/RELEASE691/org-openide-util-RELEASE691.pom or similar, though it could likely be made to understand the URL form used for Ant-based projects too. (There is also org.netbeans.modules.apisupport.project.spi.NbModuleProvider.getDependencyVersion/addDependency but that is only available as a friend API.)
There probably needs to be some more general method in ProjectClassPathModifier such as
public static boolean add/removeAPI(String apiClass, FileObject projectArtifact, String classPathType) throws IOException, UnsupportedOperationException;
which would allow the caller to specify just "org.openide.util.NbBundle" and leave it up to the implementation to decide exactly where to find this dependency and which version to use.
*** Bug 201628 has been marked as a duplicate of this bug. ***
*** Bug 201872 has been marked as a duplicate of this bug. ***
From user's point of view, the dependency on org.openide.util should be added as needed. Similarly also org.openide.awt to support Mnemonics (bug 70944).
*** Bug 213672 has been marked as a duplicate of this bug. ***
*** Bug 238857 has been marked as a duplicate of this bug. ***