KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openide > explorer > propertysheet > PropertySetModelEvent


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  * PropertySetModelEvent.java
21  *
22  * Created on December 30, 2002, 11:56 AM
23  */

24 package org.openide.explorer.propertysheet;
25
26 import java.awt.event.*;
27
28
29 /** Event type that carries information about changes in the property
30  * set model, such as changes in the number of rows that should be
31  * shown in the table due to expanding or closing categories. In
32  * particular it is used to maintain the current selection across a
33  * change which can alter the selected index.
34  * @author Tim Boudreau
35  */

36 class PropertySetModelEvent extends java.util.EventObject JavaDoc {
37     public static final int TYPE_INSERT = 0;
38     public static final int TYPE_REMOVE = 1;
39     public static final int TYPE_WHOLESALE_CHANGE = 2;
40     int type = 2;
41     int start = -1;
42     int end = -1;
43     boolean reordering = false;
44
45     /** Create a new model event of <code>TYPE_WHOLESALE_CHANGE</code>. */
46     public PropertySetModelEvent(Object JavaDoc source) {
47         super(source);
48     }
49
50     /** Create a new model event with the specified parameters. */
51     public PropertySetModelEvent(Object JavaDoc source, int type, int start, int end, boolean reordering) {
52         super(source);
53         this.type = type;
54         this.start = start;
55         this.end = end;
56         this.reordering = reordering;
57     }
58
59     /** Get the type of event. This will be one of
60     * TYPE_INSERT,
61     * TYPE_REMOVE, or
62     * TYPE_WHOLESALE_CHANGE,
63     * depending on the type of change (expansion of a category,
64     * de-expansion of a category, or a wholesale change like changing
65     * the node displayed, which completely invalidates the displayed
66     * data. */

67     public int getType() {
68         return type;
69     }
70
71     /** Get the first row affected by this change. */
72     public int getStartRow() {
73         return start;
74     }
75
76     /** Get the last row affected by this change. This should be the
77      * affected row <strong>prior</strong> to the change; that is, if
78      * a category is de-expanded, removing properties 20-30, this value
79      * should be 30. */

80     public int getEndRow() {
81         return end;
82     }
83
84     public boolean isReordering() {
85         return reordering;
86     }
87 }
88
Popular Tags