final Path path = (Path) value.content();
if( path != null && path.segmentCount() > 1 )
{
dialog.setFilterPath( path.removeLastSegments( 1 ).toOSString() );
dialog.setFileName( path.lastSegment() );
}
else if( roots.size() > 0 )
{
dialog.setFilterPath( roots.get( 0 ).toOSString() );
}