| 1 |
/* |
| 2 |
* @(#)VsnetLookAndFeelExtension.java 4/15/2007 |
| 3 |
* |
| 4 |
* Copyright 2002 - 2007 JIDE Software Inc. All rights reserved. |
| 5 |
*/ |
| 6 |
|
| 7 |
package com.jidesoft.plaf.vsnet; |
| 8 |
|
| 9 |
import com.jidesoft.plaf.LookAndFeelFactory; |
| 10 |
import com.jidesoft.plaf.basic.BasicLookAndFeelExtension; |
| 11 |
|
| 12 |
import javax.swing.*; |
| 13 |
import java.beans.Beans; |
| 14 |
|
| 15 |
/** |
| 16 |
* Initialize the uiClassID to BasicComponentUI mapping for JIDE components using Vsnet style. |
| 17 |
*/ |
| 18 |
public class VsnetLookAndFeelExtension extends BasicLookAndFeelExtension { |
| 19 |
|
| 20 |
/** |
| 21 |
* Initializes class defaults with menu components UIDefaults. |
| 22 |
* |
| 23 |
* @param table UIDefaults table |
| 24 |
*/ |
| 25 |
public static void initClassDefaultsWithMenu(UIDefaults table) { |
| 26 |
if (!Beans.isDesignTime()) { |
| 27 |
table.put("PopupMenuSeparatorUI", "com.jidesoft.plaf.vsnet.VsnetPopupMenuSeparatorUI"); |
| 28 |
table.put("MenuUI", "com.jidesoft.plaf.vsnet.VsnetMenuUI"); |
| 29 |
table.put("MenuItemUI", "com.jidesoft.plaf.vsnet.VsnetMenuItemUI"); |
| 30 |
table.put("CheckBoxMenuItemUI", "com.jidesoft.plaf.vsnet.VsnetCheckBoxMenuItemUI"); |
| 31 |
table.put("RadioButtonMenuItemUI", "com.jidesoft.plaf.vsnet.VsnetRadioButtonMenuItemUI"); |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
/** |
| 36 |
* Initializes class defaults. |
| 37 |
* |
| 38 |
* @param table UIDefaults table |
| 39 |
*/ |
| 40 |
public static void initClassDefaults(UIDefaults table) { |
| 41 |
BasicLookAndFeelExtension.initClassDefaults(table); |
| 42 |
|
| 43 |
final String vsnetPackageName = "com.jidesoft.plaf.vsnet."; |
| 44 |
|
| 45 |
// common |
| 46 |
table.put("JideTabbedPaneUI", vsnetPackageName + "VsnetJideTabbedPaneUI"); |
| 47 |
table.put("GripperUI", vsnetPackageName + "VsnetGripperUI"); |
| 48 |
|
| 49 |
int products = LookAndFeelFactory.getProductsUsed(); |
| 50 |
|
| 51 |
if ((products & PRODUCT_DOCK) != 0) { |
| 52 |
// dock |
| 53 |
table.put("SidePaneUI", vsnetPackageName + "VsnetSidePaneUI"); |
| 54 |
table.put("DockableFrameUI", vsnetPackageName + "VsnetDockableFrameUI"); |
| 55 |
} |
| 56 |
|
| 57 |
if ((products & PRODUCT_COMPONENTS) != 0) { |
| 58 |
// components |
| 59 |
table.put("CollapsiblePaneUI", vsnetPackageName + "VsnetCollapsiblePaneUI"); |
| 60 |
} |
| 61 |
} |
| 62 |
} |