Revision 23 org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/vectorediting/app/mainplugin/extensions/EditingExtension.java
EditingExtension.java | ||
---|---|---|
6 | 6 |
*/ |
7 | 7 |
package org.gvsig.vectorediting.app.mainplugin.extensions; |
8 | 8 |
|
9 |
import org.gvsig.andami.plugins.Extension; |
|
9 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel; |
|
10 |
import org.gvsig.fmap.dal.exception.DataException; |
|
11 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
12 |
import org.gvsig.vectorediting.app.mainplugin.BaseEditingServiceExtension; |
|
10 | 13 |
|
11 |
public class EditingExtension extends Extension { |
|
14 |
public class EditingExtension extends BaseEditingServiceExtension {
|
|
12 | 15 |
|
13 | 16 |
/** |
14 | 17 |
* |
15 | 18 |
*/ |
16 |
private void activateConsole() { |
|
17 |
// TODO Activate console |
|
18 |
} |
|
19 |
|
|
19 |
private static final long serialVersionUID = -5586086889681840048L; |
|
20 |
|
|
20 | 21 |
public void execute(String arg0) { |
21 |
// TODO Auto-generated method stub |
|
22 |
|
|
23 |
} |
|
24 | 22 |
|
25 |
/** |
|
26 |
* |
|
27 |
*/ |
|
28 |
private void initFocus(){ |
|
29 |
//TODO add console listener and register behavior |
|
30 |
} |
|
23 |
DefaultViewPanel vista = getActiveView(); |
|
31 | 24 |
|
32 |
/** |
|
33 |
* |
|
34 |
*/ |
|
35 |
public void initialize() { |
|
36 |
// TODO Register EditingBehaivor, as well as the actions to |
|
37 |
// activate/deactivate editing. Also activate console, put select store in |
|
38 |
// editing mode and notifies about the begin and end of editing mode. |
|
25 |
if (vista != null) { |
|
26 |
FLyrVect layer = getActiveLayer(vista); |
|
27 |
|
|
28 |
if (canBeEdited(layer)) { |
|
29 |
try { |
|
30 |
manager.beginEdition(layer, vista); |
|
31 |
} |
|
32 |
catch (DataException e) { |
|
33 |
// TODO Auto-generated catch block |
|
34 |
e.printStackTrace(); |
|
35 |
} |
|
36 |
} |
|
37 |
|
|
38 |
} |
|
39 | 39 |
} |
40 | 40 |
|
41 |
public void initialize() {} |
|
42 |
|
|
41 | 43 |
public boolean isEnabled() { |
42 |
// TODO Auto-generated method stub |
|
43 |
return false; |
|
44 |
} |
|
45 |
|
|
46 |
public boolean isVisible() { |
|
47 |
// TODO Auto-generated method stub |
|
48 |
return false; |
|
49 |
} |
|
44 |
DefaultViewPanel vista = getActiveView(); |
|
45 |
FLyrVect activeLayer = getActiveLayer(vista); |
|
46 |
|
|
47 |
return (canBeEdited(activeLayer) ? true : false); |
|
50 | 48 |
|
51 |
/** |
|
52 |
* |
|
53 |
*/ |
|
54 |
private void refreshMenusAndToolBars() { |
|
55 |
//TODO Refresh menus and toolbars |
|
56 | 49 |
} |
57 | 50 |
|
58 |
/** |
|
59 |
* |
|
60 |
*/ |
|
61 |
private void registerEditingBehaivor() { |
|
62 |
// TODO Register EditingBehaivor in MapContext |
|
51 |
public boolean isVisible() { |
|
52 |
return true; |
|
63 | 53 |
} |
64 | 54 |
|
65 |
/** |
|
66 |
* |
|
67 |
*/ |
|
68 |
private void setStoreInEditingMode() { |
|
69 |
// TODO Set the store in edition mode |
|
70 |
} |
|
71 |
|
|
72 | 55 |
} |
Also available in: Unified diff