Statistics
| Revision:

root / org.gvsig.wfs.app / trunk / org.gvsig.wfs.app / org.gvsig.wfs.app.mainplugin / src / main / java / org / gvsig / wfs / WFSClientExtension.java @ 41

History | View | Annotate | Download (4.19 KB)

1
package org.gvsig.wfs;
2

    
3
import org.gvsig.andami.IconThemeHelper;
4
import org.gvsig.andami.plugins.Extension;
5
import org.gvsig.app.extension.AddLayer;
6
import org.gvsig.app.project.documents.view.legend.gui.ThemeManagerWindow;
7
import org.gvsig.fmap.dal.store.wfs.WFSStoreProvider;
8
import org.gvsig.fmap.mapcontext.MapContextLocator;
9
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
10
import org.gvsig.gui.beans.panelGroup.PanelGroupManager;
11
import org.gvsig.tools.ToolsLocator;
12
import org.gvsig.tools.extensionpoint.ExtensionPoint;
13
import org.gvsig.tools.extensionpoint.ExtensionPointManager;
14
import org.gvsig.wfs.gui.panels.WFSAreaPanel;
15
// import org.gvsig.wfs.gui.panels.WFSFilterPanel;
16
import org.gvsig.wfs.gui.panels.WFSInfoPanel;
17
import org.gvsig.wfs.gui.panels.WFSOptionsPanel;
18
import org.gvsig.wfs.gui.panels.WFSParamsPanel;
19
import org.gvsig.wfs.gui.panels.WFSSelectFeaturePanel;
20
import org.gvsig.wfs.gui.panels.WFSSelectFieldsPanel;
21
import org.gvsig.wfs.gui.toc.WFSProperties;
22
import org.gvsig.wfs.gui.wizards.WFSWizard;
23

    
24

    
25
public class WFSClientExtension extends Extension{
26

    
27
        public void initialize() {
28
                // Adds a new tab to the "add layer" wizard for WFS layer creation
29
                AddLayer.addWizard(WFSWizard.class);
30
                
31
                ExtensionPointManager extensionPointManager = ToolsLocator
32
                .getExtensionPointManager();
33
             
34
                //WFS properties tabs:
35
                ExtensionPoint wfsTabExtensionPoint = extensionPointManager.add("WFSPropertiesDialog");
36
                wfsTabExtensionPoint.append("info", "", WFSInfoPanel.class);
37
                wfsTabExtensionPoint.append("features", "", WFSSelectFeaturePanel.class);
38
                wfsTabExtensionPoint.append("fields", "", WFSSelectFieldsPanel.class);
39
                wfsTabExtensionPoint.append("options", "", WFSOptionsPanel.class);
40
                // wfsTabExtensionPoint.append("filter", "", WFSFilterPanel.class);
41
                wfsTabExtensionPoint.append("area", "", WFSAreaPanel.class);
42
                                
43
                ThemeManagerWindow.addPage(WFSProperties.class);
44
                ThemeManagerWindow.setTabEnabledForLayer(WFSProperties.class, FLyrVect.class, true);
45
                                
46
                // Registers this class as a "PanelGroup" type
47
                PanelGroupManager.getManager().registerPanelGroup(WFSParamsPanel.class);
48

    
49
                // Sets this class as the default "PanelGroup" type
50
                PanelGroupManager.getManager().setDefaultType(WFSParamsPanel.class);
51

    
52
                initilizeIcons();                
53
        }
54

    
55
        /*
56
         * (non-Javadoc)
57
         * @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
58
         */
59
        public void execute(String actionCommand) {
60
                // TODO Auto-generated method stub
61
                
62
        }        
63

    
64
        /*
65
         * (non-Javadoc)
66
         * @see com.iver.andami.plugins.IExtension#isEnabled()
67
         */
68
        public boolean isEnabled() {
69
                // TODO Auto-generated method stub
70
                return false;
71
        }
72

    
73
        /*
74
         * (non-Javadoc)
75
         * @see com.iver.andami.plugins.IExtension#isVisible()
76
         */
77
        public boolean isVisible() {
78
                // TODO Auto-generated method stub
79
                return false;
80
        }
81
        
82
        /**
83
         * Prepares support for the icons that can be used in the WFS extension.
84
         */
85
        void initilizeIcons(){
86
                IconThemeHelper.registerIcon("layer", "layer-icon-wfs", this);
87
                MapContextLocator.getMapContextManager().registerIconLayer(WFSStoreProvider.NAME, "layer-icon-wfs");
88

    
89
                // WFSAreaPanel.java
90
                IconThemeHelper.registerIcon("wfs-properties", "wfs-properties-undo", this);
91
                IconThemeHelper.registerIcon("wfs-properties", "wfs-properties-move", this);
92
                IconThemeHelper.registerIcon("wfs-properties", "wfs-properties-scaling", this); // ???
93
                IconThemeHelper.registerIcon("wfs-properties", "wfs-properties-pan", this);
94
                IconThemeHelper.registerIcon("wfs-properties", "wfs-properties-zoom-in", this);
95
                IconThemeHelper.registerIcon("wfs-properties", "wfs-properties-zoom-out", this);
96
                IconThemeHelper.registerIcon("wfs-properties", "wfs-properties-zoom-back", this);
97
                IconThemeHelper.registerIcon("wfs-properties", "wfs-properties-zoom-all", this);
98
                IconThemeHelper.registerIcon("wfs-properties", "wfs-properties-zoom-plus", this);
99
                IconThemeHelper.registerIcon("wfs-properties", "wfs-properties-zoom-minus", this);
100
                IconThemeHelper.registerIcon("wfs-properties", "wfs-properties-query-area", this);
101
                IconThemeHelper.registerIcon("wfs-properties", "wfs-properties-query-distance", this);
102
                IconThemeHelper.registerIcon("wfs-properties", "wfs-properties-validate-area", this); // ???
103
        }
104

    
105
}