KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > core > application > swt > SWTExitModule


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: SWTExitModule.java,v 1.3 2007/01/07 06:14:22 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.swt;
23
24 import org.eclipse.swt.graphics.Image;
25 import org.eclipse.swt.widgets.Composite;
26 import org.opensubsystems.core.application.ExitModule;
27
28 /**
29  * SWT specific implementation of ExitModule.
30  *
31  * @version $Id: SWTExitModule.java,v 1.3 2007/01/07 06:14:22 bastafidli Exp $
32  * @author Miro Halas
33  * @code.reviewer Miro Halas
34  * @code.reviewed 1.1 2006/02/16 14:39:37 bastafidli
35  */

36 public class SWTExitModule extends ExitModule
37                            implements SWTThickClientModule
38 {
39    // Public methods ///////////////////////////////////////////////////////////
40

41    /**
42     * {@inheritDoc}
43     */

44    public Composite getClientArea()
45    {
46       return null;
47    }
48
49    /**
50     * {@inheritDoc}
51     */

52    public Image[] getToolbarImages(
53       SWTThickClientGui gui
54    )
55    {
56       Image[] images = new Image[3];
57       
58       // TODO: Improve: It is not correct to access these private data
59
images[0] = gui.m_redImage;
60       images[1] = gui.m_grayImage;
61       images[2] = gui.m_greenImage;
62       
63       return images;
64    }
65    
66    // Helper methods ///////////////////////////////////////////////////////////
67

68    /**
69     * {@inheritDoc}
70     */

71    protected void closeMainWindow()
72    {
73       if (!((SWTThickClientGui)(m_client.getGui())).getShell().isDisposed())
74       {
75          ((SWTThickClientGui)(m_client.getGui())).getShell().close();
76       }
77    }
78 }
79
Popular Tags