KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > forms > events > ExpansionEvent


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.ui.forms.events;
12 import org.eclipse.swt.events.TypedEvent;
13 /**
14  * Notifies listeners when expandable controls change expansion state.
15  *
16  * @since 3.0
17  */

18 public final class ExpansionEvent extends TypedEvent {
19     private static final long serialVersionUID = 6009335074727417445L;
20     /**
21      * Creates a new expansion ecent.
22      *
23      * @param obj
24      * event source
25      * @param state
26      * the new expansion state
27      */

28     public ExpansionEvent(Object JavaDoc obj, boolean state) {
29         super(obj);
30         data = state ? Boolean.TRUE : Boolean.FALSE;
31     }
32     /**
33      * Returns the new expansion state of the widget.
34      *
35      * @return <code>true</code> if the widget is now expaned, <code>false</code>
36      * otherwise.
37      */

38     public boolean getState() {
39         return data.equals(Boolean.TRUE) ? true : false;
40     }
41 }
42
Popular Tags