Object[] selectedItems = getSelectedDownloadItems(); if (selectedItems != null && selectedItems.length == 1) { if (selectedItems[0].getClass() == DownloadMainNode.class && ( (DownloadMainNode) selectedItems[0]).getType() == DownloadMainNode.ROOT_NODE) { DownloadDO downloadDO = ( (DownloadMainNode) selectedItems[0]). getDownloadDO(); String neuerName = JOptionPane.showInputDialog( AppleJuiceDialog.getApp(), neuerDateiname + ":", downloadDO.getFilename()); if (neuerName == null) { return; } neuerName = neuerName.trim(); if (neuerName.length() != 0) { if (downloadDO.getFilename().compareTo(neuerName) != 0) { ApplejuiceFassade.getInstance().renameDownload( downloadDO.getId(), neuerName); } } } }
renameDownload();
            public void actionPerformed(ActionEvent ae) {                Object[] selectedItems = getSelectedDownloadItems();                if (selectedItems != null && selectedItems.length == 1) {                    if (selectedItems[0].getClass() == DownloadMainNode.class                        &&                        ( (DownloadMainNode) selectedItems[0]).getType() ==                        DownloadMainNode.ROOT_NODE) {                        DownloadDO downloadDO = ( (DownloadMainNode)                                                 selectedItems[0]).                            getDownloadDO();                        String neuerName = JOptionPane.showInputDialog(                            AppleJuiceDialog.getApp(), neuerDateiname + ":",                            downloadDO.getFilename());                        if (neuerName == null) {                            return;                        }                        neuerName = neuerName.trim();                        if (neuerName.length() != 0) {                            if (downloadDO.getFilename().compareTo(neuerName) !=                                0) {                                ApplejuiceFassade.getInstance().renameDownload(                                    downloadDO.getId(), neuerName);                            }                        }                    }                }            }