3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.model
;
13 import org
.eclipse
.swt
.events
.ModifyListener
;
14 import org
.eclipse
.swt
.widgets
.Text
;
17 * <p>CommonHelper class.</p>
23 public class CommonHelper
{
25 * <p>editTextWithoutTriggeringListeners</p>
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.
31 public static void editTextWithoutTriggeringListeners(Text text
, ModifyListener listener
, String string
){
32 text
.removeModifyListener(listener
);
34 String textString
= string
!= null ? string
: "";
36 text
.setText(textString
);
37 text
.addModifyListener(listener
);