001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2008 Sun Microsystems, Inc.
015 */
016package org.opends.guitools.controlpanel.event;
017
018import java.util.EventObject;
019
020/**
021 * This class defines an event for the browser.  It basically it is used to
022 * communicate between the BrowserController and the NodeRefresher classes.
023 * @author jvergara
024 */
025public class BrowserEvent extends EventObject
026{
027  private static final long serialVersionUID = 6476274376887062526L;
028
029  /** The different types of events that we can have. */
030  public enum Type
031  {
032    /** Update of the entry started. */
033    UPDATE_START,
034    /** Update of the entry ended. */
035    UPDATE_END,
036    /** Insert of children started. */
037    INSERT_CHILDREN_START,
038    /** Insert of children ended. */
039    INSERT_CHILDREN_END,
040    /**
041     * The specified size limit (max number of children to be returned) in the
042     * BrowserController was reached.
043     */
044    SIZE_LIMIT_REACHED
045  }
046
047  private Type type;
048
049  /**
050   * Constructor of the event.
051   * @param source the Object that generated this event.
052   * @param id the type of the event.
053   */
054  public BrowserEvent(Object source, Type id) {
055    super(source);
056    this.type = id;
057  }
058
059  /**
060   * Returns the type of event.
061   * @return the type of event.
062   */
063  public Type getType() {
064    return type;
065  }
066}