| 1 | |
package org.jtheque.films.controllers.impl; |
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
import org.jtheque.core.managers.log.IJThequeLogger; |
| 20 | |
import org.jtheque.core.managers.log.Logger; |
| 21 | |
import org.jtheque.core.managers.view.able.controller.AbstractController; |
| 22 | |
import org.jtheque.films.controllers.able.ISitesController; |
| 23 | |
import org.jtheque.films.utils.FileUtils; |
| 24 | |
import org.jtheque.films.view.able.ISitesView; |
| 25 | |
|
| 26 | |
import javax.annotation.Resource; |
| 27 | |
import javax.swing.event.ListSelectionEvent; |
| 28 | |
import java.io.IOException; |
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | 0 | public final class SitesController extends AbstractController implements ISitesController { |
| 36 | |
@Resource |
| 37 | |
private ISitesView sitesView; |
| 38 | |
|
| 39 | |
@Logger |
| 40 | |
private IJThequeLogger logger; |
| 41 | |
|
| 42 | |
@Override |
| 43 | |
public ISitesView getView() { |
| 44 | 0 | return sitesView; |
| 45 | |
} |
| 46 | |
|
| 47 | |
@Override |
| 48 | |
public void valueChanged(ListSelectionEvent event) { |
| 49 | |
try { |
| 50 | 0 | sitesView.getSitesTextComponent().setPage(FileUtils.getLocalisedPage( |
| 51 | |
sitesView.getSelectedSite())); |
| 52 | 0 | } catch (IOException e1) { |
| 53 | 0 | sitesView.getSitesTextComponent().setText(""); |
| 54 | 0 | logger.error(e1); |
| 55 | 0 | } |
| 56 | 0 | } |
| 57 | |
} |