Source:
public SingleFilePropertyWidget(ConfiguredPropertyDescriptor propertyDescriptor, ComponentBuilder componentBuilder, UserPreferences userPreferences) { super(componentBuilder, propertyDescriptor); _userPreferences = userPreferences; _fileResolver = new FileResolver(getAnalysisJobBuilder().getConfiguration()); boolean openFileDialog = true; FileProperty fileProperty = propertyDescriptor.getAnnotation(FileProperty.class); if (fileProperty != null) { _accessMode = fileProperty.accessMode(); _extensions = fileProperty.extension(); openFileDialog = (_accessMode == FileAccessMode.OPEN); } else { _extensions = null; _accessMode = FileAccessMode.OPEN; } _filenameField = new FilenameTextField(_userPreferences.getConfiguredFileDirectory(), openFileDialog); if (_extensions != null && _extensions.length > 0) { List<FileFilter> filters = new ArrayList<FileFilter>(_extensions.length); for (String extension : _extensions) { FileFilter filter = new ExtensionFilter(extension.toUpperCase() + " file", "." + extension); filters.add(filter); _filenameField.addChoosableFileFilter(filter); } if (filters.size() == 1) { _filenameField.setSelectedFileFilter(filters.get(0)); } else { FileFilter filter = FileFilters.combined("All suggested file formats", filters.toArray(new FileFilter[filters.size()])); _filenameField.setSelectedFileFilter(filter); } } else { _filenameField.setSelectedFileFilter(FileFilters.ALL); } File currentValue = getCurrentValue(); if (currentValue != null) { _filenameField.setFile(currentValue); } _filenameField.addSelectionListener(new FileSelectionListener() { @Override public void onSelected(final FilenameTextField filenameTextField, final File file) { if (file != null) { final File dir = file.getParentFile(); _userPreferences.setConfiguredFileDirectory(dir); } fireValueChanged(); } }); add(_filenameField); }

Target:
public SingleFilePropertyWidget(ConfiguredPropertyDescriptor propertyDescriptor, ComponentBuilder componentBuilder, UserPreferences userPreferences) { super(componentBuilder, propertyDescriptor); _userPreferences = userPreferences; _fileResolver = new FileResolver(getAnalysisJobBuilder().getConfiguration()); boolean openFileDialog = true; FileProperty fileProperty = propertyDescriptor.getAnnotation(FileProperty.class); if (fileProperty != null) { _accessMode = fileProperty.accessMode(); _extensions = fileProperty.extension(); openFileDialog = (_accessMode == FileAccessMode.OPEN); } else { _extensions = null; _accessMode = FileAccessMode.OPEN; } _filenameField = new FilenameTextField(_userPreferences.getConfiguredFileDirectory(), openFileDialog); if (_extensions != null && _extensions.length > 0) { List<FileFilter> filters = new ArrayList<FileFilter>(_extensions.length); for (String extension : _extensions) { FileFilter filter = new ExtensionFilter(extension.toUpperCase() + " file", "." + extension); filters.add(filter); _filenameField.addChoosableFileFilter(filter); } if (filters.size() == 1) { _filenameField.setSelectedFileFilter(filters.get(0)); } else { FileFilter filter = FileFilters.combined("All suggested file formats", filters.toArray(new FileFilter[filters.size()])); _filenameField.setSelectedFileFilter(filter); } } else { _filenameField.setSelectedFileFilter(FileFilters.ALL); } File currentValue = getCurrentValue(); if (currentValue != null) { _filenameField.setFile(currentValue); } _filenameField.addFileSelectionListener(new FileSelectionListener() { @Override public void onSelected(final FilenameTextField filenameTextField, final File file) { if (file != null) { final File dir = file.getParentFile(); _userPreferences.setConfiguredFileDirectory(dir); } fireValueChanged(); } }); add(_filenameField); }