Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||||
TreeStateEvent |
|
| 1.0;1 |
1 | // Copyright 2004, 2005 The Apache Software Foundation |
|
2 | // |
|
3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
|
4 | // you may not use this file except in compliance with the License. |
|
5 | // You may obtain a copy of the License at |
|
6 | // |
|
7 | // http://www.apache.org/licenses/LICENSE-2.0 |
|
8 | // |
|
9 | // Unless required by applicable law or agreed to in writing, software |
|
10 | // distributed under the License is distributed on an "AS IS" BASIS, |
|
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
12 | // See the License for the specific language governing permissions and |
|
13 | // limitations under the License. |
|
14 | ||
15 | package org.apache.tapestry.contrib.tree.model; |
|
16 | ||
17 | /** |
|
18 | * @author ceco |
|
19 | */ |
|
20 | public class TreeStateEvent |
|
21 | { |
|
22 | ||
23 | public static final int SELECTED_NODE_CHANGED = 1; |
|
24 | public static final int NODE_EXPANDED = 2; |
|
25 | public static final int NODE_COLLAPSED = 4; |
|
26 | ||
27 | private int m_nEventType; |
|
28 | 0 | private transient ITreeStateModel m_objTreeStateModel = null; |
29 | 0 | private transient Object m_objNodeUID = null; |
30 | ||
31 | /** |
|
32 | * Constructor for TreeStateEvent. |
|
33 | */ |
|
34 | public TreeStateEvent(int nEventType, Object objNodeUID, |
|
35 | ITreeStateModel objTreeStateModel) |
|
36 | { |
|
37 | 0 | super(); |
38 | 0 | m_nEventType = nEventType; |
39 | 0 | m_objNodeUID = objNodeUID; |
40 | 0 | m_objTreeStateModel = objTreeStateModel; |
41 | 0 | } |
42 | ||
43 | /** |
|
44 | * Returns the EventType. |
|
45 | * |
|
46 | * @return int |
|
47 | */ |
|
48 | public int getEventType() |
|
49 | { |
|
50 | 0 | return m_nEventType; |
51 | } |
|
52 | ||
53 | public boolean isEvent(int nEventType) |
|
54 | { |
|
55 | 0 | return (getEventType() & nEventType) > 0; |
56 | } |
|
57 | ||
58 | public Object getNodeUID() |
|
59 | { |
|
60 | 0 | return m_objNodeUID; |
61 | } |
|
62 | ||
63 | public ITreeStateModel getTreeStateModel() |
|
64 | { |
|
65 | 0 | return m_objTreeStateModel; |
66 | } |
|
67 | } |