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.
Summary: | New functionality in org.netbeans.swing.tabcontrol breaks existing module | ||
---|---|---|---|
Product: | platform | Reporter: | kirillcool <kirillcool> |
Component: | Window System | Assignee: | Stanislav Aubrecht <saubrecht> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | anebuzelsky, dsimonek, err |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | 109402 | ||
Bug Blocks: | 104342 | ||
Attachments: | changes in substance laf module |
Description
kirillcool
2007-05-05 04:45:57 UTC
Passing to Standa... I think plaf package is only friend API, not public one, so as you said making extension is hard. I can't speak for original developer, but it seems to me that code in tabcontrol was never meant to support 3rd party extensions :-( If there's something simple we can do here, we should do it. TabDisplayerUI2? TabDisplayerUI2 would be nice but there are no resource for it in 6.0 time frame. kirillcool, pls feel free to contribute a patch... would it help if i added a default implementation of getButtonIcon method to the TabDisplayerUI class (returning a zero-sized icon)? What is this method used for and where is it used? If it is used for computing the actual icons displayed on the tabs (close and collapse), then returning null would result those icons missing at runtime. The real solution to this would be to make the classes in that package public (instead of package-protected) so that i will have to extend the Basic implementation instead of copying pretty much the entire package to my module. This is how it is done with the core Swing UI delegates - you almost never see custom LAFs implementing the *UI interface. They extend Basic or Metal and just add the "delta" functionality. > What is this method used for and where is it used? If it is used for computing the actual icons displayed on the tabs > (close and collapse), then returning null would result those icons missing at runtime. i wrote 'zero-sized' icon, not null. > The real solution to this would be to make the classes in that package public (instead of package-protected) so that i > will have to extend the Basic implementation instead of copying pretty much the entire package to my module. you can override method getControlButtons() in AbstractViewTabDisplayerUI and in BasicScrollingTabDisplayerUI classes respectively (they're all public) and implement the buttons in any way you like it... Please read my comments on bug 66335 on why it's not possible to extend AbstractViewTabDisplayerUI. My question about the icons still stands - if you provide a default implementation that returns an empty icon, what will happen at runtime? The tabs will not have icons for the close and collapse areas, correct? If so, i'd still need to provide my own implementation of that method, which includes copying yet more code from that package. Thanks Kirill you're right. so i suppose that fixing the binary incompatibility as i suggested above won't help you, will it? I guess not. What i would really want to see (and this brings me back to 66335) is making the classes in that package public. This way i can get rid of about 80% of the code in my module, and the updates will be much less painful. Thanks Kirill i added default implementation of getButtonIcon in TabDisplayerUI class (using metal icon set) and i also made TabControlButtonFactory and TabControlButton classes public. Checking in TabDisplayerUI.java; /cvs/core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/TabDisplayerUI.java,v <-- TabDisplayerUI.java new revision: 1.11; previous revision: 1.10 done Checking in plaf/TabControlButtonFactory.java; /cvs/core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/TabControlButtonFactory.java,v <-- TabControlButtonFactory.java new revision: 1.7; previous revision: 1.6 done Checking in plaf/TabControlButton.java; /cvs/core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/TabControlButton.java,v <-- TabControlButton.java new revision: 1.3; previous revision: 1.2 done Kirill, can you confirm if the fix introduced by Standa works for you? Thanks. When i install the latest daily build of 6.0 from http://bits.netbeans.org/download/6.0/nightly/200707031200/ , i get the following message when trying to build Substance module (in NB 6.0 daily): C:\Tools\NetBeans 6.0 200707031200\harness\build.xml:74: The module org.jvnet.substance.netbeans is not a friend of C:\Tools\NetBeans 6.0 200707031200\platform7\modules\org-netbeans-swing-tabcontrol.jar In addition, i don't see the "Tab Control" module in the list of available modules - has it been made internal? And if i just install this module into NB 6.0 daily, i get this exception when minimizing a tab: java.lang.NoClassDefFoundError: org/netbeans/swing/tabcontrol/SlidingButtonUI *** Issue 108841 has been marked as a duplicate of this issue. *** > When i install the latest daily build of 6.0 from .../200707031200/
The fixes were introduced on July/4. Can you retest with a newer build, please?
Exactly same runtime and compile problems with the latest 20070709: Created dir: C:\jprojects\substance-netbeans\build\public-package-jars Distilling C:\jprojects\substance-netbeans\build\public-package-jars\org-jdesktop-layout.jar from [C:\Tools\NetBeans 6.0 200707091200\platform7\modules\org-jdesktop-layout.jar, C:\Tools\NetBeans 6.0 200707091200\platform7\modules\ext\swing-layout-1.0.2.jar] Distilling C:\jprojects\substance-netbeans\build\public-package-jars\org-netbeans-swing-plaf.jar from [C:\Tools\NetBeans 6.0 200707091200\platform7\modules\org-netbeans-swing-plaf.jar] C:\Tools\NetBeans 6.0 200707091200\harness\build.xml:74: The module org.jvnet.substance.netbeans is not a friend of C:\Tools\NetBeans 6.0 200707091200\platform7\modules\org-netbeans-swing-tabcontrol.jar Has the "Tab Control" module been hidden along the way? core/swing/tabcontrol module has been switched to friend api only as a part of tab control redesign in october last year. those changes were not committed to nb 5.5 though. we (core team) are now discussing whether to keep it this way and add substance to friend list or switch back to public api. anyway, there are still some problems in substance ui as it uses deprecated methods. i'll try going through its source code and see what changes are needed to make it work in 6.0 Thanks for looking into this. This is certainly not specific to Substance. Napkin also has a module for NetBeans [1], and other LAFs (such as Nimbus) might express their intent to provide UI delegates for NB (or only for RCP applications) as well. Kirill [1] http://napkinlaf.sourceforge.net/netbeans/updates.xml we'll switch tab control api back to public (after a fast track api review) i also went through the substance laf module code and made some changes to make it work in 6.0 (after the api is back to public), diff attached. i mostly removed some unused code... Created attachment 44937 [details]
changes in substance laf module
Thanks. I'll apply these changes. It still won't build until the "Tab Control" is made public, correct? Kirill done Checking in nbbuild/build.properties; /cvs/nbbuild/build.properties,v <-- build.properties new revision: 1.529; previous revision: 1.528 done Checking in core/swing/tabcontrol/nbproject/project.xml; /cvs/core/swing/tabcontrol/nbproject/project.xml,v <-- project.xml new revision: 1.15; previous revision: 1.14 done Checking in core/swing/tabcontrol/manifest.mf; /cvs/core/swing/tabcontrol/manifest.mf,v <-- manifest.mf new revision: 1.12; previous revision: 1.11 done Checking in core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/TabDisplayerUI.java; /cvs/core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/TabDisplayerUI.java,v <-- TabDisplayerUI.java new revision: 1.13; previous revision: 1.12 done Checking in core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/TabControlButtonFactory.java; /cvs/core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/TabControlButtonFactory.java,v <-- TabControlButtonFactory.java new revision: 1.9; previous revision: 1.8 done Checking in core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/AbstractViewTabDisplayerUI.java; /cvs/core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/AbstractViewTabDisplayerUI.java,v <-- AbstractViewTabDisplayerUI.java new revision: 1.36; previous revision: 1.35 done Checking in core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/TabControlButton.java; /cvs/core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/TabControlButton.java,v <-- TabControlButton.java new revision: 1.5; previous revision: 1.4 done Checking in core/swing/tabcontrol/api/doc/changes/changes.xml; /cvs/core/swing/tabcontrol/api/doc/changes/changes.xml,v <-- changes.xml new revision: 1.7; previous revision: 1.6 done Which daily 6.0 build can i try? Thanks Kirill > Which daily 6.0 build can i try?
tomorrow's (25.7.) should be fine i suppose
Thanks for the fixes and the patch. You can see [1] and [2] for the announcements on my blogs. One thing that is still not consistent (and that worked in previous release) is the appearance of the scroller buttons on tabs. I'll go through the patch code to see if this has been inadvertently removed. Kirill [1] http://weblogs.java.net/blog/kirillcool/archive/2007/07/substance_modul_1.html [2] http://www.pushing-pixels.org/?p=71 |