toolbarWrapper.add( toolbar );
toolbarWrapper.setStyleName( "files-toolbar" ); //$NON-NLS-1$
add( toolbarWrapper );
SimplePanel filesListWrapper = new SimplePanel();
FocusPanel fp = new FocusPanel( filesList ) {
public void onBrowserEvent( Event event ) {
if ( ( DOM.eventGetType( event ) & Event.ONKEYDOWN ) == Event.ONKEYDOWN ) {
if ( event.getKeyCode() == KeyCodes.KEY_UP ) {
selectPreviousItem( selectedFileItems );
} else if ( event.getKeyCode() == KeyCodes.KEY_DOWN ) {
selectNextItem( selectedFileItems );
} else if ( event.getKeyCode() == KeyCodes.KEY_ENTER ) {
SolutionBrowserPanel sbp = SolutionBrowserPanel.getInstance();
FilesListPanel flp = sbp.getFilesListPanel();
List<FileItem> items = flp.getSelectedFileItems();
if ( items != null && items.size() == 1 ) {
sbp.openFile( items.get( 0 ).getRepositoryFile(), COMMAND.RUN );
}
}
}
super.onBrowserEvent( event );
}
};
filesList.setCellPadding( 1 );
filesList.setWidth( "100%" );
AbsolutePanel bounderyPanel = new AbsolutePanel();
bounderyPanel.add( fp );
fp.sinkEvents( Event.KEYEVENTS );
filesListWrapper.add( bounderyPanel );
fp.getElement().getStyle().setProperty( "margin", "29px 0px 10px 0px" ); //$NON-NLS-1$ //$NON-NLS-2$
filesListWrapper.setStyleName( "files-list-panel" ); //$NON-NLS-1$
add( filesListWrapper );
setStyleName( "panelWithTitledToolbar" ); //$NON-NLS-1$
setWidth( "100%" ); //$NON-NLS-1$