Revision 38564 branches/v2_0_0_prep/extensions/extEditing/src/org/gvsig/editing/ViewCommandStackExtension.java
ViewCommandStackExtension.java | ||
---|---|---|
5 | 5 |
import org.gvsig.app.gui.command.CommandStackDialog; |
6 | 6 |
import org.gvsig.app.project.documents.view.ViewDocument; |
7 | 7 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel; |
8 |
import org.gvsig.fmap.dal.exception.DataException; |
|
9 | 8 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
10 | 9 |
import org.gvsig.fmap.mapcontext.MapContext; |
11 | 10 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
... | ... | |
24 | 23 |
* @see org.gvsig.andami.plugins.IExtension#initialize() |
25 | 24 |
*/ |
26 | 25 |
public void initialize() { |
27 |
PluginServices.getIconTheme().registerDefault( |
|
28 |
"commands-stack", |
|
29 |
this.getClass().getClassLoader().getResource("images/commandstack.png") |
|
30 |
); |
|
31 | 26 |
} |
32 | 27 |
|
33 | 28 |
/** |
... | ... | |
41 | 36 |
ViewDocument model = vista.getModel(); |
42 | 37 |
MapContext mapa = model.getMapContext(); |
43 | 38 |
FLayers layers = mapa.getLayers(); |
44 |
if (s.equals("COMMANDSTACK")) {
|
|
39 |
if (s.equals("edit-undo-redo-actions-layer")) {
|
|
45 | 40 |
for (int i =0;i<layers.getLayersCount();i++){ |
46 | 41 |
if (layers.getLayer(i) instanceof FLyrVect){ |
47 | 42 |
FLyrVect lyrVect=(FLyrVect)layers.getLayer(i); |
48 | 43 |
if (lyrVect.isEditing() && lyrVect.isActive()){ |
49 |
// try{ |
|
50 | 44 |
FeatureStore featureStore=lyrVect.getFeatureStore(); |
51 |
// CommandsRecord commandsRecord=null; |
|
52 |
// try { |
|
53 |
// commandsRecord = lyrVect.getFeatureStore().getCommandsRecord(); |
|
54 |
// } catch (ReadException e) { |
|
55 |
// // TODO Auto-generated catch block |
|
56 |
// e.printStackTrace(); |
|
57 |
// } catch (DataException e) { |
|
58 |
// // TODO Auto-generated catch block |
|
59 |
// e.printStackTrace(); |
|
60 |
// } |
|
61 |
// commandsRecord.addObserver(this); |
|
62 | 45 |
csd=new CommandStackDialog(); |
63 | 46 |
csd.setModel(featureStore); |
64 | 47 |
PluginServices.getMDIManager().addWindow(csd); |
65 |
// } catch (DataException e) { |
|
66 |
// e.printStackTrace(); |
|
67 |
// } |
|
68 | 48 |
return; |
69 | 49 |
} |
70 | 50 |
} |
71 | 51 |
} |
72 | 52 |
} |
73 | 53 |
|
74 |
//PluginServices.getMainFrame().enableControls(); |
|
75 |
|
|
76 | 54 |
} |
77 | 55 |
|
78 | 56 |
/** |
Also available in: Unified diff