KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: ThickClientModuleImpl.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 java.util.logging.Logger JavaDoc;
25
26 import org.opensubsystems.core.error.OSSException;
27 import org.opensubsystems.core.util.Log;
28
29 /**
30  * Base class for all thick client modules providing basic implementation
31  * of common tasks.
32  *
33  * @version $Id: ThickClientModuleImpl.java,v 1.7 2007/01/07 06:14:39 bastafidli Exp $
34  * @author Miro Halas
35  * @code.reviewer Miro Halas
36  * @code.reviewed 1.5 2006/03/13 15:41:59 bastafidli
37  */

38 public abstract class ThickClientModuleImpl implements ThickClientModule
39 {
40    // Attributes ///////////////////////////////////////////////////////////////
41

42    /**
43     * Client using this module.
44     */

45    protected ThickClient m_client;
46    
47    /**
48     * Flag telling us if the module was already initialized.
49     */

50    protected boolean m_bInitialized;
51    
52    // Cached values ////////////////////////////////////////////////////////////
53

54    /**
55     * Logger for this class
56     */

57    private static Logger JavaDoc s_logger = Log.getInstance(ThickClientModuleImpl.class);
58
59    // Constructors /////////////////////////////////////////////////////////////
60

61    /**
62     * Constructor
63     */

64    public ThickClientModuleImpl(
65    )
66    {
67       m_bInitialized = false;
68    }
69    
70    // Public methods ///////////////////////////////////////////////////////////
71

72    /**
73     * {@inheritDoc}
74     */

75    public ThickClient getClient(
76    )
77    {
78       return m_client;
79    }
80    
81    /**
82     * {@inheritDoc}
83     */

84    public void init(
85       ThickClient client
86    ) throws OSSException
87    {
88       s_logger.finer("Initializing module " + getName());
89       m_client = client;
90       m_bInitialized = true;
91    }
92    
93    /**
94     * {@inheritDoc}
95     */

96    public boolean activate(
97       boolean bReactivate
98    )
99    {
100       // Nothing to do
101
return true;
102    }
103
104    /**
105     * {@inheritDoc}
106     */

107    public void pasivate()
108    {
109       // Nothing to do
110
}
111
112    /**
113     * {@inheritDoc}
114     */

115    public void refresh()
116    {
117       // Nothing to do
118
}
119
120    /**
121     * {@inheritDoc}
122     */

123    public void destroy()
124    {
125       // Nothing to do
126
s_logger.finer("Destroying module " + getName());
127       m_bInitialized = false;
128    }
129
130    /**
131     * {@inheritDoc}
132     */

133    public Object JavaDoc displayMessage(
134       String JavaDoc strTitle,
135       String JavaDoc strMessage,
136       Object JavaDoc additionalInfo
137    )
138    {
139       // By default the moduleis displayed as part of the main window so just
140
// delegate the call to the main window method
141
return m_client.getGui().displayMessage(strTitle, strMessage, additionalInfo);
142    }
143 }
144
Popular Tags