KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > patterns > thickclient > application > swt > CharacterPadTextUpdater


1 /*
2  * Copyright (c) 2006 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: CharacterPadTextUpdater.java,v 1.4 2007/01/07 06:14:15 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.patterns.thickclient.application.swt;
23
24 import org.eclipse.swt.widgets.Text;
25
26 /**
27  * Implementation of character pad listener which simply updatest text control
28  * when notified by character pad.
29  *
30  * @version $Id: CharacterPadTextUpdater.java,v 1.4 2007/01/07 06:14:15 bastafidli Exp $
31  * @author Miro Halas
32  * @code.reviewer Miro Halas
33  * @code.reviewed 1.2 2006/04/05 05:32:41 bastafidli
34  */

35 public class CharacterPadTextUpdater implements CharacterPadListener
36 {
37    // Attributes ///////////////////////////////////////////////////////////////
38

39    /**
40     * Text control to update.
41     */

42    protected Text m_text;
43    
44    // Constructors /////////////////////////////////////////////////////////////
45

46    /**
47     * Constructor.
48     *
49     * @param text - text control to be updated by the character pad
50     */

51    public CharacterPadTextUpdater(
52       Text text
53    )
54    {
55       m_text = text;
56    }
57    
58    // Public methods ///////////////////////////////////////////////////////////
59

60    /**
61     * {@inheritDoc}
62     */

63    public boolean takeAction(
64       CharacterPad chpad,
65       int iNumberValue,
66       String JavaDoc strButtonName,
67       String JavaDoc strText
68    )
69    {
70       m_text.setText(strText);
71       return true;
72    }
73 }
74
Popular Tags