1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
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.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.taxeditor.model;
|
11
|
|
12
|
import org.eclipse.swt.events.ModifyListener;
|
13
|
import org.eclipse.swt.widgets.Text;
|
14
|
|
15
|
/**
|
16
|
* <p>CommonHelper class.</p>
|
17
|
*
|
18
|
* @author n.hoffmann
|
19
|
* @created 02.07.2009
|
20
|
* @version 1.0
|
21
|
*/
|
22
|
public class CommonHelper {
|
23
|
/**
|
24
|
* <p>editTextWithoutTriggeringListeners</p>
|
25
|
*
|
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.
|
29
|
*/
|
30
|
public static void editTextWithoutTriggeringListeners(Text text, ModifyListener listener, String string){
|
31
|
text.removeModifyListener(listener);
|
32
|
|
33
|
String textString = string != null ? string : "";
|
34
|
|
35
|
text.setText(textString);
|
36
|
text.addModifyListener(listener);
|
37
|
}
|
38
|
}
|