netbeans-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrik Karlström <pat...@trixon.se>
Subject Re: [PLATFORM] Listening to Show Only Editor changes
Date Mon, 14 May 2018 19:43:14 GMT
Den fre 11 maj 2018 kl 06:32 skrev Patrik Karlström <patrik@trixon.se>:

> Hi,
> How do I listen to Show Only Editor changes and at the same time, get the
> state it's in?
>

Inspired by the source of
https://github.com/apache/incubator-netbeans/blob/master/core.windows/src/org/netbeans/core/windows/EditorOnlyDisplayer.java
I came up with this piece of code for my top component that got me the
result I wanted.

        addHierarchyListener((HierarchyEvent e) -> {
            if (e.getChangedParent() instanceof JLayeredPane) {
                Dimension d = ((JFrame)
WindowManager.getDefault().getMainWindow()).getContentPane().getPreferredSize();
                final boolean showOnlyEditor = 1 == d.height && 1 ==
d.width;
                if (showOnlyEditor) {
                } else {
                }
            }
        });

Mime
View raw message