1 /* 2 * The contents of this file are subject to the terms of the Common Development 3 * and Distribution License (the License). You may not use this file except in 4 * compliance with the License. 5 * 6 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html 7 * or http://www.netbeans.org/cddl.txt. 8 * 9 * When distributing Covered Code, include this CDDL Header Notice in each file 10 * and include the License file at http://www.netbeans.org/cddl.txt. 11 * If applicable, add the following below the CDDL Header, with the fields 12 * enclosed by brackets [] replaced by your own identifying information: 13 * "Portions Copyrighted [year] [name of copyright owner]" 14 * 15 * The Original Software is NetBeans. The Initial Developer of the Original 16 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun 17 * Microsystems, Inc. All Rights Reserved. 18 */ 19 20 package org.netbeans.modules.java.bridge; 21 22 import java.beans.PropertyChangeEvent; 23 import java.beans.PropertyVetoException; 24 25 import javax.swing.undo.UndoableEdit; 26 27 import org.openide.src.SourceException; 28 29 /** 30 * 31 * @author sdedic 32 * @version 33 */ 34 interface ElementEvents { 35 /** Adds a PropertyChangeEvent to be fired. The event is not necessarily fired 36 * immediately, but may be queued and fired after a lock on the element/model is 37 * released. The method may throw IllegalArgumentException, if the event source 38 * reported in the event does not match the return value of {@link #getSource} 39 * @param evt the event to be fired 40 */ 41 public void addPropertyChange(PropertyChangeEvent evt); 42 43 /** Fires a property change event to Vetoable listeners. If a listener cancels 44 * the ongoing change, its response is wrapped into a SourceException object which 45 * is thrown from the method. The method may throw IllegalArgumentException, if the event source 46 * reported in the event does not match the return value of {@link #getSource} 47 * @param evt the event to be fired 48 */ 49 public void fireVetoableChange(PropertyChangeEvent evt) throws SourceException; 50 51 /** Adds another UndoableEdit. Generally there should be an edit for each partial 52 * operation on any data structure. Those edits are grouped such that edits generated 53 * during one particular change operation are always undone as a group. 54 * @param edit the edit that should be queued in the undo queue 55 public void addUndoableEdit(UndoableEdit edit); 56 */ 57 58 /** Returns the event source for events that should be fired on this interface. 59 * @return object representing the event source. 60 */ 61 public Object getEventSource(); 62 63 /** Returns the implementation of the element. 64 */ 65 public ElementImpl getElementImpl(); 66 } 67