01: /*
02: * Created on May 5, 2003
03: *
04: * Dbmjui is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU General Public License version 2 as
06: * published by the Free Software Foundation.
07: *
08: * Dbmjui is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * General Public License for more details.
12: *
13: * You should have received a copy of the GNU General Public
14: * License along with dbmjui; see the file COPYING. If not,
15: * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16: * Boston, MA 02111-1307, USA.
17: *
18: */
19: package fr.aliacom.form.swt;
20:
21: import org.eclipse.swt.widgets.ToolItem;
22:
23: import fr.aliacom.form.swt.events.CommandSelectionListener;
24:
25: /**
26: * @author tom
27: *
28: * (c) 2001, 2003 Thomas Cataldo
29: */
30: public class SWTToolItem implements IItem {
31:
32: private ToolItem item;
33:
34: public SWTToolItem(ToolItem item) {
35: this .item = item;
36: }
37:
38: /* (non-Javadoc)
39: * @see fr.aliacom.form.swt.SWTItem#setText(java.lang.String)
40: */
41: public void setText(String name) {
42: item.setToolTipText(name);
43: }
44:
45: public void addSelectionListener(CommandSelectionListener listener) {
46: item.addSelectionListener(listener);
47: }
48:
49: /* (non-Javadoc)
50: * @see fr.aliacom.form.swt.SWTItem#setEnabled(boolean)
51: */
52: public void setEnabled(boolean b) {
53: item.setEnabled(b);
54: }
55:
56: }
|