Java Doc for MyDOM.java in  » Ajax » MyGWT » net » mygwt » ui » client » 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 » MyGWT » net.mygwt.ui.client 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.mygwt.ui.client.MyDOM

MyDOM
public class MyDOM (Code)
Provides additional static methods that allow you to manipulate the browser's Document Object Model (DOM).
See Also:   DOM




Method Summary
public static  voidaddEventsSunk(Element elem, int event)
     Adds the event type to the element's sunk events.
public static  voidaddStyleName(Element elem, String style)
     Adds a style name to the element.
public static  voidalignTo(Element elem, Element align, String pos, int[] offsets)
     Aligns the element with another element relative to the specified anchor points.
native public static  voidapplyStyles(Element elem, String styles)
     Sets multiple style on the given element.
public static  voidcenter(Element elem)
     Centers the element.
public static  voidclip(Element elem)
     Clips overflow on the element.
public static  Elementcreate(String html)
     Creates an element form the given markup.
native public static  voiddisable(Element elem)
     Disable the element.
native public static  voiddisableContextMenu(Element elem, boolean disable)
     Enables and disables the browsers default context menu for the specified element.A circular reference will be created when disabling text selection. Disabling should be cleared when the element is detached.
public static  voiddisableTextSelection(Element elem, boolean disable)
     Enables or disables text selection for the element.
native public static  voidenable(Element elem)
     Enable the element.
native public static  StringescapeHTML(String html)
     Removes script and javascript code from the given html markup.
native public static  ElementfindChild(String style, Element elem)
     Returns the first child with a matching style name.
public static  ElementfindParent(String style, Element elem, int maxDepth)
     Finds the first parent element with the given style name.
public static  ElementfindParentWithId(Element elem, int maxDepth)
     Finds the first parent element with an id.
public static  PointgetAlignToXY(Element elem, Element align, String pos, int[] offsets)
     Returns the x,y coordinates to align this element with another element.
public static  PointgetAnchorXY(Element elem, String anchor, boolean local)
     Returns the x,y coordinates specified by the anchor position on the element.
Parameters:
  elem - the element
Parameters:
  anchor - the specified anchor position (defaults to "c").
native public static  StringgetAnyElementProperty(Element elem, String property)
     Gets any named property from an element, as a string.
native public static  ElementgetBody()
     Returns the body element.
native public static  intgetBodyScrollLeft()
     Returns the body elements horizontal scroll.
native public static  intgetBodyScrollTop()
     Return the body elements vertical scroll.
public static  intgetBorderWidth(Element elem, int sides)
     Returns the total border width of the specified sides.
public static  intgetBottom(Element elem, boolean local)
     Returns the bottom Y coordinate of the element (element Y position + element height).
public static  RectanglegetBounds(Element elem)
     Returns the element's bounds.
public static  RectanglegetBounds(Element elem, boolean content)
     Returns the element's bounds.
public static  intgetComputedHeight(Element elem)
     Returns either the offsetHeight or the height of this element based on it's CSS height.
public static  intgetComputedWidth(Element elem)
     Returns either the offsetWidth or the width of this element based on it's CSS width.
public static  intgetDecorationWidth(Element elem, int sides)
     Returns the total width of borders and padding for the specified sides.
native public static  ElementgetDocument()
     Returns the document element.
native public static  ElementgetHead()
    
public static  intgetHeight(Element elem)
     Returns the element's offset height in pixels.
public static  intgetHeight(Element elem, boolean contentHeight)
     Returns the element's height.
public static  StringgetId(Element elem)
     Returns the element's id.
public static  intgetIntStyleAttribute(Element elem, String attr)
     Returns the element's style attribute value.
public static  intgetLeft(Element elem)
     Returns the left X coordinate.
public static  intgetPaddingWidth(Element elem, int sides)
     Returns the total padding width of the given sides.
public static  RegiongetRegion(Element elem)
     Returns the region of the given element.
public static  intgetRight(Element elem, boolean local)
     Returns the right X coordinate of the element (element X position + element width).
public static  intgetScrollBarWidth()
     Returns the width of the scroll bar.
native public static  intgetScrollHeight(Element elem)
     Returns the element's scroll height.
public static  intgetScrollLeft(Element elem)
     Returns the element's horizontal scroll position.
public static  intgetScrollTop(Element elem)
     Returns the element's vertical scroll position.
native public static  intgetScrollWidth(Element elem)
     Returns the element's scroll width.
public static  SizegetSize(Element elem)
     Returns the elements size.
public static  StringgetStyleName(Element elem)
    
public static  ElementgetSubChild(Element elem, int depth)
     Returns the element's sub child.
public static  intgetTop(Element elem)
     Returns the top Y coordinate.
public static  StringgetUniqueID()
     Returns an unique id.
public static  StringgetValue(Element elem)
     Returns the the "value" attribute.
native public static  SizegetViewportSize()
     Returns the viewports size.
public static  intgetWidth(Element elem)
     Returns the element's offset width in pixels.
public static  intgetWidth(Element elem, boolean contentWidth)
     Returns the element's width.
public static  intgetX(Element elem)
     Gets the current X position of the element based on page coordinates.
public static  PointgetXY(Element elem)
     Returns the current position of the element based on page coordinates.
public static  intgetY(Element elem)
     Returns the current Y position of the element based on page coordinates.
public static  intgetZIndex()
     Returns the current max z-index.
public static  booleanhasClass(Element elem, String className)
     Checks if the specified CSS class exists on this element's DOM node.
native static  voidinit()
     This function can be replaced to plugin an alternate function to handle XSS exploits.
native public static  voidinsertAfter(Element elem, Element after)
     Inserts this element after the passed element in the DOM.
native public static  voidinsertBefore(Element elem, Element before)
     Inserts the element before the passed element in the DOM.
public static  booleanisHScrollBarShowing(Element container)
    
public static  booleanisVScrollBarShowing(Element container)
    
public static  booleanisVisibility(Element elem)
     Returns true if the element is visible using the css 'visibiliy' attribute.
public static  booleanisVisible(Element elem)
     Checks whether the element is currently visible using both visibility and display properties.
public static  booleanisVisibleBox()
     Determines if the visible box or content area is set when sizing elements.
public static  voidmakePositionable(Element elem)
     Makes an element positionable.
public static  voidmakePositionable(Element elem, boolean absolute)
     Makes an element positionable.
public static  PointoffsetsTo(Element elem, Element to)
     Returns the offsets between two elements.
public static  voidremoveChildren(Element elem)
     Removes all the elements children.
public static  voidremoveFromParent(Element elem)
     Removes the element from it's parent.
public static  voidremoveStyleName(Element elem, String style)
     Removes a style name.
native public static  voidscrollIntoView(Element elem, Element container, boolean hscroll)
     Scrolls the element into view.
public static  voidsetBorders(Element elem, boolean show)
     Adds or removes a border.
public static  voidsetBounds(Element elem, int x, int y, int width, int height)
    
public static  voidsetBounds(Element elem, int x, int y, int width, int height, boolean adjust)
     Sets the widgets size and location to the rectangular area specified by the arguments.
public static  voidsetBounds(Element elem, Rectangle rect)
     Sets the elements size and location to the specified rectangle.
public static  voidsetBounds(Element elem, Rectangle rect, boolean adjust)
     Sets the widgets size and location to the specified rectangle.
public static  voidsetDoubleStyleAttribute(Element elem, String style, double value)
     Sets the elements style attribute.
native public static  voidsetFocus(Element elem, boolean focused)
     Sets the focus state of the element.
public static  voidsetHeight(Element elem, int height)
     Sets the element's height.
public static  voidsetHeight(Element elem, int height, boolean adjust)
     Sets the element's height.
native public static  voidsetInnerHTML(Element elem, String html)
     Sets the HTML contained within an element.
native public static  voidsetInnerHTML(Element elem, String html, boolean escape)
     Sets the HTML contained within an element.
public static  voidsetLeft(Element elem, int left)
     Sets the element's left position directly using CSS style (instead of MyDOM.setX ).
public static  voidsetLeftTop(Element elem, int left, int top)
     Sets the element's left position directly using CSS style.
public static  voidsetLocation(Element elem, int x, int y)
     Sets the element position using page coordinates.
public static  voidsetScrollLeft(Element elem, int left)
     Sets the element's scroll left value.
public static  voidsetScrollTop(Element elem, int top)
     Sets the element's scroll top value.
public static  voidsetSize(Element elem, int width, int height)
     Set the size of the element.
public static  voidsetSize(Element elem, int width, int height, boolean adjust)
     Set the size of the element.
public static  voidsetStyleAttribute(Element elem, String attr, String value)
     Sets the element's style attribute.
public static  voidsetStyleName(Element elem, String style)
     Sets the element's style name.
public static  voidsetStyleName(Element elem, String style, boolean add)
     This convenience method adds or removes a style name for a given element.
public static  voidsetTop(Element elem, int top)
     Sets the element's top position directly using CSS style (instead of MyDOM.setY ).
public static  voidsetValue(Element elem, String value)
     Sets the element's value property.
public static  voidsetVisibility(Element elem, boolean visible)
     Sets the elements css 'visibility' property.
public static  voidsetVisible(Element elem, boolean visible)
     Sets the element's css 'display' property.
public static  voidsetWidth(Element elem, int width)
     Sets the element's width.
public static  voidsetWidth(Element elem, int width, boolean adjust)
     Sets the element's width.
public static  voidsetX(Element elem, int x)
     Set the x position of the element.
public static  voidsetXY(Element elem, Point point)
     Sets the position of the element.
public static  voidsetY(Element elem, int y)
     Set the y position of an html element in page coordinates, regardless of how the element is positioned.
public static  voidsetZIndex(Element elem, int index)
     Sets the element's z-index.
public static  voidunwrap(Element wrapper, Element child, Rectangle bounds)
     Unwraps the child element.
public static  voidunwrap(Element wrapper, Element child, Rectangle bounds, int index)
     Unwraps the child element.
public static  Rectanglewrap(Element elem, Element wrapper)
     Wraps the element with the specified wrapper.



Method Detail
addEventsSunk
public static void addEventsSunk(Element elem, int event)(Code)
Adds the event type to the element's sunk events.
Parameters:
  elem - the element
Parameters:
  event - the events to add



addStyleName
public static void addStyleName(Element elem, String style)(Code)
Adds a style name to the element.
Parameters:
  elem - the element
Parameters:
  style - the style to be added



alignTo
public static void alignTo(Element elem, Element align, String pos, int[] offsets)(Code)
Aligns the element with another element relative to the specified anchor points. Two values from the table below should be passed separated by a dash, the first value is used as the element's anchor point, and the second value is used as the target's anchor point.

In addition to the anchor points, the position parameter also supports the "?" character. If "?" is passed at the end of the position string, the element will attempt to align as specified, but the position will be adjusted to constrain to the viewport if necessary. Note that the element being aligned might be swapped to align to a different position than that specified in order to enforce the viewport constraints.

Following are all of the supported anchor positions:
 Value  Description
 -----  -----------------------------
 tl     The top left corner (default)
 t      The center of the top edge
 tr     The top right corner
 l      The center of the left edge
 c      In the center of the element
 r      The center of the right edge
 bl     The bottom left corner
 b      The center of the bottom edge
 br     The bottom right corner
 

Parameters:
  elem - the element to be aligned
Parameters:
  align - the element to align to
Parameters:
  pos - the position to align to
Parameters:
  offsets - the offsets or null



applyStyles
native public static void applyStyles(Element elem, String styles)(Code)
Sets multiple style on the given element.
Parameters:
  elem - the element
Parameters:
  styles - the styles



center
public static void center(Element elem)(Code)
Centers the element.
Parameters:
  elem - the element



clip
public static void clip(Element elem)(Code)
Clips overflow on the element.



create
public static Element create(String html)(Code)
Creates an element form the given markup.
Parameters:
  html - the markup the new element



disable
native public static void disable(Element elem)(Code)
Disable the element.



disableContextMenu
native public static void disableContextMenu(Element elem, boolean disable)(Code)
Enables and disables the browsers default context menu for the specified element.A circular reference will be created when disabling text selection. Disabling should be cleared when the element is detached. See the Component source for an example.
Parameters:
  elem - the element
Parameters:
  disable - true to disable



disableTextSelection
public static void disableTextSelection(Element elem, boolean disable)(Code)
Enables or disables text selection for the element. A circular reference will be created when disabling text selection. Disabling should be cleared when the element is detached. See the Component source for an example.
Parameters:
  elem - the element
Parameters:
  disable - true to disable



enable
native public static void enable(Element elem)(Code)
Enable the element.
Parameters:
  elem - the element



escapeHTML
native public static String escapeHTML(String html)(Code)
Removes script and javascript code from the given html markup.
Parameters:
  html - the html the updated html



findChild
native public static Element findChild(String style, Element elem)(Code)
Returns the first child with a matching style name.
Parameters:
  style - the style
Parameters:
  elem - the element the matching element or null



findParent
public static Element findParent(String style, Element elem, int maxDepth)(Code)
Finds the first parent element with the given style name.
Parameters:
  style - the style name
Parameters:
  elem - the start element
Parameters:
  maxDepth - the max amount of parent to search the matching element



findParentWithId
public static Element findParentWithId(Element elem, int maxDepth)(Code)
Finds the first parent element with an id.
Parameters:
  elem - the start element
Parameters:
  maxDepth - the max amount of parent to search the matching element



getAlignToXY
public static Point getAlignToXY(Element elem, Element align, String pos, int[] offsets)(Code)
Returns the x,y coordinates to align this element with another element. See MyDOM.alignTo for more info on the supported position values.
Parameters:
  elem - the align to be aligned
Parameters:
  align - the element to align to
Parameters:
  pos - the position, see alignTo
Parameters:
  offsets - the optional offsets the the point



getAnchorXY
public static Point getAnchorXY(Element elem, String anchor, boolean local)(Code)
Returns the x,y coordinates specified by the anchor position on the element.
Parameters:
  elem - the element
Parameters:
  anchor - the specified anchor position (defaults to "c"). SeeMyDOM.alignTo for details on supported anchor positions.
Parameters:
  local - true to get the local (elementtop/left-relative) anchor position instead of page coordinates the position



getAnyElementProperty
native public static String getAnyElementProperty(Element elem, String property)(Code)
Gets any named property from an element, as a string.
Parameters:
  elem - the element whose attribute is to be retrieved
Parameters:
  property - the name of the property the property value



getBody
native public static Element getBody()(Code)
Returns the body element. the body



getBodyScrollLeft
native public static int getBodyScrollLeft()(Code)
Returns the body elements horizontal scroll. the scroll amount in pixels



getBodyScrollTop
native public static int getBodyScrollTop()(Code)
Return the body elements vertical scroll. the scroll amount in pixels



getBorderWidth
public static int getBorderWidth(Element elem, int sides)(Code)
Returns the total border width of the specified sides.
Parameters:
  elem - the element
Parameters:
  sides - can be any combination of LEFT, RIGHT, TOP, BOTTOM the width of the sides passed added together



getBottom
public static int getBottom(Element elem, boolean local)(Code)
Returns the bottom Y coordinate of the element (element Y position + element height).
Parameters:
  elem - the element
Parameters:
  local - true to get the local css position instead ofpage coordinate the bottom value



getBounds
public static Rectangle getBounds(Element elem)(Code)
Returns the element's bounds.
Parameters:
  elem - the element the elements bounds



getBounds
public static Rectangle getBounds(Element elem, boolean content)(Code)
Returns the element's bounds.
Parameters:
  elem - the element
Parameters:
  content - true to adjust for box model issues the elements bounds



getComputedHeight
public static int getComputedHeight(Element elem)(Code)
Returns either the offsetHeight or the height of this element based on it's CSS height.
Parameters:
  elem - the element the height



getComputedWidth
public static int getComputedWidth(Element elem)(Code)
Returns either the offsetWidth or the width of this element based on it's CSS width.
Parameters:
  elem - the element the width



getDecorationWidth
public static int getDecorationWidth(Element elem, int sides)(Code)
Returns the total width of borders and padding for the specified sides.
Parameters:
  elem - the element
Parameters:
  sides - can be any combination of LEFT, RIGHT, TOP, BOTTOM the width in pixels



getDocument
native public static Element getDocument()(Code)
Returns the document element. the docuemnt



getHead
native public static Element getHead()(Code)



getHeight
public static int getHeight(Element elem)(Code)
Returns the element's offset height in pixels. This is the total height of the object, including decorations such as border, margin, and padding.
Parameters:
  elem - the element the element's offset height



getHeight
public static int getHeight(Element elem, boolean contentHeight)(Code)
Returns the element's height.
Parameters:
  elem - the element
Parameters:
  contentHeight - true to get the height minus bordersand padding the element's height



getId
public static String getId(Element elem)(Code)
Returns the element's id.
Parameters:
  elem - the element the id



getIntStyleAttribute
public static int getIntStyleAttribute(Element elem, String attr)(Code)
Returns the element's style attribute value.
Parameters:
  elem - the element
Parameters:
  attr - the attribute name the attribute value



getLeft
public static int getLeft(Element elem)(Code)
Returns the left X coordinate.
Parameters:
  elem - the element the left value



getPaddingWidth
public static int getPaddingWidth(Element elem, int sides)(Code)
Returns the total padding width of the given sides.
Parameters:
  elem - the element
Parameters:
  sides - can be any combination of LEFT, RIGHT, TOP, BOTTOM the padding



getRegion
public static Region getRegion(Element elem)(Code)
Returns the region of the given element. The element must be part of the DOM tree to have a region.
Parameters:
  elem - the element a region containing top, left, bottom, right



getRight
public static int getRight(Element elem, boolean local)(Code)
Returns the right X coordinate of the element (element X position + element width).
Parameters:
  elem - the element
Parameters:
  local - true to get the local css position instead ofpage coordinate the right value



getScrollBarWidth
public static int getScrollBarWidth()(Code)
Returns the width of the scroll bar. the scroll bar width



getScrollHeight
native public static int getScrollHeight(Element elem)(Code)
Returns the element's scroll height.
Parameters:
  elem - the element the scroll height



getScrollLeft
public static int getScrollLeft(Element elem)(Code)
Returns the element's horizontal scroll position.
Parameters:
  elem - the element the scroll amount in pixels



getScrollTop
public static int getScrollTop(Element elem)(Code)
Returns the element's vertical scroll position.
Parameters:
  elem - the element the scroll amount in pixel



getScrollWidth
native public static int getScrollWidth(Element elem)(Code)
Returns the element's scroll width.
Parameters:
  elem - the element the scroll width



getSize
public static Size getSize(Element elem)(Code)
Returns the elements size.
Parameters:
  elem - the element the size



getStyleName
public static String getStyleName(Element elem)(Code)



getSubChild
public static Element getSubChild(Element elem, int depth)(Code)
Returns the element's sub child.
Parameters:
  elem - the element
Parameters:
  depth - the child node depth the child element



getTop
public static int getTop(Element elem)(Code)
Returns the top Y coordinate.
Parameters:
  elem - the element the top value



getUniqueID
public static String getUniqueID()(Code)
Returns an unique id. the id



getValue
public static String getValue(Element elem)(Code)
Returns the the "value" attribute.
Parameters:
  elem - the element the value



getViewportSize
native public static Size getViewportSize()(Code)
Returns the viewports size. the size



getWidth
public static int getWidth(Element elem)(Code)
Returns the element's offset width in pixels. This is the total width of the element, including decorations such as border, margin, and padding.
Parameters:
  elem - the element the element's offset width



getWidth
public static int getWidth(Element elem, boolean contentWidth)(Code)
Returns the element's width.
Parameters:
  elem - the element
Parameters:
  contentWidth - true to get the width minus borders andpadding the element's width



getX
public static int getX(Element elem)(Code)
Gets the current X position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates.
Parameters:
  elem - the element the x coordinate



getXY
public static Point getXY(Element elem)(Code)
Returns the current position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates.
Parameters:
  elem - the element the current location



getY
public static int getY(Element elem)(Code)
Returns the current Y position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates.
Parameters:
  elem - the element the y coordinate



getZIndex
public static int getZIndex()(Code)
Returns the current max z-index. the z-index



hasClass
public static boolean hasClass(Element elem, String className)(Code)
Checks if the specified CSS class exists on this element's DOM node.
Parameters:
  elem - the element
Parameters:
  className - the CSS class to check for true if the class exists, else false



init
native static void init()(Code)
This function can be replaced to plugin an alternate function to handle XSS exploits.



insertAfter
native public static void insertAfter(Element elem, Element after)(Code)
Inserts this element after the passed element in the DOM.
Parameters:
  elem - the element
Parameters:
  after - the element to insert after



insertBefore
native public static void insertBefore(Element elem, Element before)(Code)
Inserts the element before the passed element in the DOM.
Parameters:
  elem - the element to be inserted
Parameters:
  before - the element to insert before



isHScrollBarShowing
public static boolean isHScrollBarShowing(Element container)(Code)
Returns true if the horizontal scroll bar is present
Parameters:
  container - the container element the vertical scroll bar state



isVScrollBarShowing
public static boolean isVScrollBarShowing(Element container)(Code)
Returns true if the vertical scroll bar is present
Parameters:
  container - the container element the vertical scroll bar state



isVisibility
public static boolean isVisibility(Element elem)(Code)
Returns true if the element is visible using the css 'visibiliy' attribute.
Parameters:
  elem - the element the visible state



isVisible
public static boolean isVisible(Element elem)(Code)
Checks whether the element is currently visible using both visibility and display properties. true if the element is currently visible, elsefalse



isVisibleBox
public static boolean isVisibleBox()(Code)
Determines if the visible box or content area is set when sizing elements. true for visible box sizing



makePositionable
public static void makePositionable(Element elem)(Code)
Makes an element positionable.
Parameters:
  elem - the element



makePositionable
public static void makePositionable(Element elem, boolean absolute)(Code)
Makes an element positionable.
Parameters:
  elem - the element
Parameters:
  absolute - true to position absolute



offsetsTo
public static Point offsetsTo(Element elem, Element to)(Code)
Returns the offsets between two elements. Both element must be part of the DOM tree and not have display:none to have page coordinates.
Parameters:
  elem - the element
Parameters:
  to - the to element the xy page offsets



removeChildren
public static void removeChildren(Element elem)(Code)
Removes all the elements children.
Parameters:
  elem - the element



removeFromParent
public static void removeFromParent(Element elem)(Code)
Removes the element from it's parent.
Parameters:
  elem - the element



removeStyleName
public static void removeStyleName(Element elem, String style)(Code)
Removes a style name.
Parameters:
  elem - the element
Parameters:
  style - the style to be removed



scrollIntoView
native public static void scrollIntoView(Element elem, Element container, boolean hscroll)(Code)
Scrolls the element into view.
Parameters:
  elem - the element to scroll
Parameters:
  container - the container element
Parameters:
  hscroll - false to disable horizontal scrolling.



setBorders
public static void setBorders(Element elem, boolean show)(Code)
Adds or removes a border. The style name 'my-border' is added to the widget to display a border.
Parameters:
  elem - the element
Parameters:
  show - the show state



setBounds
public static void setBounds(Element elem, int x, int y, int width, int height)(Code)



setBounds
public static void setBounds(Element elem, int x, int y, int width, int height, boolean adjust)(Code)
Sets the widgets size and location to the rectangular area specified by the arguments.
Parameters:
  elem - the element
Parameters:
  x - the x coordinate
Parameters:
  y - the y coordinate
Parameters:
  width - the width
Parameters:
  height - the height
Parameters:
  adjust - true to adjust for box model issues



setBounds
public static void setBounds(Element elem, Rectangle rect)(Code)
Sets the elements size and location to the specified rectangle.
Parameters:
  elem - the element
Parameters:
  rect - the rectangle



setBounds
public static void setBounds(Element elem, Rectangle rect, boolean adjust)(Code)
Sets the widgets size and location to the specified rectangle.
Parameters:
  elem - the element
Parameters:
  adjust - true to adjust for box model issues
Parameters:
  rect - the rectangle



setDoubleStyleAttribute
public static void setDoubleStyleAttribute(Element elem, String style, double value)(Code)
Sets the elements style attribute.
Parameters:
  elem - the element
Parameters:
  style - the style
Parameters:
  value - the new double value



setFocus
native public static void setFocus(Element elem, boolean focused)(Code)
Sets the focus state of the element.
Parameters:
  focused - the new focus state



setHeight
public static void setHeight(Element elem, int height)(Code)
Sets the element's height.
Parameters:
  elem - the element
Parameters:
  height - the new height



setHeight
public static void setHeight(Element elem, int height, boolean adjust)(Code)
Sets the element's height.
Parameters:
  elem - the element
Parameters:
  height - the new height
Parameters:
  adjust - true to adjust for box model issue



setInnerHTML
native public static void setInnerHTML(Element elem, String html)(Code)
Sets the HTML contained within an element. The specified html will be escaped for XSS exploits if MyGWT.enableEscapeHTML(boolean) has been enabled.
Parameters:
  elem - the element
Parameters:
  html - the html



setInnerHTML
native public static void setInnerHTML(Element elem, String html, boolean escape)(Code)
Sets the HTML contained within an element. The specified html will be escaped for XSS exploits if MyGWT.enableEscapeHTML(boolean) has been enabled.
Parameters:
  elem - the element
Parameters:
  html - the html
Parameters:
  escape - true to escape html for XSS exploits.



setLeft
public static void setLeft(Element elem, int left)(Code)
Sets the element's left position directly using CSS style (instead of MyDOM.setX ).
Parameters:
  elem - the element
Parameters:
  left - the left value



setLeftTop
public static void setLeftTop(Element elem, int left, int top)(Code)
Sets the element's left position directly using CSS style.
Parameters:
  elem - the element
Parameters:
  left - the left value
Parameters:
  top - the top value



setLocation
public static void setLocation(Element elem, int x, int y)(Code)
Sets the element position using page coordinates.
Parameters:
  elem - the element
Parameters:
  x - the x coordinate value
Parameters:
  y - the y coordinate value



setScrollLeft
public static void setScrollLeft(Element elem, int left)(Code)
Sets the element's scroll left value.
Parameters:
  elem - the element
Parameters:
  left - the value



setScrollTop
public static void setScrollTop(Element elem, int top)(Code)
Sets the element's scroll top value.
Parameters:
  elem - the element
Parameters:
  top - the value



setSize
public static void setSize(Element elem, int width, int height)(Code)
Set the size of the element. Values equal to My.DEFAULT are ignored.
Parameters:
  elem - the element
Parameters:
  width - the new width
Parameters:
  height - the new height



setSize
public static void setSize(Element elem, int width, int height, boolean adjust)(Code)
Set the size of the element. Values equal to My.DEFAULT are ignored.
Parameters:
  elem - the element
Parameters:
  width - the new width
Parameters:
  height - the new height
Parameters:
  adjust - true to adjust for box model issues



setStyleAttribute
public static void setStyleAttribute(Element elem, String attr, String value)(Code)
Sets the element's style attribute.
Parameters:
  elem - the element
Parameters:
  attr - the attribute
Parameters:
  value - the value



setStyleName
public static void setStyleName(Element elem, String style)(Code)
Sets the element's style name.
Parameters:
  elem - the element
Parameters:
  style - the style name



setStyleName
public static void setStyleName(Element elem, String style, boolean add)(Code)
This convenience method adds or removes a style name for a given element. This method is typically used to add and remove secondary style names, but it can be used to remove primary stylenames as well, but that is not recommended.
Parameters:
  elem - the element whose style is to be modified
Parameters:
  style - the secondary style name to be added or removed
Parameters:
  add - true to add the given style, falseto remove it



setTop
public static void setTop(Element elem, int top)(Code)
Sets the element's top position directly using CSS style (instead of MyDOM.setY ).
Parameters:
  elem - the element
Parameters:
  top - the top value



setValue
public static void setValue(Element elem, String value)(Code)
Sets the element's value property.
Parameters:
  elem - the element
Parameters:
  value - the value



setVisibility
public static void setVisibility(Element elem, boolean visible)(Code)
Sets the elements css 'visibility' property. Behavior is different than using the 'display' property.
Parameters:
  elem - the element
Parameters:
  visible - true to show, false to hide



setVisible
public static void setVisible(Element elem, boolean visible)(Code)
Sets the element's css 'display' property.
Parameters:
  elem - the element
Parameters:
  visible - true to show, false to hide



setWidth
public static void setWidth(Element elem, int width)(Code)
Sets the element's width.
Parameters:
  elem - the element
Parameters:
  width - the new width value



setWidth
public static void setWidth(Element elem, int width, boolean adjust)(Code)
Sets the element's width.
Parameters:
  elem - the element
Parameters:
  adjust - true to adjust for box model issues
Parameters:
  width - the new width value



setX
public static void setX(Element elem, int x)(Code)
Set the x position of the element.
Parameters:
  elem - the element
Parameters:
  x - the x coordinate



setXY
public static void setXY(Element elem, Point point)(Code)
Sets the position of the element.
Parameters:
  elem - the element
Parameters:
  point - the position



setY
public static void setY(Element elem, int y)(Code)
Set the y position of an html element in page coordinates, regardless of how the element is positioned. The element must be part of the DOM tree to have page coordinates.
Parameters:
  elem - the element
Parameters:
  y - the y coordinate



setZIndex
public static void setZIndex(Element elem, int index)(Code)
Sets the element's z-index.
Parameters:
  elem - the element
Parameters:
  index - the z-index



unwrap
public static void unwrap(Element wrapper, Element child, Rectangle bounds)(Code)
Unwraps the child element.
Parameters:
  wrapper - the wrapper element
Parameters:
  child - the child element
Parameters:
  bounds - the size



unwrap
public static void unwrap(Element wrapper, Element child, Rectangle bounds, int index)(Code)
Unwraps the child element.
Parameters:
  wrapper - the wrapper element
Parameters:
  child - the child element
Parameters:
  bounds - the size
Parameters:
  index - the insert location



wrap
public static Rectangle wrap(Element elem, Element wrapper)(Code)
Wraps the element with the specified wrapper. The wrapper will have the same size and position of the element. The original bounds can be used to 'unwrap' the element.
Parameters:
  wrapper - the wrapper element the original bounds



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.