pl.edu.agh.cast.importer.wizard.template
Class TemplateManagementPresenter

java.lang.Object
  extended by pl.edu.agh.cast.importer.wizard.template.TemplateManagementPresenter
All Implemented Interfaces:
ITemplateSelectionListener

public class TemplateManagementPresenter
extends Object
implements ITemplateSelectionListener

Presenter for ITemplateManagementView.

Author:
AGH CAST Team

Constructor Summary
TemplateManagementPresenter(ITemplateManagementView view)
          Constructor.
 
Method Summary
 void dispose()
          Disposes this presenter.
 Collection<ImportTemplateGroup> getModel()
           
 IImportTemplate getSelectedTemplate()
           
 ITemplateManagementView getView()
           
 void handleExportTemplate(File file, IMsgBoxHelper msgBoxHelper)
          Handle template export to file.
 IImportTemplate handleImportTemplate(File file, IMsgBoxHelper msgBoxHelper)
          Handle import from file.
 void handleRemoveTemplate()
          Handle remove template action.
 void selectionChanged(IImportTemplate selected)
          Notifies about template selection change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateManagementPresenter

public TemplateManagementPresenter(ITemplateManagementView view)
Constructor.

Parameters:
view - view for this presenter
Method Detail

getModel

public Collection<ImportTemplateGroup> getModel()

getView

public ITemplateManagementView getView()

getSelectedTemplate

public IImportTemplate getSelectedTemplate()

handleRemoveTemplate

public void handleRemoveTemplate()
Handle remove template action.


handleImportTemplate

public IImportTemplate handleImportTemplate(File file,
                                            IMsgBoxHelper msgBoxHelper)
                                     throws TemplateException
Handle import from file. The calling view is responsible for choosing appropriate file.

Parameters:
file - file from template will be imported
msgBoxHelper - message box helper which is used to show messages to user
Returns:
imported template
Throws:
TemplateException - if any error occurs during import; exceptions should contain localized message which can be displayed to user

handleExportTemplate

public void handleExportTemplate(File file,
                                 IMsgBoxHelper msgBoxHelper)
Handle template export to file.

Parameters:
file - destination file
msgBoxHelper - message box helper which is used to show messages to user

selectionChanged

public void selectionChanged(IImportTemplate selected)
Notifies about template selection change.

Specified by:
selectionChanged in interface ITemplateSelectionListener
Parameters:
selected - actual selected template
See Also:
#selectionChanged(pl.edu.agh.cast.importer.base.template.IImportTemplate)

dispose

public void dispose()
Disposes this presenter. Note that view must be disposed manually.



Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.