if ( onPathClick == null ) {
breadcrumbs.add( new ListItem( new InlineLabel( repoName ) ) {{
setStyleName( NavigatorResources.INSTANCE.css().repoName() );
}} );
} else {
breadcrumbs.add( new NavLink( repoName ) {{
setStyleName( NavigatorResources.INSTANCE.css().repoName() );
addClickHandler( new ClickHandler() {
@Override
public void onClick( ClickEvent event ) {
onPathClick.execute( root );
}
} );
}} );
}
} else if ( root != null ) {
if ( onPathClick == null ) {
breadcrumbs.add( new ListItem( new InlineLabel( file.getFileName() ) ) {{
setStyleName( NavigatorResources.INSTANCE.css().repoName() );
}} );
} else {
breadcrumbs.add( new NavLink( root.getFileName() ) {{
setStyleName( NavigatorResources.INSTANCE.css().repoName() );
addClickHandler( new ClickHandler() {
@Override
public void onClick( ClickEvent event ) {
onPathClick.execute( root );
}
} );
}} );
}
}
if ( path != null && !path.isEmpty() ) {
if ( onPathClick == null ) {
for ( final Path activePath : path ) {
breadcrumbs.add( new ListItem( new InlineLabel( activePath.getFileName() ) {{
setStyleName( NavigatorResources.INSTANCE.css().directory() );
}} ) );
}
} else {
for ( final Path activePath : path ) {
breadcrumbs.add( new NavLink( activePath.getFileName() ) {{
setStyleName( NavigatorResources.INSTANCE.css().directory() );
addClickHandler( new ClickHandler() {
@Override
public void onClick( ClickEvent event ) {
onPathClick.execute( activePath );