001: /*
002: * @(#)EclipssMetalUtils.java
003: *
004: * Copyright 2002 JIDE Software Inc. All rights reserved.
005: */
006: package com.jidesoft.plaf.eclipse;
007:
008: import com.jidesoft.icons.IconsFactory;
009: import com.jidesoft.icons.JideIconsFactory;
010: import com.jidesoft.plaf.LookAndFeelFactory;
011: import com.jidesoft.plaf.basic.BasicRangeSliderUI;
012: import com.jidesoft.plaf.basic.Painter;
013: import com.jidesoft.swing.JideSwingUtilities;
014: import com.jidesoft.swing.JideTabbedPane;
015:
016: import javax.swing.*;
017: import javax.swing.border.Border;
018: import javax.swing.plaf.BorderUIResource;
019: import javax.swing.plaf.ColorUIResource;
020: import javax.swing.plaf.DimensionUIResource;
021: import javax.swing.plaf.InsetsUIResource;
022: import javax.swing.plaf.basic.BasicBorders;
023: import java.awt.*;
024:
025: /**
026: * Utility Class for WindowsLookAndFeel to add Eclipse related LookAndFeel style
027: */
028: public class EclipseMetalUtils extends EclipseLookAndFeelExtension {
029:
030: /**
031: * Initializes class defaults.
032: *
033: * @param table
034: */
035: public static void initClassDefaults(UIDefaults table) {
036: EclipseLookAndFeelExtension.initClassDefaults(table);
037: }
038:
039: /**
040: * Initializes components defaults.
041: *
042: * @param table
043: */
044: public static void initComponentDefaults(UIDefaults table) {
045: Toolkit toolkit = Toolkit.getDefaultToolkit();
046:
047: Object defaultTextColor = table.get("controlText");
048: Object defaultBackgroundColor = table.get("control");
049: Object defaultHighlightColor = table.get("controlHighlight");
050: Object defaultLtHighlightColor = table
051: .get("controlLtHighlight");
052: Object defaultShadowColor = table.get("controlShadow");
053: Object defaultDarkShadowColor = table.get("controlDkShadow");
054: Object activeTitleTextColor = table.get("activeCaptionText");
055: Object activeTitleBackgroundColor = table.get("activeCaption");
056: Object activeTitleBarGradientColor = table.getColor(
057: "activeCaption").darker();
058: Object activeTitleBorderColor = table.get("controlDkShadow");
059: Object inactiveTitleTextColor = table.get("controlText");
060: Object inactiveTitleBackgroundColor = table.get("control");
061: Object mdiBackgroundColor = table.get("controlShadow");
062: Object selectionBackgroundColor = table
063: .getColor("controlShadow");
064:
065: Object controlFont = JideSwingUtilities.getControlFont(toolkit,
066: table);
067: Object toolbarFont = JideSwingUtilities.getMenuFont(toolkit,
068: table);
069: Object boldFont = JideSwingUtilities
070: .getBoldFont(toolkit, table);
071:
072: Border shadowBorder = BorderFactory.createCompoundBorder(
073: new ShadowBorder(null, null, new Color(171, 168, 165),
074: new Color(143, 141, 138),
075: new Insets(0, 0, 2, 2)), BorderFactory
076: .createLineBorder(Color.gray));
077:
078: Border documentBorder = shadowBorder;
079:
080: Object slidingEastFrameBorder = new FrameBorder(table
081: .getColor("control"), table
082: .getColor("controlLtHighlight"), table
083: .getColor("controlShadow"), table
084: .getColor("controlDkShadow"), new Insets(0, 4, 0, 0));
085:
086: Object slidingWestFrameBorder = new FrameBorder(table
087: .getColor("control"), table
088: .getColor("controlLtHighlight"), table
089: .getColor("controlShadow"), table
090: .getColor("controlDkShadow"), new Insets(0, 0, 0, 4));
091:
092: Object slidingNorthFrameBorder = new FrameBorder(table
093: .getColor("control"), table
094: .getColor("controlLtHighlight"), table
095: .getColor("controlShadow"), table
096: .getColor("controlDkShadow"), new Insets(0, 0, 4, 0));
097:
098: Object slidingSouthFrameBorder = new FrameBorder(table
099: .getColor("control"), table
100: .getColor("controlLtHighlight"), table
101: .getColor("controlShadow"), table
102: .getColor("controlDkShadow"), new Insets(4, 0, 0, 0));
103:
104: Object focusedButtonColor = new ColorUIResource(EclipseUtils
105: .getFocusedButtonColor(table.getColor("textHighlight")));
106:
107: Object selectedAndFocusedButtonColor = new ColorUIResource(
108: EclipseUtils.getSelectedAndFocusedButtonColor(table
109: .getColor("textHighlight")));
110:
111: Object selectedButtonColor = new ColorUIResource(
112: EclipseUtils.getSelectedButtonColor(table
113: .getColor("textHighlight")));
114:
115: Painter gripperPainter = new Painter() {
116: public void paint(JComponent c, Graphics g, Rectangle rect,
117: int orientation, int state) {
118: EclipsePainter.getInstance().paintGripper(c, g, rect,
119: orientation, state);
120: }
121: };
122:
123: Object buttonBorder = new BasicBorders.MarginBorder();
124:
125: ImageIcon sliderHorizontalImage = IconsFactory
126: .getImageIcon(BasicRangeSliderUI.class,
127: "icons/slider_horizontal.gif");
128: ImageIcon sliderVerticalalImage = IconsFactory.getImageIcon(
129: BasicRangeSliderUI.class, "icons/slider_vertical.gif");
130:
131: Object uiDefaults[] = {
132: "JideButton.selectedAndFocusedBackground",
133: selectedAndFocusedButtonColor,
134: "JideButton.focusedBackground",
135: focusedButtonColor,
136: "JideButton.selectedBackground",
137: selectedButtonColor,
138: "JideButton.borderColor",
139: selectionBackgroundColor,
140:
141: "JideButton.font",
142: controlFont,
143: "JideButton.background",
144: defaultBackgroundColor,
145: "JideButton.foreground",
146: defaultTextColor,
147: "JideButton.shadow",
148: defaultShadowColor,
149: "JideButton.darkShadow",
150: defaultDarkShadowColor,
151: "JideButton.light",
152: defaultHighlightColor,
153: "JideButton.highlight",
154: defaultLtHighlightColor,
155: "JideButton.border",
156: buttonBorder,
157: "JideButton.margin",
158: new InsetsUIResource(3, 3, 3, 3),
159: "JideButton.textIconGap",
160: 4,
161: "JideButton.textShiftOffset",
162: 0,
163: "JideButton.focusInputMap",
164: new UIDefaults.LazyInputMap(new Object[] { "SPACE",
165: "pressed", "released SPACE", "released" }),
166:
167: "JideSplitPane.dividerSize",
168: 3,
169: "JideSplitPaneDivider.border",
170: new BorderUIResource(BorderFactory.createEmptyBorder()),
171: "JideSplitPaneDivider.background",
172: defaultBackgroundColor,
173: "JideSplitPaneDivider.gripperPainter",
174: gripperPainter,
175:
176: "JideTabbedPane.defaultTabShape",
177: JideTabbedPane.SHAPE_ECLIPSE,
178: "JideTabbedPane.defaultTabColorTheme",
179: JideTabbedPane.COLOR_THEME_WIN2K,
180:
181: "JideTabbedPane.tabRectPadding",
182: 2,
183: "JideTabbedPane.closeButtonMarginHorizonal",
184: 3,
185: "JideTabbedPane.closeButtonMarginVertical",
186: 3,
187: "JideTabbedPane.textMarginVertical",
188: 4,
189: "JideTabbedPane.noIconMargin",
190: 2,
191: "JideTabbedPane.iconMargin",
192: 5,
193: "JideTabbedPane.textPadding",
194: 6,
195: "JideTabbedPane.buttonSize",
196: 18,
197: "JideTabbedPane.buttonMargin",
198: 5,
199: "JideTabbedPane.fitStyleBoundSize",
200: 8,
201: "JideTabbedPane.fitStyleFirstTabMargin",
202: 4,
203: "JideTabbedPane.fitStyleIconMinWidth",
204: 24,
205: "JideTabbedPane.fitStyleTextMinWidth",
206: 16,
207: "JideTabbedPane.compressedStyleNoIconRectSize",
208: 24,
209: "JideTabbedPane.compressedStyleIconMargin",
210: 12,
211: "JideTabbedPane.compressedStyleCloseButtonMarginHorizontal",
212: 0,
213: "JideTabbedPane.compressedStyleCloseButtonMarginVertical",
214: 0,
215: "JideTabbedPane.fixedStyleRectSize",
216: 60,
217: "JideTabbedPane.closeButtonMargin",
218: 2,
219: "JideTabbedPane.gripLeftMargin",
220: 4,
221: "JideTabbedPane.closeButtonMarginSize",
222: 6,
223: "JideTabbedPane.closeButtonLeftMargin",
224: 2,
225: "JideTabbedPane.closeButtonRightMargin",
226: 2,
227:
228: "JideTabbedPane.defaultTabBorderShadowColor",
229: new ColorUIResource(115, 109, 99),
230:
231: "JideTabbedPane.gripperPainter",
232: gripperPainter,
233: "JideTabbedPane.border",
234: new BorderUIResource(shadowBorder),
235: "JideTabbedPane.background",
236: defaultBackgroundColor,
237: "JideTabbedPane.foreground",
238: defaultTextColor,
239: "JideTabbedPane.light",
240: defaultHighlightColor,
241: "JideTabbedPane.highlight",
242: defaultLtHighlightColor,
243: "JideTabbedPane.shadow",
244: defaultShadowColor,
245: "JideTabbedPane.darkShadow",
246: defaultDarkShadowColor,
247: "JideTabbedPane.tabInsets",
248: new InsetsUIResource(1, 4, 1, 4),
249: "JideTabbedPane.contentBorderInsets",
250: new InsetsUIResource(1, 0, 0, 0),
251: "JideTabbedPane.ignoreContentBorderInsetsIfNoTabs",
252: Boolean.FALSE,
253: "JideTabbedPane.tabAreaInsets",
254: new InsetsUIResource(0, 0, 0, 0),
255: "JideTabbedPane.tabAreaBackground",
256: defaultBackgroundColor,
257: "JideTabbedPane.tabRunOverlay",
258: 2,
259: "JideTabbedPane.font",
260: controlFont,
261: "JideTabbedPane.selectedTabFont",
262: controlFont,
263: "JideTabbedPane.selectedTabTextForeground",
264: activeTitleTextColor,
265: "JideTabbedPane.unselectedTabTextForeground",
266: inactiveTitleTextColor,
267: "JideTabbedPane.selectedTabBackground",
268: defaultBackgroundColor,
269: "JideTabbedPane.textIconGap",
270: 4,
271: "JideTabbedPane.showIconOnTab",
272: Boolean.FALSE,
273: "JideTabbedPane.showCloseButtonOnTab",
274: Boolean.TRUE,
275: "JideTabbedPane.closeButtonAlignment",
276: SwingConstants.TRAILING,
277: "JideTabbedPane.focusInputMap",
278: new UIDefaults.LazyInputMap(new Object[] { "RIGHT",
279: "navigateRight", "KP_RIGHT", "navigateRight",
280: "LEFT", "navigateLeft", "KP_LEFT",
281: "navigateLeft", "UP", "navigateUp", "KP_UP",
282: "navigateUp", "DOWN", "navigateDown",
283: "KP_DOWN", "navigateDown", "ctrl DOWN",
284: "requestFocusForVisibleComponent",
285: "ctrl KP_DOWN",
286: "requestFocusForVisibleComponent", }),
287: "JideTabbedPane.ancestorInputMap",
288: new UIDefaults.LazyInputMap(new Object[] {
289: "ctrl PAGE_DOWN", "navigatePageDown",
290: "ctrl PAGE_UP", "navigatePageUp", "ctrl UP",
291: "requestFocus", "ctrl KP_UP", "requestFocus", }),
292:
293: "Resizable.resizeBorder",
294: new BorderUIResource(shadowBorder),
295:
296: "Gripper.size",
297: 8,
298: "Gripper.size",
299: 8,
300: "Gripper.painter",
301: gripperPainter,
302:
303: "MenuBar.border",
304: new BorderUIResource(BorderFactory.createEmptyBorder(2,
305: 2, 2, 2)),
306: "Icon.floating",
307: Boolean.FALSE,
308:
309: "JideSplitButton.font",
310: controlFont,
311: "JideSplitButton.margin",
312: new InsetsUIResource(3, 3, 3, 7),
313: "JideSplitButton.border",
314: buttonBorder,
315: "JideSplitButton.borderPainted",
316: Boolean.FALSE,
317: "JideSplitButton.textIconGap",
318: 3,
319: "JideSplitButton.selectionBackground",
320: selectionBackgroundColor,
321: "JideSplitButton.selectionForeground",
322: defaultTextColor,
323: "JideSplitButton.focusInputMap",
324: new UIDefaults.LazyInputMap(new Object[] { "SPACE",
325: "pressed", "released SPACE", "released",
326: "DOWN", "downPressed", "released DOWN",
327: "downReleased" }),
328:
329: "RangeSlider.lowerIcon",
330: IconsFactory.getIcon(null, sliderHorizontalImage, 0, 0,
331: 9, 8),
332: "RangeSlider.upperIcon",
333: IconsFactory.getIcon(null, sliderHorizontalImage, 0, 8,
334: 9, 8),
335: "RangeSlider.middleIcon",
336: IconsFactory.getIcon(null, sliderHorizontalImage, 0,
337: 16, 9, 6),
338: "RangeSlider.lowerVIcon",
339: IconsFactory.getIcon(null, sliderVerticalalImage, 0, 0,
340: 8, 9),
341: "RangeSlider.upperVIcon",
342: IconsFactory.getIcon(null, sliderVerticalalImage, 8, 0,
343: 8, 9),
344: "RangeSlider.middleVIcon",
345: IconsFactory.getIcon(null, sliderVerticalalImage, 16,
346: 0, 6, 9),
347:
348: "ButtonPanel.order",
349: "ACO",
350: "ButtonPanel.oppositeOrder",
351: "H",
352: "ButtonPanel.buttonGap",
353: 5,
354: "ButtonPanel.groupGap",
355: 5,
356: "ButtonPanel.minButtonWidth",
357: 57,
358:
359: "Cursor.hsplit",
360: JideIconsFactory
361: .getImageIcon(JideIconsFactory.Cursor.HSPLIT),
362: "Cursor.vsplit",
363: JideIconsFactory
364: .getImageIcon(JideIconsFactory.Cursor.VSPLIT),
365:
366: "Cursor.north",
367: JideIconsFactory
368: .getImageIcon(JideIconsFactory.Cursor.NORTH),
369: "Cursor.south",
370: JideIconsFactory
371: .getImageIcon(JideIconsFactory.Cursor.SOUTH),
372: "Cursor.east",
373: JideIconsFactory
374: .getImageIcon(JideIconsFactory.Cursor.EAST),
375: "Cursor.west",
376: JideIconsFactory
377: .getImageIcon(JideIconsFactory.Cursor.WEST),
378: "Cursor.tab",
379: JideIconsFactory
380: .getImageIcon(JideIconsFactory.Cursor.TAB),
381: "Cursor.float",
382: JideIconsFactory
383: .getImageIcon(JideIconsFactory.Cursor.FLOAT),
384: "Cursor.vertical",
385: JideIconsFactory
386: .getImageIcon(JideIconsFactory.Cursor.VERTICAL),
387: "Cursor.horizontal",
388: JideIconsFactory
389: .getImageIcon(JideIconsFactory.Cursor.HORIZONTAL),
390: "Cursor.delete",
391: JideIconsFactory
392: .getImageIcon(JideIconsFactory.Cursor.DELETE),
393: "Cursor.drag",
394: JideIconsFactory
395: .getImageIcon(JideIconsFactory.Cursor.DROP),
396: "Cursor.dragStop",
397: JideIconsFactory
398: .getImageIcon(JideIconsFactory.Cursor.NODROP),
399: "Cursor.dragText",
400: JideIconsFactory
401: .getImageIcon(JideIconsFactory.Cursor.DROP_TEXT),
402: "Cursor.dragTextStop",
403: JideIconsFactory
404: .getImageIcon(JideIconsFactory.Cursor.NODROP_TEXT),
405:
406: };
407: table.putDefaults(uiDefaults);
408:
409: int products = LookAndFeelFactory.getProductsUsed();
410:
411: if ((products & PRODUCT_DOCK) != 0) {
412: ImageIcon titleButtonImage = IconsFactory.getImageIcon(
413: EclipseMetalUtils.class,
414: "icons/title_buttons_eclipse.gif"); // 16 x 16 x 8
415: final int titleButtonSize = 16;
416:
417: uiDefaults = new Object[] {
418: "Workspace.background",
419: mdiBackgroundColor,
420:
421: "SidePane.margin",
422: new InsetsUIResource(1, 1, 1, 1),
423: "SidePane.iconTextGap",
424: 2,
425: "SidePane.textBorderGap",
426: 13,
427: "SidePane.itemGap",
428: 4,
429: "SidePane.groupGap",
430: 3,
431: "SidePane.foreground",
432: defaultDarkShadowColor,
433: "SidePane.background",
434: defaultBackgroundColor,
435: "SidePane.lineColor",
436: defaultShadowColor,
437: "SidePane.buttonBackground",
438: defaultBackgroundColor,
439: "SidePane.font",
440: controlFont,
441: "SidePane.orientation",
442: 1,
443: "SidePane.showSelectedTabText",
444: Boolean.FALSE,
445: "SidePane.alwaysShowTabText",
446: Boolean.FALSE,
447:
448: "DockableFrame.defaultIcon",
449: JideIconsFactory
450: .getImageIcon(JideIconsFactory.DockableFrame.BLANK),
451: "DockableFrame.background",
452: defaultBackgroundColor,
453: "DockableFrame.border",
454: new BorderUIResource(BorderFactory
455: .createEmptyBorder(0, 0, 0, 0)),
456: "DockableFrame.floatingBorder",
457: new BorderUIResource(BorderFactory
458: .createEmptyBorder(0, 0, 0, 0)),
459: "DockableFrame.slidingEastBorder",
460: slidingEastFrameBorder,
461: "DockableFrame.slidingWestBorder",
462: slidingWestFrameBorder,
463: "DockableFrame.slidingNorthBorder",
464: slidingNorthFrameBorder,
465: "DockableFrame.slidingSouthBorder",
466: slidingSouthFrameBorder,
467:
468: "DockableFrame.activeTitleBackground",
469: activeTitleBackgroundColor,
470: "DockableFrame.activeTitleBackground2",
471: activeTitleBarGradientColor, //EclipseUtils.getLighterColor((Color)windowTitleBackground),
472: "DockableFrame.activeTitleForeground",
473: activeTitleTextColor,
474: "DockableFrame.inactiveTitleBackground",
475: inactiveTitleBackgroundColor,
476: "DockableFrame.inactiveTitleForeground",
477: inactiveTitleTextColor,
478: "DockableFrame.activeTitleBorderColor",
479: activeTitleBorderColor,
480: "DockableFrame.inactiveTitleBorderColor",
481: activeTitleBorderColor,
482: "DockableFrame.titleBorder",
483: new BorderUIResource(BorderFactory
484: .createEmptyBorder(0, 0, 0, 0)),
485: "DockableFrame.font",
486: controlFont,
487:
488: "DockableFrameTitlePane.gripperPainter",
489: gripperPainter,
490: "DockableFrameTitlePane.font",
491: controlFont,
492: "DockableFrameTitlePane.hideIcon",
493: IconsFactory.getIcon(null, titleButtonImage, 0, 0,
494: titleButtonSize, titleButtonSize),
495: "DockableFrameTitlePane.unfloatIcon",
496: IconsFactory.getIcon(null, titleButtonImage, 0,
497: titleButtonSize, titleButtonSize,
498: titleButtonSize),
499: "DockableFrameTitlePane.floatIcon",
500: IconsFactory.getIcon(null, titleButtonImage, 0,
501: 2 * titleButtonSize, titleButtonSize,
502: titleButtonSize),
503: "DockableFrameTitlePane.autohideIcon",
504: IconsFactory.getIcon(null, titleButtonImage, 0,
505: 3 * titleButtonSize, titleButtonSize,
506: titleButtonSize),
507: "DockableFrameTitlePane.stopAutohideIcon",
508: IconsFactory.getIcon(null, titleButtonImage, 0,
509: 4 * titleButtonSize, titleButtonSize,
510: titleButtonSize),
511: "DockableFrameTitlePane.hideAutohideIcon",
512: IconsFactory.getIcon(null, titleButtonImage, 0,
513: 5 * titleButtonSize, titleButtonSize,
514: titleButtonSize),
515: "DockableFrameTitlePane.maximizeIcon",
516: IconsFactory.getIcon(null, titleButtonImage, 0,
517: 6 * titleButtonSize, titleButtonSize,
518: titleButtonSize),
519: "DockableFrameTitlePane.restoreIcon",
520: IconsFactory.getIcon(null, titleButtonImage, 0,
521: 7 * titleButtonSize, titleButtonSize,
522: titleButtonSize),
523: "DockableFrameTitlePane.titleBarComponent",
524: Boolean.TRUE,
525:
526: "DockableFrameTitlePane.alwaysShowAllButtons",
527: Boolean.FALSE, // true if show all three buttons no matter if the buttons is available. false if only show buttons which is available
528: "DockableFrameTitlePane.buttonsAlignment",
529: SwingConstants.TRAILING, // trailing or leading
530: "DockableFrameTitlePane.titleAlignment",
531: SwingConstants.LEADING, // trailing or leading or center
532: "DockableFrameTitlePane.buttonGap",
533: 3, // gap between buttons
534: "DockableFrameTitlePane.showIcon",
535: Boolean.TRUE, // show icon or not, the alignment is the same as titleAlignment
536: "DockableFrameTitlePane.margin",
537: new InsetsUIResource(0, 6, 0, 6), // gap
538:
539: "ContentContainer.background",
540: defaultBackgroundColor,
541: "ContentContainer.vgap",
542: 1,
543: "ContentContainer.hgap",
544: 1,
545: "MainContainer.border",
546: new BorderUIResource(BorderFactory
547: .createEmptyBorder(0, 0, 0, 0)),
548:
549: "DockingFramework.changeCursor", Boolean.TRUE,
550: "Contour.color",
551: new ColorUIResource(136, 136, 136),
552: "Contour.thickness", 2,
553:
554: };
555: table.putDefaults(uiDefaults);
556: }
557:
558: if ((products & PRODUCT_COMPONENTS) != 0) {
559: ImageIcon collapsiblePaneImage = IconsFactory.getImageIcon(
560: EclipseMetalUtils.class,
561: "icons/collapsible_pane_eclipse.gif"); // 11 x 11 x 2
562: final int collapsiblePaneSize = 11;
563:
564: uiDefaults = new Object[] {
565: "CollapsiblePanes.border",
566: new BorderUIResource(BorderFactory
567: .createEmptyBorder(12, 12, 0, 12)),
568: "CollapsiblePanes.gap",
569: 15,
570:
571: "CollapsiblePane.background",
572: defaultBackgroundColor,
573: "CollapsiblePane.contentBackground",
574: defaultHighlightColor,
575: "CollapsiblePane.foreground",
576: defaultTextColor,
577: "CollapsiblePane.emphasizedBackground",
578: activeTitleBackgroundColor,
579: "CollapsiblePane.emphasizedForeground",
580: activeTitleTextColor,
581: "CollapsiblePane.border",
582: new BorderUIResource(BorderFactory
583: .createEmptyBorder(1, 1, 1, 1)),
584: "CollapsiblePane.font",
585: controlFont,
586:
587: "CollapsiblePane.contentBorder",
588: new BorderUIResource(BorderFactory
589: .createEmptyBorder(8, 10, 8, 10)),
590:
591: "CollapsiblePane.titleBorder",
592: new BorderUIResource(BorderFactory
593: .createEmptyBorder(3, 3, 3, 3)),
594: "CollapsiblePane.titleFont",
595: boldFont,
596: "CollapsiblePane.downIcon",
597: IconsFactory
598: .getIcon(null, collapsiblePaneImage, 0, 0,
599: collapsiblePaneSize,
600: collapsiblePaneSize),
601: "CollapsiblePane.upIcon",
602: IconsFactory.getIcon(null, collapsiblePaneImage, 0,
603: collapsiblePaneSize, collapsiblePaneSize,
604: collapsiblePaneSize),
605:
606: "StatusBarItem.border",
607: new BorderUIResource(BorderFactory
608: .createEtchedBorder()),
609:
610: "StatusBar.border",
611: new BorderUIResource(BorderFactory
612: .createEmptyBorder(2, 0, 0, 0)),
613: "StatusBar.margin",
614: new Insets(2, 0, 0, 0),
615: "StatusBar.gap",
616: 3,
617: "StatusBar.background",
618: defaultBackgroundColor,
619: "StatusBar.font",
620: controlFont,
621:
622: "DocumentPane.groupBorder",
623: new BorderUIResource(documentBorder),
624: "DocumentPane.newHorizontalGroupIcon",
625: JideIconsFactory
626: .getImageIcon(JideIconsFactory.WindowMenu.NEW_HORIZONTAL_TAB),
627: "DocumentPane.newVerticalGroupIcon",
628: JideIconsFactory
629: .getImageIcon(JideIconsFactory.WindowMenu.NEW_VERTICAL_TAB),
630: "DocumentPane.boldActiveTab", Boolean.FALSE, };
631: table.putDefaults(uiDefaults);
632: }
633:
634: if ((products & PRODUCT_ACTION) != 0) {
635: uiDefaults = new Object[] {
636: "CommandBar.font",
637: toolbarFont,
638: "CommandBar.background",
639: defaultBackgroundColor,
640: "CommandBar.foreground",
641: defaultTextColor,
642: "CommandBar.shadow",
643: defaultShadowColor,
644: "CommandBar.darkShadow",
645: defaultDarkShadowColor,
646: "CommandBar.light",
647: defaultHighlightColor,
648: "CommandBar.highlight",
649: defaultLtHighlightColor,
650: "CommandBar.border",
651: new BorderUIResource(BorderFactory
652: .createEmptyBorder(2, 1, 2, 1)),
653: "CommandBar.borderVert",
654: new BorderUIResource(BorderFactory
655: .createEmptyBorder(2, 1, 2, 1)),
656: "CommandBar.borderFloating",
657: new BorderUIResource(
658: BorderFactory
659: .createCompoundBorder(
660: BorderFactory
661: .createLineBorder(
662: (Color) activeTitleBackgroundColor,
663: 2),
664: BorderFactory
665: .createEmptyBorder(
666: 1, 1, 1, 1))),
667: "CommandBar.separatorSize",
668: 3,
669: "CommandBar.ancestorInputMap",
670: new UIDefaults.LazyInputMap(new Object[] { "UP",
671: "navigateUp", "KP_UP", "navigateUp",
672: "DOWN", "navigateDown", "KP_DOWN",
673: "navigateDown", "LEFT", "navigateLeft",
674: "KP_LEFT", "navigateLeft", "RIGHT",
675: "navigateRight", "KP_RIGHT",
676: "navigateRight" }),
677: "CommandBar.titleBarSize", 17,
678: "CommandBar.titleBarButtonGap",
679: 1,
680: "CommandBar.titleBarBackground",
681: table.getColor("activeCaption"),
682: "CommandBar.titleBarForeground",
683: table.getColor("activeCaptionText"),
684: "CommandBar.titleBarFont",
685: boldFont,
686: "CommandBar.minimumSize",
687: new DimensionUIResource(20, 20),
688:
689: "CommandBar.separatorSize",
690: new DimensionUIResource(5, 20),
691:
692: // *** Separator
693: "CommandBarSeparator.background",
694: new Color(219, 216, 209),
695: "CommandBarSeparator.foreground",
696: new Color(166, 166, 166),
697:
698: "Chevron.size", 11, "Chevron.alwaysVisible",
699: Boolean.FALSE,
700:
701: };
702: table.putDefaults(uiDefaults);
703: }
704:
705: if ((products & PRODUCT_GRIDS) != 0) {
706: uiDefaults = new Object[] { "AbstractComboBox.useJButton",
707: Boolean.TRUE, "NestedTableHeader.cellBorder",
708: table.getBorder("TableHeader.cellBorder"), };
709: table.putDefaults(uiDefaults);
710: }
711: table.put("Theme.painter", EclipsePainter.getInstance());
712: }
713: }
|