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 103361 - New functionality in org.netbeans.swing.tabcontrol breaks existing module
Summary: New functionality in org.netbeans.swing.tabcontrol breaks existing module
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords:
: 108841 (view as bug list)
Depends on: 109402
Blocks: 104342
  Show dependency tree
 
Reported: 2007-05-05 04:45 UTC by kirillcool
Modified: 2008-12-22 12:11 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
changes in substance laf module (107.20 KB, patch)
2007-07-11 12:39 UTC, Stanislav Aubrecht
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kirillcool 2007-05-05 04:45:57 UTC
The newly added abstract method in TabDisplayerUI - getButtonIcon(int, int)
breaks the Substance NB module. This happens since the existing UI delegates for
tab displayers no longer compile.

In addition, there are way too many package-protected classes in the
org.netbeans.swing.tabcontrol.plaf package (such as TabControlButton and
TabControlButtonFactory) to make proper extension impossible.
Comment 1 David Simonek 2007-05-09 10:00:32 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 :-(
Comment 2 _ tboudreau 2007-05-18 07:37:10 UTC
If there's something simple we can do here, we should do it.  TabDisplayerUI2?
Comment 3 Stanislav Aubrecht 2007-06-19 11:28:58 UTC
TabDisplayerUI2 would be nice but there are no resource for it in 6.0 time frame.
kirillcool, pls feel free to contribute a patch...
Comment 4 Stanislav Aubrecht 2007-06-26 15:04:31 UTC
would it help if i added a default implementation of getButtonIcon method to the TabDisplayerUI class (returning a
zero-sized icon)?
Comment 5 kirillcool 2007-06-26 16:45:39 UTC
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.
Comment 6 Stanislav Aubrecht 2007-06-26 17:00:56 UTC
> 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... 
Comment 7 kirillcool 2007-06-26 17:05:36 UTC
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
Comment 8 Stanislav Aubrecht 2007-06-26 17:21:05 UTC
you're right. so i suppose that fixing the binary incompatibility as i suggested above won't help you, will it?
Comment 9 kirillcool 2007-06-26 18:16:11 UTC
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
Comment 10 Stanislav Aubrecht 2007-07-04 14:36:21 UTC
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

Comment 11 Antonin Nebuzelsky 2007-07-04 17:21:15 UTC
Kirill, can you confirm if the fix introduced by Standa works for you? Thanks.
Comment 12 kirillcool 2007-07-05 02:13:14 UTC
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
Comment 13 Jan Chalupa 2007-07-09 08:37:10 UTC
*** Issue 108841 has been marked as a duplicate of this issue. ***
Comment 14 Antonin Nebuzelsky 2007-07-09 12:47:38 UTC
> 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?
Comment 15 kirillcool 2007-07-10 06:36:45 UTC
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?
Comment 16 Stanislav Aubrecht 2007-07-10 12:04:51 UTC
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
Comment 17 kirillcool 2007-07-10 16:16:36 UTC
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
Comment 18 Stanislav Aubrecht 2007-07-11 12:38:05 UTC
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...
Comment 19 Stanislav Aubrecht 2007-07-11 12:39:04 UTC
Created attachment 44937 [details]
changes in substance laf module
Comment 20 kirillcool 2007-07-11 17:19:27 UTC
Thanks.

I'll apply these changes. It still won't build until the "Tab Control" is made public, correct?

Kirill
Comment 21 Stanislav Aubrecht 2007-07-24 12:16:32 UTC
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
Comment 22 kirillcool 2007-07-24 16:29:40 UTC
Which daily 6.0 build can i try?

Thanks
Kirill
Comment 23 Stanislav Aubrecht 2007-07-24 16:38:49 UTC
> Which daily 6.0 build can i try?
tomorrow's (25.7.) should be fine i suppose
Comment 24 kirillcool 2007-07-28 23:23:23 UTC
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