001: package org.uispec4j.interception.ui;
002:
003: import javax.swing.*;
004: import java.util.Enumeration;
005: import java.util.Iterator;
006: import java.util.Set;
007: import java.util.TreeSet;
008:
009: public class UISpecLF {
010: public static void init() {
011: UIManager.put("ButtonUI", UISpecButtonUI.class.getName());
012: UIManager.put("CheckBoxMenuItemUI",
013: UISpecCheckBoxMenuItemUI.class.getName());
014: UIManager.put("CheckBoxUI", UISpecCheckBoxUI.class.getName());
015: UIManager.put("ColorChooserUI", UISpecColorChooserUI.class
016: .getName());
017: UIManager.put("ComboBoxUI", UISpecComboBoxUI.class.getName());
018: UIManager.put("DesktopIconUI", UISpecDesktopIconUI.class
019: .getName());
020: UIManager.put("DesktopPaneUI", UISpecDesktopPaneUI.class
021: .getName());
022: UIManager.put("EditorPaneUI", UISpecEditorPaneUI.class
023: .getName());
024: UIManager.put("FileChooserUI", UISpecFileChooserUI.class
025: .getName());
026: UIManager.put("FormattedTextFieldUI",
027: UISpecFormattedTextFieldUI.class.getName());
028: UIManager.put("InternalFrameUI", UISpecInternalFrameUI.class
029: .getName());
030: UIManager.put("LabelUI", UISpecLabelUI.class.getName());
031: UIManager.put("ListUI", UISpecListUI.class.getName());
032: UIManager.put("MenuBarUI", UISpecMenuBarUI.class.getName());
033: UIManager.put("MenuItemUI", UISpecMenuItemUI.class.getName());
034: UIManager.put("MenuUI", UISpecMenuUI.class.getName());
035: UIManager.put("OptionPaneUI", UISpecOptionPaneUI.class
036: .getName());
037: UIManager.put("PanelUI", UISpecPanelUI.class.getName());
038: UIManager.put("PasswordFieldUI", UISpecPasswordFieldUI.class
039: .getName());
040: UIManager.put("PopupMenuSeparatorUI",
041: UISpecPopupMenuSeparatorUI.class.getName());
042: UIManager.put("PopupMenuUI", UISpecPopupMenuUI.class.getName());
043: UIManager.put("ProgressBarUI", UISpecProgressBarUI.class
044: .getName());
045: UIManager.put("RadioButtonMenuItemUI",
046: UISpecRadioButtonMenuItemUI.class.getName());
047: UIManager.put("RadioButtonUI", UISpecRadioButtonUI.class
048: .getName());
049: UIManager.put("RootPaneUI", UISpecRootPaneUI.class.getName());
050: UIManager.put("ScrollBarUI", UISpecScrollBarUI.class.getName());
051: UIManager.put("ScrollPaneUI", UISpecScrollPaneUI.class
052: .getName());
053: UIManager.put("SeparatorUI", UISpecSeparatorUI.class.getName());
054: UIManager.put("SliderUI", UISpecSliderUI.class.getName());
055: UIManager.put("SpinnerUI", UISpecSpinnerUI.class.getName());
056: UIManager.put("SplitPaneUI", UISpecSplitPaneUI.class.getName());
057: UIManager.put("TableHeaderUI", UISpecTableHeaderUI.class
058: .getName());
059: UIManager.put("TableUI", UISpecTableUI.class.getName());
060: UIManager.put("TextAreaUI", UISpecTextAreaUI.class.getName());
061: UIManager.put("TextFieldUI", UISpecTextFieldUI.class.getName());
062: UIManager.put("TextPaneUI", UISpecTextPaneUI.class.getName());
063: UIManager.put("ToggleButtonUI", UISpecToggleButtonUI.class
064: .getName());
065: UIManager.put("ToolBarSeparatorUI",
066: UISpecToolBarSeparatorUI.class.getName());
067: UIManager.put("ToolBarUI", UISpecToolBarUI.class.getName());
068: UIManager.put("ToolTipUI", UISpecToolTipUI.class.getName());
069: UIManager.put("TreeUI", UISpecTreeUI.class.getName());
070: }
071:
072: ///CLOVER:OFF
073: public static void main(String[] args) {
074: init();
075: UIDefaults defaults = UIManager.getDefaults();
076: Set set = new TreeSet();
077: for (Enumeration dfkeys = defaults.keys(); dfkeys
078: .hasMoreElements();) {
079: String key = (String) dfkeys.nextElement();
080: if (key.endsWith("UI")) {
081: set.add(key);
082: }
083: }
084: for (Iterator iterator = set.iterator(); iterator.hasNext();) {
085: String key = (String) iterator.next();
086: String compName = key.substring(0, key.length() - 2);
087: System.out.println(" UIManager.put(\"" + key
088: + "\", UISpec" + key + ".class.getName());");
089: }
090: System.out.println("\n");
091: }
092:
093: private static void printUIManager() {
094: UIDefaults defaults = UIManager.getDefaults(); // returns a HashTable
095: Enumeration dfkeys = defaults.keys(); // returns an Enumeration
096:
097: System.out.println("KEY / VALUE list");
098: while (dfkeys.hasMoreElements()) {
099: String key = (String) dfkeys.nextElement();
100: String line = key + " => " + defaults.get(key);
101: if (line.indexOf("UI") >= 0) {
102: System.out.println(line);
103: }
104: }
105: System.out.println("\n");
106: }
107: }
|