root / tags / v2_0_0_Build_2056 / extensions / extEditing / src / org / gvsig / editing / TableCommandStackExtension.java @ 39004
History | View | Annotate | Download (1.69 KB)
1 |
package org.gvsig.editing; |
---|---|
2 |
|
3 |
import org.gvsig.andami.PluginServices; |
4 |
import org.gvsig.andami.plugins.Extension; |
5 |
import org.gvsig.app.gui.command.CommandStackDialog; |
6 |
import org.gvsig.app.project.documents.table.TableDocument; |
7 |
import org.gvsig.app.project.documents.table.gui.FeatureTableDocumentPanel; |
8 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
9 |
|
10 |
|
11 |
/**
|
12 |
* DOCUMENT ME!
|
13 |
*
|
14 |
* @author Vicente Caballero Navarro
|
15 |
*/
|
16 |
public class TableCommandStackExtension extends Extension { |
17 |
/**
|
18 |
* @see org.gvsig.andami.plugins.IExtension#initialize()
|
19 |
*/
|
20 |
public void initialize() { |
21 |
} |
22 |
|
23 |
/**
|
24 |
* @see org.gvsig.andami.plugins.IExtension#execute(java.lang.String)
|
25 |
*/
|
26 |
public void execute(String s) { |
27 |
org.gvsig.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager() |
28 |
.getActiveWindow(); |
29 |
|
30 |
FeatureTableDocumentPanel table = (FeatureTableDocumentPanel) f; |
31 |
TableDocument model = table.getModel(); |
32 |
if (s.equals("edit-undo-redo-actions-table")) { |
33 |
FeatureStore featureStore = model.getStore(); |
34 |
featureStore.addObserver(table); |
35 |
CommandStackDialog csd = new CommandStackDialog();
|
36 |
|
37 |
csd.setModel(featureStore); |
38 |
|
39 |
PluginServices.getMDIManager().addWindow(csd); |
40 |
} |
41 |
} |
42 |
|
43 |
/**
|
44 |
* @see org.gvsig.andami.plugins.IExtension#isEnabled()
|
45 |
*/
|
46 |
public boolean isEnabled() { |
47 |
return true; |
48 |
} |
49 |
|
50 |
/**
|
51 |
* @see org.gvsig.andami.plugins.IExtension#isVisible()
|
52 |
*/
|
53 |
public boolean isVisible() { |
54 |
org.gvsig.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager() |
55 |
.getActiveWindow(); |
56 |
if (f instanceof FeatureTableDocumentPanel){ |
57 |
FeatureTableDocumentPanel table = (FeatureTableDocumentPanel) f; |
58 |
TableDocument model = table.getModel(); |
59 |
if (model.getStore().isEditing())
|
60 |
return true; |
61 |
} |
62 |
return false; |
63 |
} |
64 |
} |