Revision 38564 branches/v2_0_0_prep/frameworks/_fwAndami/src/org/gvsig/andami/PluginServices.java

View differences:

PluginServices.java
63 63
import javax.swing.SwingUtilities;
64 64
import javax.swing.Timer;
65 65

  
66
import org.slf4j.Logger;
67
import org.slf4j.LoggerFactory;
68

  
69 66
import org.gvsig.andami.authentication.IAuthentication;
70
import org.gvsig.andami.iconthemes.IIconTheme;
71
import org.gvsig.andami.iconthemes.IconThemeManager;
72 67
import org.gvsig.andami.messages.Messages;
73 68
import org.gvsig.andami.messages.NotificationManager;
74 69
import org.gvsig.andami.plugins.ExclusiveUIExtension;
......
86 81
import org.gvsig.tools.persistence.PersistenceManager;
87 82
import org.gvsig.tools.persistence.PersistentState;
88 83
import org.gvsig.tools.persistence.exception.AddDefinitionException;
84
import org.gvsig.tools.swing.icontheme.IconTheme;
85
import org.gvsig.tools.swing.icontheme.IconThemeManager;
86
import org.gvsig.tools.swing.icontheme.impl.DefaultIconThemeManager;
89 87
import org.gvsig.utils.XMLEntity;
90 88
import org.gvsig.utils.swing.threads.IMonitorableTask;
91 89
import org.gvsig.utils.swing.threads.IProgressMonitorIF;
92 90
import org.gvsig.utils.swing.threads.TaskMonitorTimerListener;
93 91
import org.gvsig.utils.swing.threads.UndefinedProgressMonitor;
92
import org.slf4j.Logger;
93
import org.slf4j.LoggerFactory;
94 94

  
95 95
/**
96 96
 * Provides services to Plugins. Each plugin has an associated PluginServices
......
168 168
     * 
169 169
     * @return The plugin's name
170 170
     */
171
    String getPluginName() {
171
    public String getPluginName() {
172 172
        return loader.getPluginName();
173 173
    }
174 174

  
......
191 191
     */
192 192
    public static PluginServices getPluginServices(Object pluginClassInstance) {
193 193
        try {
194
            PluginClassLoader loader =
195
                (PluginClassLoader) pluginClassInstance.getClass()
196
                .getClassLoader();
197

  
194
        	PluginClassLoader loader;
195
    		if( pluginClassInstance instanceof Class ) {
196
    			loader = (PluginClassLoader) ((Class) pluginClassInstance).getClassLoader();
197
    		} else {
198
    			loader = (PluginClassLoader) pluginClassInstance.getClass().getClassLoader();
199
    		}
198 200
            return Launcher.getPluginServices(loader.getPluginName());
199 201
        } catch (ClassCastException e) {
200 202
            /*
......
671 673
    }
672 674

  
673 675
    public static IconThemeManager getIconThemeManager() {
674
        return IconThemeManager.getIconThemeManager();
676
        return DefaultIconThemeManager.getIconThemeManager();
675 677
    }
676 678

  
677
    public static IIconTheme getIconTheme() {
678
        return IconThemeManager.getIconThemeManager().getCurrent();
679
    public static IconTheme getIconTheme() {
680
        return DefaultIconThemeManager.getIconThemeManager().getCurrent();
679 681
    }
680 682

  
681 683
    /**

Also available in: Unified diff