This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 216175 - Toolbar overflow
Summary: Toolbar overflow
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords: API, API_REVIEW_FAST, PLAN
Depends on:
Blocks:
 
Reported: 2012-07-31 10:15 UTC by Theofanis Oikonomou
Modified: 2012-08-09 02:39 UTC (History)
9 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
new api and usage (17.14 KB, patch)
2012-07-31 12:54 UTC, Theofanis Oikonomou
Details | Diff
patch (16.62 KB, patch)
2012-08-01 12:21 UTC, Theofanis Oikonomou
Details | Diff
final patch (16.91 KB, patch)
2012-08-01 16:04 UTC, Theofanis Oikonomou
Details | Diff
Mockup of toolbar with double-arrow overflow symbol (64.56 KB, image/png)
2012-08-02 13:16 UTC, Petr Somol
Details
horizontal double-arrow (248 bytes, image/png)
2012-08-02 13:17 UTC, Petr Somol
Details
vertical double-arrow (245 bytes, image/png)
2012-08-02 13:17 UTC, Petr Somol
Details
patch for review (17.71 KB, patch)
2012-08-03 09:51 UTC, Theofanis Oikonomou
Details | Diff
RBScreenshot (12.81 KB, image/png)
2012-08-06 08:42 UTC, Ralph Ruijs
Details
patch for RB1, RB2 (18.50 KB, patch)
2012-08-06 12:25 UTC, Theofanis Oikonomou
Details | Diff
better toolbar borders (10.96 KB, image/png)
2012-08-06 13:48 UTC, Petr Somol
Details
final patch (21.11 KB, patch)
2012-08-06 16:37 UTC, Theofanis Oikonomou
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Theofanis Oikonomou 2012-07-31 10:15:52 UTC
Toolbar overflow - if toolbar is too wide to fit to the screen, show additional buttons in some sort of drop down menu.
Comment 1 Theofanis Oikonomou 2012-07-31 12:54:33 UTC
Created attachment 122576 [details]
new api and usage

Please review the new api. The patch also contains usage of the new api from various toolbars in the IDE such as the main, the editor and the output window toolbars.
Comment 2 Jaroslav Havlin 2012-08-01 08:30:45 UTC
Great job. The new toolbar looks very well in Output Window. I'll definitely use it also in Search Results window. Thank you.

JH01: Only small question, would it be possible to eliminate the need of calling maybeAddOverflow() from client code?

Maybe the logic could be moved to validate() method. Seems to work fine, but I'm not sure this is correct and effective solution.

    private void maybeAddOverflow() {
        validate();
        repaint();
    }

    @Override
    public void validate() {
        computeVisibleButtons();
        if (visibleButtons == -1) {
            handleOverflowRemoval();
        } else {
            handleOverflowAddittion();
        }
        super.validate();
    }
Comment 3 Stanislav Aubrecht 2012-08-01 10:57:54 UTC
SA01: The overflow toolbar should listen to its own ContainerEvents and show/hide the overflow button as needed. Checking overflow in validate() might work as well though.

SA02: getPreferredSize() should be made final.

SA03: The origin of popup menus is usually the bottom left corner of the invoking button, not the current mouse cursor location.

SA04: Would be nice to have 'down arrow' icon when the toolbar has vertical layout.

SA05: JavaDoc is missing @since tag.

SA06: apichanges.xml must be updated as well.
Comment 4 Theofanis Oikonomou 2012-08-01 12:21:44 UTC
Created attachment 122636 [details]
patch

This patch handles JH01, SA01-SA03 and SA05-SA06. Method maybeAddOverflow() is now private. The problem, Jardo was facing, was happening when all the components were removed from the toolbar. So overriding removeAll() seems to fix the issue. Jardo, could you verify please?

> SA04: Would be nice to have 'down arrow' icon when the toolbar has vertical
> layout.

Petr any thoughts on this?
Thank you
Comment 5 Theofanis Oikonomou 2012-08-01 16:04:29 UTC
Created attachment 122648 [details]
final patch

Seems like solution from comment 2 is a better start than the one from comment 4. This is the final patch.
Comment 6 Petr Somol 2012-08-02 13:16:44 UTC
Created attachment 122682 [details]
Mockup of toolbar with double-arrow overflow symbol

Attaching a mockup of how the double-arrow might look like. Actually it would be preferable if the missing part of toolbar appeared immediately on roll over over the doublearrow, not only after click (cf. IntelliJ). Going to attach icon files..
Comment 7 Petr Somol 2012-08-02 13:17:13 UTC
Created attachment 122683 [details]
horizontal double-arrow
Comment 8 Petr Somol 2012-08-02 13:17:44 UTC
Created attachment 122684 [details]
vertical double-arrow
Comment 9 Petr Somol 2012-08-02 13:19:51 UTC
CC-ing several people that might be interested in overflow toolbars..
Comment 10 Theofanis Oikonomou 2012-08-03 09:51:11 UTC
Created attachment 122706 [details]
patch for review

This patch also handles both overflow arrows, horizontal and vertical. Thank you Peter. Please comment as I would like to integrate on Tuesday. Thank you.
Comment 11 Ralph Ruijs 2012-08-06 08:42:53 UTC
Created attachment 122772 [details]
RBScreenshot

RB1: The button is rectangular when the other buttons are smaller than the default.
RB2: There is a strange white border around the panel. (Using GTK3)
Comment 12 Theofanis Oikonomou 2012-08-06 12:25:12 UTC
Created attachment 122783 [details]
patch for RB1, RB2

Ralph thank you for your comments. 

> RB1: The button is rectangular when the other buttons are smaller than the
> default.

I think that the overflow button should be rectangular in order to take as less space as possible. Fixed it.


> RB2: There is a strange white border around the panel. (Using GTK3)

This patch removes the border from the toolbar. I do not know if this is better approach. Peter what do you think about this?
Comment 13 Petr Somol 2012-08-06 13:48:06 UTC
Created attachment 122791 [details]
better toolbar borders

I agree with RB2; attaching a mockup of IMHO more satisfactorily looking borders (note also the now removed vertical white line on the right of the right vertical toolbar, plus reduced darkgray vertical line on left border of the window contents, etc.)

BTW, is there an option to display the overflow on hover over the doublearrow (the Idea way) ?
Comment 14 Theofanis Oikonomou 2012-08-06 13:56:17 UTC

(In reply to comment #13)
> Created attachment 122791 [details]
> better toolbar borders
> 
> I agree with RB2; attaching a mockup of IMHO more satisfactorily looking
> borders (note also the now removed vertical white line on the right of the
> right vertical toolbar, plus reduced darkgray vertical line on left border of
> the window contents, etc.)

ok I will create a line border of some kind then.

> 
> BTW, is there an option to display the overflow on hover over the doublearrow
> (the Idea way) ?

not currently but it could be added. Great idea. Thank you Peter
Comment 15 Theofanis Oikonomou 2012-08-06 16:37:49 UTC
Created attachment 122805 [details]
final patch

This is the final patch. 

A light gray, 1px line border is added to the overflow toolbar and on hover mouse event triggers the display of the overflow toolbar.

If there are no more comments I am going to integrate tomorrow. Thank you.
Comment 16 Theofanis Oikonomou 2012-08-07 12:11:44 UTC
Thank you for all your comments. Added minor code to have the overflow toolbar not steal the focus.

Integrated in core-main: http://hg.netbeans.org/core-main/rev/007c384cf15d
Comment 17 Jaroslav Tulach 2012-08-07 16:05:28 UTC
I had to revert the integration in core-main#007c384cf15d as it breaks the signature tests somehow (seems to be incompatible with signatures of release72).

I can work on trying to find what is wrong, but still (even a bit too late) I'd like to add a suggestion:

Y01 Why the patch introduces ToolbarWithOverflow superclass? Can't we just put the implementation inside of Toolbar or make ToolbarWithOverflow package private and delegate to it?
Comment 18 Jaroslav Tulach 2012-08-07 16:46:42 UTC
Reopening after the revert. Before integration try:

$ ant -f openide.loaders/build.xml clean netbeans sigtest-check
Comment 19 Quality Engineering 2012-08-08 02:34:38 UTC
Integrated into 'main-golden', will be available in build *201208080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/007c384cf15d
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Issue #216175 - Toolbar overflow
Comment 20 Theofanis Oikonomou 2012-08-08 12:45:52 UTC
Sorry for that. The problem was that the getPreferredSize() method was final. Fixed: http://hg.netbeans.org/core-main/rev/571f9fce2408
Comment 21 Quality Engineering 2012-08-09 02:39:13 UTC
Integrated into 'main-golden', will be available in build *201208090001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/571f9fce2408
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Issue #216175 - Toolbar overflow