Bug 362647 - CCombo: Make fields available for subclasses
Summary: CCombo: Make fields available for subclasses
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2011-11-02 05:26 EDT by Ralph Schuster CLA
Modified: 2019-12-04 08:59 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Schuster CLA 2011-11-02 05:26:07 EDT
Build Identifier: 20110301-1815

The fields "text", "popup" and "arrow" are declared visible for the same package only. This makes it impossible to access information by sub-classes, e.g. for computeSize() fixes.

Reason for requiring this: CCombo is higher than normal text fields which looks ugly on many layouts. CCombo should find it's preferred height according to its text field.


Reproducible: Always

Steps to Reproduce:
1. Try to extend CCombo in another package (fields not accessible / not compilable)
2. Try to extend CCombo in same package and run your personal Demo app (runtime causes SecurityException)
Comment 1 Remy Suen CLA 2011-11-02 08:29:32 EDT
Looks like CCombo is missing a @noextend.
Comment 2 Ralph Schuster CLA 2011-11-02 08:56:18 EDT
(In reply to comment #1)
> Looks like CCombo is missing a @noextend.

I would not constrain CCombo even more. CCombo has some drawbacks (the layout problem in comparison to Combo is just one of it). Is there a reason users shall not subclass it? If so, how should someone then alter some behaviour or fix the computeSize() method?
Comment 3 Felipe Heidrich CLA 2011-11-02 14:52:44 EDT
ccombo is not designed for subclassing,

computeSize should return the smallest size to show the control including content and trim. If you believe the behaviour is broken then it should be fixed in ccombo and not in a subclass...
Comment 4 Joachim Fuchs CLA 2013-10-07 04:34:31 EDT
computeSize() seems ask its private child list which happens to be disposed. How can that be?

...
org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:4361)
	at org.eclipse.swt.SWT.error(SWT.java:4276)
	at org.eclipse.swt.SWT.error(SWT.java:4247)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:468)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:340)
	at org.eclipse.swt.widgets.List.getItems(List.java:492)
	at org.eclipse.swt.custom.CCombo.computeSize(CCombo.java:432)
...
Comment 5 Lars Vogel CLA 2019-11-27 07:04:03 EST
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.

If the bug is still relevant, please remove the stalebug whiteboard tag.
Comment 6 Manuel Steurer CLA 2019-12-04 07:19:50 EST
Still relevant for me, I want to access the CCombo field "Button arrow" to have a bigger arrow for big-font scenarios.
I'm doing this via reflection since CCombo still has that field package-private.
(I lack privileges to remove the "stalebug" tag.)