Project: SWT
Bug 105764 org.eclipse.swt.custom.ControlEditor.computeBounds() is package private
Reported: 2005-08-02 06:07:54 | Status: resolved fixed

Suppose I've developed a custom SWT control called Grid, which is an alternative to the Table control. To support in-place cell editing, I would like to also develop a GridEditor, which should be similar in spirit to the existing org.eclipse.swt.custom.TableEditor. My GridEditor should inherit from ControlEditor in order to reuse the code that tracks the scrollbars of the Grid control (which is a Composite, after all). However, I cannot do that, because in my GridEditor class I *have* to override ControlEditor.computeBounds(), which should calculate the bounds of the in- place editing control according to the Grid's notion of cell bounds. It looks like the single method in ControlEditor, computeBounds() which should be protected is package protected instead.. And yes, I know I have the option of not basing my GridEditor on ControlEditor at all, but why is then ControlEditor public at all?

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ControlEditor.java bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableEditor.java bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TableTreeEditor.java bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/TreeEditor.java