RFR: JDK-8292669: IGV: Search not useable when in Overflow Toolbar [v2]
Tobias Holenstein
tholenstein at openjdk.org
Wed Aug 24 14:13:47 UTC 2022
On Wed, 24 Aug 2022 14:03:35 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">
>
> Tobias Holenstein has updated the pull request incrementally with one additional commit since the last revision:
>
> componentActivated() added
Updated PR to add the Search when opening a new Tab without first clicking on it
-------------
PR: https://git.openjdk.org/jdk/pull/9940
More information about the hotspot-compiler-dev
mailing list