private void initListening() { controlView.addLibraryListSelectionListener( new LibrarySelectionListener(controlView, searchControl, resources)); libraryModel.addLibraryChangedListener( new ILibraryChangedListener() { public void librariesChanged(ILibrary[] allLibraries, ILibrary selectedLibrary) { controlView.getLibraryView().setObjects(allLibraries); } }); selectionModel.addCurrentSelectionChangeListener( new IChangeListener() { public void changeOccurred() { refreshTrackView(); } }); selectionModel .getTrackDetailModel() .addChangeDetailListener( new IChangeListener() { public void changeOccurred() { refreshTrackView(); } }); }
private void initSelectionModelListening() { if (selectionModel == null) { return; } final ITrackDetailModel trackDetailModel = selectionModel.getTrackDetailModel(); trackDetailModel.addTrackChangeListener( new IChangeListener() { public void changeOccurred() { IMp3Track selectedTrack = trackDetailModel.getSelectedTrack(); if (selectedTrack != null) { try { playerModel.stopPlayback(); playerModel.setTrack(selectedTrack); } catch (AnathemaException e1) { e1.printStackTrace(); } } } }); }
@Override protected void execute(Component parentComponent) { selectionModel.removeFromCurrentSelection(trackListView.getSelectedIndices()); }