Integrated: JDK-8292669: IGV: Search not useable when in Overflow Toolbar

Tobias Holenstein tholenstein at openjdk.org
Fri Aug 26 13:41:09 UTC 2022


On Fri, 19 Aug 2022 14:00:32 GMT, Tobias Holenstein <tholenstein at openjdk.org> wrote:

> ## Overview
> 
> The toolbar of the `EditorTopComponent` uses an overflow toolbar when it does not fit in the width of the TopComponent. When the window was not wide enough the `QuickSearch` used to land in the overflow toolbar. Unfortunately, `QuickSearch` stops working in the overflow toolbar.
> 
> Now the `QuickSearch` never lands in the overflow toolbar anymore as shown bellow: 
> <img width="922" alt="ToolbarOverflow" src="https://user-images.githubusercontent.com/71546117/186420098-5fcb2348-b955-40c5-b5ca-2bc38525ffcf.png">
> 
> Since the Netbeans Platform only allows for one occurrence of `QuickSearch`, it is only shown in the `EditorTopComponent` that was selected last. 
> 
> ## Implementation
> We introduce a new `JPanel` named `topPanel` as a parent container. 
> <img width="889" alt="topPanel" src="https://user-images.githubusercontent.com/71546117/186420990-9888e17d-6c45-4b7d-86a5-1fe2981f197d.png">
> 
> `topPanel` contains another  `JPanel` `toolbarPanel` and a `Toolbar` `quickSearchToolbar`:
> <img width="889" alt="Toolbars" src="https://user-images.githubusercontent.com/71546117/186421595-08a74998-b783-43f1-bd15-c41e7fdcbd23.png">
> 
> `toolbarPanel` uses the `GridLayout` which gives the original `Toolbar` `toolBar` the maximal available width while still allowing it to overflow. 
> On the right we have `quickSearchToolbar`, a `Toolbar` with a single element `quickSearchPresenter`. We give `quickSearchPresenter` a minimum size and use the `BoxLayout` in `quickSearchToolbar` that respects the minimum size of its children.  Therefore the `quickSearchToolbar` never overflows. 
> <img width="889" alt="Toolbars_inner" src="https://user-images.githubusercontent.com/71546117/186421729-2591e753-a111-4d09-9fc6-14839730b669.png">

This pull request has now been integrated.

Changeset: 2b803493
Author:    Tobias Holenstein <tholenstein at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/2b803493ba4f631bfff928c8bd95aeaa3368cb36
Stats:     86 lines in 3 files changed: 35 ins; 30 del; 21 mod

8292669: IGV: Search not useable when in Overflow Toolbar

Co-authored-by: Christian Hagedorn <chagedorn at openjdk.org>
Co-authored-by: Tobias Holenstein <tholenstein at openjdk.org>
Reviewed-by: chagedorn, rcastanedalo

-------------

PR: https://git.openjdk.org/jdk/pull/9940


More information about the hotspot-compiler-dev mailing list