ApplicationUtil : Added 'Remoting' to title
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / model / CommonHelper.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10
11 package eu.etaxonomy.taxeditor.model;
12
13 import org.eclipse.swt.events.ModifyListener;
14 import org.eclipse.swt.widgets.Text;
15
16 /**
17 * <p>CommonHelper class.</p>
18 *
19 * @author n.hoffmann
20 * @created 02.07.2009
21 * @version 1.0
22 */
23 public class CommonHelper {
24 /**
25 * <p>editTextWithoutTriggeringListeners</p>
26 *
27 * @param text a {@link org.eclipse.swt.widgets.Text} object.
28 * @param listener a {@link org.eclipse.swt.events.ModifyListener} object.
29 * @param string a {@link java.lang.String} object.
30 */
31 public static void editTextWithoutTriggeringListeners(Text text, ModifyListener listener, String string){
32 text.removeModifyListener(listener);
33
34 String textString = string != null ? string : "";
35
36 text.setText(textString);
37 text.addModifyListener(listener);
38 }
39 }