| | package com.keenwrite.ui.explorer; |
| | |
| | +import com.keenwrite.events.FileOpenEvent; |
| | import com.keenwrite.ui.controls.BrowseButton; |
| | import javafx.beans.property.*; |
 |
| | import java.util.List; |
| | import java.util.Locale; |
| | +import java.util.Objects; |
| | import java.util.Optional; |
| | |
| | import static com.keenwrite.constants.Constants.UI_CONTROL_SPACING; |
| | -import static com.keenwrite.events.FileOpenEvent.fire; |
| | import static com.keenwrite.events.StatusEvent.clue; |
| | import static com.keenwrite.ui.fonts.IconFactory.createFileIcon; |
 |
| | } |
| | |
| | - for( final var f : directory.list() ) { |
| | + for( final var f : Objects.requireNonNull( directory.list() ) ) { |
| | if( !f.startsWith( "." ) ) { |
| | mItems.add( pathEntry( Paths.get( directory.toString(), f ) ) ); |
 |
| | |
| | mDirectory.addListener( ( c, o, n ) -> { |
| | - if( n != null ) { field.setText( n.getAbsolutePath() ); } |
| | + if( n != null ) {field.setText( n.getAbsolutePath() );} |
| | } ); |
| | |
 |
| | |
| | if( file.isFile() ) { |
| | - fire( path.toUri() ); |
| | + FileOpenEvent.fire( path.toUri() ); |
| | } |
| | else if( file.isDirectory() ) { |
 |
| | private final StringProperty mTime; |
| | |
| | - protected PathEntry( final Path path ) throws IOException { |
| | + private PathEntry( final Path path ) throws IOException { |
| | this( |
| | path, |