Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334786 - TableCombo drop down height problems
Summary: TableCombo drop down height problems
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Marty Jones CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-19 09:15 EST by Andreas Ehret CLA
Modified: 2021-07-05 11:40 EDT (History)
1 user (show)

See Also:


Attachments
Path that fixes TableCombo drop down height problem (1.43 KB, patch)
2011-01-19 09:32 EST, Andreas Ehret CLA
wim.jongman: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Ehret CLA 2011-01-19 09:15:14 EST
Build Identifier: 20100617-1415

If I create a TableCombo with a number of items less or equals the visibleItemCount, the height of the drop down part of the combo is not correct, but too small, which leads to a unneccessary scroll bar. In case of having only a single item, its even not possible to select the item at all using the mouse, as the height of the drop down area seems to be zero. 

I found the problem in the dropDown(boolean drop) method where the itemCount is computed. For some reason the itemCount is decremented by 1 in cases where the item count is smaller than the visibleItemCount. If I remove the -1 in the line

itemCount = (itemCount == 0) ? visibleItemCount : Math.min(visibleItemCount, itemCount) - 1;

that seems to solve this problem. There is, however, still an empty row at the end, which appears to me the space for the horizontal scroll bar. In my case no scroll bar is required as the combo item is smaller that the combo itself, so code like the following solves this issue:

if (itemCount <= visibleItemCount) {
   if (table.getHorizontalBar() != null && !table.getHorizontalBar().isVisible()) {
      itemHeight -= table.getHorizontalBar().getSize().y;
   }
}

Reproducible: Always

Steps to Reproduce:
1. create a TableCombo snippet (don't modify the visibleItemCount which is 7 by default) 
2. fill the combo with a single item
3. run the snippet and try to select the item using the mouse
Comment 1 Andreas Ehret CLA 2011-01-19 09:32:58 EST
Created attachment 187106 [details]
Path that fixes TableCombo drop down height problem
Comment 2 Wim Jongman CLA 2012-02-28 19:33:56 EST
ping

http://www.eclipse.org/forums/index.php/t/284010/
Comment 3 Marty Jones CLA 2012-03-04 16:51:36 EST
Sorry for the delay.  I have been out of town for the past week.  I will take a look at this in the next day or so.

Marty
Comment 4 Marty Jones CLA 2012-03-08 08:41:50 EST
Update:

I have verified that the patch fixes the issue on Windows 7.  I am going to test on windows xp and vista and then I will apply the patch to git.

Thanks Andreas for the patch.  I will let you know once it has been applied to source.

Marty
Comment 5 Marty Jones CLA 2012-03-09 13:51:49 EST
I have pushed the patch up to the remote git repository.

Thanks Andreas for the patch.

Marty