DateiListeDialog dateiListeDialog = new DateiListeDialog(parent, false);
DateiListeDialog dateiListeDialog = new DateiListeDialog(AppleJuiceDialog.getApp(), false);
    private void init() throws Exception {        IconManager im = IconManager.getInstance();        itemCopyToClipboard.setIcon(im.getIcon("clipboard"));        itemCopyToClipboardAsUBBCode.setIcon(im.getIcon("clipboard"));        popup2.add(itemCopyToClipboard);        popup2.add(itemCopyToClipboardAsUBBCode);        folderTree.setModel(new DefaultTreeModel(new WaitNode()));        folderTree.setCellRenderer(new ShareSelectionTreeCellRenderer());        itemCopyToClipboard.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent ae) {                Object[] obj = shareTable.getSelectedItems();                if (((ShareNode)obj[0]).isLeaf()){                    ShareDO shareDO = ((ShareNode)obj[0]).getDO();                    Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();                    StringBuffer toCopy = new StringBuffer();                    toCopy.append("ajfsp://file|");                    toCopy.append(shareDO.getShortfilename() + "|" + shareDO.getCheckSum() + "|" + shareDO.getSize() + "/");                    StringSelection contents = new StringSelection(toCopy.toString());                    cb.setContents(contents, null);                }            }        });        itemCopyToClipboardAsUBBCode.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent ae) {                Object[] obj = shareTable.getSelectedItems();                if (((ShareNode)obj[0]).isLeaf()){                    ShareDO shareDO = ((ShareNode)obj[0]).getDO();                    Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();                    StringBuffer toCopy = new StringBuffer();                    StringBuffer tempFilename = new StringBuffer(shareDO.getShortfilename());                    for (int i=0; i<tempFilename.length(); i++){                        if (tempFilename.charAt(i)==' '){                            tempFilename.setCharAt(i, '.');                        }                    }                    String encodedFilename = "";                    try {                        encodedFilename = URLEncoder.encode(tempFilename.toString(), "ISO-8859-1");                    }                    catch (UnsupportedEncodingException ex) {                        //gibbet, also nix zu behandeln...                    }                    toCopy.append("[URL=ajfsp://file|");                    toCopy.append(encodedFilename + "|" + shareDO.getCheckSum() + "|" + shareDO.getSize());                    toCopy.append("/]" + shareDO.getShortfilename() + "[/URL]");                    StringSelection contents = new StringSelection(toCopy.toString());                    cb.setContents(contents, null);                }            }        });        neueListe.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent ae) {                DateiListeDialog dateiListeDialog = new DateiListeDialog(parent, false);                shareTable.setDragEnabled(true);                dateiListeDialog.show();            }        });        cmbPrio.setEditable(false);        for (int i = 1; i < 251; i++)        {            cmbPrio.addItem(new Integer(i));        }        prioritaetAufheben.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent ae) {                prioritaetAufheben.setEnabled(false);                prioritaetSetzen.setEnabled(false);                neuLaden.setEnabled(false);                final SwingWorker worker = new SwingWorker() {                    public Object construct() {                        try{                            Object[] values = shareTable.getSelectedItems();                            if (values == null)                                return null;                            ShareNode shareNode = null;                            for (int i = 0; i < values.length; i++)                            {                                shareNode = (ShareNode) values[i];                                shareNode.setPriority(1);                            }                        }                        catch (Exception e)                        {                            if (logger.isEnabledFor(Level.ERROR))                                logger.error("Unbehandelte Exception", e);                        }                        return null;                    }                    public void finished() {                        SwingUtilities.invokeLater(new Runnable() {                            public void run() {                                shareTable.updateUI();                                prioritaetAufheben.setEnabled(true);                                prioritaetSetzen.setEnabled(true);                                neuLaden.setEnabled(true);                            }                        });                    }                };                worker.start();            }        });        prioritaetSetzen.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent ae) {                prioritaetAufheben.setEnabled(false);                prioritaetSetzen.setEnabled(false);                neuLaden.setEnabled(false);                new Thread() {                    public void run() {                        try{                            int prio = ((Integer) cmbPrio.getSelectedItem()).intValue();                            Object[] values = shareTable.getSelectedItems();                            synchronized (values){                                if (values == null)                                    return;                                ShareNode shareNode = null;                                for (int i = 0; i < values.length; i++) {                                    shareNode = (ShareNode) values[i];                                    shareNode.setPriority(prio);                                }                            }                            shareNeuLaden(false);                        }                        catch (Exception e)                        {                            if (logger.isEnabledFor(Level.ERROR))                                logger.error("Unbehandelte Exception", e);                        }                    }                }.start();            }        });        item1 = new JMenuItem();        item1.setIcon(im.getIcon("sharedwsub"));        item2 = new JMenuItem();        item2.setIcon(im.getIcon("sharedwosub"));        item3 = new JMenuItem();        item3.setIcon(im.getIcon("notshared"));        popup.add(item1);        popup.add(item2);        popup.add(item3);        shareModel = new ShareModel(new ShareNode(null, null));        shareTable = new ShareTable(shareModel);        shareTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);        shareTable.addMouseListener(new MouseAdapter() {            public void mousePressed(MouseEvent me) {                if (SwingUtilities.isRightMouseButton(me))                {                    Point p = me.getPoint();                    int iRow = shareTable.rowAtPoint(p);                    int iCol = shareTable.columnAtPoint(p);                    if (iRow==-1 || iCol==-1){                        return;                    }                    shareTable.setRowSelectionInterval(iRow, iRow);                    shareTable.setColumnSelectionInterval(iCol, iCol);                }                maybeShowPopup(me);            }            public void mouseReleased(MouseEvent e) {                super.mouseReleased(e);                maybeShowPopup(e);            }            private void maybeShowPopup(MouseEvent e) {                if (e.isPopupTrigger() && shareTable.getSelectedRowCount()==1)                {                    Object[] obj = shareTable.getSelectedItems();                    if (((ShareNode)obj[0]).isLeaf()){                        popup2.show(shareTable, e.getX(), e.getY());                    }                }            }        });        titledBorder1 = new TitledBorder("Test");        titledBorder2 = new TitledBorder("Tester");        setLayout(new BorderLayout());        panelCenter = new JPanel(new BorderLayout());        panelCenter.setBorder(titledBorder2);        neueListe.setIcon(IconManager.getInstance().getIcon("treeRoot"));        neuLaden.setIcon(IconManager.getInstance().getIcon("erneuern"));        refresh.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent ae) {                refresh.setEnabled(false);                final SwingWorker worker = new SwingWorker() {                    public Object construct() {                        try{                            HashSet shares = ajSettings.getShareDirs();                            ApplejuiceFassade.getInstance().setShare(shares);                        }                        catch (Exception e)                        {                            if (logger.isEnabledFor(Level.ERROR))                                logger.error("Unbehandelte Exception", e);                        }                        return null;                    }                    public void finished() {                        refresh.setEnabled(true);                    }                };                worker.start();            }        });        neuLaden.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent ae) {                shareNeuLaden(true);            }        });        JPanel panel1 = new JPanel(new FlowLayout(FlowLayout.LEFT));        panel1.add(neueListe);        panel1.add(neuLaden);        panel1.add(cmbPrio);        panel1.add(prioritaetSetzen);        panel1.add(prioritaetAufheben);        panelCenter.add(panel1, BorderLayout.NORTH);        JScrollPane scrollPane = new JScrollPane(shareTable);        scrollPane.setBackground(shareTable.getBackground());        scrollPane.getViewport().setOpaque(false);        panelCenter.add(scrollPane, BorderLayout.CENTER);        panelCenter.add(dateien, BorderLayout.SOUTH);        JScrollPane aScrollPane = new JScrollPane(folderTree);        aScrollPane.setBorder(titledBorder1);        JPanel panelWest = new JPanel(new BorderLayout());        panelWest.add(aScrollPane, BorderLayout.CENTER);        panelWest.add(refresh, BorderLayout.SOUTH);        add(panelWest, BorderLayout.WEST);        add(panelCenter, BorderLayout.CENTER);        treeMouseAdapter = new TreeMouseAdapter();        LanguageSelector.getInstance().addLanguageListener(this);        item1.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent ae) {                HashSet shares = ajSettings.getShareDirs();                DirectoryNode node = (DirectoryNode) folderTree.getLastSelectedPathComponent();                if (node != null)                {                    String path = node.getDO().getPath();                    ShareEntry entry = new ShareEntry(path, ShareEntry.SUBDIRECTORY);                    shares.add(entry);                    ApplejuiceFassade.getInstance().setShare(shares);                    DirectoryNode.setShareDirs(shares);                    folderTree.updateUI();                }            }        });        item2.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent ae) {                HashSet shares = ajSettings.getShareDirs();                DirectoryNode node = (DirectoryNode) folderTree.getLastSelectedPathComponent();                if (node != null)                {                    String path = node.getDO().getPath();                    ShareEntry entry = new ShareEntry(path, ShareEntry.SINGLEDIRECTORY);                    shares.add(entry);                    ApplejuiceFassade.getInstance().setShare(shares);                    DirectoryNode.setShareDirs(shares);                    folderTree.updateUI();                }            }        });        item3.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent ae) {                HashSet shares = ajSettings.getShareDirs();                DirectoryNode node = (DirectoryNode) folderTree.getLastSelectedPathComponent();                if (node != null)                {                    String path = node.getDO().getPath();                    Iterator it = shares.iterator();                    ShareEntry toRemove = null;                    while (it.hasNext())                    {                        toRemove = (ShareEntry) it.next();                        if (toRemove.getDir().compareToIgnoreCase(path) == 0)                        {                            break;                        }                        toRemove = null;                    }                    if (toRemove != null)                    {                        shares.remove(toRemove);                        ApplejuiceFassade.getInstance().setShare(shares);                        DirectoryNode.setShareDirs(shares);                        folderTree.updateUI();                    }                }            }        });    }