(String path)
| 292 | } |
| 293 | |
| 294 | private boolean loadIntoEditor(String path) { |
| 295 | Map<String, ZipEntry> contents = ResourceLoader.getZipContents(path, true); |
| 296 | // extract the zip file contents |
| 297 | xmlFiles.clear(); |
| 298 | otherFiles.clear(); |
| 299 | for (String next : contents.keySet()) { |
| 300 | String s = ResourceLoader.getURIPath(path + "!/" + next); |
| 301 | if (next.endsWith(".trk") |
| 302 | || next.endsWith(".xml") |
| 303 | || next.endsWith(".ejss")) { |
| 304 | xmlFiles.add(s); |
| 305 | } else { |
| 306 | otherFiles.add(s); |
| 307 | } |
| 308 | } |
| 309 | contents = null; |
| 310 | if (xmlFiles.isEmpty()) { |
| 311 | String msg = XML.getName(path)+ " contains no editable xml files."; |
| 312 | JOptionPane.showMessageDialog(frame, msg, "No Editable Content", JOptionPane.WARNING_MESSAGE); |
| 313 | return false; |
| 314 | } |
| 315 | // remove file that will be edited so the original |
| 316 | // will not be included in the output zip |
| 317 | editedFilePath = xmlFiles.remove(0); |
| 318 | String text = ResourceLoader.getString(editedFilePath); |
| 319 | setEditorText(text); |
| 320 | libraryBrowser.setVisible(false); |
| 321 | return true; |
| 322 | } |
| 323 | |
| 324 | private boolean isZip(String path) { |
| 325 | return path.toLowerCase().endsWith(".zip") |
no test coverage detected