|
1 /* |
|
2 * CDDL HEADER START |
|
3 * |
|
4 * The contents of this file are subject to the terms of the |
|
5 * Common Development and Distribution License (the "License"). |
|
6 * You may not use this file except in compliance with the License. |
|
7 * |
|
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 * or http://www.opensolaris.org/os/licensing. |
|
10 * See the License for the specific language governing permissions |
|
11 * and limitations under the License. |
|
12 * |
|
13 * When distributing Covered Code, include this CDDL HEADER in each |
|
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 * If applicable, add the following below this CDDL HEADER, with the |
|
16 * fields enclosed by brackets "[]" replaced with your own identifying |
|
17 * information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 * |
|
19 * CDDL HEADER END |
|
20 */ |
|
21 |
|
22 /* |
|
23 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. |
|
24 */ |
|
25 |
|
26 package com.oracle.solaris.vp.util.swing.event; |
|
27 |
|
28 import java.util.EventObject; |
|
29 import com.oracle.solaris.vp.util.swing.ExtListSelectionModel; |
|
30 |
|
31 @SuppressWarnings({"serial"}) |
|
32 public class ExtListSelectionEvent extends EventObject { |
|
33 // |
|
34 // Enums |
|
35 // |
|
36 |
|
37 public enum Type { |
|
38 ADD, REMOVE, SET, CLEAR |
|
39 } |
|
40 |
|
41 // |
|
42 // Instance data |
|
43 // |
|
44 |
|
45 private Type type; |
|
46 private int anchorIndex; |
|
47 private int leadIndex; |
|
48 private boolean isAdjusting; |
|
49 |
|
50 // |
|
51 // Constructors |
|
52 // |
|
53 |
|
54 public ExtListSelectionEvent(ExtListSelectionModel source, |
|
55 Type type, int anchorIndex, int leadIndex, boolean isAdjusting) { |
|
56 |
|
57 super(source); |
|
58 |
|
59 this.type = type; |
|
60 this.anchorIndex = anchorIndex; |
|
61 this.leadIndex = leadIndex; |
|
62 this.isAdjusting = isAdjusting; |
|
63 } |
|
64 |
|
65 // |
|
66 // EventObject methods |
|
67 // |
|
68 |
|
69 public ExtListSelectionModel getSource() { |
|
70 return (ExtListSelectionModel)super.getSource(); |
|
71 } |
|
72 |
|
73 // |
|
74 // ExtListSelectionEvent methods |
|
75 // |
|
76 |
|
77 public Type getType() { |
|
78 return type; |
|
79 } |
|
80 |
|
81 public int getAnchorIndex() { |
|
82 return anchorIndex; |
|
83 } |
|
84 |
|
85 public int getLeadIndex() { |
|
86 return leadIndex; |
|
87 } |
|
88 |
|
89 public boolean getIsAdjusting() { |
|
90 return isAdjusting; |
|
91 } |
|
92 } |