Search code examples
javanetbeans-platform

Netbeans RCP - reopen closed tabs


Is there some easy way to reopen closed tabs in Netbeans RCP application?

I have a module application with several modules that each has some topComponents (explorers, editors etc.) but when I close some tab (using the "x" symbol), it stays closed even during next startup and I cant seem to find any way how to restore it.

All the components contains @TopComponent.Registration(mode = "explorer", openAtStartup = true)

The components also contains this:

@TopComponent.Description(
        preferredID = "ProductionExplorer",
        //iconBase="SET/PATH/TO/ICON/HERE", 
        persistenceType = TopComponent.PERSISTENCE_ALWAYS
)

What am I missing here?


Solution

  • The persitence type of the top component is set to "always", that means the state of the component will allways be stored when you close the application. Whether it is closed or opened. If you change to PERSISTENCE_NEVER, it won't be saved.

    To reset the windows you have to use the menu item "Reset Windows" under "Windows".