You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Jerome Lelasseux <le...@yahoo.com.INVALID> on 2022/01/28 19:29:13 UTC

TopComponent question

Hi, In my NB platform application I use annotations to have a unique TopComponent always opened at startup and not closable by user:
...
@TopComponent.Description(        preferredID = "MixConsoleTopComponent",
        persistenceType = TopComponent.PERSISTENCE_ALWAYS    
)
@TopComponent.Registration(mode = "explorer", openAtStartup = true, position = 1)
...public final class MixConsoleTopComponent extends TopComponent{
    public MixConsoleTopComponent()
    {            ...
            putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE);            ...    }
...

It works well 99% of the time.
But if it happens there is a bug in the MixConsoleTopComponent constructor, the TopComponent is not opened, and when user leaves the application the window configuration (WindowManager.wswmgr file) is saved with no MixConsoleTopComponent. When user restarts the app, even if the bug is gone, the MixConsoleTopComponent will not appear anymore.
Is there a simple way to solve this ?