| 1 | |
package org.jtheque.films.view.impl.actions.file; |
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
import org.jtheque.core.managers.Managers; |
| 20 | |
import org.jtheque.core.managers.beans.IBeansManager; |
| 21 | |
import org.jtheque.core.managers.error.IErrorManager; |
| 22 | |
import org.jtheque.core.managers.error.InternationalizedError; |
| 23 | |
import org.jtheque.core.managers.log.ILoggingManager; |
| 24 | |
import org.jtheque.core.managers.view.impl.actions.JThequeAction; |
| 25 | |
import org.jtheque.films.controllers.able.IImportController; |
| 26 | |
import org.jtheque.utils.io.FileException; |
| 27 | |
|
| 28 | |
import java.awt.event.ActionEvent; |
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
public final class AcValidateImportView extends JThequeAction { |
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
public AcValidateImportView() { |
| 40 | 0 | super("generic.view.actions.validate"); |
| 41 | 0 | } |
| 42 | |
|
| 43 | |
@Override |
| 44 | |
public void actionPerformed(ActionEvent e) { |
| 45 | 0 | IImportController importController = Managers.getManager(IBeansManager.class).getBean("importController"); |
| 46 | |
|
| 47 | |
try { |
| 48 | 0 | importController.importData(importController.getView().getFilePath()); |
| 49 | 0 | } catch (FileException e1) { |
| 50 | 0 | Managers.getManager(ILoggingManager.class).getLogger(getClass()).error(e1); |
| 51 | 0 | Managers.getManager(IErrorManager.class).addError(new InternationalizedError( |
| 52 | |
"export.errors.file.filenotfound.title", |
| 53 | |
"export.errors.file.filenotfound" + importController.getView().getFilePath())); |
| 54 | 0 | } |
| 55 | |
|
| 56 | 0 | importController.closeView(); |
| 57 | 0 | } |
| 58 | |
} |