Custom style for JideTabbedPane

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.

Custom style for JideTabbedPane

Postby jblumenkrantz » Mon Jun 23, 2008 1:19 pm

I'm trying to customize the colors used in my JideTabbedPane, and I'm getting nowhere with setting the UIDefaults. I'm setting JIDE up during initalization with the following:

Code: Select all
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());        LookAndFeelFactory.installJideExtension(LookAndFeelFactory.VSNET_STYLE_WITHOUT_MENU);


and creating my JideTabbedPane as such:
Code: Select all
        _tabs = new JideTabbedPane();
        _tabs.setContentBorderInsets(new Insets(0, 0, 0, 0));
        _tabs.setUseDefaultShowCloseButtonOnTab(false);
        _tabs.setShowCloseButton(true);
        _tabs.setShowCloseButtonOnTab(true);
        _tabs.setShowTabButtons(true);
        _tabs.setBoldActiveTab(true);
        _tabs.setTabResizeMode(JideTabbedPane.RESIZE_MODE_NONE);
        _tabs.setHideOneTab(false);
        _tabs.setTabEditingAllowed(false);
        _tabs.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));       
        _tabs.setTabShape(JideTabbedPane.SHAPE_ROUNDED_VSNET);
        _tabs.setColorTheme(JideTabbedPane.COLOR_THEME_VSNET);
        _contentPanel.add(_tabs, BorderLayout.CENTER);


I've attempted using UIManager.put("JideTabbedPane,background", Color.red), as well as using LookAndFeelFactory.addUIDefaultsCustomizer to set up the UIDefaults. It looks like the tab shape and color theme are taking precedence over the UIDefaults. So I attempted the following, which had no effect:

Code: Select all
     _tabs.setUI(new VsnetJideTabbedPaneUI() {
            protected void installBackgroundColor() {
                super.installBackgroundColor();
                super._backgroundSelectedColorStart = Color.black;
                super._backgroundSelectedColorEnd = Color.blue;
                super._backgroundUnselectedColorStart = Color.white;
                super._backgroundUnselectedColorEnd= Color.red;
                super._tabBackground = Color.green;
            }
    }


What's the proper way to do this color customization?
Thanks in advance,
Jason
jblumenkrantz
 
Posts: 2
Joined: Fri Jan 02, 2004 12:01 pm

Postby JIDE Support » Mon Jun 23, 2008 1:54 pm

JideTabbedPane is not very consistent in using the UIDefault since it has to support so many different styles and tab shapes. The fastset is probably to take a look at BasicJideTabbedPane source code from open source JCL and put a breakpoint at various paintXxx methods and see what color it uses.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Postby jblumenkrantz » Mon Jun 23, 2008 2:15 pm

JIDE Support wrote:JideTabbedPane is not very consistent in using the UIDefault since it has to support so many different styles and tab shapes. The fastset is probably to take a look at BasicJideTabbedPane source code from open source JCL and put a breakpoint at various paintXxx methods and see what color it uses.


I'll give that a shot, but should it work if I go the setUI() route with my own subclass of BasicJideTabbedPaneUI in order to circumvent the lookups altogether? If that's feasible what's the best way to get the UI in place?
Thanks again,
Jason
jblumenkrantz
 
Posts: 2
Joined: Fri Jan 02, 2004 12:01 pm

Postby JIDE Support » Mon Jun 23, 2008 4:32 pm

Probably register it with your UI class name with UIDefault "JideTabbedPaneUI".

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


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

Who is online

Users browsing this forum: No registered users and 60 guests