This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 156947 - Problems when disabling module providing option panel when Options window is opened
Summary: Problems when disabling module providing option panel when Options window is ...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Options&Settings (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 2 votes (vote)
Assignee: Jiri Skrivanek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-16 12:49 UTC by matteodg
Modified: 2009-02-19 22:53 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NoClassDefFoundError when executableoptions module has been disabled with opened Options window (60.89 KB, text/plain)
2009-01-16 12:53 UTC, matteodg
Details
AssertionError: BaseKit.install() incorrectly called from non-AWT thread, happened when disabling a module with opened Options window (115.40 KB, text/plain)
2009-01-16 12:54 UTC, matteodg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matteodg 2009-01-16 12:49:46 UTC
We have our RCP application and wrote a license manager that enables or disables modules depending on a license file.

To do so we have to ask the user for a license at the first run of our application. In a subsequent session we simply
apply the saved license settings.

Steps at first run:
1) disable all modules that need a license to be enabled
2) ask the user for a license
3) check the license and, if all is OK, enable the licensed modules and leave disabled the others (if any).

These operations done at first run seem causing some problem in NB code (and also in our code, see #156822 likely fixed
using Presenter.Toolbar suggestion), during the same session.

For example, say that a module (executableoptions), that can be disabled due to licensing, registers an Option panel in
the layer.xml.
If the disable operation is done when the Options windows is open, the merged layer.xml content is changing, but it
seems that the Options window is not listening to that layer.xml change.
Therefore the Options window still shows the Option panel registered by executableoptions and when the user try to
switch to that Option panel, an exception will be thrown.

Another problem is that in response to a lookup result change event, some NB code is doing a call to BaseKit.install()
from a RequestProcessor thread: so BaseKit.install() is complaining, because it has to be called from AWT thread.

I'm going to attach two stack traces about those exceptions.
Comment 1 matteodg 2009-01-16 12:53:29 UTC
Created attachment 75889 [details]
NoClassDefFoundError when executableoptions module has been disabled with opened Options window
Comment 2 matteodg 2009-01-16 12:54:36 UTC
Created attachment 75890 [details]
AssertionError: BaseKit.install() incorrectly called from non-AWT thread, happened when disabling a module with opened Options window
Comment 3 Jiri Skrivanek 2009-02-13 14:44:28 UTC
To prevent exceptions the options window is closed when panels change. AWT Thread exception was fixed in issue 157434.
http://hg.netbeans.org/core-main/rev/f1990ce17736
Comment 4 matteodg 2009-02-13 16:49:12 UTC
Since we disable and enable the modules from a license manager option panel (then while Option dialog is open), is there
a way to listen to layer.xml changes and handle them, instead of abruptly close the Options dialog?
Thanks in advance for the support.
Comment 5 Jiri Skrivanek 2009-02-13 17:35:33 UTC
This is something unusual. The place for enabling/disabling modules is the plugin manager. When module is selected to be
enabled, licence is shown. Your approach is inverse. Anyway, it is possible to listen to layer changes but options
dialog has to be rebuild from scratch. So, it is not possible to selectively remove one panel.
Comment 6 matteodg 2009-02-13 18:57:44 UTC
Likely you misunderstood me: we built a license manager to protect our RCP application.
This license manager is a plugin that enables/disables other modules if the user has/hasn't authorization to use them.

GUI of our Licence Manager is in an options panel, thus when it disables/enables modules the Options dialog has to
remain opened.

Now with your fix, disabling a module, that registers an OptionsCategory (and OptionsPanelController, etc.), will close
the whole Options window.

However I comprehend that rebuilding from scratch the Options dialog is unfortunately not an option....
Comment 7 Jiri Skrivanek 2009-02-13 20:00:02 UTC
Yes, I understand. I just wanted to say that there already exists plugin manager (Tools>Plugins). Now I have no better
solution for you than to move your Licence Manager from the options window into dedicated dialog.
Comment 8 Quality Engineering 2009-02-14 08:38:13 UTC
Integrated into 'main-golden', will be available in build *200902140319* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/f1990ce17736
User: Jiri Skrivanek <jskrivanek@netbeans.org>
Log: #156947 - close dialog when categories change.