What is a Mode in the Windowing System?
Note: These pages are being reviewed.
"Mode" refers to "docking mode". A Mode is a place in a main window, a place between splitters. Separate "floating" window is also backed by Mode. Mode is usually visually represented by a tabbed container. Programmatically it is represented by the class
Think of a
Mode as synonymous with a one of the tabbed containers you see in the IDE’s main window. The name "Mode" is historical, and a bit unfortunate. When you hear "Mode," think tabbed container and you’ll be fine.
A Mode is not a GUI component. There is no legitimate programmatic way to fetch the component that represents a Mode on-screen, and the windowing system makes no guarantees about what that component is.
Modes can contain one or more TopComponents. They may be visible or non-visible at any given time.
The DevFaqCustomWindowMode page has a visual representation of the available modes, and http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/doc-files/api.html has details about the contents of wstcref and settings files.
NetBeans defines six modes in core.ui:
NetBeans defines additional modes in other places:
To dock a TopComponent into the 'editor' mode:
Mode myMode = WindowManager.getDefault().findMode("editor"); TopComponent myTopComponent = WindowManager.getDefault().findTopComponent("MyTopComponent"); myMode.dockInto(myTopComponent);
''The ID string of the TopComponent can usually be found in that TopComponent’s Java file where it gets registered using annotations, or in the layer.xml. ''