This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 139251 - API issues
Summary: API issues
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: _ ahimanikya
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2008-07-08 13:45 UTC by Andrei Badea
Modified: 2008-07-09 15:50 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Badea 2008-07-08 13:45:21 UTC
There are a couple of issues in the API exposed by dataview:

- too many exposed packages: net.java.hulp.i18n, org.netbeans.modules.db.dataview.logger should not be exposed
- too many exposed classes: only DataView in org.netbeans.modules.db.dataview.output should be exposed, and the package
should be hidden. 

Please move DataView.java to a dedicated package, like org.netbeans.modules.db.dataview.api.

What is DataView.getVerticalToolBar() good for?

What is setToolbarType() good for? If you need to keep it, please move the int constants to an enum. There is no need to
use integer constants instead of an enum from Java 1.5 on.
Comment 1 Andrei Badea 2008-07-08 13:46:32 UTC
Moreover, are you sure the API should be public? If so, you need to go through an API review. I would rather suggest you
make the API friend for now. That is, you use friend-packages instead of public-packages in project.xml.
Comment 2 _ ahimanikya 2008-07-08 15:48:50 UTC
No classes other than DataView is exposed. 
net.java.hulp.i18n, org.netbeans.modules.db.dataview.logger is hidden now -- >
http://hg.netbeans.org/dbdataview/rev/913c80f32426

We need to DataView.getVerticalToolBar() in ETL editor

It does not have to be public, I just need to know which modules will be declared as friend. ETL and Mashup editor will
be two of them. 
Comment 3 Andrei Badea 2008-07-08 16:05:20 UTC
InsertRecordDialog and ShowSQLDialog are exposed.

It is quite risky to expose a whole package full of implementation classes and then have to ensure all those impl
classes are not public. Please do move DataView to a dedicated o.n.m.dataview.api package.

Regarding the vertical toolbar:

- the name is not a good one, since you only return a list of buttons which doesn't specify the orientation in any way.
Please rename the method to getToolbarButtons().

- there should not be a notion of vertical vs. horizontal toolbar in the API, since it is up to the client to decide how
to display the buttons (if the wants to). Perhaps it would make more sense to have a setToolbarVisible(boolean) method
and drop setToolbarType().

Regarding the friend API: o.n.m.db.core needs to be friend too.
Comment 4 _ ahimanikya 2008-07-09 06:48:34 UTC
Fixed.
http://hg.netbeans.org/dbdataview/rev/347bef1e8ad6
Comment 5 _ ahimanikya 2008-07-09 06:49:40 UTC
All API related issues has been fixed.
Comment 6 _ ahimanikya 2008-07-09 07:19:34 UTC
Also see http://hg.netbeans.org/dbdataview/rev/a11667ed08d0 updated db.core to reflect the API changes
Comment 7 Roman Mostyka 2008-07-09 15:50:28 UTC
Verified with build 080709.