use of com.intellij.openapi.fileChooser.ex.FileDrop in project intellij-community by JetBrains.
the class SelectLocationStep method init.
protected void init() {
final DefaultActionGroup fileSystemActionGroup = createFileSystemActionGroup();
myFileSystemToolBar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, fileSystemActionGroup, true);
final JTree tree = myFileSystemTree.getTree();
tree.getSelectionModel().addTreeSelectionListener(myTreeSelectionListener);
tree.setCellRenderer(new NodeRenderer());
tree.addMouseListener(new PopupHandler() {
public void invokePopup(Component comp, int x, int y) {
final ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.UPDATE_POPUP, fileSystemActionGroup);
popupMenu.getComponent().show(comp, x, y);
}
});
tree.addSelectionPath(tree.getPathForRow(0));
new FileDrop(tree, new FileDrop.Target() {
public FileChooserDescriptor getDescriptor() {
return myChooserDescriptor;
}
public boolean isHiddenShown() {
return myFileSystemTree.areHiddensShown();
}
public void dropFiles(final List<VirtualFile> files) {
if (files.size() > 0) {
selectInTree(files.toArray(new VirtualFile[files.size()]));
}
}
});
super.init();
}
Aggregations