KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > internal > text > link > contentassist > Helper2


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.internal.text.link.contentassist;
12
13
14
15 import org.eclipse.swt.widgets.Widget;
16
17
18 /**
19  * Helper class for testing widget state.
20  */

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

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