コード例 #1
0
  @Override
  public void actionPerformed(ActionEvent e) {
    ICoverService coverService = Managers.getManager(IBeansManager.class).getBean("coverService");
    ICoverView coverView = Managers.getManager(IBeansManager.class).getBean("coverView");

    coverView.display(
        coverService.getReportImage(coverView.getSelectedFilm(), coverView.getSelectedFormat()));
  }
コード例 #2
0
  /**
   * Construct a new CreatedFilmEdit.
   *
   * @param film The created film.
   */
  public CreatedFilmEdit(Film film) {
    super();

    Managers.getManager(IBeansManager.class).inject(this);

    this.film = film;
  }
コード例 #3
0
  @Override
  public void writeFile(BufferedOutputStream stream, BasicDataSource source) {
    JTFEDataSource dataSource = (JTFEDataSource) source;

    Collection<File> files = new ArrayList<File>(dataSource.getFilms().size());
    JTFileWriter writer = new JTFFileWriter();

    int count = 0;
    for (Film film : dataSource.getFilms()) {
      ++count;

      File f =
          new File(
              Managers.getCore().getFolders().getTempFolderPath()
                  + File.separator
                  + count
                  + ".jtf");

      try {
        BasicDataSource filmDataSource = new JTFDataSource(film);
        filmDataSource.setFileVersion(dataSource.getFileVersion());
        filmDataSource.setVersion(dataSource.getVersion());

        writer.writeFile(f, filmDataSource);
      } catch (FileException e) {
        Managers.getManager(ILoggingManager.class).getLogger(getClass()).error(e);
      }

      files.add(f);
    }

    FileUtils.zip(files, stream);

    for (File f : files) {
      if (!f.delete()) {
        Managers.getManager(IErrorManager.class)
            .addInternationalizedError("errors.jtfe.delete", f.getAbsolutePath());
      }
    }
  }
コード例 #4
0
  @Override
  public ControllerState view(Data data) {
    Person realizer = (Person) data;

    assert realizer.getType().equals(IRealizersService.PERSON_TYPE)
        : "The person must of type Actor";

    if (Managers.getManager(IViewManager.class)
        .askI18nUserForConfirmation(
            "realizer.dialogs.confirmSave", "realizer.dialogs.confirmSave.title")) {
      controller.save();
    } else {
      getViewModel().getCurrentRealizer().restoreMemento();
    }

    getViewModel().setCurrentRealizer(realizer);

    return controller.getViewState();
  }
コード例 #5
0
 @Override
 public void refreshText() {
   chart.setTitle(Managers.getManager(ILanguageManager.class).getMessage(key));
 }
コード例 #6
0
 @Override
 public String getPresentationName() {
   return Managers.getManager(ILanguageManager.class).getMessage("undo.edits.create");
 }