public List<File> selectFiles(Component source){
AbstractComponent targetComponent = currentContext.getSelectedManifestations()
.iterator().next().getManifestedComponent();
//Initialize the file chooser with the current user
User user = PlatformAccess.getPlatform().getCurrentUser();
final CustomFileChooser fileChooser = new CustomFileChooser();
//add the list of owners and set selection to current owner
fileChooser.addOwners(Arrays.asList(RoleAccess.getAllUsers()));
fileChooser.setOwner(user.getUserId());
fileChooser.setDialogTitle(bundle.getString("import_message")
+ targetComponent.getDisplayName());
fileChooser.setApproveButtonText(bundle.getString("import_button"));
fileChooser.setFileSelectionMode(FileChooser.FILES_AND_DIRECTORIES);
fileChooser.setFileFilter(new XMLFileFilter());
fileChooser.setMultiSelectionEnabled(true);
if (source == null) return null;
int returnVal = fileChooser.showOpenDialog(source);
if (returnVal == FileChooser.APPROVE_OPTION) {
File[] rootFileOrDir = fileChooser.getSelectedFiles();
List<File> files = Utilities.filterSelectedFiles(Arrays.asList(rootFileOrDir));
//set the owner
owner = fileChooser.getOwner();
return files;
}
return null;
}