1 /*
2 * This file is a part of CAST project.
3 * (c) Copyright 2007, AGH University of Science & Technology
4 * https://caribou.iisg.agh.edu.pl/trac/cast
5 *
6 * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 * http://www.eclipse.org/legal/epl-v10.html
10 */
11 /*
12 * File: ITemplateManagementView.java
13 * Created: 2009-09-16
14 * Author: kpietak
15 * $Id$
16 */
17
18 package pl.edu.agh.cast.importer.wizard.template;
19
20 import java.util.Collection;
21
22 import pl.edu.agh.cast.importer.base.template.IImportTemplate;
23 import pl.edu.agh.cast.importer.base.template.exception.TemplateException;
24
25 /**
26 * An interface which describes view template management view.
27 *
28 * @author AGH CAST Team
29 */
30 public interface ITemplateManagementView {
31
32 /**
33 * Initializes the view with presenter.
34 *
35 * @param presenter
36 * a presenter
37 */
38 void initialize(TemplateManagementPresenter presenter);
39
40 /**
41 * Sets list of import template groups as an input.
42 *
43 * @param groups
44 * collection of template groups
45 */
46 void setInput(Collection<TemplateGroupTreeEntry> groups);
47
48 /**
49 * Adds template selection listener.
50 *
51 * @param listener
52 * the template selection listener
53 */
54 public void addTemplateSelecionListener(final ITemplateSelectionListener listener);
55
56 /**
57 * Removes template selection listener.
58 *
59 * @param listener
60 * the template selection listener
61 */
62 public void removeTemplateSelectionListener(final ITemplateSelectionListener listener);
63
64 // BEGIN Handle user notifications
65
66 /**
67 * Notifies user that no template is selected while trying to remove one.
68 */
69 public void showNoTemplateSelectedInfo();
70
71 /**
72 * Notifies user that an error occurred removing a given template.
73 *
74 * @param template
75 * template which should be removed
76 * @param e
77 * an error
78 */
79 public void showCannotRemoveTemplateError(IImportTemplate template, TemplateException e);
80
81 /**
82 * Asks user if he/she wants to remove a given template.
83 *
84 * @param template
85 * template to remove
86 * @return <code>SWT.YES</code> if user wants to remove the template
87 */
88 public int showRemoveTemplateConfirmationQuestion(IImportTemplate template);
89
90 // END Handle user notifications
91
92 }