001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: *
017: * $Header:$
018: */
019: package org.apache.beehive.netui.tags.javascript;
020:
021: /**
022: *
023: */
024: public class CoreScriptFeature {
025: public static final int INT_LEGACY_LOOKUP = 0x00001;
026: public static final int INT_ID_LOOKUP = 0x00002;
027: public static final int INT_NAME_LOOKUP = 0x00004;
028: public static final int INT_SCOPE_LOOKUP = 0x00008;
029: public static final int INT_ROLLOVER = 0x00010;
030: public static final int INT_ANCHOR_SUBMIT = 0x00020;
031: public static final int INT_POPUP_OPEN = 0x00040;
032: public static final int INT_POPUP_DONE = 0x00080;
033: public static final int INT_POPUP_UPDATE_FORM = 0x00100;
034: public static final int INT_ALLOCATE_LEGACY = 0x00200;
035: public static final int INT_ALLOCATE_ID = 0x00400;
036: public static final int INT_ALLOCATE_NAME = 0x00800;
037: public static final int INT_LEGACY_SCOPE_LOOKUP = 0x01000;
038: public static final int INT_TREE_INIT = 0x02000;
039: public static final int INT_DIVPANEL_INIT = 0x04000;
040: public static final int INT_DYNAMIC_INIT = 0x08000;
041: public static final int INT_BUTTON_DISABLE_AND_SUBMIT = 0x10000;
042: public static final int INT_BUTTON_DISABLE = 0x20000;
043: public static final int INT_AJAX_PREFIX = 0x40000;
044: public static final int INT_AJAX_PARAM = 0x80000;
045:
046: // These features are not written out once. They are identified by setting the top bit
047: protected static final int INT_SET_FOCUS = 0x10000001;
048:
049: public int value;
050:
051: CoreScriptFeature(int val) {
052: value = val;
053: }
054:
055: public static final CoreScriptFeature LEGACY_LOOKUP = new CoreScriptFeature(
056: INT_LEGACY_LOOKUP);
057: public static final CoreScriptFeature ID_LOOKUP = new CoreScriptFeature(
058: INT_ID_LOOKUP);
059: public static final CoreScriptFeature NAME_LOOKUP = new CoreScriptFeature(
060: INT_NAME_LOOKUP);
061: public static final CoreScriptFeature SCOPE_LOOKUP = new CoreScriptFeature(
062: INT_SCOPE_LOOKUP);
063: public static final CoreScriptFeature ROLLOVER = new CoreScriptFeature(
064: INT_ROLLOVER);
065: public static final CoreScriptFeature ANCHOR_SUBMIT = new CoreScriptFeature(
066: INT_ANCHOR_SUBMIT);
067: public static final CoreScriptFeature POPUP_OPEN = new CoreScriptFeature(
068: INT_POPUP_OPEN);
069: public static final CoreScriptFeature POPUP_DONE = new CoreScriptFeature(
070: INT_POPUP_DONE);
071: public static final CoreScriptFeature POPUP_UPDATE_FORM = new CoreScriptFeature(
072: INT_POPUP_UPDATE_FORM);
073: public static final CoreScriptFeature ALLOCATE_LEGACY = new CoreScriptFeature(
074: INT_ALLOCATE_LEGACY);
075: public static final CoreScriptFeature ALLOCATE_ID = new CoreScriptFeature(
076: INT_ALLOCATE_ID);
077: public static final CoreScriptFeature ALLOCATE_NAME = new CoreScriptFeature(
078: INT_ALLOCATE_NAME);
079: public static final CoreScriptFeature LEGACY_SCOPE_LOOKUP = new CoreScriptFeature(
080: INT_LEGACY_SCOPE_LOOKUP);
081: public static final CoreScriptFeature TREE_INIT = new CoreScriptFeature(
082: INT_TREE_INIT);
083: public static final CoreScriptFeature AJAX_PREFIX = new CoreScriptFeature(
084: INT_AJAX_PREFIX);
085: public static final CoreScriptFeature AJAX_PARAM = new CoreScriptFeature(
086: INT_AJAX_PARAM);
087: public static final CoreScriptFeature DIVPANEL_INIT = new CoreScriptFeature(
088: INT_DIVPANEL_INIT);
089: public static final CoreScriptFeature DYNAMIC_INIT = new CoreScriptFeature(
090: INT_DYNAMIC_INIT);
091: public static final CoreScriptFeature BUTTON_DISABLE_AND_SUBMIT = new CoreScriptFeature(
092: INT_BUTTON_DISABLE_AND_SUBMIT);
093: public static final CoreScriptFeature BUTTON_DISABLE = new CoreScriptFeature(
094: INT_BUTTON_DISABLE);
095: public static final CoreScriptFeature SET_FOCUS = new CoreScriptFeature(
096: INT_SET_FOCUS);
097:
098: public String toString() {
099: switch (value) {
100: case INT_LEGACY_LOOKUP:
101: return "LEGACY_LOOKUP";
102: case INT_ID_LOOKUP:
103: return "ID_LOOKUP";
104: case INT_NAME_LOOKUP:
105: return "NAME_LOOKUP";
106: case INT_SCOPE_LOOKUP:
107: return "SCOPE_LOOKUP";
108: case INT_ROLLOVER:
109: return "ROLLOVER";
110: case INT_ANCHOR_SUBMIT:
111: return "ANCHOR_SUBMIT";
112: case INT_POPUP_OPEN:
113: return "POPUP_OPEN";
114: case INT_POPUP_DONE:
115: return "POPUP_DONE";
116: case INT_POPUP_UPDATE_FORM:
117: return "POPUP_UPDATE_FORM";
118: case INT_ALLOCATE_LEGACY:
119: return "ALLOCATE_LEGACY";
120: case INT_ALLOCATE_ID:
121: return "ALLOCATE_ID";
122: case INT_ALLOCATE_NAME:
123: return "ALLOCATE_NAME";
124: case INT_LEGACY_SCOPE_LOOKUP:
125: return "LEGACY_SCOPE_LOOKUP";
126: case INT_TREE_INIT:
127: return "TREE_INIT";
128: case INT_DIVPANEL_INIT:
129: return "DIVPANEL_INIT";
130: case INT_DYNAMIC_INIT:
131: return "DYNAMIC_INIT";
132: case INT_BUTTON_DISABLE_AND_SUBMIT:
133: return "BUTTON_DISABLE_AND_SUBMIT";
134: case INT_BUTTON_DISABLE:
135: return "BUTTON_DISABLE";
136: case INT_SET_FOCUS:
137: return "SET_FOCUS";
138: }
139:
140: assert false : value;
141: return "<unknown CoreScriptFeature>";
142: }
143:
144: public boolean equals(Object o) {
145: if (o == null)
146: return false;
147: if (o == this )
148: return true;
149: if (!(o instanceof CoreScriptFeature))
150: return false;
151: return ((CoreScriptFeature) o).value == value;
152: }
153:
154: public int hashCode() {
155: return value;
156: }
157:
158: public int getIntValue() {
159: return value;
160: }
161: }
|