| 1 | |
package org.jtheque.films.view.impl.actions.auto.imports; |
| 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.language.ILanguageManager; |
| 22 | |
import org.jtheque.core.managers.view.able.IViewManager; |
| 23 | |
import org.jtheque.core.managers.view.impl.actions.JThequeAction; |
| 24 | |
import org.jtheque.films.view.able.IAutoImportView; |
| 25 | |
import org.jtheque.utils.StringUtils; |
| 26 | |
|
| 27 | |
import java.awt.event.ActionEvent; |
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | |
public final class AcAddTitle extends JThequeAction { |
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
public AcAddTitle() { |
| 39 | 0 | super("generic.view.actions.add"); |
| 40 | 0 | } |
| 41 | |
|
| 42 | |
@Override |
| 43 | |
public void actionPerformed(ActionEvent arg0) { |
| 44 | 0 | String title = Managers.getManager(IViewManager.class). |
| 45 | |
askUserForText(Managers.getManager(ILanguageManager.class).getMessage("auto.import.input.title")); |
| 46 | |
|
| 47 | 0 | if (!StringUtils.isEmpty(title)) { |
| 48 | 0 | IAutoImportView autoImportView = Managers.getManager(IBeansManager.class).getBean("autoImportView"); |
| 49 | |
|
| 50 | 0 | autoImportView.getModelTitles().addElement(title); |
| 51 | 0 | autoImportView.getModel().getTitles().add(title); |
| 52 | |
} |
| 53 | 0 | } |
| 54 | |
} |