How to open Navigator panel programmatically?
Peter Nabbefeld <[email protected]> Fri, 14 Jul 2017 22:19:37 +0200
| Newsgroups | gmane.comp.java.netbeans.modules.openide.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I wonder how to activate navigator panel programmatically. My current
code is:
/**
*
* @author peter
*/
public class FormDataOpenAction extends OpenAction {
private final OpenAction action;
public FormDataOpenAction() {
action = SystemAction.get(OpenAction.class);
}
@Override
public String getName() {
return "Open";
}
@Override
protected void performAction(final Node[] activatedNodes) {
// Mode mode = WindowManager.getDefault().findMode("navigator");
// TopComponent[] navComponents = mode.getTopComponents();
// if (navComponents.length > 0) {
// navComponents[0].requestActive();
// }
super.performAction(activatedNodes);
NuclosLayoutNavigatorPanel panel =
NuclosLayoutNavigatorPanel.getInstance();
NavigatorHandler.activateNavigator();
NavigatorHandler.activatePanel(panel);
}
}
If I remove the comments, the project panel is selected (obviously
because it is the first one shown in that "mode").
I'd like to find the panel and open it, eventually also creating the
TopComponent if not already done.
The code related to NavigatorHandler does not seem to work.
Kind regards
Peter