themesDateien.add(themeFiles[i].toURL());
ZipFile jf = new ZipFile(themeFiles[i]); ZipEntry entry = jf.getEntry("skinlf-themepack.xml"); if (entry!=null){ themesDateien.add(themeFiles[i].toURL()); }
    protected JMenuBar createMenuBar() {        try {            if (!themesInitialized) {                AppleJuiceDialog.initThemes();            }            String path = System.getProperty("user.dir") + File.separator +                "language" +                File.separator;            File languagePath = new File(path);            if (!languagePath.isDirectory()) {                closeWithErrormessage("Der Ordner " + path +                                      " fr die Sprachauswahl xml-Dateien ist nicht vorhanden." +                                      "\r\nappleJuice wird beendet.", false);            }            String[] tempListe = languagePath.list();            HashSet sprachDateien = new HashSet();            for (int i = 0; i < tempListe.length; i++) {                if (tempListe[i].indexOf(".xml") != -1) {                    sprachDateien.add(tempListe[i]);                }            }            if (sprachDateien.size() == 0) {                closeWithErrormessage(                    "Es sind keine xml-Dateien fr die Sprachauswahl im Ordner " +                    path + " vorhanden." +                    "\r\nappleJuice wird beendet.", false);            }            JMenuBar menuBar = new JMenuBar();            optionenMenu = new JMenu("Extras");            menuItemOptionen.addActionListener(new ActionListener() {                public void actionPerformed(ActionEvent e) {                    showOptionsDialog();                }            });            menuItemDateiliste.addActionListener(new ActionListener() {                public void actionPerformed(ActionEvent e) {                    dateiListeImportieren();                }            });            menuItemCoreBeenden.addActionListener(new ActionListener() {                public void actionPerformed(ActionEvent e) {                    int result = JOptionPane.showConfirmDialog(AppleJuiceDialog.                        getApp(), bestaetigung,                        "appleJuice Client", JOptionPane.YES_NO_OPTION,                        JOptionPane.WARNING_MESSAGE);                    if (result == JOptionPane.YES_OPTION) {                        ApplejuiceFassade.getInstance().exitCore();                    }                }            });            menuItemUeber.addActionListener(new ActionListener() {                public void actionPerformed(ActionEvent e) {                    showAboutDialog();                }            });            optionenMenu.add(menuItemOptionen);            optionenMenu.add(menuItemDateiliste);            optionenMenu.add(menuItemUeber);            menuBar.add(optionenMenu);            sprachMenu = new JMenu("Sprache");            menuBar.add(sprachMenu);            ButtonGroup lafGroup = new ButtonGroup();            Iterator it = sprachDateien.iterator();            while (it.hasNext()) {                String sprachText = LanguageSelector.getInstance(path +                    (String) it.next()).                    getFirstAttrbuteByTagName(".root.Languageinfo.name");                JCheckBoxMenuItem rb = new JCheckBoxMenuItem(sprachText);                if (PropertiesManager.getOptionsManager().getSprache().                    equalsIgnoreCase(sprachText)) {                    rb.setSelected(true);                }                Image img = Toolkit.getDefaultToolkit().getImage(path +                    sprachText.toLowerCase() + ".gif");                ImageIcon result = new ImageIcon();                result.setImage(img);                rb.setIcon(result);                sprachMenu.add(rb);                rb.addItemListener(new ItemListener() {                    public void itemStateChanged(ItemEvent ae) {                        JCheckBoxMenuItem rb2 = (JCheckBoxMenuItem) ae.                            getSource();                        if (rb2.isSelected()) {                            String path = System.getProperty("user.dir") +                                File.separator +                                "language" + File.separator;                            String dateiName = path + rb2.getText().toLowerCase() +                                ".xml";                            LanguageSelector.getInstance(dateiName);                        }                    }                });                lafGroup.add(rb);            }            themesMenu = new JMenu("Themes");            if (PropertiesManager.getOptionsManager().isThemesSupported()) {                HashSet themesDateien = new HashSet();                File themesPath = new File(System.getProperty("user.dir") +                                           File.separator + "themes");                if (!themesPath.isDirectory()) {                    closeWithErrormessage("Der Ordner " + path +                                          " fr die Themes zip-Dateien ist nicht vorhanden." +                                          "\r\nappleJuice wird beendet.", false);                }                File[] themeFiles = themesPath.listFiles();                for (int i = 0; i < themeFiles.length; i++) {                    if (themeFiles[i].isFile() &&                        themeFiles[i].getName().indexOf(".zip") != -1) {                        themesDateien.add(themeFiles[i].toURL());                    }                }                it = themesDateien.iterator();                ButtonGroup lafGroup2 = new ButtonGroup();                Skin standardSkin = null;                String temp;                String shortName = "";                String defaultTheme = PropertiesManager.getOptionsManager().                    getDefaultTheme();                while (it.hasNext()) {                    URL skinUrl = (URL) it.next();                    temp = skinUrl.getFile();                    int index1 = temp.lastIndexOf('/');                    int index2 = temp.lastIndexOf(".zip");                    if (index1 == -1 || index2 == -1) {                        continue;                    }                    shortName = temp.substring(index1 + 1, index2);                    final JCheckBoxMenuItem rb = new JCheckBoxMenuItem(                        shortName);                    if (shortName.compareToIgnoreCase(defaultTheme) == 0) {                        rb.setSelected(true);                    }                    rb.addItemListener(new ItemListener() {                        public void itemStateChanged(ItemEvent ae) {                            if (rb.isSelected()) {                                activateLaF(rb.getText());                            }                        }                    });                    lafGroup2.add(rb);                    themesMenu.add(rb);                }                themesMenu.add(new JSeparator());                menuItemDeaktivieren.setText("deaktivieren");                menuItemDeaktivieren.addActionListener(new ActionListener() {                    public void actionPerformed(ActionEvent ce) {                        activateThemeSupport(false);                    }                });                themesMenu.add(menuItemDeaktivieren);            }            else {                JMenuItem menuItem = new JMenuItem();                menuItem.setText("aktivieren");                menuItem.addActionListener(new ActionListener() {                    public void actionPerformed(ActionEvent ce) {                        activateThemeSupport(true);                    }                });                themesMenu.add(menuItem);            }            menuBar.add(themesMenu);            coreMenu = new JMenu("Core");            coreMenu.add(menuItemCoreBeenden);            menuBar.add(coreMenu);            return menuBar;        }        catch (Exception e) {            if (logger.isEnabledFor(Level.ERROR)) {                logger.error("Unbehandelte Exception", e);            }            return null;        }    }