Revision 9532 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/contextMenu/actions/CutDocumentContextMenuAction.java
CutDocumentContextMenuAction.java | ||
---|---|---|
15 | 15 |
public int getOrder() { |
16 | 16 |
return 1; |
17 | 17 |
} |
18 |
|
|
18 |
|
|
19 | 19 |
public boolean isVisible(ProjectDocument item, |
20 | 20 |
ProjectDocument[] selectedItems) { |
21 | 21 |
return true; |
... | ... | |
30 | 30 |
ProjectExtension projectExtension = (ProjectExtension)PluginServices.getExtension(ProjectExtension.class); |
31 | 31 |
Project project = projectExtension.getProject(); |
32 | 32 |
String data; |
33 |
|
|
34 | 33 |
|
35 |
|
|
36 |
|
|
37 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 | 38 |
try { |
39 | 39 |
data = project.exportToXML(selectedItems); |
40 | 40 |
} catch (SaveException e) { |
... | ... | |
47 | 47 |
return; |
48 | 48 |
} |
49 | 49 |
PluginServices.putInClipboard(data); |
50 |
|
|
50 |
|
|
51 | 51 |
for (int i =0;i<selectedItems.length;i++) { |
52 | 52 |
if (selectedItems[i].isLocked()) { |
53 | 53 |
JOptionPane.showMessageDialog( |
... | ... | |
55 | 55 |
PluginServices.getText(this, "locked_element_it_cannot_be_deleted") + ": " +selectedItems[i].getName() |
56 | 56 |
); |
57 | 57 |
return; |
58 |
|
|
58 |
|
|
59 | 59 |
} |
60 | 60 |
} |
61 |
|
|
62 |
|
|
61 |
|
|
62 |
|
|
63 | 63 |
int option=JOptionPane.showConfirmDialog((Component)PluginServices.getMainFrame(),PluginServices.getText(this,"desea_borrar_el_documento")); |
64 | 64 |
if (option!=JOptionPane.OK_OPTION) { |
65 | 65 |
return; |
66 | 66 |
} |
67 | 67 |
|
68 | 68 |
this.removeDocuments(selectedItems,project); |
69 |
|
|
70 |
|
|
69 |
project.setModified(true); |
|
70 |
|
|
71 | 71 |
} |
72 | 72 |
|
73 | 73 |
public String getText() { |
74 | 74 |
return PluginServices.getText(this, "cortar"); |
75 | 75 |
} |
76 |
|
|
77 |
private boolean removeDocuments(ProjectDocument[] selectedItems,Project project) {
|
|
76 |
|
|
77 |
private boolean removeDocuments(ProjectDocument[] selectedItems,Project project) { |
|
78 | 78 |
ProjectDocument element; |
79 | 79 |
int index; |
80 | 80 |
for (int i=selectedItems.length-1;i>=0;i--) { |
81 | 81 |
|
82 | 82 |
element = selectedItems[i]; |
83 |
|
|
84 |
|
|
83 |
|
|
84 |
|
|
85 | 85 |
if (element.isLocked()) { |
86 | 86 |
JOptionPane.showMessageDialog( |
87 | 87 |
(Component)PluginServices.getMainFrame(), |
Also available in: Unified diff