private void fsTreeValueChanged(javax.swing.event.TreeSelectionEvent evt)//GEN-FIRST:event_fsTreeValueChanged
    {//GEN-HEADEREND:event_fsTreeValueChanged
        DefaultMutableTreeNode node = (DefaultMutableTreeNode) evt.getPath().getLastPathComponent();
        Object obj = node.getUserObject();

        String text = "";
        optionsPanel.removeAll();

        if (obj instanceof File)
        {
            final File f = (File) obj;
            FileType ft = FileType.typeForFile(f);
            text = ft.toString() + " file, ID: " + f.getId() + ", size: " + f.getFileSize() + " bytes";

            for (final FileAction act : Actions.actions)
                if (act.canDoOn(ft))
                {
                    JButton but = new JButton(act.toString());
                    optionsPanel.add(but);
                    but.addActionListener(new ActionListener()
                    {
                        @Override
                        public void actionPerformed(ActionEvent e)
                        {
                            act.doOn(f);
                        }
                    });
                }
        }
        else if (obj instanceof Directory)
        {
            Directory d = (Directory) obj;
            text = "Directory, ID: " + d.getId();
        }

        optionsPanel.invalidate();
        optionsPanel.repaint();
        infoLabel.setText(text);
    }//GEN-LAST:event_fsTreeValueChanged