Bug 213188 - [API] [cdt.ui] FileListControl's BROWSE_NONE,_FILE,_DIR etc constants are private
Summary: [API] [cdt.ui] FileListControl's BROWSE_NONE,_FILE,_DIR etc constants are pri...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 4.0.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 285033 294319
  Show dependency tree
 
Reported: 2007-12-17 11:01 EST by Andras Varga CLA
Modified: 2020-09-04 15:24 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andras Varga CLA 2007-12-17 11:01:35 EST
Build ID: M20070921-1145

The (public) constructor of FileListControl expects an "int type" argument which is supposed to be one of BROWSE_NONE, BROWSE_FILE, BROWSE_DIR in the same class, but these constants are *private*. Can you please change them to public, so that the class can be used as intended.

Also, the constructor sets a GridData(FILL_BOTH) on the internally created Composite (filePanel), which is not good for me. I need GridData(...,true,false) in my dialog, but I cannot overwrite it because there's no getter for the composite. (I can get to it as getListControl().getParent(), but that hurts encapsulation). I don't see why FileControlList forces a particular LayoutData on me -- it should be none of its business what layout I use in the dialog.

Since this class basically implements a compound widget, I would expect it to *subclass* from composite (as opposed to *contain* a Composite). Then the above would just get fixed by itself.
Comment 1 Andras Varga CLA 2007-12-17 16:36:07 EST
Just realized that adding "extends Composite", and replacing "filePanel" with "this" would painlessly resolve the problem of missing getter for filePanel, and be completely invisible for clients of this class. Why not go for it?

New problems: all non-public methods (and all data members as well) are *private*,   making it impossible to customize anything on it. I just wanted to refine the labels in the "Add" dialog, but addPressed()/getNewInputObject() are also private. Could you please make all methods *protected*? Possibly data members too? Thanks...