KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: ExitModule.java,v 1.4 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 /**
25  * The module responsible for closing the application.
26  *
27  * @version $Id: ExitModule.java,v 1.4 2007/01/07 06:14:39 bastafidli Exp $
28  * @author Miro Halas
29  * @code.reviewer Miro Halas
30  * @code.reviewed 1.2 2006/03/13 15:39:55 bastafidli
31  */

32 public abstract class ExitModule extends ThickClientModuleImpl
33 {
34    // Public methods ///////////////////////////////////////////////////////////
35

36    /**
37     * {@inheritDoc}
38     */

39    public String JavaDoc getName()
40    {
41       return "Exit";
42    }
43
44    /**
45     * {@inheritDoc}
46     */

47    public boolean activate(
48       boolean bReactivate
49    )
50    {
51       closeMainWindow();
52       return false;
53    }
54    
55    /**
56     * {@inheritDoc}
57     */

58    public void pasivate()
59    {
60       // Since this module can be never activated, it cannot be also pasivated
61
assert false : "This method shouldn't be ever invoked.";
62    }
63
64    // Helper methods ///////////////////////////////////////////////////////////
65

66    /**
67     * Close the main window since it is no longer necessary. Since this depends
68     * on GUI implementation technology, delegate this to child clas.
69     */

70    protected abstract void closeMainWindow();
71 }
72
Popular Tags