01: /*
02: * @(#)EclipseLookAndFeelExtension.java 4/15/2007
03: *
04: * Copyright 2002 - 2007 JIDE Software Inc. All rights reserved.
05: */
06:
07: package com.jidesoft.plaf.eclipse;
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: * Utility Class for WindowsLookAndFeel to add Eclipse related LookAndFeel style
17: */
18: public class EclipseLookAndFeelExtension extends
19: BasicLookAndFeelExtension {
20:
21: /**
22: * Initializes class defaults with menu components UIDefaults.
23: *
24: * @param table
25: */
26: public static void initClassDefaultsWithMenu(UIDefaults table) {
27: if (!Beans.isDesignTime()) {
28: table
29: .put("PopupMenuSeparatorUI",
30: "com.jidesoft.plaf.eclipse.EclipsePopupMenuSeparatorUI");
31: table
32: .put("SeparatorUI",
33: "com.jidesoft.plaf.eclipse.EclipsePopupMenuSeparatorUI");
34: table.put("MenuUI",
35: "com.jidesoft.plaf.eclipse.EclipseMenuUI");
36: table.put("MenuItemUI",
37: "com.jidesoft.plaf.eclipse.EclipseMenuItemUI");
38: table
39: .put("CheckBoxMenuItemUI",
40: "com.jidesoft.plaf.eclipse.EclipseCheckBoxMenuItemUI");
41: table
42: .put("RadioButtonMenuItemUI",
43: "com.jidesoft.plaf.eclipse.EclipseRadioButtonMenuItemUI");
44: }
45: }
46:
47: /**
48: * Initializes class defaults.
49: *
50: * @param table
51: */
52: public static void initClassDefaults(UIDefaults table) {
53: BasicLookAndFeelExtension.initClassDefaults(table);
54:
55: final String eclipsePackageName = "com.jidesoft.plaf.eclipse.";
56:
57: int products = LookAndFeelFactory.getProductsUsed();
58:
59: table.put("JideTabbedPaneUI", eclipsePackageName
60: + "EclipseJideTabbedPaneUI");
61: table.put("JideSplitButtonUI", eclipsePackageName
62: + "EclipseJideSplitButtonUI");
63: table.put("GripperUI", eclipsePackageName + "EclipseGripperUI");
64:
65: if ((products & PRODUCT_DOCK) != 0) {
66: table.put("SidePaneUI", eclipsePackageName
67: + "EclipseSidePaneUI");
68: table.put("DockableFrameUI", eclipsePackageName
69: + "EclipseDockableFrameUI");
70: }
71:
72: if ((products & PRODUCT_COMPONENTS) != 0) {
73: table.put("CollapsiblePaneUI", eclipsePackageName
74: + "EclipseCollapsiblePaneUI");
75: }
76:
77: if ((products & PRODUCT_ACTION) != 0) {
78: table.put("CommandBarUI", eclipsePackageName
79: + "EclipseCommandBarUI");
80: table.put("CommandBarSeparatorUI", eclipsePackageName
81: + "EclipseCommandBarSeparatorUI");
82: table.put("ChevronUI",
83: "com.jidesoft.plaf.vsnet.VsnetChevronUI");
84: }
85: }
86: }
|