Revision 31496 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/extension/LayoutUndoExtension.java
LayoutUndoExtension.java | ||
---|---|---|
43 | 43 |
import org.gvsig.andami.PluginServices; |
44 | 44 |
import org.gvsig.andami.messages.NotificationManager; |
45 | 45 |
import org.gvsig.andami.plugins.Extension; |
46 |
import org.gvsig.app.project.documents.layout.gui.Layout; |
|
46 |
import org.gvsig.app.project.documents.layout.gui.LayoutPanel;
|
|
47 | 47 |
import org.gvsig.tools.undo.UndoException; |
48 | 48 |
|
49 | 49 |
|
... | ... | |
61 | 61 |
} |
62 | 62 |
|
63 | 63 |
public void execute(String actionCommand) { |
64 |
Layout layout=(Layout)PluginServices.getMDIManager().getActiveWindow();
|
|
64 |
LayoutPanel layout=(LayoutPanel)PluginServices.getMDIManager().getActiveWindow();
|
|
65 | 65 |
if (actionCommand.equals("UNDO")){ |
66 | 66 |
try { |
67 | 67 |
layout.getLayoutContext().getFrameCommandsRecord().undo(); |
... | ... | |
75 | 75 |
} |
76 | 76 |
|
77 | 77 |
public boolean isEnabled() { |
78 |
if (PluginServices.getMDIManager().getActiveWindow() instanceof Layout){ |
|
79 |
Layout layout=(Layout)PluginServices.getMDIManager().getActiveWindow();
|
|
78 |
if (PluginServices.getMDIManager().getActiveWindow() instanceof LayoutPanel){
|
|
79 |
LayoutPanel layout=(LayoutPanel)PluginServices.getMDIManager().getActiveWindow();
|
|
80 | 80 |
if (layout.getLayoutContext().getFrameCommandsRecord().canUndo() && layout.getLayoutContext().isEditable()) |
81 | 81 |
return true; |
82 | 82 |
} |
... | ... | |
84 | 84 |
} |
85 | 85 |
|
86 | 86 |
public boolean isVisible() { |
87 |
if (PluginServices.getMDIManager().getActiveWindow() instanceof Layout){ |
|
87 |
if (PluginServices.getMDIManager().getActiveWindow() instanceof LayoutPanel){
|
|
88 | 88 |
return true; |
89 | 89 |
} |
90 | 90 |
return false; |
Also available in: Unified diff