Revision 45160 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.geodb.app/org.gvsig.geodb.app.mainplugin/src/main/java/org/gvsig/geodb/ExtDB_Spatial.java
ExtDB_Spatial.java | ||
---|---|---|
22 | 22 |
*/ |
23 | 23 |
package org.gvsig.geodb; |
24 | 24 |
|
25 |
import java.util.ArrayList; |
|
26 |
import java.util.HashMap; |
|
27 |
import java.util.List; |
|
28 |
import java.util.Map; |
|
25 | 29 |
import org.gvsig.andami.IconThemeHelper; |
26 | 30 |
import org.gvsig.andami.PluginsLocator; |
27 | 31 |
import org.gvsig.andami.PluginsManager; |
28 | 32 |
import org.gvsig.andami.plugins.Extension; |
33 |
import org.gvsig.andami.preferences.IPreference; |
|
34 |
import org.gvsig.andami.preferences.IPreferenceExtension; |
|
29 | 35 |
import org.gvsig.app.ApplicationLocator; |
30 |
import org.gvsig.app.ApplicationManager; |
|
31 | 36 |
import org.gvsig.app.extension.AddLayer; |
32 | 37 |
import org.gvsig.fmap.dal.DALLocator; |
33 | 38 |
import org.gvsig.fmap.dal.DataManager; |
34 | 39 |
import org.gvsig.tools.dynobject.DynObject; |
35 | 40 |
import org.gvsig.fmap.dal.DataServerExplorerPool; |
41 |
import static org.gvsig.geodb.WizardDBVectorial.LAYERS_SCALE_VISIBILITY_PARAMETER; |
|
42 |
import org.gvsig.geodb.preferences.layersVisibility.LayersVisibilityReminderPage; |
|
43 |
import org.gvsig.geodb.vectorialdb.visibility.LayerScaleVisibility; |
|
36 | 44 |
|
37 | 45 |
/** |
38 | 46 |
* This extension adds the export-to-oracle button. |
... | ... | |
40 | 48 |
* @author jldominguez |
41 | 49 |
* |
42 | 50 |
*/ |
43 |
public class ExtDB_Spatial extends Extension { |
|
51 |
public class ExtDB_Spatial extends Extension implements IPreferenceExtension{
|
|
44 | 52 |
|
45 | 53 |
@Override |
46 | 54 |
public void initialize() { |
... | ... | |
48 | 56 |
IconThemeHelper.registerIcon("geodb", "geodb-advanced-properties", this); |
49 | 57 |
IconThemeHelper.registerIcon("geodb", "geodb-get-view-extent", this); |
50 | 58 |
|
59 |
LayerScaleVisibility.selfRegister(); |
|
60 |
|
|
51 | 61 |
DataManager dataManager = DALLocator.getDataManager(); |
52 | 62 |
PluginsManager manager = PluginsLocator.getManager(); |
53 | 63 |
DynObject pluginProperties = manager.getPlugin(ExtDB_Spatial.class).getPluginProperties(); |
... | ... | |
57 | 67 |
dataManager.setDataServerExplorerPool((DataServerExplorerPool)pluginProperties.getDynValue("explorersPool")); |
58 | 68 |
} |
59 | 69 |
|
70 |
HashMap<Object, Object> layersScaleVisibility = new HashMap<>(); |
|
71 |
Map<String, LayerScaleVisibility> tmp = (Map) pluginProperties.getDynValue(LAYERS_SCALE_VISIBILITY_PARAMETER); |
|
72 |
if(tmp != null){ |
|
73 |
layersScaleVisibility.putAll(tmp); |
|
74 |
} |
|
75 |
pluginProperties.setDynValue(LAYERS_SCALE_VISIBILITY_PARAMETER, layersScaleVisibility); |
|
76 |
|
|
77 |
IconThemeHelper.registerIcon("preferences", "layers-visibility-remember-preferences", this); |
|
60 | 78 |
} |
61 | 79 |
|
62 | 80 |
@Override |
... | ... | |
85 | 103 |
AddLayer.addWizard(WizardDBVectorial.class); |
86 | 104 |
|
87 | 105 |
} |
106 |
|
|
107 |
@Override |
|
108 |
public IPreference[] getPreferencesPages() { |
|
109 |
List<IPreference> prefs = new ArrayList<>(); |
|
110 |
prefs.add(new LayersVisibilityReminderPage()); |
|
88 | 111 |
|
112 |
return prefs.toArray(new IPreference[prefs.size()]); |
|
113 |
} |
|
114 |
|
|
115 |
|
|
89 | 116 |
} |
Also available in: Unified diff