KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > core > application > ThickClientModule


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: ThickClientModule.java,v 1.7 2007/01/07 06:14:39 bastafidli Exp $
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; version 2 of the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */

21  
22 package org.opensubsystems.core.application;
23
24 import org.opensubsystems.core.error.OSSException;
25
26 /**
27  * Interface representing thick client module, which is either specific action
28  * executed when activated or set of screens acting together.
29  *
30  * The lifecycle of the thick client module is
31  *
32  * 1. constructor
33  * 2. init if ever acticated
34  * 3. activate if ever acticated
35  * 4. optional refresh if invoked by functionality
36  * 5. optional pasivate
37  * 6. optional activate if previously pasivated + refresh
38  * 7. repeat 4 - 6
39  * 8. destroy
40  *
41  * @version $Id: ThickClientModule.java,v 1.7 2007/01/07 06:14:39 bastafidli Exp $
42  * @author Miro Halas
43  * @code.reviewer Miro Halas
44  * @code.reviewed 1.5 2006/03/13 15:41:48 bastafidli
45  */

46 public interface ThickClientModule
47 {
48    /**
49     * Get user friedly name UNIQUE name of the module.
50     *
51     * @return String
52     */

53    String JavaDoc getName(
54    );
55    
56    /**
57     * Get client displaing this module.
58     *
59     * @return ThickClient
60     */

61    ThickClient getClient(
62    );
63    
64    /**
65     * Initialize the module for a specified client. This method may not need to
66     * be called immediately after the module is constructed. It may be delayed
67     * until the module is actually accesed to speed up start up of application.
68     * It must be called before any other lifecycle method in this interface is
69     * invoked.
70     *
71     * @param client - client using this module
72     * @throws OSSException - an error has occured
73     */

74    void init(
75       ThickClient client
76    ) throws OSSException;
77    
78    /**
79     * Activate the module so that user can interact with it.
80     *
81     * @param bReactivate - this is true if the module was pasivated but it is
82     * being immediately activated again because the other
83     * module which caused it's pasivation coun't be
84     * activated again. This is false if some other module
85     * was active and now this module is being activated.
86     * @return boolean - true if sucessfully activated
87     * false if cannot be activated and either the previously
88     * active module should remain active or no module should
89     * be active
90     */

91    boolean activate(
92       boolean bReactivate
93    );
94    
95    /**
96     * Pasivate the module since user no longer interacts with it.
97     */

98    void pasivate(
99    );
100    
101    /**
102     * Refresh the currently displayed screen of this module with the latest
103     * data. This method will be called for example when user switches between
104     * two modules.
105     */

106    void refresh(
107    );
108    
109    /**
110     * Destroy the module since the application is shutting down.
111     */

112    void destroy(
113    );
114    
115    /**
116     * Display message to the user.
117     *
118     * @param strTitle - title of the message, look at MESSAGE_TITLE_XXX constants
119     * in ThickClienGui interface
120     * @param strMessage - message to display
121     * @param additionalInfo - additional information to pass in, this may be
122     * implementation specific, look at MESSAGE_STYLE_XXX
123     * constants in ThickClienGui interface
124     * @return Object - result of the message, this may be implementation
125     * specific
126     */

127    Object JavaDoc displayMessage(
128       String JavaDoc strTitle,
129       String JavaDoc strMessage,
130       Object JavaDoc additionalInfo
131    );
132 }
133
Popular Tags