Creating window groups on Netbeans Platform with Annotations

Javier Ortiz <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <CAP3=pbP4VY2x8sNoJrJdwbVbz6PBicJdbtrfggX3bh+6dvPK7g@mail.gmail.com>
There's a related question
<http://stackoverflow.com/questions/9922179/creating-window-groups-on-netbeans-platform>
already
answered, but so much has changed since then with the use of annotations.

I'm registering TopComponents with annotations. For example:

@TopComponent.Registration(mode = "explorer", openAtStartup = false,
        roles = "Test Role")

Later I tried to open the group like this, as a test:

    WindowManager.getDefault().invokeWhenUIReady(() -> {
        WindowManager.getDefault().getRegistry().getOpened().stream()
                .forEach((tc) -> {
                    tc.close();
                });
        TopComponentGroup group
                = WindowManager.getDefault()
                .findTopComponentGroup("Test Role");
        if (group != null) {
            group.open();
        }
    });

All components are closed but nothing opens. It doesn't work, so obviously
some plumbing is missing.

Is this still the right way of doing it?

Is there a working example of this somewhere?

Question also in Stackoverflow
<http://stackoverflow.com/questions/36655361/creating-window-groups-on-netbeans-platform-with-annotations>
.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.