DevFaqMultiViewChangeTabInCode

How to change selected tab of Multiview?

Using org.netbeans.core.api.multiview.MultiViews you can get an instance of org.netbeans.core.api.multiview.MultiViewHandler.

For example: Get the handler for the current TopComponent

TopComponent activated = WindowManager.getDefault().getRegistry().getActivated();
MultiViewHandler mvh = MultiViews.findMultiViewHandler(activated);

Using this handler you can call

  • getPerspectives() to get all available tabs
  • requestActive/requestVisible(MultiViewPerspective desc) to activate the tab

See also http://bits.netbeans.org/dev/javadoc/org-netbeans-core-multiview/org/netbeans/core/api/multiview/MultiViewHandler.html

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo