Revision 6656 trunk/libraries/libCorePlugin/src/com/iver/core/preferences/general/AppearancePage.java

View differences:

AppearancePage.java
43 43
*
44 44
* $Id$
45 45
* $Log$
46
* Revision 1.3  2006-08-02 12:49:07  cesar
46
* Revision 1.4  2006-08-04 11:03:43  cesar
47
* Set the selected appearance after the combo box is filled (it had no effect otherwise)
48
*
49
* Revision 1.3  2006/08/02 12:49:07  cesar
47 50
* Install Plastic look and feel before getting the LAF-combo. Hide installed but non-supported themes from the list.
48 51
*
49 52
* Revision 1.2  2006/07/31 10:02:31  jaume
......
109 112
    	if (lookAndFeel == null) {
110 113
    		lookAndFeel = Launcher.getDefaultLookAndFeel();
111 114
    	}
112

  
115
    	
116
    	for (int i=0; i<lookAndFeelCombo.getModel().getSize(); i++) {
117
    		LF element = (LF) lookAndFeelCombo.getModel().getElementAt(i);
118
    		if (element.getClassName().equals(lookAndFeel)) {
119
    			lookAndFeelCombo.setSelectedIndex(i);
120
    			lookAndFeelIndex = i;
121
    			break;
122
    		}
123
    	}
113 124
    }
114 125

  
115 126

  
116

  
117 127
	public boolean storeValues() {
118 128
    	Launcher.getAndamiConfig().setLookAndFeel(lookAndFeel);
119 129
        return true;
......
141 151
    private JComboBox getLookAndFeelComboBox() {
142 152
        if (lookAndFeelCombo==null) {
143 153
            LookAndFeelInfo[] lfs = UIManager.getInstalledLookAndFeels();
144
            LF selectedLookAndFeel = null;
145 154
            ArrayList a = new ArrayList();
146 155
            for (int i = 0; i < lfs.length; i++) {
147 156
                LF lf = new LF(lfs[i]);
148
                if (lf.getClassName().equals(lookAndFeel))
149
                	selectedLookAndFeel = lf;
150 157
                
151 158
                // test if the look and feel is supported in this platform before adding it to the list
152 159
                Class lafClassDef;
......
167 174
				}
168 175
            }
169 176
            lookAndFeelCombo = new JComboBox((LF[]) a.toArray(new LF[a.size()]));
170

  
171
            if (selectedLookAndFeel!=null) {
172
                lookAndFeelCombo.setSelectedItem(selectedLookAndFeel);
173
                lookAndFeelIndex = lookAndFeelCombo.getSelectedIndex();
174
            }
175

  
176 177
            lookAndFeelCombo.addActionListener(new ActionListener() {
177 178
                public void actionPerformed(ActionEvent e) {
178 179
                    lookAndFeel = ((LF) lookAndFeelCombo.getSelectedItem()).getClassName();

Also available in: Unified diff