01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jface.text.contentassist;
11:
12: import org.eclipse.swt.widgets.Widget;
13:
14: /**
15: * Helper class for testing widget state.
16: */
17: class Helper {
18:
19: /**
20: * Returns whether the widget is <code>null</code> or disposed.
21: *
22: * @param widget the widget to check
23: * @return <code>true</code> if the widget is neither <code>null</code> nor disposed
24: */
25: public static boolean okToUse(Widget widget) {
26: return (widget != null && !widget.isDisposed());
27: }
28: }
|