From users-return-1060-archive-asf-public=cust-asf.ponee.io@netbeans.apache.org Mon May 14 21:44:09 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 5B0B4180627 for ; Mon, 14 May 2018 21:44:08 +0200 (CEST) Received: (qmail 55012 invoked by uid 500); 14 May 2018 19:44:06 -0000 Mailing-List: contact users-help@netbeans.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@netbeans.apache.org Received: (qmail 55001 invoked by uid 99); 14 May 2018 19:44:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 May 2018 19:44:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 6E4051A29D6 for ; Mon, 14 May 2018 19:44:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.11 X-Spam-Level: ** X-Spam-Status: No, score=2.11 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, HTML_MESSAGE=2, T_DKIM_INVALID=0.01] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=neutral reason="invalid (public key: not available)" header.d=trixon.se Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 8ku1sojiwkO4 for ; Mon, 14 May 2018 19:44:02 +0000 (UTC) Received: from manu33.manufrog.com (manu33.manufrog.com [98.142.98.18]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 670965F178 for ; Mon, 14 May 2018 19:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=trixon.se; s=default; h=Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Sender:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=qLGgQ7K0TIVemusrLX0fOEnIm3Nuh2S9jSrMT/qdyaE=; b=FzXr5V+5oZaGqn5YhiY35URKeC 2nhDl4Rj3NwFKcOt9ccG06RJ+idt3eS67wrXaU4hycagZiuXBauIcpdExe29nQlygToaWdnmGp5ie EX5MjT4kuQYsmmLalejkGFSbT0rQClPZIMp0e0iHvEvjf14RZrGNzUfSw31faqUeu91C9Am9aBH6j VualcKnJkhxnhbJkrLypqa5mruaGxYP9CDnLFawVFgDsrwD7vYUZoxcjnSqV3OU6FcWbtYkEWqHwb 823AvRS+t3iwqUEc69/Nd/FR265WEWa0nkVeHAwAQOrOGpwEb7DcYziJ+xgceTo2e6u6laMs3ox4D wa9bSjNQ==; Received: from mail-pl0-f47.google.com ([209.85.160.47]:33040) by manu33.manufrog.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1fIJNx-00CVV3-BF for users@netbeans.incubator.apache.org; Mon, 14 May 2018 21:43:55 +0200 Received: by mail-pl0-f47.google.com with SMTP id n10-v6so7960006plp.0 for ; Mon, 14 May 2018 12:43:53 -0700 (PDT) X-Gm-Message-State: ALKqPwcI6oqcqlR8xDGW32v/BBKTypQh2M1/2m6J6EqdCZLM6MfOPZkt RT0svb6psbKjy3kkG9QCarBTJCfTMReXYs6wAe8= X-Google-Smtp-Source: AB8JxZoPbby80ZziuoKK3d5IMorXEHj4vuNHwiHiPHBz+7PRq3zQ+FzV97VES0lJjBqzsCAZdXtnDyWJpOeXSTJauGM= X-Received: by 2002:a17:902:bcc4:: with SMTP id o4-v6mr10915488pls.308.1526327032524; Mon, 14 May 2018 12:43:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Patrik_Karlstr=C3=B6m?= Date: Mon, 14 May 2018 21:43:14 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PLATFORM] Listening to Show Only Editor changes To: users@netbeans.incubator.apache.org Content-Type: multipart/alternative; boundary="00000000000095b6dd056c2fb4c3" X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - manu33.manufrog.com X-AntiAbuse: Original Domain - netbeans.incubator.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - trixon.se X-Get-Message-Sender-Via: manu33.manufrog.com: authenticated_id: patrik@trixon.se X-Authenticated-Sender: manu33.manufrog.com: patrik@trixon.se X-Source: X-Source-Args: X-Source-Dir: --00000000000095b6dd056c2fb4c3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Den fre 11 maj 2018 kl 06:32 skrev Patrik Karlstr=C3=B6m = : > 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/o= rg/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 =3D ((JFrame) WindowManager.getDefault().getMainWindow()).getContentPane().getPreferredSi= ze(); final boolean showOnlyEditor =3D 1 =3D=3D d.height && 1 =3D= =3D d.width; if (showOnlyEditor) { } else { } } }); --00000000000095b6dd056c2fb4c3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Den fre 11 maj= 2018 kl 06:32 skrev Patrik Karlstr=C3=B6m <patrik@trixon.se>:
Hi,
How do I listen to Sh= ow Only Editor changes and at the same time, get the state it's in?
=C2=A0
I came up with this piece= of code for my top component that got me the result I wanted.
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 addHierarchyListene= r((HierarchyEvent e) -> {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 if (e.getChangedParent() instanceof JLayeredPane) = {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 Dimension d =3D ((JFrame) WindowManager.getDefault().= getMainWindow()).getContentPane().getPreferredSize();
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fi= nal boolean showOnlyEditor =3D 1 =3D=3D d.height && 1 =3D=3D d.widt= h;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 if (showOnlyEditor) {
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else {=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 });

=
--00000000000095b6dd056c2fb4c3--