Bug 289457 - [Presentations] Layout Problem with DropDownAction Toolbar Item On View
Summary: [Presentations] Layout Problem with DropDownAction Toolbar Item On View
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-15 08:27 EDT by pradeep CLA
Modified: 2019-09-06 16:06 EDT (History)
3 users (show)

See Also:


Attachments
Problem with the Dropdown Toolbar on VIew (39.76 KB, image/pjpeg)
2009-09-15 08:28 EDT, pradeep CLA
no flags Details
View Tool bar with a Push Button (39.27 KB, image/pjpeg)
2009-09-16 05:08 EDT, pradeep CLA
no flags Details
View Tool bar with a DropDown Action - On View Resize to Increase the Width (45.16 KB, image/pjpeg)
2009-09-16 06:43 EDT, pradeep CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description pradeep CLA 2009-09-15 08:27:05 EDT
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Build Identifier: I20090806-1400

When a View is attached with a new Toolbar Action which is DropDown , There are Layout issues

Reproducible: Always

Steps to Reproduce:
1. Create an action something like this.
action = new Action("Click",SWT.DROP_DOWN){
			public void run(){
				System.out.println("Clicked..");
			}
		};		
	}
2. Add to the toolbar of the view.
getViewSite().getActionBars().getToolBarManager().add(action);
3. Run the Application to look at the layout problem with the Toolbar area of the view where this menu is added.
Comment 1 pradeep CLA 2009-09-15 08:28:29 EDT
Created attachment 147188 [details]
Problem with the Dropdown Toolbar on VIew
Comment 2 Prakash Rangaraj CLA 2009-09-15 11:03:55 EDT
(In reply to comment #0)
> action = new Action("Click",SWT.DROP_DOWN){

    Why are you passing SWT.DROP_DOWN here? It should be IAction.AS_DROP_DOWN_MENU.
Comment 3 pradeep CLA 2009-09-16 04:39:20 EDT
(In reply to comment #2)
> (In reply to comment #0)
> > action = new Action("Click",SWT.DROP_DOWN){
>     Why are you passing SWT.DROP_DOWN here? It should be
> IAction.AS_DROP_DOWN_MENU.

Usage of IAction.AS_DROP_DOWN_MENU also results in the Problem.

Action style constants IAction.AS_DROP_DOWN_MENU & SWT.DROP_DOWN are the same.
Comment 4 Prakash Rangaraj CLA 2009-09-16 04:47:21 EDT
(In reply to comment #3)
> 
> Usage of IAction.AS_DROP_DOWN_MENU also results in the Problem.

     I'm looking at the attachment, and it seems to be alright to me. Whats wrong with the layout?
Comment 5 pradeep CLA 2009-09-16 05:05:19 EDT
(In reply to comment #4)
> (In reply to comment #3)
> > 
> > Usage of IAction.AS_DROP_DOWN_MENU also results in the Problem.
>      I'm looking at the attachment, and it seems to be alright to me. Whats
> wrong with the layout?

Probabaly the additional composite is not clear in the attachemnt. (This is due to the height of the DropDown Widget added to the View ToolBar). Please look at the second which diaplys the View Tool bar with a push button.
Comment 6 pradeep CLA 2009-09-16 05:08:41 EDT
Created attachment 147281 [details]
View Tool bar with a Push Button
Comment 7 Prakash Rangaraj CLA 2009-09-16 05:18:22 EDT
(In reply to comment #6)
> Created an attachment (id=147281) [details]
> View Tool bar with a Push Button

Resize any view. When there is no enough space the toolbar will go down. In your case, when the drop down style is used, the toolbar needs more space and goes down. Try increasing the width of your view, does that solve the problem?
Comment 8 pradeep CLA 2009-09-16 05:33:20 EDT
(In reply to comment #7)
> (In reply to comment #6)
> > Created an attachment (id=147281) [details] [details]
> > View Tool bar with a Push Button
> Resize any view. When there is no enough space the toolbar will go down. In
> your case, when the drop down style is used, the toolbar needs more space and
> goes down. Try increasing the width of your view, does that solve the problem?

Its not a problem with the width... resizing the view has not solved teh problem..
its the problem with the height of teh drowpdown widget added to teh toolbar by the View's ToolbarManager.
Comment 9 Prakash Rangaraj CLA 2009-09-16 05:51:10 EDT
(In reply to comment #8)
> Its not a problem with the width... resizing the view has not solved teh
> problem..

    Can you attach a screen shot with drop down style and width of the view increased?
Comment 10 pradeep CLA 2009-09-16 06:43:19 EDT
Created attachment 147292 [details]
View Tool bar with a DropDown Action - On View Resize to Increase the Width
Comment 11 Prakash Rangaraj CLA 2009-09-16 07:20:42 EDT
(In reply to comment #10)
> Created an attachment (id=147292) [details]
> View Tool bar with a DropDown Action - On View Resize to Increase the Width

      I'm not able to reproduce this on Mac. Probably a windows only issue?
Comment 12 Eric Moffatt CLA 2009-09-16 10:40:27 EDT
Pradeep, what happens if you give your original drop down an image? I think there are a number of cases where SWT has an issue with TB's that have *no* images. Specifically it uses some default height that's larger than a 'regular' TB.
Comment 13 pradeep CLA 2009-09-17 08:24:00 EDT
(In reply to comment #12)
> Pradeep, what happens if you give your original drop down an image? I think
> there are a number of cases where SWT has an issue with TB's that have *no*
> images. Specifically it uses some default height that's larger than a 'regular'
> TB.


The toolbar looks good and has no layout problem or additional composite with an iamge set to the Dropdown Action. 

You are right Eric ! This looks to be an issue only when no image set a tool bar item.
Comment 14 Eric Moffatt CLA 2009-09-17 09:56:06 EDT
Pradeep, see bug 155311. I suspect that this may be a DUP but I'm not positive.
Comment 15 Thomas Champagne CLA 2009-10-16 09:31:34 EDT
We got a similar problem with a dropdown menu populate with a CompoundContributionItem.

When we defined the attribute FORCE_TEXT (it works perflecty without), the dropdown menu appears below the toolbar like on that first screenshot. 

The strangest thing is we haven't always the problem. Sometimes it works depending on the computer whe are using to run the application (the code is the same). The two computers are under Windows XP and their configurations are very similar. 

Have you find any issue ?
Comment 16 Thomas Champagne CLA 2009-10-19 04:02:55 EDT
I know how to reproduce the bug. It is a Windows bug. 
You can reproduce this on changing the decorating style windows to "Windows XP style". 
If you are in "classic style", you will never see it. 

I think the bug comes from Windows XP because when SWT requests the toolbar's height with this code line (org.eclipse.swt.widgets.ToolBar:225) : 

OS.SendMessage (handle, OS.TB_GETITEMRECT, count - 1, rect); 

the returned height is always 30 instead of 22 I think.

If you want to reproduce this bug : 
 * Create a plugin project with the name "test_menus" and generate the template "RCP application with a view" ;
 * Put this code in the plugin.xml file : 
<extension point="org.eclipse.ui.menus">
  <menuContribution locationURI="toolbar:test_menus.views.SampleView">
    <command commandId="org.eclipse.ui.window.resetPerspective"
             icon="icons/sample.gif"
             id="test-menus.pulldown"
             mode="FORCE_TEXT"
             style="pulldown">
    </command>
  </menuContribution>
  <menuContribution locationURI="menu:test-menus.pulldown">
    <command commandId="org.eclipse.ui.window.nextPerspective" />
    <command commandId="org.eclipse.ui.window.previousPerspective" />
  </menuContribution>
</extension>

 * Switch the decorating windows style to "Windows XP Style" in the display properties ;
 * Run the project. 



I haven't any suggestion to fix this bug. And you ?
Comment 17 Thomas Champagne CLA 2009-11-02 09:42:17 EST
(In reply to comment #14)
> Pradeep, see bug 155311. I suspect that this may be a DUP but I'm not positive.

I'm agree with you. This bug comes from 155311.
Comment 18 Eclipse Webmaster CLA 2019-09-06 16:06:11 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.