1 package com.loribel.commons.abstraction;
2
3 import javax.swing.*;
4
5 /***
6 * Abstraction of a view Manager.
7 * A View manager is just an object tht is able to Returns a view.
8 * We can start and stop it to optimize the build of the view, and the exchange between
9 * model.
10 * <p>
11 * See the default implementation :
12 * GB_ViewManagerAbstract
13 * GB_ViewManagerSimple
14 * GB_ViewManagerComplex
15 *
16 * @author Grégory Borelli
17 */
18 public interface GB_ViewManager
19 extends
20 GB_LabelIconOwner,
21 GB_MenusOwner,
22 GB_Unregisterable
23 {
24 /***
25 * Returns the view managed by this ViewManager.
26 *
27 * @return JComponent
28 */
29 JComponent getView();
30
31 /***
32 * Returns true if the manager is started.
33 *
34 * @return boolean
35 */
36 boolean isStarted();
37
38 /***
39 * Start the manager.
40 */
41 void start();
42
43 /***
44 * Stop the viewManager.
45 * If you want to block the stop, this method must returns false.
46 * Otherwise returns true.
47 *
48 * @param a_flagOk true if we want to stop with default stop actions,
49 * false for cancel ViewManager action (the save is ignored).
50 *
51 * @return boolean returns tru if success, false otherwise.
52 */
53 boolean stop(
54 boolean a_flagOk);
55
56 /***
57 * Returns true if stop is enabled.
58 */
59 boolean isStopEnabled();
60
61 void setStopEnabled(
62 boolean a_flag);
63 }