01: /*
02: * @(#)VsnetLookAndFeelExtension.java 4/15/2007
03: *
04: * Copyright 2002 - 2007 JIDE Software Inc. All rights reserved.
05: */
06:
07: package com.jidesoft.plaf.vsnet;
08:
09: 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
19: BasicLookAndFeelExtension {
20:
21: /**
22: * Initializes class defaults with menu components UIDefaults.
23: *
24: * @param table UIDefaults table
25: */
26: public static void initClassDefaultsWithMenu(UIDefaults table) {
27: if (!Beans.isDesignTime()) {
28: table
29: .put("PopupMenuSeparatorUI",
30: "com.jidesoft.plaf.vsnet.VsnetPopupMenuSeparatorUI");
31: table.put("MenuUI", "com.jidesoft.plaf.vsnet.VsnetMenuUI");
32: table.put("MenuItemUI",
33: "com.jidesoft.plaf.vsnet.VsnetMenuItemUI");
34: table.put("CheckBoxMenuItemUI",
35: "com.jidesoft.plaf.vsnet.VsnetCheckBoxMenuItemUI");
36: table
37: .put("RadioButtonMenuItemUI",
38: "com.jidesoft.plaf.vsnet.VsnetRadioButtonMenuItemUI");
39: }
40: }
41:
42: /**
43: * Initializes class defaults.
44: *
45: * @param table UIDefaults table
46: */
47: public static void initClassDefaults(UIDefaults table) {
48: BasicLookAndFeelExtension.initClassDefaults(table);
49:
50: final String vsnetPackageName = "com.jidesoft.plaf.vsnet.";
51:
52: // common
53: table.put("JideTabbedPaneUI", vsnetPackageName
54: + "VsnetJideTabbedPaneUI");
55: table.put("GripperUI", vsnetPackageName + "VsnetGripperUI");
56:
57: int products = LookAndFeelFactory.getProductsUsed();
58:
59: if ((products & PRODUCT_DOCK) != 0) {
60: // dock
61: table.put("SidePaneUI", vsnetPackageName
62: + "VsnetSidePaneUI");
63: table.put("DockableFrameUI", vsnetPackageName
64: + "VsnetDockableFrameUI");
65: }
66:
67: if ((products & PRODUCT_COMPONENTS) != 0) {
68: // components
69: table.put("CollapsiblePaneUI", vsnetPackageName
70: + "VsnetCollapsiblePaneUI");
71: table.put("StatusBarSeparatorUI", vsnetPackageName
72: + "VsnetStatusBarSeparatorUI");
73: }
74:
75: if ((products & PRODUCT_ACTION) != 0) {
76: // action
77: table.put("CommandBarUI", vsnetPackageName
78: + "VsnetCommandBarUI");
79: table.put("CommandBarSeparatorUI", vsnetPackageName
80: + "VsnetCommandBarSeparatorUI");
81: table.put("ChevronUI", vsnetPackageName + "VsnetChevronUI");
82: }
83: }
84: }
|