KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > contentassist > Helper


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jface.text.contentassist;
12
13 import org.eclipse.swt.widgets.Widget;
14
15
16 /**
17  * Helper class for testing widget state.
18  */

19 class Helper {
20
21     /**
22      * Returns whether the widget is <code>null</code> or disposed.
23      *
24      * @param widget the widget to check
25      * @return <code>true</code> if the widget is neither <code>null</code> nor disposed
26      */

27     public static boolean okToUse(Widget widget) {
28         return (widget != null && !widget.isDisposed());
29     }
30 }
31
Popular Tags