KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > browser > core > events > ValueRenamedEvent


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  */

20
21 package org.apache.directory.ldapstudio.browser.core.events;
22
23
24 import org.apache.directory.ldapstudio.browser.core.BrowserCoreMessages;
25 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
26 import org.apache.directory.ldapstudio.browser.core.model.IEntry;
27 import org.apache.directory.ldapstudio.browser.core.model.IValue;
28
29
30 /**
31  * An ValueRenamedEvent indicates that an {@link IValue} was renamed. This
32  * means that the attribute type was modified.
33  *
34  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
35  * @version $Rev$, $Date$
36  */

37 public class ValueRenamedEvent extends EntryModificationEvent
38 {
39
40     /** The old value with the old attribute type. */
41     private IValue oldValue;
42
43     /** The new value with the new attribute type. */
44     private IValue newValue;
45
46
47     /**
48      * Creates a new instance of ValueRenamedEvent.
49      *
50      * @param connection the connection
51      * @param modifiedEntry the modified entry
52      * @param oldValue the old value with the old attribute type
53      * @param newValue the new value with the new attribute type
54      */

55     public ValueRenamedEvent( IConnection connection, IEntry modifiedEntry, IValue oldValue, IValue newValue )
56     {
57         super( connection, modifiedEntry );
58         this.oldValue = oldValue;
59         this.newValue = newValue;
60     }
61
62
63     /**
64      * Gets the new value with the new attribute type.
65      *
66      * @return the new value with the new attribute type
67      */

68     public IValue getNewValue()
69     {
70         return newValue;
71     }
72
73
74     /**
75      * Gets the old value with the old attribute type.
76      *
77      * @return the old value with the old attribute type
78      */

79     public IValue getOldValue()
80     {
81         return oldValue;
82     }
83
84
85     /**
86      * {@inheritDoc}
87      */

88     public String JavaDoc toString()
89     {
90         return BrowserCoreMessages.bind( BrowserCoreMessages.event__renamed_oldval_by_newval_at_dn, new String JavaDoc[]
91             { getOldValue().toString(), getNewValue().toString(), getModifiedEntry().getDn().toString() } );
92     }
93
94 }
95
Popular Tags