KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > tags > javascript > CoreScriptFeature


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

18 package org.apache.beehive.netui.tags.javascript;
19
20 /**
21  *
22  */

23 public class CoreScriptFeature
24 {
25     public static final int INT_LEGACY_LOOKUP = 0x0001;
26     public static final int INT_ID_LOOKUP = 0x0002;
27     public static final int INT_NAME_LOOKUP = 0x0004;
28     public static final int INT_SCOPE_LOOKUP = 0x0008;
29     public static final int INT_ROLLOVER = 0x0010;
30     public static final int INT_ANCHOR_SUBMIT = 0x0020;
31     public static final int INT_POPUP_DONE = 0x0040;
32     public static final int INT_ALLOCATE_LEGACY = 0x0080;
33     public static final int INT_ALLOCATE_ID = 0x0100;
34     public static final int INT_ALLOCATE_NAME = 0x0200;
35     public static final int INT_LEGACY_SCOPE_LOOKUP = 0x0400;
36     public static final int INT_TREE_INIT = 0x0800;
37     public static final int INT_DIVPANEL_INIT = 0x1000;
38     public static final int INT_DYNAMIC_INIT = 0x2000;
39     public static final int INT_BUTTON_DISABLE_AND_SUBMIT = 0x4000;
40     public static final int INT_BUTTON_DISABLE = 0x8000;
41
42     // These features are not written out once. They are identified by setting the top bit
43
protected static final int INT_SET_FOCUS = 0x10000001;
44
45     public int value;
46
47     CoreScriptFeature(int val)
48     {
49         value = val;
50     }
51     
52     public static final CoreScriptFeature LEGACY_LOOKUP = new CoreScriptFeature(INT_LEGACY_LOOKUP);
53     public static final CoreScriptFeature ID_LOOKUP = new CoreScriptFeature(INT_ID_LOOKUP);
54     public static final CoreScriptFeature NAME_LOOKUP = new CoreScriptFeature(INT_NAME_LOOKUP);
55     public static final CoreScriptFeature SCOPE_LOOKUP = new CoreScriptFeature(INT_SCOPE_LOOKUP);
56     public static final CoreScriptFeature ROLLOVER = new CoreScriptFeature(INT_ROLLOVER);
57     public static final CoreScriptFeature ANCHOR_SUBMIT = new CoreScriptFeature(INT_ANCHOR_SUBMIT);
58     public static final CoreScriptFeature POPUP_DONE = new CoreScriptFeature(INT_POPUP_DONE);
59     public static final CoreScriptFeature ALLOCATE_LEGACY = new CoreScriptFeature(INT_ALLOCATE_LEGACY);
60     public static final CoreScriptFeature ALLOCATE_ID = new CoreScriptFeature(INT_ALLOCATE_ID);
61     public static final CoreScriptFeature ALLOCATE_NAME = new CoreScriptFeature(INT_ALLOCATE_NAME);
62     public static final CoreScriptFeature LEGACY_SCOPE_LOOKUP = new CoreScriptFeature(INT_LEGACY_SCOPE_LOOKUP);
63     public static final CoreScriptFeature TREE_INIT = new CoreScriptFeature(INT_TREE_INIT);
64     public static final CoreScriptFeature DIVPANEL_INIT = new CoreScriptFeature(INT_DIVPANEL_INIT);
65     public static final CoreScriptFeature DYNAMIC_INIT = new CoreScriptFeature(INT_DYNAMIC_INIT);
66     public static final CoreScriptFeature BUTTON_DISABLE_AND_SUBMIT = new CoreScriptFeature(INT_BUTTON_DISABLE_AND_SUBMIT);
67     public static final CoreScriptFeature BUTTON_DISABLE = new CoreScriptFeature(INT_BUTTON_DISABLE);
68     public static final CoreScriptFeature SET_FOCUS = new CoreScriptFeature(INT_SET_FOCUS);
69     
70     public String JavaDoc toString()
71     {
72         switch ( value )
73         {
74             case INT_LEGACY_LOOKUP: return "LEGACY_LOOKUP";
75             case INT_ID_LOOKUP: return "ID_LOOKUP";
76             case INT_NAME_LOOKUP: return "NAME_LOOKUP";
77             case INT_SCOPE_LOOKUP: return "SCOPE_LOOKUP";
78             case INT_ROLLOVER: return "ROLLOVER";
79             case INT_ANCHOR_SUBMIT: return "ANCHOR_SUBMIT";
80             case INT_POPUP_DONE: return "POPUP_DONE";
81             case INT_ALLOCATE_LEGACY: return "ALLOCATE_LEGACY";
82             case INT_ALLOCATE_ID: return "ALLOCATE_ID";
83             case INT_ALLOCATE_NAME: return "ALLOCATE_NAME";
84             case INT_LEGACY_SCOPE_LOOKUP: return "LEGACY_SCOPE_LOOKUP";
85             case INT_TREE_INIT: return "TREE_INIT";
86             case INT_DIVPANEL_INIT: return "DIVPANEL_INIT";
87             case INT_DYNAMIC_INIT: return "DYNAMIC_INIT";
88             case INT_BUTTON_DISABLE_AND_SUBMIT: return "BUTTON_DISABLE_AND_SUBMIT";
89             case INT_BUTTON_DISABLE: return "BUTTON_DISABLE";
90             case INT_SET_FOCUS: return "SET_FOCUS";
91         }
92         
93         assert false : value;
94         return "<unknown CoreScriptFeature>";
95     }
96     
97     public boolean equals( Object JavaDoc o )
98     {
99         if (o == null) return false;
100         if (o == this ) return true;
101         if (!(o instanceof CoreScriptFeature)) return false;
102         return ((CoreScriptFeature)o).value == value;
103     }
104     
105     public int hashCode()
106     {
107         return value;
108     }
109     
110     public int getIntValue()
111     {
112         return value;
113     }
114 }
115
Popular Tags