001: /*
002: * The contents of this file are subject to the terms of the Common Development
003: * and Distribution License (the License). You may not use this file except in
004: * compliance with the License.
005: *
006: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007: * or http://www.netbeans.org/cddl.txt.
008: *
009: * When distributing Covered Code, include this CDDL Header Notice in each file
010: * and include the License file at http://www.netbeans.org/cddl.txt.
011: * If applicable, add the following below the CDDL Header, with the fields
012: * enclosed by brackets [] replaced by your own identifying information:
013: * "Portions Copyrighted [year] [name of copyright owner]"
014: *
015: * The Original Software is NetBeans. The Initial Developer of the Original
016: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017: * Microsystems, Inc. All Rights Reserved.
018: */
019:
020: /**
021: *
022: */package org.netbeans.modules.bpel.model.api.events;
023:
024: import org.netbeans.modules.bpel.model.api.BpelEntity;
025:
026: /**
027: * @author ads
028: */
029: public class EntityInsertEvent<T extends BpelEntity> extends
030: IndexedChangeEvent {
031:
032: private static final long serialVersionUID = 3559485179223140644L;
033:
034: /**
035: * Constructor for EntityInsertEvent with source ref.
036: *
037: * @param source
038: * source of event ( who produce this event ).
039: * @param parent
040: * element in OM that contains event entity.
041: * @param name
042: * entity name.
043: * @param value
044: * entity value.
045: */
046: public EntityInsertEvent(Object source, BpelEntity parent,
047: String name, T value) {
048: super (source, parent, name, -1);
049: myValue = value;
050: }
051:
052: /**
053: * Constructor for EntityInsertEvent with source ref and index.
054: *
055: * @param source
056: * source of event ( who produce this event ).
057: * @param parent
058: * element in OM that contains event entity.
059: * @param name
060: * entity name.
061: * @param value
062: * entity value.
063: * @param index
064: * index of child entity in parent.
065: */
066: public EntityInsertEvent(Object source, BpelEntity parent,
067: String name, T value, int index) {
068: super (source, parent, name, index);
069: myValue = value;
070: }
071:
072: /**
073: * Constructor for EntityInsertEvent without source ref.
074: *
075: * @param parent
076: * element in OM that contains event entity.
077: * @param name
078: * entity name.
079: * @param value
080: * entity value.
081: */
082: public EntityInsertEvent(BpelEntity parent, String name, T value) {
083: this (Thread.currentThread(), parent, name, value);
084: }
085:
086: /**
087: * Constructor for EntityInsertEvent with index and without source ref.
088: *
089: * @param parent
090: * element in OM that contains event entity.
091: * @param name
092: * entity name.
093: * @param value
094: * entity value.
095: * @param index
096: * index of child entity in parent.
097: */
098: public EntityInsertEvent(BpelEntity parent, String name, T value,
099: int index) {
100: this (Thread.currentThread(), parent, name, value, index);
101: }
102:
103: /**
104: * @return inserted value.
105: */
106: public T getValue() {
107: return myValue;
108: }
109:
110: private T myValue;
111: }
|