}
JPanel pnlDrives = new JPanel();
pnlDrives.setLayout(Layout.getGBL());
JComboBox cbDrives = ComponentFactory.getComboBox();
JButton btAddDrive = ComponentFactory.getIconButton(IconLibrary._icoAdd);
btAddDrive.setToolTipText(DcResources.getText("tpAddDrive"));
btAddDrive.setActionCommand("addDrive");
btAddDrive.addActionListener(this);
pnlDrives.add(cbDrives, Layout.getGBC( 0, 1, 1, 1, 30.0, 1.0
,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
new Insets(15, 5, 5, 5), 0, 0));
pnlDrives.add(btAddDrive, Layout.getGBC( 1, 1, 1, 1, 1.0, 1.0
,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
new Insets(15, 5, 5, 5), 0, 0));
add(pnlDrives, Layout.getGBC( 0, 1, 3, 1, 20.0, 1.0
,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
new Insets(0, 0, 0, 0), 0, 0));
DcTree tree;
for (Drive drive : new Drives().getDrives()) {
tree = new DcTree(new FileSystemTreeModel(drive.getPath(), filter));
tree.setCellRenderer(new FileSystemTreeNodeRenderer());
tree.setCellEditor(new FileSystemTreeNodeEditor());
tree.setEditable(true);
JScrollPane scroller = new JScrollPane(tree);
scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
add(scroller, Layout.getGBC( 0, 2, 1, 1, 20.0, 20.0
,GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
new Insets(5, 5, 5, 5), 0, 0));
scroller.setVisible(false);
scrollers.put(drive, scroller);
models.put(drive, (FileSystemTreeModel) tree.getModel());
cbDrives.addItem(drive);
}
cbDrives.setActionCommand("drvChanged");
cbDrives.addActionListener(this);
cbDrives.setSelectedIndex(0);
}