KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > contrib > tree > model > TreeStateEvent


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     public static final int SELECTED_NODE_CHANGED = 1;
22     public static final int NODE_EXPANDED = 2;
23     public static final int NODE_COLLAPSED = 4;
24     
25     private int m_nEventType;
26     private transient ITreeStateModel m_objTreeStateModel = null;
27     private transient Object JavaDoc m_objNodeUID = null;
28
29     /**
30      * Constructor for TreeStateEvent.
31      */

32     public TreeStateEvent(int nEventType, Object JavaDoc objNodeUID, ITreeStateModel objTreeStateModel) {
33         super();
34         m_nEventType = nEventType;
35         m_objNodeUID = objNodeUID;
36         m_objTreeStateModel = objTreeStateModel;
37     }
38
39     /**
40      * Returns the EventType.
41      * @return int
42      */

43     public int getEventType() {
44         return m_nEventType;
45     }
46
47     public boolean isEvent(int nEventType){
48         return (getEventType() & nEventType) > 0;
49     }
50
51     public Object JavaDoc getNodeUID() {
52         return m_objNodeUID;
53     }
54
55     public ITreeStateModel getTreeStateModel() {
56         return m_objTreeStateModel;
57     }
58 }
59
Popular Tags