2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.model
;
12 import org
.eclipse
.swt
.events
.ModifyListener
;
13 import org
.eclipse
.swt
.widgets
.Text
;
16 * <p>CommonHelper class.</p>
22 public class CommonHelper
{
24 * <p>editTextWithoutTriggeringListeners</p>
26 * @param text a {@link org.eclipse.swt.widgets.Text} object.
27 * @param listener a {@link org.eclipse.swt.events.ModifyListener} object.
28 * @param string a {@link java.lang.String} object.
30 public static void editTextWithoutTriggeringListeners(Text text
, ModifyListener listener
, String string
){
31 text
.removeModifyListener(listener
);
33 String textString
= string
!= null ? string
: "";
35 text
.setText(textString
);
36 text
.addModifyListener(listener
);