If you building a Netbeans RCP application and you would like to replace the current Exception dialog by a customised one. There are two ways to replace the standard “unexpected exception” window:
- The Lookup supports extension to the JDK's standard. It allows a module to remove class registered by another one.
- Implement your own java.util.logging handler (using "@ServiceProvider(service=Handler.class)"). For example my.company.MyErrorHandler.
- Adding a META-INF/services for java.util.logging.Handler in your source.
- Add to this file:
#-org.netbeans.core.NbErrorManager
my.company.MyErrorHandler
The reason why the removal line starts with #- is to keep compatibility with JDK's implementation. The # means comment and thus JDK will not interpret the line and will not get confused by the - before class name.
bits.netbeans.org - You can superseding NbErrorManager.
- Implement your own java.util.logging handler
- Use:
@ServiceProvider(service=Handler.class, supersedes ={"org.netbeans.core.NbErrorManager"})")
Geertjan's Blog
No comments:
Post a Comment