Revision 218
org.gvsig.educa.thematicmap/trunk/org.gvsig.educa.thematicmap/org.gvsig.educa.thematicmap.lib/org.gvsig.educa.thematicmap.lib.spi/src/main/java/org/gvsig/educa/thematicmap/spi/ThematicMapProviderManager.java | ||
---|---|---|
1 | 1 |
package org.gvsig.educa.thematicmap.spi; |
2 | 2 |
|
3 |
import java.util.List; |
|
4 |
|
|
5 |
import org.gvsig.tools.service.spi.ProviderFactory; |
|
3 | 6 |
import org.gvsig.tools.service.spi.ProviderManager; |
4 | 7 |
|
5 | 8 |
public interface ThematicMapProviderManager extends ProviderManager{ |
6 | 9 |
|
10 |
public List<ProviderFactory> getProviderFactories(); |
|
7 | 11 |
//? |
8 | 12 |
|
9 | 13 |
} |
org.gvsig.educa.thematicmap/trunk/org.gvsig.educa.thematicmap/org.gvsig.educa.thematicmap.lib/org.gvsig.educa.thematicmap.lib.impl/src/main/java/org/gvsig/educa/thematicmap/impl/editor/StepIdentification.java | ||
---|---|---|
24 | 24 |
import java.awt.GridBagConstraints; |
25 | 25 |
import java.awt.GridBagLayout; |
26 | 26 |
import java.awt.Insets; |
27 |
import java.util.List; |
|
27 | 28 |
|
28 | 29 |
import javax.swing.JComponent; |
29 | 30 |
import javax.swing.JLabel; |
... | ... | |
33 | 34 |
import javax.swing.JTextField; |
34 | 35 |
|
35 | 36 |
import org.apache.commons.lang3.StringUtils; |
36 |
|
|
37 | 37 |
import org.gvsig.educa.thematicmap.ThematicMapLocator; |
38 | 38 |
import org.gvsig.educa.thematicmap.ThematicMapManager; |
39 | 39 |
import org.gvsig.educa.thematicmap.compilation.ThematicMapCompilation; |
40 | 40 |
import org.gvsig.educa.thematicmap.compilation.ThematicMapCompilationInformation; |
41 |
import org.gvsig.educa.thematicmap.spi.ThematicMapProviderManager; |
|
41 | 42 |
import org.gvsig.gui.beans.wizard.panel.NotContinueWizardException; |
42 | 43 |
import org.gvsig.gui.beans.wizard.panel.OptionPanel; |
44 |
import org.gvsig.tools.service.spi.ProviderFactory; |
|
45 |
import org.slf4j.Logger; |
|
46 |
import org.slf4j.LoggerFactory; |
|
43 | 47 |
|
44 | 48 |
/** |
45 | 49 |
* |
... | ... | |
57 | 61 |
*/ |
58 | 62 |
private static final long serialVersionUID = 5061121028061557890L; |
59 | 63 |
|
64 |
private static final Logger logger = LoggerFactory.getLogger(StepIdentification.class); |
|
65 |
|
|
60 | 66 |
private static final GridBagConstraints LABEL_CONSTRAINT = |
61 | 67 |
new GridBagConstraints(GridBagConstraints.RELATIVE, |
62 | 68 |
GridBagConstraints.RELATIVE, 1, 1, 0, 0, GridBagConstraints.WEST, |
... | ... | |
108 | 114 |
this.compilation = defaultThematicMapCompilationEditor.getCompilation(); |
109 | 115 |
this.allowChangeId = allowChangeId; |
110 | 116 |
initializeUI(); |
117 |
listProviderfactories(); |
|
111 | 118 |
} |
112 | 119 |
|
113 | 120 |
/** |
... | ... | |
233 | 240 |
|
234 | 241 |
} |
235 | 242 |
|
243 |
private void listProviderfactories() { |
|
244 |
ThematicMapProviderManager providerManager = (ThematicMapProviderManager) manager.getProviderManager(); |
|
245 |
List<ProviderFactory> factories = providerManager.getProviderFactories(); |
|
246 |
for (ProviderFactory factory : factories) { |
|
247 |
logger.info(factory.getName()); |
|
248 |
} |
|
249 |
} |
|
236 | 250 |
} |
org.gvsig.educa.thematicmap/trunk/org.gvsig.educa.thematicmap/org.gvsig.educa.thematicmap.lib/org.gvsig.educa.thematicmap.lib.impl/src/main/java/org/gvsig/educa/thematicmap/impl/DefaultThematicMapProviderManager.java | ||
---|---|---|
1 | 1 |
package org.gvsig.educa.thematicmap.impl; |
2 | 2 |
|
3 |
import java.util.ArrayList; |
|
4 |
import java.util.List; |
|
5 |
|
|
3 | 6 |
import org.gvsig.educa.thematicmap.spi.ThematicMapProviderManager; |
7 |
import org.gvsig.tools.ToolsLocator; |
|
8 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
|
9 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
|
4 | 10 |
import org.gvsig.tools.service.Service; |
5 | 11 |
import org.gvsig.tools.service.spi.AbstractProviderManager; |
12 |
import org.gvsig.tools.service.spi.ProviderFactory; |
|
6 | 13 |
import org.gvsig.tools.service.spi.ProviderServices; |
14 |
import org.slf4j.Logger; |
|
15 |
import org.slf4j.LoggerFactory; |
|
7 | 16 |
|
8 | 17 |
public class DefaultThematicMapProviderManager extends AbstractProviderManager |
9 | 18 |
implements ThematicMapProviderManager { |
10 | 19 |
|
20 |
private static final Logger logger = LoggerFactory.getLogger(DefaultThematicMapProviderManager.class); |
|
21 |
|
|
11 | 22 |
public static final String PROVIDERS_NAME = "ThematicMap.providers"; |
12 | 23 |
|
13 | 24 |
public static final String PROVIDERS_DESCRIPTION = "ThematicMap providers"; |
... | ... | |
31 | 42 |
return new DefaultThematicMapProviderServices(); |
32 | 43 |
} |
33 | 44 |
|
45 |
public List<ProviderFactory> getProviderFactories() { |
|
46 |
ExtensionPointManager epm = ToolsLocator.getExtensionPointManager(); |
|
47 |
List<ProviderFactory> factories = new ArrayList<ProviderFactory>(); |
|
48 |
|
|
49 |
@SuppressWarnings("unchecked") |
|
50 |
List<String> factoryNames = epm.getNames(); |
|
51 |
|
|
52 |
for (String factoryName : factoryNames) { |
|
53 |
ExtensionPoint ep = epm.get(factoryName); |
|
54 |
ProviderFactory factory = null; |
|
55 |
|
|
56 |
if (ep != null) { |
|
57 |
try { |
|
58 |
factory = ((ProviderFactory) ep.create(factoryName)); |
|
59 |
factories.add(factory); |
|
60 |
} catch (Exception e) { |
|
61 |
logger.info("Can't create ThematicMapProviderfactory for '"+factoryName+"."); |
|
62 |
} |
|
63 |
} |
|
64 |
} |
|
65 |
return factories; |
|
66 |
} |
|
34 | 67 |
} |
Also available in: Unified diff