JideTabbedPane#setTabComponentAt does not work

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

JideTabbedPane#setTabComponentAt does not work

Postby stephane.demurget » Wed Apr 08, 2009 6:49 am

Hi,

Java 6 introduced the JTabbedPane#setTabComponentAt API to set a custom component in a tab title, but this is not supported by Jide-OSS (it does not crash, just does nothing).

On the Jide-OSS page http://www.jidesoft.com/products/oss.htm, I read: "Bug reports: We will have dedicated resource to work on the bugs based on the priority we decide. We also accept bug fixes from the community after reviewed by our staff."

But that does not point me to where to the bug tracker. Is it still the one at java.net (https://jide-oss.dev.java.net/servlets/ProjectIssues)?

Here's a sample that does not do what it's supposed to do. If you replace new JideTabbedPane() by new JTabbedPane(), it works like a charm.

Code: Select all
public class JideTabbedPaneTabComponentAt {
   public static void main(String[] args) {
      JTabbedPane tabbedPane = new JideTabbedPane();
      tabbedPane.addTab("First Page", new JTextArea(10, 60));
      tabbedPane.addTab("Second One", new JTextArea(10, 60));
      tabbedPane.setTabComponentAt(0, new JTextField("Fu!"));

      JFrame frame = new JFrame("Crash Demo");
      frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
      frame.add(tabbedPane);
      frame.pack();
      frame.setVisible(true);
   }
}


thanks for the wonderful library :D

--Stéphane
stephane.demurget
 
Posts: 4
Joined: Thu Nov 27, 2008 2:03 am

Re: JideTabbedPane#setTabComponentAt does not work

Postby JIDE Support » Wed Apr 08, 2009 9:23 am

Thanks for the report. We will get it work like JTabbedPane in next release.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37266
Joined: Sun Sep 14, 2003 10:49 am

Re: JideTabbedPane#setTabComponentAt does not work

Postby JIDE Support » Wed Apr 08, 2009 2:00 pm

After deelply looking into it, I'm afraid we cannot make it happen in near future. Because JTabbedPane make all related method and field private and we have no easy way to reuse this feature.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37266
Joined: Sun Sep 14, 2003 10:49 am

Re: JideTabbedPane#setTabComponentAt does not work

Postby stephane.demurget » Wed Apr 08, 2009 11:57 pm

JIDE Support wrote:After deelply looking into it, I'm afraid we cannot make it happen in near future. Because JTabbedPane make all related method and field private and we have no easy way to reuse this feature.

Thanks,


If you're talking about the inner Page class, it has always been private data and all the rest of its contents is already supported by JideTabbedPane.
Aren't get/setTabComponentAt + the "indexForTabComponent" property enough to implement it? What kind of additional private data do you need?
stephane.demurget
 
Posts: 4
Joined: Thu Nov 27, 2008 2:03 am

Re: JideTabbedPane#setTabComponentAt does not work

Postby JIDE Support » Thu Apr 09, 2009 8:35 am

Well, we did try the property approach. I believe you must have something we didn't realize yet. Since it's an open source project, you are very welcome to distribute your code there.

https://jide-oss.dev.java.net/

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37266
Joined: Sun Sep 14, 2003 10:49 am

Re: JideTabbedPane#setTabComponentAt does not work

Postby stephane.demurget » Thu Apr 09, 2009 8:44 am

JIDE Support wrote:Well, we did try the property approach. I believe you must have something we didn't realize yet. Since it's an open source project, you are very welcome to distribute your code there.

https://jide-oss.dev.java.net/

Thanks,


Actually no, I've got nothing, I've just checked how it is done and I did not find anything wrong at first glance.
I'm very inclined to contribute a patch but I need to understand what were the technical issues you encountered, hence my original question, "were you talking about the Page private fields?"

I just meant this new property is available like all the others before.
stephane.demurget
 
Posts: 4
Joined: Thu Nov 27, 2008 2:03 am

Re: JideTabbedPane#setTabComponentAt does not work

Postby JIDE Support » Thu Apr 09, 2009 8:52 am

You probably noticed that BasicJideTabbedPaneUI doesn't extend BasicTabbedPaneUI. We did that because we can't access a lot of private fields and methods in BasicTabbedPaneUI. To add all the features we wanted, we had to rewrite the whole implementation of BasicTabbedPaneUI. One of the obvious cons with this approach is when JDK adds features to BasicTabbedPaneUI, we will have to re-implement them in BasicJideTabbedPaneUI. It is not technically impossible, just a lot of work and right now we just don't have the resource to do it. So if you are willing to contribute, it would be great.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37266
Joined: Sun Sep 14, 2003 10:49 am

Re: JideTabbedPane#setTabComponentAt does not work

Postby stephane.demurget » Thu Apr 09, 2009 11:29 pm

JIDE Support wrote:You probably noticed that BasicJideTabbedPaneUI doesn't extend BasicTabbedPaneUI. We did that because we can't access a lot of private fields and methods in BasicTabbedPaneUI. To add all the features we wanted, we had to rewrite the whole implementation of BasicTabbedPaneUI. One of the obvious cons with this approach is when JDK adds features to BasicTabbedPaneUI, we will have to re-implement them in BasicJideTabbedPaneUI. It is not technically impossible, just a lot of work and right now we just don't have the resource to do it. So if you are willing to contribute, it would be great.

Thanks,


Understood. Our team needs that and I'm working for a non-FOSS company so I'll ask my boss. If that's not possible I'll consider doing it in the real OSS way :wink:
stephane.demurget
 
Posts: 4
Joined: Thu Nov 27, 2008 2:03 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 4 guests

cron