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