Source Code Cross Referenced for ExtElement.java in  » Ajax » gwtext-2.01 » com » gwtext » client » core » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » gwtext 2.01 » com.gwtext.client.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /*
0002:         * GWT-Ext Widget Library
0003:         * Copyright(c) 2007-2008, GWT-Ext.
0004:         * licensing@gwt-ext.com
0005:         * 
0006:         * http://www.gwt-ext.com/license
0007:         */
0008:
0009:        package com.gwtext.client.core;
0010:
0011:        import com.google.gwt.core.client.JavaScriptObject;
0012:        import com.google.gwt.user.client.Element;
0013:
0014:        public class ExtElement extends BaseElement {
0015:
0016:            protected ExtElement() {
0017:            }
0018:
0019:            /**
0020:             * Create an ExtElement using an existing native element.
0021:             *
0022:             * @param jsObj native Element object
0023:             */
0024:            public ExtElement(JavaScriptObject jsObj) {
0025:                super (jsObj);
0026:            }
0027:
0028:            /**
0029:             * Create an ExtElement wrapper around en existing DOM Element.
0030:             *
0031:             * @param elem the DOM Element
0032:             */
0033:            public ExtElement(Element elem) {
0034:                this (elem, false);
0035:            }
0036:
0037:            /**
0038:             * Create an ExtElement wrapper around an existing DOM Element.
0039:             *
0040:             * @param elem     the DOM Element
0041:             * @param forceNew by default the constructor checks to see if there is already an instance of this element in the cache and if there is it returns the same instance.
0042:             *                 Passing <code>true</code> will skip that check (useful for extending this class)
0043:             */
0044:            public ExtElement(Element elem, boolean forceNew) {
0045:                jsObj = create(elem, forceNew);
0046:            }
0047:
0048:            private native JavaScriptObject create(Element elem,
0049:                    boolean forceNew)/*-{
0050:                    return new $wnd.Ext.Element(elem, forceNew);
0051:                }-*/;
0052:
0053:            private static ExtElement instance(JavaScriptObject jsObj) {
0054:                return new ExtElement(jsObj);
0055:            }
0056:
0057:            /**
0058:             * Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element -
0059:             * the dom node can be overwritten by other code.
0060:             *
0061:             * @param id the Element id
0062:             * @return the shared ExtElement object
0063:             */
0064:            public static native ExtElement fly(String id)/*-{
0065:                    var elem = $wnd.Ext.fly(id);
0066:                    return @com.gwtext.client.core.ExtElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(elem);
0067:                }-*/;
0068:
0069:            /**
0070:             * Gets the globally shared flyweight ExtElement, with the passed node as the active element. Do not store a reference to this element -
0071:             * the dom node can be overwritten by other code.
0072:             *
0073:             * @param id    the Element id
0074:             * @param named allows for creation of named reusable flyweights to prevent conflicts (e.g. internally Ext uses "_internal")
0075:             * @return the shared ExtElement object
0076:             */
0077:            public static native ExtElement fly(String id, String named)/*-{
0078:                    var elem = $wnd.Ext.fly(id, named);
0079:                    return @com.gwtext.client.core.ExtElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(elem);
0080:                }-*/;
0081:
0082:            /**
0083:             * Static method to retrieve ExtElement objects. Uses simple caching to consistently return the same object. Automatically fixes
0084:             * if an object was recreated with the same id via AJAX or DOM.
0085:             *
0086:             * @param id the id of Element
0087:             * @return the ExtElement object
0088:             */
0089:            public static native ExtElement get(String id)/*-{
0090:                    var elem = $wnd.Ext.get(id);
0091:                    return @com.gwtext.client.core.ExtElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(elem);
0092:                }-*/;
0093:
0094:            //todo support CompositeElements
0095:            /**
0096:             * Appends the passed element to this element.
0097:             *
0098:             * @param child the child element
0099:             * @return this
0100:             */
0101:            public native ExtElement appendChild(Element child) /*-{
0102:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0103:                   elem.appendChild(child);
0104:                   return this;
0105:               }-*/;
0106:
0107:            /**
0108:             * Appends this element to the passed element.
0109:             *
0110:             * @param el the new parent element
0111:             * @return this
0112:             */
0113:            public native ExtElement appendTo(Element el) /*-{
0114:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0115:                   elem.appendTo(el);
0116:                   return this;
0117:               }-*/;
0118:
0119:            /**
0120:             * Tries to blur the element. Any exceptions are caught and ignored.
0121:             *
0122:             * @return this
0123:             */
0124:            public native ExtElement blur() /*-{
0125:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0126:                   elem.blur();
0127:                   return this;
0128:               }-*/;
0129:
0130:            /**
0131:             * Wraps the specified element with a special markup/CSS block that renders by default as a gray container with a gradient background,
0132:             * rounded corners and a 4-way shadow.
0133:             *
0134:             * @return this
0135:             */
0136:            public native ExtElement boxWrap() /*-{
0137:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0138:                   var wrap = elem.boxWrap();
0139:                   return @com.gwtext.client.core.ExtElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(wrap);
0140:               }-*/;
0141:
0142:            /**
0143:             * Wraps the specified element with a special markup/CSS block that renders by default as a gray container with a gradient background,
0144:             * rounded corners and a 4-way shadow.
0145:             *
0146:             * @param boxClass A base CSS class to apply to the containing wrapper element (defaults to 'x-box'). Note that there are a number of
0147:             *                 CSS rules that are dependent on this name to make the overall effect work, so if you supply an alternate base class, make sure you also supply all of the necessary rules.
0148:             * @return this
0149:             */
0150:            public native ExtElement boxWrap(String boxClass) /*-{
0151:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0152:                   var wrap = elem.boxWrap(boxClass);
0153:                   return @com.gwtext.client.core.ExtElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(wrap);
0154:               }-*/;
0155:
0156:            /**
0157:             * Centers the Element in the viewport.
0158:             *
0159:             * @return this
0160:             */
0161:            public native ExtElement center() /*-{
0162:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0163:                   elem.center();
0164:                   return this;
0165:               }-*/;
0166:
0167:            /**
0168:             * Centers the Element in another Element.
0169:             *
0170:             * @param centerIn the element in which to center the element.
0171:             * @return this
0172:             */
0173:            public native ExtElement center(Element centerIn) /*-{
0174:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0175:                   elem.center(centerIn);
0176:                   return this;
0177:               }-*/;
0178:
0179:            /**
0180:             * Selects a single child at any depth below this element based on the passed CSS selector
0181:             * (the selector should not contain an id).
0182:             *
0183:             * @param selector the CSS selector
0184:             * @return child element
0185:             */
0186:            public native Element child(String selector) /*-{
0187:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0188:                   return elem.child(selector, true);
0189:               }-*/;
0190:
0191:            /**
0192:             * Clear positioning back to the default when the document was loaded.
0193:             *
0194:             * @return this
0195:             */
0196:            public native ExtElement clearPositioning() /*-{
0197:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0198:                   elem.clearPositioning();
0199:                   return this;
0200:               }-*/;
0201:
0202:            /**
0203:             * Clear positioning back to the default when the document was loaded
0204:             *
0205:             * @param value the position value
0206:             * @return this
0207:             */
0208:            public native ExtElement clearPositioning(Position value) /*-{
0209:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0210:                   var valueJS = value.@com.gwtext.client.core.Position::getPosition()();
0211:                   elem.clearPositioning(valueJS);
0212:                   return this;
0213:               }-*/;
0214:
0215:            /**
0216:             * Whether this element is an ancestor of the passed element.
0217:             *
0218:             * @param el the element to check
0219:             * @return true if this element is an ancestor of the passed element
0220:             */
0221:            public native boolean contains(Element el) /*-{
0222:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0223:                   return elem.contains(el);
0224:               }-*/;
0225:
0226:            /**
0227:             * Creates the passed DomHelper config and appends it to this element
0228:             *
0229:             * @param config DomHelper element config object. If no tag is specified (e.g., {tag:'input'}) then a div will be automatically generated with the specified attributes.
0230:             * @return the new child element
0231:             */
0232:            public native ExtElement createChild(DomConfig config) /*-{
0233:                   var configJS = config.@com.gwtext.client.core.DomConfig::getJsObject()();
0234:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0235:                   var childJS = elem.createChild(configJS);
0236:                   var childJ = @com.gwtext.client.core.ExtElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(elem);
0237:                   return childJ;
0238:               }-*/;
0239:
0240:            /**
0241:             * Creates the passed DomHelper config and appends inserts it before the passed child element.
0242:             *
0243:             * @param config       DomHelper element config object. If no tag is specified (e.g., {tag:'input'}) then a div will be automatically generated with the specified attributes.
0244:             * @param insertBefore a child element of this element
0245:             * @return the new child element
0246:             */
0247:            public native ExtElement createChild(DomConfig config,
0248:                    Element insertBefore) /*-{
0249:                   var configJS = config.@com.gwtext.client.core.DomConfig::getJsObject()();
0250:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0251:                   var childJS = elem.createChild(configJS, insertBefore);
0252:                   var childJ = @com.gwtext.client.core.ExtElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(elem);
0253:                   return childJ;
0254:               }-*/;
0255:
0256:            //http://extjs.com/forum/showthread.php?t=568&highlight=createProxy
0257:            /**
0258:             * Creates a proxy element of this element.
0259:             *
0260:             * @param config DomHelper config object
0261:             * @return the new proxy element
0262:             */
0263:            public native ExtElement createProxy(DomConfig config) /*-{
0264:                   var configJS = config.@com.gwtext.client.core.DomConfig::getJsObject()();
0265:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0266:                   var proxy = elem.createProxy(configJS);
0267:                   var proxyJ = @com.gwtext.client.core.ExtElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(proxy);
0268:                   return proxyJ;
0269:               }-*/;
0270:
0271:            /**
0272:             * Creates a proxy element of this element.
0273:             *
0274:             * @param config   DomHelper config object
0275:             * @param renderTo The element render the proxy to
0276:             * @param matchBox true to align and size the proxy to this element now (defaults to false)
0277:             * @return the new proxy element
0278:             */
0279:            public native ExtElement createProxy(DomConfig config,
0280:                    Element renderTo, boolean matchBox) /*-{
0281:                   var configJS = config.@com.gwtext.client.core.DomConfig::getJsObject()();
0282:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0283:                   var proxy = elem.createProxy(configJS, renderTo, matchBox);
0284:                   var proxyJ = @com.gwtext.client.core.ExtElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(proxy);
0285:                   return proxyJ;
0286:               }-*/;
0287:
0288:            /**
0289:             * Creates a proxy element of this element.
0290:             *
0291:             * @param cls the class name of the proxy element
0292:             * @return the new proxy element
0293:             */
0294:            public native ExtElement createProxy(String cls) /*-{
0295:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0296:                   elem.createProxy(cls);
0297:                   return this;
0298:               }-*/;
0299:
0300:            /**
0301:             * Creates a proxy element of this element.
0302:             *
0303:             * @param cls      the class name of the proxy element
0304:             * @param renderTo The element render the proxy to
0305:             * @param matchBox true to align and size the proxy to this element now (defaults to false)
0306:             * @return the new proxy element
0307:             */
0308:            public native ExtElement createProxy(String cls, Element renderTo,
0309:                    boolean matchBox) /*-{
0310:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0311:                   elem.createProxy(cls, renderTo, matchBox);
0312:                   return this;
0313:               }-*/;
0314:
0315:            /**
0316:             * Selects a single *direct* child based on the passed CSS selector
0317:             * (the selector should not contain an id).
0318:             *
0319:             * @param selector the CSS selector
0320:             * @return the child element
0321:             */
0322:            public native Element down(String selector) /*-{
0323:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0324:                   return elem.down(selector, true);
0325:               }-*/;
0326:
0327:            /**
0328:             * Looks at this node and then at parent nodes for a match of the passed simple selector
0329:             * (e.g. div.some-class or span:first-child)
0330:             *
0331:             * @param selector the simple selector to test
0332:             * @return the matching element of null if no node found
0333:             */
0334:            public native Element findParent(String selector) /*-{
0335:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0336:                   return elem.findParent(selector);
0337:               }-*/;
0338:
0339:            /**
0340:             * Looks at this node and then at parent nodes for a match of the passed simple selector
0341:             * (e.g. div.some-class or span:first-child)
0342:             *
0343:             * @param selector  the simple selector to test
0344:             * @param container search until container element is reached
0345:             * @return the matching element of null if no node found
0346:             */
0347:            public native Element findParent(String selector, Element container) /*-{
0348:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0349:                   return elem.findParent(selector, container);
0350:               }-*/;
0351:
0352:            /**
0353:             * Looks at this node and then at parent nodes for a match of the passed simple selector
0354:             * (e.g. div.some-class or span:first-child)
0355:             *
0356:             * @param selector the simple selector to test
0357:             * @param maxDepth the max depth to search as a number (defaults to 10)
0358:             * @return the matching element of null if no node found
0359:             */
0360:            public native Element findParent(String selector, int maxDepth) /*-{
0361:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0362:                   return elem.findParent(selector, maxDepth);
0363:               }-*/;
0364:
0365:            /**
0366:             * Looks at parent nodes for a match of the passed simple selector
0367:             * (e.g. div.some-class or span:first-child)
0368:             *
0369:             * @param selector  the simple selector to test
0370:             * @param container search until container element is reached
0371:             * @return the matching element of null if no node found
0372:             */
0373:            public native Element findParentNode(String selector,
0374:                    Element container) /*-{
0375:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0376:                   return elem.findParentNode(selector, container);
0377:               }-*/;
0378:
0379:            /**
0380:             * Looks at parent nodes for a match of the passed simple selector
0381:             * (e.g. div.some-class or span:first-child)
0382:             *
0383:             * @param selector the simple selector to test
0384:             * @param maxDepth the max depth to search as a number (defaults to 10)
0385:             * @return the matching element of null if no node found
0386:             */
0387:            public native Element findParentNode(String selector, int maxDepth) /*-{
0388:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0389:                   return elem.findParentNode(selector, maxDepth);
0390:               }-*/;
0391:
0392:            /**
0393:             * Tries to focus the element. Any exceptions are caught and ignored.
0394:             *
0395:             * @return this
0396:             */
0397:            public native ExtElement focus() /*-{
0398:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0399:                   elem.focus();
0400:                   return this;
0401:               }-*/;
0402:
0403:            /**
0404:             * Gets the x,y coordinates to align this element with another element.
0405:             *
0406:             * @param element        The element to align to
0407:             * @param anchorPosition the element's anchor point
0408:             * @return an array containing the element's x and y coordinates
0409:             */
0410:            public native int[] getAlignToXY(Element element,
0411:                    String anchorPosition) /*-{
0412:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0413:                   var arrJS = elem.getAlignToXY(element, anchorPosition);
0414:                   return @com.gwtext.client.util.JavaScriptObjectHelper::convertToJavaIntArray(Lcom/google/gwt/core/client/JavaScriptObject;)(arrJS);
0415:               }-*/;
0416:
0417:            /**
0418:             * Gets the x,y coordinates to align this element with another element.
0419:             *
0420:             * @param element        The element to align to.
0421:             * @param anchorPosition the element's anchor point
0422:             * @param offesets       offset the positioning by [x, y]
0423:             * @return an array containing the element's x and y coordinates
0424:             */
0425:            public native int[] getAlignToXY(Element element,
0426:                    String anchorPosition, int[] offesets) /*-{
0427:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0428:                   var offsetsJS = @com.gwtext.client.util.JavaScriptObjectHelper::convertToJavaScriptArray([I)(offesets);
0429:                   var arrJS = elem.getAlignToXY(element, anchorPosition, offsetsJS);
0430:                   return @com.gwtext.client.util.JavaScriptObjectHelper::convertToJavaIntArray(Lcom/google/gwt/core/client/JavaScriptObject;)(arrJS);
0431:               }-*/;
0432:
0433:            /**
0434:             * Gets the x,y coordinates specified by the anchor position on the element.
0435:             *
0436:             * @return an array containing the element's x and y coordinates
0437:             */
0438:            public native int[] getAnchorXY() /*-{
0439:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0440:                   var arrJS = elem.getAnchorXY();
0441:                   return @com.gwtext.client.util.JavaScriptObjectHelper::convertToJavaIntArray(Lcom/google/gwt/core/client/JavaScriptObject;)(arrJS);
0442:               }-*/;
0443:
0444:            /**
0445:             * Gets the x,y coordinates specified by the anchor position on the element.
0446:             *
0447:             * @param anchorPosition the specified anchor position.
0448:             * @param local          true to get the local (element top/left-relative) anchor position instead of page coordinates
0449:             * @param width          width to use for calculating anchor position
0450:             * @param height         height to use for calculating anchor position
0451:             * @return an array containing the element's x and y coordinates
0452:             */
0453:            public native int[] getAnchorXY(String anchorPosition,
0454:                    boolean local, int width, int height) /*-{
0455:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0456:                   var arrJS = elem.getAnchorXY(anchorPosition, local, {width: width, height : height});
0457:                   return @com.gwtext.client.util.JavaScriptObjectHelper::convertToJavaIntArray(Lcom/google/gwt/core/client/JavaScriptObject;)(arrJS);
0458:               }-*/;
0459:
0460:            /**
0461:             * Returns the value of a namespaced attribute from the element's underlying DOM node.
0462:             *
0463:             * @param namespace the namespace in which to look for the attribute
0464:             * @param name      the attribute name
0465:             * @return the attribute value
0466:             */
0467:            public native String getAttributeNS(String namespace, String name)/*-{
0468:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0469:                    return elem.getAttributeNS(namespace, name);
0470:                }-*/;
0471:
0472:            /**
0473:             * Gets the width of the border for the specified side.
0474:             *
0475:             * @param side the side
0476:             * @return width of the side
0477:             */
0478:            public native int getBorderWidth(Side side)/*-{
0479:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0480:                    var sideJS = side.@com.gwtext.client.core.Side::getSide()();
0481:                    return elem.getBorderWidth(sideJS);
0482:                }-*/;
0483:
0484:            /**
0485:             * Gets the bottom Y coordinate of the element (element Y position + element height)
0486:             *
0487:             * @param local true to get the local css position instead of page coordinate
0488:             * @return the bottom Y coordinate
0489:             */
0490:            public native int getBottom(boolean local)/*-{
0491:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0492:                    return elem.getBottom(local);
0493:                }-*/;
0494:
0495:            /**
0496:             * Return a Box that can be used to set another elements size/location to match this element.
0497:             *
0498:             * @return the box object
0499:             */
0500:            public native Box getBox()/*-{
0501:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0502:                    var boxJS = elem.getBox();
0503:                    return @com.gwtext.client.core.Box::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(boxJS);
0504:                }-*/;
0505:
0506:            /**
0507:             * Return a Box that can be used to set another elements size/location to match this element.
0508:             *
0509:             * @param contentBox if true a box for the content of the element is returned.
0510:             * @param local      if true the element's left and top are returned instead of page x/y
0511:             * @return the box object
0512:             */
0513:            public native Box getBox(boolean contentBox, boolean local)/*-{
0514:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0515:                    var boxJS = elem.getBox(contentBox, local);
0516:                    return @com.gwtext.client.core.Box::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(boxJS);
0517:                }-*/;
0518:
0519:            /**
0520:             * Calculates the x, y to center this element on the screen
0521:             *
0522:             * @return the x, y values [
0523:             */
0524:            public native int[] getCenterXY() /*-{
0525:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0526:                   var arrJS = elem.getCenterXY();
0527:                   return @com.gwtext.client.util.JavaScriptObjectHelper::convertToJavaIntArray(Lcom/google/gwt/core/client/JavaScriptObject;)(arrJS);
0528:               }-*/;
0529:
0530:            /**
0531:             * Return the CSS color for the specified CSS attribute. rgb, 3 digit (like #fff) and valid values are convert
0532:             * to standard 6 digit hex color.
0533:             *
0534:             * @param attr         the css attribute
0535:             * @param defaultValue the default value to use when a valid color isn't found
0536:             * @return the css color
0537:             */
0538:            public native String getColor(String attr, String defaultValue)/*-{
0539:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0540:                    return elem.getColor(attr, defaultValue);
0541:                }-*/;
0542:
0543:            /**
0544:             * Return the CSS color for the specified CSS attribute. rgb, 3 digit (like #fff) and valid values are convert
0545:             * to standard 6 digit hex color.
0546:             *
0547:             * @param attr         the css attribute
0548:             * @param defaultValue the default value to use when a valid color isn't found
0549:             * @param prefix       defaults to #. Use an empty string when working with YUI color anims.
0550:             * @return the css color
0551:             */
0552:            public native String getColor(String attr, String defaultValue,
0553:                    String prefix)/*-{
0554:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0555:                    return elem.getColor(attr, defaultValue, prefix);
0556:                }-*/;
0557:
0558:            /**
0559:             * Returns either the offsetHeight or the height of this element based on CSS height adjusted by padding or borders
0560:             * when needed to simulate offsetHeight when offsets aren't available. This may not work on display:none elements if
0561:             * a height has not been set using CSS.
0562:             *
0563:             * @return the computed height
0564:             */
0565:            public native int getComputedHeight()/*-{
0566:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0567:                    return elem.getComputedHeight();
0568:                }-*/;
0569:
0570:            /**
0571:             * Returns either the offsetWidth or the width of this element based on CSS width adjusted by padding or borders when
0572:             * needed to simulate offsetWidth when offsets aren't available. This may not work on display:none elements if a width
0573:             * has not been set using CSS.
0574:             *
0575:             * @return the computed width
0576:             */
0577:            public native int getComputedWidth()/*-{
0578:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0579:                    return elem.getComputedWidth();
0580:                }-*/;
0581:
0582:            /**
0583:             * Retursn the underlying DOM Element.
0584:             *
0585:             * @return the DOM element
0586:             */
0587:            public native Element getDOM()/*-{
0588:                    var element = this.@com.gwtext.client.core.JsObject::getJsObj()();
0589:                    return element.dom;
0590:                }-*/;
0591:
0592:            /**
0593:             * Returns the sum width of the padding and borders for the passed side.
0594:             *
0595:             * @param side the side
0596:             * @return sum of padding and border for the side
0597:             */
0598:            public native int getFrameWidth(Side side)/*-{
0599:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0600:                    var sideJS = side.@com.gwtext.client.core.Side::getSide()();
0601:                    return elem.getFrameWidth(sideJS);
0602:                }-*/;
0603:
0604:            /**
0605:             * Returns the offset height of the element.
0606:             *
0607:             * @return the element's height
0608:             */
0609:            public native int getHeight()/*-{
0610:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0611:                    return elem.getHeight();
0612:                }-*/;
0613:
0614:            /**
0615:             * Returns the offset height of the element.
0616:             *
0617:             * @param contentHeight true to get the height minus borders and padding
0618:             * @return the element's height
0619:             */
0620:            public native int getHeight(boolean contentHeight)/*-{
0621:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0622:                    return elem.getHeight(contentHeight);
0623:                }-*/;
0624:
0625:            /**
0626:             * Gets the left X coordinate
0627:             *
0628:             * @return the left coordinate.
0629:             */
0630:            public native int getLeft()/*-{
0631:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0632:                    return elem.getLeft();
0633:                }-*/;
0634:
0635:            /**
0636:             * Gets the left X coordinate.
0637:             *
0638:             * @param local true to get the local css position instead of page coordinate
0639:             * @return the X cooridinate
0640:             */
0641:            public native int getLeft(boolean local)/*-{
0642:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0643:                    return elem.getLeft(local);
0644:                }-*/;
0645:
0646:            /**
0647:             * Returns the margins of this element.
0648:             *
0649:             * @return the margin
0650:             */
0651:            public native Margins getMargins()/*-{
0652:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0653:                    var marginsJS = elem.getMargins();
0654:                    return @com.gwtext.client.core.Margins::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(marginsJS);
0655:                }-*/;
0656:
0657:            /**
0658:             * Gets the next sibling, skipping text nodes.
0659:             *
0660:             * @return the next sibling or null
0661:             */
0662:            public native Element next()/*-{
0663:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0664:                    return elem.next(null, true);
0665:                }-*/;
0666:
0667:            /**
0668:             * Gets the next sibling, skipping text nodes.
0669:             *
0670:             * @param selector Find the next sibling that matches the passed simple selector
0671:             * @return the next sibling or null
0672:             */
0673:            public native Element next(String selector)/*-{
0674:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0675:                    return elem.next(selector, true);
0676:                }-*/;
0677:
0678:            /**
0679:             * Gets the width of the padding for the specified side.
0680:             *
0681:             * @param side the side
0682:             * @return padding
0683:             */
0684:            public native int getPadding(Side side)/*-{
0685:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0686:                    var sideJS = side.@com.gwtext.client.core.Side::getSide()();
0687:                    return elem.getPadding(sideJS);
0688:                }-*/;
0689:
0690:            /**
0691:             * Gets a {@link PositioningConfig} object with all CSS positioning properties. Useful along with setPostioning to get snapshot before
0692:             * performing an update and then restoring the element.
0693:             *
0694:             * @return positioning config object
0695:             */
0696:            public native PositioningConfig getPositioning()/*-{
0697:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0698:                    var posJS = elem.getPositioning();
0699:                    return @com.gwtext.client.core.PositioningConfig::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(posJS);
0700:                }-*/;
0701:
0702:            /**
0703:             * Set positioning with an object returned by getPositioning().
0704:             *
0705:             * @param posCfg the position config
0706:             * @return this
0707:             */
0708:            public native BaseElement setPositioning(PositioningConfig posCfg)/*-{
0709:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0710:                    var posCfgJS = posCfg.@com.gwtext.client.core.JsObject::getJsObj()();
0711:                    elem.setPositioning(posCfgJS);
0712:                    return this;
0713:                }-*/;
0714:
0715:            /**
0716:             * Gets the previous sibling, skipping text nodes.
0717:             *
0718:             * @return the previous sibling or null
0719:             */
0720:            public native Element prev()/*-{
0721:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0722:                    return elem.prev(null, true);
0723:                }-*/;
0724:
0725:            /**
0726:             * Gets the previous sibling, skipping text nodes.
0727:             *
0728:             * @param selector Find the previous sibling that matches the passed simple selector
0729:             * @return the previous sibling or null
0730:             */
0731:            public native Element prev(String selector)/*-{
0732:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0733:                    return elem.prev(selector, true);
0734:                }-*/;
0735:
0736:            /**
0737:             * Returns the region of the given element. The element must be part of the DOM tree to have a region
0738:             * (display:none or elements not appended return false).
0739:             *
0740:             * @return region of the element
0741:             */
0742:            public native Region getRegion()/*-{
0743:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0744:                    var regionJS = elem.getRegion();
0745:                    return @com.gwtext.client.core.Region::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(regionJS);
0746:                }-*/;
0747:
0748:            //todo test
0749:            /**
0750:             * Returns the current scroll position of the element.
0751:             *
0752:             * @return array of left and top scroll position
0753:             */
0754:            public native int[] getScroll()/*-{
0755:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0756:                    var scroll = elem.getScroll();
0757:                    return @com.gwtext.client.util.JavaScriptObjectHelper::convertToJavaIntArray(Lcom/google/gwt/core/client/JavaScriptObject;)([scroll.left, scroll.top]);
0758:                }-*/;
0759:
0760:            /**
0761:             * Returns the size of the element..
0762:             *
0763:             * @return element size
0764:             */
0765:            public native Size getSize()/*-{
0766:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0767:                    var sizeJS = elem.getSize();
0768:                    return @com.gwtext.client.core.Size::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(sizeJS);
0769:                }-*/;
0770:
0771:            /**
0772:             * Normalizes currentStyle and computedStyle.
0773:             *
0774:             * @param property the style property whose value is returned
0775:             * @return the current value of the style property for this element
0776:             */
0777:            public native String getStyle(String property)/*-{
0778:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0779:                    return elem.getStyle(property);
0780:                }-*/;
0781:
0782:            /**
0783:             * Returns the top Y coordinate.
0784:             *
0785:             * @return the Y coordinate
0786:             */
0787:            public native int getTop()/*-{
0788:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0789:                    return elem.getTop();
0790:                }-*/;
0791:
0792:            /**
0793:             * Returns the top Y coordinate.
0794:             *
0795:             * @param local true to get the local css position instead of page coordinate
0796:             * @return the top Y coordinate
0797:             */
0798:            public native int getTop(boolean local)/*-{
0799:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0800:                    return elem.getTop(local);
0801:                }-*/;
0802:
0803:            /**
0804:             * Gets this element's {@link UpdateManager}.
0805:             *
0806:             * @return the UpdateManager
0807:             */
0808:            public native UpdateManager getUpdateManager()/*-{
0809:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0810:                    var umJS = elem.getUpdateManager();
0811:                    return @com.gwtext.client.core.UpdateManager::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(umJS);
0812:                }-*/;
0813:
0814:            /**
0815:             * Returns the value of the "value" attribute
0816:             *
0817:             * @return the value
0818:             */
0819:            public native String getValue()/*-{
0820:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0821:                    return elem.getValue();
0822:                }-*/;
0823:
0824:            /**
0825:             * Returns the value of the "value" attribute as a number.
0826:             *
0827:             * @return tried to parse the value as number
0828:             */
0829:            public native float getValueAsNumber()/*-{
0830:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0831:                    return elem.getValue();
0832:                }-*/;
0833:
0834:            /**
0835:             * Returns the width and height of the viewport.
0836:             *
0837:             * @return the viewport's Size
0838:             */
0839:            public native Size getViewSize()/*-{
0840:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0841:                    var sizeJS = elem.getViewSize();
0842:                    return @com.gwtext.client.core.Size::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(sizeJS);
0843:                }-*/;
0844:
0845:            /**
0846:             * Returns the offset width of the element.
0847:             *
0848:             * @return the elements width
0849:             */
0850:            public native int getWidth()/*-{
0851:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0852:                    return elem.getWidth();
0853:                }-*/;
0854:
0855:            /**
0856:             * Returns the offset width of the element.
0857:             *
0858:             * @param contentWidth true to get the width minus borders and padding
0859:             * @return the elemetns width
0860:             */
0861:            public native int getWidth(boolean contentWidth)/*-{
0862:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0863:                    return elem.getWidth(contentWidth);
0864:                }-*/;
0865:
0866:            /**
0867:             * Gets the current X position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates
0868:             * (display:none or elements not appended return false).
0869:             *
0870:             * @return the X position of the element
0871:             */
0872:            public native int getX()/*-{
0873:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0874:                    return elem.getX();
0875:                }-*/;
0876:
0877:            /**
0878:             * Gets the current position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates
0879:             * (display:none or elements not appended return false).
0880:             *
0881:             * @return the XY position of the element
0882:             */
0883:            public native int[] getXY() /*-{
0884:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0885:                   var arrJS = elem.getXY();
0886:                   return @com.gwtext.client.util.JavaScriptObjectHelper::convertToJavaIntArray(Lcom/google/gwt/core/client/JavaScriptObject;)(arrJS);
0887:               }-*/;
0888:
0889:            /**
0890:             * Gets the current Y position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates
0891:             * (display:none or elements not appended return false).
0892:             *
0893:             * @return the Y position of the element
0894:             */
0895:            public native int getY()/*-{
0896:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0897:                    return elem.getY();
0898:                }-*/;
0899:
0900:            /**
0901:             * Checks if the specified CSS class exists on this element's DOM node.
0902:             *
0903:             * @param className the CSS class to check for
0904:             * @return true if the class exists, else false
0905:             */
0906:            public native boolean hasClass(String className)/*-{
0907:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0908:                    return elem.hasClass(className);
0909:                }-*/;
0910:
0911:            //todo initDD, initDDProxy, initDDTarget
0912:            /**
0913:             * Inserts this element after the passed element in the DOM.
0914:             *
0915:             * @param el the element to insert after
0916:             * @return this
0917:             */
0918:            public native ExtElement insertAfter(Element el)/*-{
0919:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0920:                    elem.insertAfter(el);
0921:                    return this;
0922:                }-*/;
0923:
0924:            /**
0925:             * Inserts this element before the passed element in the DOM.
0926:             *
0927:             * @param el the element to insert before
0928:             * @return this
0929:             */
0930:            public native ExtElement insertBefore(Element el)/*-{
0931:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0932:                    elem.insertBefore(el);
0933:                    return this;
0934:                }-*/;
0935:
0936:            /**
0937:             * Inserts an element as the first child of the this element.
0938:             *
0939:             * @param el the element to insert
0940:             * @return this
0941:             */
0942:            public native ExtElement insertFirst(Element el)/*-{
0943:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0944:                    elem.insertFirst(el);
0945:                    return this;
0946:                }-*/;
0947:
0948:            /**
0949:             * Creates an element as the first child of the this element.
0950:             *
0951:             * @param config DomHelper config to create element
0952:             * @return the new child                                                             i
0953:             */
0954:            public native ExtElement insertFirst(DomConfig config)/*-{
0955:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0956:                    var configJS = config.@com.gwtext.client.core.DomConfig::getJsObject()();
0957:                    var el = elem.insertFirst(configJS);
0958:                    return @com.gwtext.client.core.ExtElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(el);
0959:                }-*/;
0960:
0961:            /**
0962:             * Inserts an html fragment into this element.
0963:             *
0964:             * @param html the html fragment
0965:             * @return the inserted node (or nearest related if more than 1 inserted)
0966:             */
0967:            public native Element insertHtmlBeforeBegin(String html)/*-{
0968:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0969:                    return elem.insertHtml('beforeBegin', html, true);
0970:                }-*/;
0971:
0972:            /**
0973:             * Inserts an html fragment into this element.
0974:             *
0975:             * @param html the html fragment
0976:             * @return the inserted node (or nearest related if more than 1 inserted)
0977:             */
0978:            public native Element insertHtmlAfterBegin(String html)/*-{
0979:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0980:                    return elem.insertHtml('afterBegin', html, true);
0981:                }-*/;
0982:
0983:            /**
0984:             * Inserts an html fragment into this element.
0985:             *
0986:             * @param html the html fragment
0987:             * @return the inserted node (or nearest related if more than 1 inserted)
0988:             */
0989:            public native Element insertHtmlBeforeEnd(String html)/*-{
0990:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
0991:                    return elem.insertHtml('beforeEnd', html, true);
0992:                }-*/;
0993:
0994:            /**
0995:             * Inserts an html fragment into this element.
0996:             *
0997:             * @param html the html fragment
0998:             * @return the inserted node (or nearest related if more than 1 inserted)
0999:             */
1000:            public native Element insertHtmlAfterEnd(String html)/*-{
1001:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1002:                    return elem.insertHtml('afterEnd', html, true);
1003:                }-*/;
1004:
1005:            /**
1006:             * Inserts the passed element as a sibling of this element.
1007:             *
1008:             * @param el the element to insert
1009:             * @return the inserted element
1010:             */
1011:            public native Element insertSibling(Element el)/*-{
1012:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1013:                    return elem.insertSibling(el, 'before', true);
1014:                }-*/;
1015:
1016:            /**
1017:             * Inserts the passed element as a sibling of this element.
1018:             *
1019:             * @param el     the element to insert
1020:             * @param before insert before or after
1021:             * @return the inserted element
1022:             */
1023:            public native ExtElement insertSibling(Element el, boolean before)/*-{
1024:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1025:                    var where = before ? 'before':'after';
1026:                    return elem.insertSibling(el, where, true);
1027:                }-*/;
1028:
1029:            /**
1030:             * Created the passed DomHelper config as a sibling of this element.
1031:             *
1032:             * @param config the DomHelper config
1033:             * @return the inserted element
1034:             */
1035:            public native Element insertSibling(DomConfig config)/*-{
1036:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1037:                    var configJS = config.@com.gwtext.client.core.DomConfig::getJsObject()();
1038:                    return elem.insertSibling(configJS, 'before', true);
1039:                }-*/;
1040:
1041:            /**
1042:             * Created the passed DomHelper config as a sibling of this element.
1043:             *
1044:             * @param config the DomHelper config
1045:             * @param before to insert before or after
1046:             * @return the inserted element
1047:             */
1048:            public native ExtElement insertSibling(DomConfig config,
1049:                    boolean before)/*-{
1050:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1051:                    var configJS = config.@com.gwtext.client.core.DomConfig::getJsObject()();
1052:                    var where = before ? 'before':'after';
1053:                    elem.insertSibling(configJS, where);
1054:                    return this;
1055:                }-*/;
1056:
1057:            /**
1058:             * Returns true if this element matches the passed simple selector (e.g. div.some-class or span:first-child)
1059:             *
1060:             * @param selector the simple selector to test
1061:             * @return true if this element matches the selector, else false
1062:             */
1063:            public native boolean is(String selector)/*-{
1064:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1065:                    return elem.is(selector);
1066:                }-*/;
1067:
1068:            /**
1069:             * Tests various css rules/browsers to determine if this element uses a border box
1070:             *
1071:             * @return true is element uses border box
1072:             */
1073:            public native boolean isBorderBox()/*-{
1074:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1075:                    return elem.isBorderBox();
1076:                }-*/;
1077:
1078:            /**
1079:             * Returns true if display is not "none".
1080:             *
1081:             * @return true if display is not "none"
1082:             */
1083:            public native boolean isDisplayed()/*-{
1084:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1085:                    return elem.isDisplayed();
1086:                }-*/;
1087:
1088:            /**
1089:             * Returns true if this element is masked.
1090:             *
1091:             * @return true if this element is masked
1092:             */
1093:            public native boolean isMasked()/*-{
1094:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1095:                    return elem.isMasked();
1096:                }-*/;
1097:
1098:            /**
1099:             * Returns true if this element is scrollable.
1100:             *
1101:             * @return true if this element is scrollable
1102:             */
1103:            public native boolean isScrollable()/*-{
1104:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1105:                    return elem.isScrollable();
1106:                }-*/;
1107:
1108:            /**
1109:             * Checks whether the element is currently visible using both visibility and display properties.
1110:             *
1111:             * @return true if visible
1112:             */
1113:            public native boolean isVisible()/*-{
1114:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1115:                    return elem.isVisible();
1116:                }-*/;
1117:
1118:            /**
1119:             * Checks whether the element is currently visible using both visibility and display properties.
1120:             *
1121:             * @param deep true to walk the dom and see if parent elements are hidden (defaults to false)
1122:             * @return true if visible
1123:             */
1124:            public native boolean isVisible(boolean deep)/*-{
1125:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1126:                    return elem.isVisible(deep);
1127:                }-*/;
1128:
1129:            /**
1130:             * Puts a mask over this element to disable user interaction. This method can only be applied to elements which accept child nodes.
1131:             *
1132:             * @return the mask element
1133:             */
1134:            public native ExtElement mask()/*-{
1135:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1136:                    var me = elem.mask();
1137:                    return @com.gwtext.client.core.ExtElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(me);
1138:                }-*/;
1139:
1140:            /**
1141:             * Puts a mask over this element to disable user interaction. This method can only be applied to elements which accept child nodes.
1142:             * By default an animated loading icon is added.
1143:             *
1144:             * @param msg a message to display in the mask
1145:             * @return the mask element
1146:             */
1147:            public ExtElement mask(String msg) {
1148:                //by default add animated icon
1149:                return mask(msg, "x-mask-loading");
1150:            }
1151:
1152:            /**
1153:             * Puts a mask over this element to disable user interaction. This method can only be applied to elements which accept child nodes.
1154:             * By default an animated loading icon is added.
1155:             *
1156:             * @param msg a message to display in the mask
1157:             * @param animatedIcon true to add animated loading icon, false to skip
1158:             * @return the mask element
1159:             */
1160:            public ExtElement mask(String msg, boolean animatedIcon) {
1161:                if (animatedIcon) {
1162:                    return mask(msg, animatedIcon);
1163:                } else {
1164:                    return mask(msg, null);
1165:                }
1166:            }
1167:
1168:            /**
1169:             * Puts a mask over this element to disable user interaction. This method can only be applied to elements which accept child nodes.
1170:             *
1171:             * @param msg      a message to display in the mask
1172:             * @param msgClass a css class to apply to the msg element
1173:             * @return the mask element
1174:             */
1175:            public native ExtElement mask(String msg, String msgClass) /*-{
1176:                   var el = this.@com.gwtext.client.core.JsObject::getJsObj()();
1177:                   var me = el.mask(msg, msgClass);
1178:                   return @com.gwtext.client.core.ExtElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(me);
1179:               }-*/;
1180:
1181:            /**
1182:             * Initializes positioning on this element. The element will be positioned relative IF it is not already positioned
1183:             */
1184:            public native void position()/*-{
1185:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1186:                    elem.position();
1187:                }-*/;
1188:
1189:            /**
1190:             * Initializes positioning on this element.
1191:             *
1192:             * @param pos    positioning to use
1193:             * @param zIndex the zIndex to apply
1194:             * @param x      set the page X position
1195:             * @param y      set the page Y position
1196:             */
1197:            public native void position(Positioning pos, int zIndex, int x,
1198:                    int y)/*-{
1199:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1200:                    var posJS = pos.@com.gwtext.client.core.Positioning::getPositioning()();
1201:                    elem.position(posJS, zIndex, x, y);
1202:                }-*/;
1203:
1204:            /**
1205:             * Selects child nodes based on the passed CSS selector (the selector should not contain an id).
1206:             *
1207:             * @param selector the CSS selector
1208:             * @return an array of the matched nodes
1209:             */
1210:            public static native Element[] query(String selector)/*-{
1211:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1212:                    var elemsJS = elem.query(selector);
1213:                    return @com.gwtext.client.util.JavaScriptObjectHelper::toElementArray(Lcom/google/gwt/core/client/JavaScriptObject;)(elemsJS);
1214:                }-*/;
1215:
1216:            //todo removeListener
1217:            /**
1218:             * Replaces the passed element with this element.
1219:             *
1220:             * @param el the element to replace
1221:             * @return this
1222:             */
1223:            public native ExtElement replace(Element el)/*-{
1224:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1225:                    elem.replace(el);
1226:                    return this;
1227:                }-*/;
1228:
1229:            /**
1230:             * Scrolls this element into view within the passed container.
1231:             *
1232:             * @return this
1233:             */
1234:            public native ExtElement scrollIntoView()/*-{
1235:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1236:                    elem.scrollIntoView();
1237:                    return this;
1238:                }-*/;
1239:
1240:            /**
1241:             * Scrolls this element into view within the passed container
1242:             *
1243:             * @param container the container element to scroll (defaults to document.body)
1244:             * @param hscroll   false to disable horizontal scroll (defaults to true)
1245:             * @return this
1246:             */
1247:            public native ExtElement scrollIntoView(Element container,
1248:                    boolean hscroll)/*-{
1249:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1250:                    elem.scrollIntoView(container, hscroll);
1251:                    return this;
1252:                }-*/;
1253:
1254:            /**
1255:             * Creates a CompositeElement for child nodes based on the passed CSS selector (the selector should not contain an id).
1256:             *
1257:             * @param selector the CSS selector
1258:             * @return the CompositeElement
1259:             */
1260:            public native CompositeElement select(String selector)/*-{
1261:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1262:                    var ceJS = elem.select(selector);
1263:                    return @com.gwtext.client.core.CompositeElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(ceJS);
1264:                }-*/;
1265:
1266:            /**
1267:             * Creates a CompositeElement for child nodes based on the passed CSS selector (the selector should not contain an id).
1268:             *
1269:             * @param selector the CSS selector
1270:             * @param unique   true to create a unique ExtElement for each child (defaults to false, which creates a single shared flyweight object)
1271:             * @return the CompositeElement
1272:             */
1273:            public native CompositeElement select(String selector,
1274:                    boolean unique)/*-{
1275:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1276:                    var ceJS = elem.select(selector, unique);
1277:                    if(unique) {
1278:                        return @com.gwtext.client.core.CompositeElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(ceJS);
1279:                    } else {
1280:                        return @com.gwtext.client.core.CompositeElementLite::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(ceJS);
1281:                    }
1282:                }-*/;
1283:
1284:            //todo test
1285:            /**
1286:             * Translates the passed page coordinates into left/top css values for this element
1287:             *
1288:             * @param x the page x
1289:             * @param y the page y
1290:             * @return array of left, top values
1291:             */
1292:            public native int[] translatePoints(int x, int y)/*-{
1293:                    var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1294:                    var leftTopJS = elem.translatePoints(x, y);
1295:                    return @com.gwtext.client.util.JavaScriptObjectHelper::convertToJavaIntArray(Lcom/google/gwt/core/client/JavaScriptObject;)([leftTopJS.left, leftTopJS.top]);
1296:                }-*/;
1297:
1298:            /**
1299:             * Return clipping (overflow) to original clipping before clip() was called.
1300:             *
1301:             * @return this
1302:             */
1303:            public native ExtElement unclip() /*-{
1304:                   var el = this.@com.gwtext.client.core.JsObject::getJsObj()();
1305:                   el.unclip();
1306:                   return this;
1307:               }-*/;
1308:
1309:            /**
1310:             * Removes a previously applied mask. If removeEl is true the mask overlay is destroyed, otherwise it is cached for reuse.
1311:             */
1312:            public native void unmask() /*-{
1313:                   var el = this.@com.gwtext.client.core.JsObject::getJsObj()();
1314:                   el.unmask();
1315:               }-*/;
1316:
1317:            /**
1318:             * Update the innerHTML of this element, optionally searching for and processing scripts.
1319:             *
1320:             * @param html        the new HTML
1321:             * @param loadScripts true to look for and process scripts
1322:             * @param callback    for async script loading you can be notified when the update completes
1323:             */
1324:            public native void update(String html, boolean loadScripts,
1325:                    Function callback) /*-{
1326:                   var el = this.@com.gwtext.client.core.JsObject::getJsObj()();
1327:                   el.update(html, loadScripts, callback  == null ? null : function() {
1328:                       callback.@com.gwtext.client.core.Function::execute()();
1329:                   });
1330:               }-*/;
1331:
1332:            /**
1333:             * Walks up the dom looking for a parent node that matches the passed simple selector (e.g. div.some-class or span:first-child). This is a shortcut for findParentNode() that always returns an ExtElement
1334:             *
1335:             * @param selector  the simple selector to test
1336:             * @param container the container to stop at
1337:             * @return the matching DOM or null if no match was found
1338:             */
1339:            public native ExtElement up(String selector, Element container) /*-{
1340:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1341:                   var el = elem.up(selector, container);
1342:                   return @com.gwtext.client.core.ExtElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(el);
1343:               }-*/;
1344:
1345:            /**
1346:             * Walks up the dom looking for a parent node that matches the passed simple selector (e.g. div.some-class or span:first-child). This is a shortcut for findParentNode() that always returns an ExtElement
1347:             *
1348:             * @param selector the simple selector to test
1349:             * @param maxDepth The max depth to search (defaults to 10 || document.body)
1350:             * @return the matching DOM or null if no match was found
1351:             */
1352:            public native ExtElement up(String selector, int maxDepth) /*-{
1353:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1354:                   var el = elem.up(selector, maxDepth);
1355:                   return @com.gwtext.client.core.ExtElement::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(el);
1356:               }-*/;
1357:
1358:            /**
1359:             * Return the first child of this element.
1360:             *
1361:             * @return the first child
1362:             */
1363:            public native Element getFirstChild() /*-{
1364:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1365:                   return elem.dom.firstChild;
1366:               }-*/;
1367:
1368:            /**
1369:             * Return the parent node of this element,
1370:             *
1371:             * @return the parent node
1372:             */
1373:            public native Element getParentNode() /*-{
1374:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1375:                   return elem.dom.parentNode;
1376:               }-*/;
1377:
1378:            /**
1379:             * Return the client width of the element.
1380:             *
1381:             * @return the client width
1382:             */
1383:            public native int getClientWidth() /*-{
1384:                   var elem = this.@com.gwtext.client.core.JsObject::getJsObj()();
1385:                   return elem.dom.clientWidth;
1386:               }-*/;
1387:
1388:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.