void addImage() { ArrayList<String> fileList = new ArrayList<String>(); for (String file : peer.getOriginalFiles()) { if (false == peer.modifiedFileExists(file)) { if (ZipManager.isImage(file)) { fileList.add(file); } } } for (String file : peer.getModifiedFileNames()) { if (ZipManager.isImage(file)) { fileList.add(file); } } Object[] files = fileList.toArray(); String s = (String) JOptionPane.showInputDialog( null, "File to use:", "New Photo", JOptionPane.PLAIN_MESSAGE, null, files, files[0]); if ((s != null) && (s.length() > 0)) { getCurrentExhibit().addPhoto(new ExhibitPhoto(s, null)); exhibitPhotosModel.notifyChange(); peer.makeChange(); } }
private String[] getAllContentList() { ArrayList<String> list = new ArrayList<String>(); for (String s : peer.getOriginalFiles()) { if (false == peer.modifiedFileExists(s)) { if (ZipManager.isImage(s) == false) { list.add(s); } } } for (String s : peer.getModifiedFileNames()) { if (ZipManager.isImage(s) == false) { list.add(s); } } return list.toArray(new String[0]); }