Class CmsDomUtil
- Since:
- 8.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
HTML tag attributes.static class
Helper class to encapsulate an attribute/value pair.static enum
CSS Colors.static enum
HTML entities.static enum
Form methods.static enum
CSS Properties.static enum
CSS Property values.static enum
HTML Tags.static enum
Enumeration of link/form targets. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addDisablingOverlay
(com.google.gwt.dom.client.Element element) Adds an overlay div to the element.static void
addDynamicStyleRule
(String rule) Adds a CSS style rule to a dynamically inserted style sheet.static boolean
checkPositionInside
(com.google.gwt.dom.client.Element element, int x, int y) Returns if the given client position is over the given element.static void
clearHover
(com.google.gwt.dom.client.Element element) Clears the elements hover state by removing it from the DOM and re-attaching it.static void
clearOpacity
(com.google.gwt.dom.client.Element element) Removes the opacity attribute from the element's inline-style.static com.google.gwt.dom.client.Element
clone
(com.google.gwt.dom.client.Element element) Clones the given element.static String
close
(CmsDomUtil.Tag tag) Generates a closing tag.static boolean
copyToClipboard
(String selector) Copy the text content of the matching element to the clip-board.static com.google.gwt.dom.client.Element
createElement
(String html) This method will create anElement
for the given HTML.static String
createFaceHtml
(String text, String imageClass, com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant align) Convenience method to assemble the HTML to use for a button face.static com.google.gwt.dom.client.Element
createIFrameElement
(String name) Creates an iFrame element with the given name attribute.static String
enclose
(CmsDomUtil.Tag tag, String text, CmsDomUtil.AttributeValue... attrs) Encloses the given text with the given tag.static void
ensureJavaScriptIncluded
(String javascriptLink) Ensures a script tag is present within the window document context.static void
ensureJavaScriptIncluded
(String javascriptLink, boolean async) Ensures a script tag is present within the window document context.static void
ensureJavaScriptIncluded
(String javascriptLink, boolean async, com.google.gwt.core.client.JavaScriptObject callback) Ensures a script tag is present within the window document context.static void
ensureMouseOut
(com.google.gwt.dom.client.Element element) Triggers a mouse-out event for the given element.static void
ensureMouseOut
(com.google.gwt.event.shared.HasHandlers target) Triggers a mouse-out event for the given target.static void
ensureMouseOver
(com.google.gwt.dom.client.Element element) Triggers a mouse-over event for the given element.static void
ensureStyleSheetIncluded
(String styleSheetLink) Checks the window.document for given style-sheet and includes it if required.static void
ensureVisible
(com.google.gwt.dom.client.Element containerElement, com.google.gwt.dom.client.Element element, int animationTime) Ensures that the given element is visible.static String
Escapes a String so it may be printed as text content or attribute value in a HTML page or an XML file.static void
fireFocusEvent
(com.google.gwt.user.client.ui.Widget widget) Fires a focus event for the given widget.static void
fixFlashZindex
(com.google.gwt.dom.client.Element element) Ensures any embedded flash players are set opaque so UI elements may be placed above them.static com.google.gwt.dom.client.FormElement
generateHiddenForm
(String action, CmsDomUtil.Method method, String target, Map<String, String> values) Generates a form element with hidden input fields.static com.google.gwt.dom.client.FormElement
generateHiddenForm
(String action, CmsDomUtil.Method method, CmsDomUtil.Target target, Map<String, String> values) Generates a form element with hidden input fields.static com.google.gwt.dom.client.Element
Returns the currently focused element.static List<CmsEditableDataJSO>
Gets the edit data for all oc-editable elements in the page.static com.google.gwt.dom.client.Element
getAncestor
(com.google.gwt.dom.client.Element element, String className) Returns the given element or it's closest ancestor with the given class.static com.google.gwt.dom.client.Element
getAncestor
(com.google.gwt.dom.client.Element element, CmsDomUtil.Tag tag) Returns the given element or it's closest ancestor with the given tag name.static com.google.gwt.dom.client.Element
getAncestor
(com.google.gwt.dom.client.Element element, CmsDomUtil.Tag tag, String className) Returns the given element or it's closest ancestor with the given tag and class.static String
getCurrentStyle
(com.google.gwt.dom.client.Element element, CmsDomUtil.Style style) Returns the computed style of the given element.static double
getCurrentStyleFloat
(com.google.gwt.dom.client.Element element, CmsDomUtil.Style style) Returns the computed style of the given element as floating point number.static int
getCurrentStyleInt
(com.google.gwt.dom.client.Element element, CmsDomUtil.Style style) Returns the computed style of the given element as number.static CmsPositionBean
getEditablePosition
(com.google.gwt.dom.client.Element editable) Determines the position of the list collector editable content.static String
getEffectiveBackgroundColor
(com.google.gwt.dom.client.Element element) Utility method to determine the effective background color.static List<com.google.gwt.dom.client.Element>
getElementsByClass
(String className) Returns all elements from the DOM with the given CSS class.static List<com.google.gwt.dom.client.Element>
getElementsByClass
(String className, com.google.gwt.dom.client.Element rootElement) Returns all elements with the given CSS class including the root element.static List<com.google.gwt.dom.client.Element>
getElementsByClass
(String className, CmsDomUtil.Tag tag) Returns all elements from the DOM with the given CSS class and tag name.static List<com.google.gwt.dom.client.Element>
getElementsByClass
(String className, CmsDomUtil.Tag tag, com.google.gwt.dom.client.Element rootElement) Returns all elements with the given CSS class and tag name including the root element.static com.google.gwt.dom.client.Element
getFirstChildWithClass
(com.google.gwt.dom.client.Element element, String className) Returns the first direct child matching the given class name.static com.google.gwt.dom.client.Element
Gets the root <html> element.static int
getIFrameContentHeight
(com.google.gwt.dom.client.Element iframe) Returns the content height of the given iFrame element.static int
getPosition
(com.google.gwt.dom.client.Element e) Returns the element position relative to its siblings.static com.google.gwt.dom.client.Element
getPositioningParent
(com.google.gwt.dom.client.Element child) Returns the next ancestor to the element with an absolute, fixed or relative position.static int
getRelativeX
(int x, com.google.gwt.dom.client.Element target) Gets the horizontal position of the given x-coordinate relative to a given element.static int
getRelativeY
(int y, com.google.gwt.dom.client.Element target) Gets the vertical position of the given y-coordinate relative to a given element.static int
Measures the scroll bar width.static com.google.gwt.core.client.JavaScriptObject
Returns the DOM window object.static String
getZIndex
(com.google.gwt.dom.client.Style style) Returns the Z index from the given style.static boolean
hasBackground
(com.google.gwt.dom.client.Element element) Utility method to determine if the given element has a set background.static boolean
hasBackgroundImage
(com.google.gwt.dom.client.Element element) Utility method to determine if the given element has a set background image.static boolean
hasBorder
(com.google.gwt.dom.client.Element element) Utility method to determine if the given element has a set border.static boolean
Indicates if the given element has a CSS class.static boolean
hasDimension
(com.google.gwt.dom.client.Element element) Returns if the given element has any dimension.static boolean
Checks whether the copy command is supported by the client browser.static boolean
isJavaScriptPresent
(String javascriptLink) Checks whether a given script resource is present within the window context.static void
makeScrollable
(com.google.gwt.dom.client.Element elem) Gives an element the overflow:auto property.static void
makeScrollable
(com.google.gwt.user.client.ui.Widget widget) Gives the element of a widget the overflow:auto property.static String
Message accessor.static String
Message accessor.static List<com.google.gwt.dom.client.Element>
nodeListToList
(com.google.gwt.dom.client.NodeList<com.google.gwt.dom.client.Element> nodelist) Converts a NodeList to a List of elements.static String
open
(CmsDomUtil.Tag tag, CmsDomUtil.AttributeValue... attrs) Generates an opening tag.static void
openWindow
(String url, String name, String features) Opens a new browser window.static com.google.gwt.core.client.JavaScriptObject
Parses the given string into a JSON object.static void
positionElement
(com.google.gwt.dom.client.Element elem, com.google.gwt.dom.client.Element referenceElement, int dx, int dy) Positions an element in the DOM relative to another element.static int
positionElementInside
(com.google.gwt.dom.client.Element element, com.google.gwt.dom.client.Element parent, int currentIndex, int x, int y) Positions an element inside the given parent, reordering the content of the parent and returns the new position index.static com.google.gwt.dom.client.Element
querySelector
(String selector, com.google.gwt.dom.client.Element context) Returns the first element matching the given CSS selector.static com.google.gwt.dom.client.NodeList<com.google.gwt.dom.client.Element>
querySelectorAll
(String selector, com.google.gwt.dom.client.Element context) Returns a list of elements matching the given CSS selector.static void
removeDisablingOverlay
(com.google.gwt.dom.client.Element element) Removes any present overlay from the element and it's children.static com.google.gwt.dom.client.Element
removeScriptTags
(com.google.gwt.dom.client.Element element) Removes all script tags from the given element.static String
removeScriptTags
(String source) Removes all script tags from the given string.static void
resizeAncestor
(com.google.gwt.user.client.ui.Widget parent) CallsI_CmsDescendantResizeHandler.onResizeDescendant()
on the closest resizable ancestor.static void
safeLoadStylesheets
(String[] stylesheets, com.google.gwt.core.client.JavaScriptObject callback) Loads a list of stylesheets and invokes a Javascript callback after everything has been loaded.static void
setAttribute
(com.google.gwt.core.client.JavaScriptObject jso, String key, com.google.gwt.core.client.JavaScriptObject value) Sets an attribute on a Javascript object.static void
setAttribute
(com.google.gwt.core.client.JavaScriptObject jso, String key, String value) Sets an attribute on a Javascript object.static void
setStylesheetText
(String id, String styleText) Sets the stylesheet text for the stylesheet with the given ID.static void
showOverlay
(com.google.gwt.dom.client.Element element, boolean show) Sets a CSS class to show or hide a given overlay.static void
Shows a message that a popup was blocked.static String
Returns the text content to any HTML.updateStyle
(com.google.gwt.dom.client.Style style, Map<String, String> properties) Updates a set of style properties on the given style object, and returns a map with the previous values.static com.google.gwt.user.client.ui.FlowPanel
wrapScrollable
(com.google.gwt.user.client.ui.Widget widget) Wraps a widget in a scrollable FlowPanel.
-
Method Details
-
addDisablingOverlay
Adds an overlay div to the element.- Parameters:
element
- the element
-
addDynamicStyleRule
Adds a CSS style rule to a dynamically inserted style sheet.- Parameters:
rule
- the style rule
-
checkPositionInside
Returns if the given client position is over the given element.Use
-1
for x or y to ignore one ordering orientation.- Parameters:
element
- the elementx
- the client x position, use-1
to ignore x positiony
- the client y position, use-1
to ignore y position- Returns:
true
if the given position is over the given element
-
clearHover
Clears the elements hover state by removing it from the DOM and re-attaching it.- Parameters:
element
- the element
-
clearOpacity
Removes the opacity attribute from the element's inline-style.- Parameters:
element
- the DOM element to manipulate
-
clone
Clones the given element.It creates a new element with the same tag, and sets the class attribute, and sets the innerHTML.
- Parameters:
element
- the element to clone- Returns:
- the cloned element
-
close
Generates a closing tag.- Parameters:
tag
- the tag to use- Returns:
- HTML code
-
copyToClipboard
Copy the text content of the matching element to the clip-board.- Parameters:
selector
- the query selector matching the target element- Returns:
- in case the command was executed successfully
-
createElement
This method will create anElement
for the given HTML. The HTML should have a single root tag, if not, the first tag will be used and all others discarded.Script-tags will be removed.
- Parameters:
html
- the HTML to use for the element- Returns:
- the created element
- Throws:
Exception
- if something goes wrong
-
createFaceHtml
public static String createFaceHtml(String text, String imageClass, com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant align) Convenience method to assemble the HTML to use for a button face.- Parameters:
text
- text the up face text to set, set tonull
to not show anyimageClass
- the up face image class to use, set tonull
to not show anyalign
- the alignment of the text in reference to the image- Returns:
- the HTML
-
createIFrameElement
Creates an iFrame element with the given name attribute.- Parameters:
name
- the name attribute value- Returns:
- the iFrame element
-
enclose
Encloses the given text with the given tag.- Parameters:
tag
- the tag to usetext
- the text to encloseattrs
- the optional tag attributes- Returns:
- HTML code
-
ensureJavaScriptIncluded
Ensures a script tag is present within the window document context.- Parameters:
javascriptLink
- the link to the java script resource
-
ensureJavaScriptIncluded
Ensures a script tag is present within the window document context.- Parameters:
javascriptLink
- the link to the java script resource
-
ensureJavaScriptIncluded
public static void ensureJavaScriptIncluded(String javascriptLink, boolean async, com.google.gwt.core.client.JavaScriptObject callback) Ensures a script tag is present within the window document context.- Parameters:
javascriptLink
- the link to the java script resource
-
ensureMouseOut
Triggers a mouse-out event for the given element.Useful in case something is capturing all events.
- Parameters:
element
- the element to use
-
ensureMouseOver
Triggers a mouse-over event for the given element.Useful in case something is capturing all events.
- Parameters:
element
- the element to use
-
ensureStyleSheetIncluded
Checks the window.document for given style-sheet and includes it if required.- Parameters:
styleSheetLink
- the style-sheet link
-
ensureVisible
public static void ensureVisible(com.google.gwt.dom.client.Element containerElement, com.google.gwt.dom.client.Element element, int animationTime) Ensures that the given element is visible.Assuming the scrollbars are on the container element, and that the element is a child of the container element.
- Parameters:
containerElement
- the container element, has to be parent of the elementelement
- the element to be seenanimationTime
- the animation time for scrolling, use zero for no animation
-
escapeXml
Escapes a String so it may be printed as text content or attribute value in a HTML page or an XML file.This method replaces the following characters in a String:
- < with <
- > with >
- & with &
- " with "
- Parameters:
source
- the string to escape- Returns:
- the escaped string
-
fireFocusEvent
Fires a focus event for the given widget.- Parameters:
widget
- the widget
-
fixFlashZindex
Ensures any embedded flash players are set opaque so UI elements may be placed above them.- Parameters:
element
- the element to work on
-
generateHiddenForm
public static com.google.gwt.dom.client.FormElement generateHiddenForm(String action, CmsDomUtil.Method method, String target, Map<String, String> values) Generates a form element with hidden input fields.- Parameters:
action
- the form actionmethod
- the form methodtarget
- the form targetvalues
- the input values- Returns:
- the generated form element
-
generateHiddenForm
public static com.google.gwt.dom.client.FormElement generateHiddenForm(String action, CmsDomUtil.Method method, CmsDomUtil.Target target, Map<String, String> values) Generates a form element with hidden input fields.- Parameters:
action
- the form actionmethod
- the form methodtarget
- the form targetvalues
- the input values- Returns:
- the generated form element
-
getActiveElement
Returns the currently focused element.- Returns:
- the currently focused element
-
getAllEditableDataForPage
Gets the edit data for all oc-editable elements in the page.- Returns:
- the list of edit data
-
getAncestor
public static com.google.gwt.dom.client.Element getAncestor(com.google.gwt.dom.client.Element element, String className) Returns the given element or it's closest ancestor with the given class.Returns
null
if no appropriate element was found.- Parameters:
element
- the elementclassName
- the class name- Returns:
- the matching element
-
getAncestor
public static com.google.gwt.dom.client.Element getAncestor(com.google.gwt.dom.client.Element element, CmsDomUtil.Tag tag) Returns the given element or it's closest ancestor with the given tag name.Returns
null
if no appropriate element was found.- Parameters:
element
- the elementtag
- the tag name- Returns:
- the matching element
-
getAncestor
public static com.google.gwt.dom.client.Element getAncestor(com.google.gwt.dom.client.Element element, CmsDomUtil.Tag tag, String className) Returns the given element or it's closest ancestor with the given tag and class.Returns
null
if no appropriate element was found.- Parameters:
element
- the elementtag
- the tag nameclassName
- the class name- Returns:
- the matching element
-
getCurrentStyle
public static String getCurrentStyle(com.google.gwt.dom.client.Element element, CmsDomUtil.Style style) Returns the computed style of the given element.- Parameters:
element
- the elementstyle
- the CSS property- Returns:
- the currently computed style
-
getCurrentStyleFloat
public static double getCurrentStyleFloat(com.google.gwt.dom.client.Element element, CmsDomUtil.Style style) Returns the computed style of the given element as floating point number.- Parameters:
element
- the elementstyle
- the CSS property- Returns:
- the currently computed style
-
getCurrentStyleInt
public static int getCurrentStyleInt(com.google.gwt.dom.client.Element element, CmsDomUtil.Style style) Returns the computed style of the given element as number.- Parameters:
element
- the elementstyle
- the CSS property- Returns:
- the currently computed style
-
getEditablePosition
Determines the position of the list collector editable content.- Parameters:
editable
- the editable marker tag- Returns:
- the position
-
getEffectiveBackgroundColor
Utility method to determine the effective background color.- Parameters:
element
- the element- Returns:
- the background color
-
getElementsByClass
Returns all elements from the DOM with the given CSS class.- Parameters:
className
- the class name to look for- Returns:
- the matching elements
-
getElementsByClass
public static List<com.google.gwt.dom.client.Element> getElementsByClass(String className, com.google.gwt.dom.client.Element rootElement) Returns all elements with the given CSS class including the root element.- Parameters:
className
- the class name to look forrootElement
- the root element of the search- Returns:
- the matching elements
-
getElementsByClass
public static List<com.google.gwt.dom.client.Element> getElementsByClass(String className, CmsDomUtil.Tag tag) Returns all elements from the DOM with the given CSS class and tag name.- Parameters:
className
- the class name to look fortag
- the tag- Returns:
- the matching elements
-
getElementsByClass
public static List<com.google.gwt.dom.client.Element> getElementsByClass(String className, CmsDomUtil.Tag tag, com.google.gwt.dom.client.Element rootElement) Returns all elements with the given CSS class and tag name including the root element.- Parameters:
className
- the class name to look fortag
- the tagrootElement
- the root element of the search- Returns:
- the matching elements
-
getFirstChildWithClass
public static com.google.gwt.dom.client.Element getFirstChildWithClass(com.google.gwt.dom.client.Element element, String className) Returns the first direct child matching the given class name.- Parameters:
element
- the parent elementclassName
- the class name to match- Returns:
- the child element
-
getHtmlElement
Gets the root <html> element.- Returns:
- the html element
-
getIFrameContentHeight
Returns the content height of the given iFrame element.- Parameters:
iframe
- the iFrame element- Returns:
- the content height
-
getPosition
Returns the element position relative to its siblings.- Parameters:
e
- the element to get the position for- Returns:
- the position, or
-1
if not found
-
getPositioningParent
public static com.google.gwt.dom.client.Element getPositioningParent(com.google.gwt.dom.client.Element child) Returns the next ancestor to the element with an absolute, fixed or relative position.- Parameters:
child
- the element- Returns:
- the positioning parent element (may be
null
)
-
getRelativeX
Gets the horizontal position of the given x-coordinate relative to a given element.- Parameters:
x
- the coordinate to usetarget
- the element whose coordinate system is to be used- Returns:
- the relative horizontal position
- See Also:
-
MouseEvent.getRelativeX(com.google.gwt.dom.client.Element)
-
getRelativeY
Gets the vertical position of the given y-coordinate relative to a given element.- Parameters:
y
- the coordinate to usetarget
- the element whose coordinate system is to be used- Returns:
- the relative vertical position
- See Also:
-
MouseEvent.getRelativeY(com.google.gwt.dom.client.Element)
-
getScrollbarWidth
Measures the scroll bar width.- Returns:
- the scroll bar width
-
getWindow
Returns the DOM window object.- Returns:
- the DOM window object
-
getZIndex
Returns the Z index from the given style.This is a workaround for a bug with
Style.getZIndex()
which occurs with IE in hosted mode.- Parameters:
style
- the style object from which the Z index property should be fetched- Returns:
- the z index
-
hasBackground
Utility method to determine if the given element has a set background.- Parameters:
element
- the element- Returns:
true
if the element has a background set
-
hasBackgroundImage
Utility method to determine if the given element has a set background image.- Parameters:
element
- the element- Returns:
true
if the element has a background image set
-
hasBorder
Utility method to determine if the given element has a set border.- Parameters:
element
- the element- Returns:
true
if the element has a border
-
hasClass
Indicates if the given element has a CSS class.- Parameters:
className
- the class name to look forelement
- the element- Returns:
true
if the element has the given CSS class
-
hasDimension
Returns if the given element has any dimension.All visible elements should have a dimension.
- Parameters:
element
- the element to test- Returns:
true
if the given element has any dimension
-
isCopyToClipboardSupported
Checks whether the copy command is supported by the client browser.- Returns:
true
if the copy command is supported
-
isJavaScriptPresent
Checks whether a given script resource is present within the window context.- Parameters:
javascriptLink
- the resource URL- Returns:
true
if the script resource is present within the window context
-
makeScrollable
Gives an element the overflow:auto property.- Parameters:
elem
- a DOM element
-
makeScrollable
Gives the element of a widget the overflow:auto property.- Parameters:
widget
- the widget to make scrollable
-
messagePopupBlocked
Message accessor.- Returns:
- the message string
-
messagePopupBlockedTitle
Message accessor.- Returns:
- the message string
-
nodeListToList
public static List<com.google.gwt.dom.client.Element> nodeListToList(com.google.gwt.dom.client.NodeList<com.google.gwt.dom.client.Element> nodelist) Converts a NodeList to a List of elements.- Parameters:
nodelist
- the node list- Returns:
- the list of elements
-
open
Generates an opening tag.- Parameters:
tag
- the tag to useattrs
- the optional tag attributes- Returns:
- HTML code
-
openWindow
Opens a new browser window. The "name" and "features" arguments are specified here.- Parameters:
url
- the URL that the new window will displayname
- the name of the window (e.g. "_blank")features
- the features to be enabled/disabled on this window
-
parseJSON
Parses the given string into a JSON object.- Parameters:
jsonString
- the string to parse- Returns:
- the JSON object
-
positionElement
public static void positionElement(com.google.gwt.dom.client.Element elem, com.google.gwt.dom.client.Element referenceElement, int dx, int dy) Positions an element in the DOM relative to another element.- Parameters:
elem
- the element to positionreferenceElement
- the element relative to which the first element should be positioneddx
- the x offset relative to the reference elementdy
- the y offset relative to the reference element
-
positionElementInside
public static int positionElementInside(com.google.gwt.dom.client.Element element, com.google.gwt.dom.client.Element parent, int currentIndex, int x, int y) Positions an element inside the given parent, reordering the content of the parent and returns the new position index.This is none absolute positioning. Use for drag and drop reordering of drop targets.
Use
-1
for x or y to ignore one ordering orientation.- Parameters:
element
- the child elementparent
- the parent elementcurrentIndex
- the current index position of the element, use -1 if element is not attached to the parent yetx
- the client x position, use-1
to ignore x positiony
- the client y position, use-1
to ignore y position- Returns:
- the new index position
-
querySelector
public static com.google.gwt.dom.client.Element querySelector(String selector, com.google.gwt.dom.client.Element context) Returns the first element matching the given CSS selector.- Parameters:
selector
- the CSS selectorcontext
- the context element, may benull
- Returns:
- the matching element
-
querySelectorAll
public static com.google.gwt.dom.client.NodeList<com.google.gwt.dom.client.Element> querySelectorAll(String selector, com.google.gwt.dom.client.Element context) Returns a list of elements matching the given CSS selector.- Parameters:
selector
- the CSS selectorcontext
- the context element, may benull
- Returns:
- the list of matching elements
-
removeDisablingOverlay
Removes any present overlay from the element and it's children.- Parameters:
element
- the element
-
removeScriptTags
public static com.google.gwt.dom.client.Element removeScriptTags(com.google.gwt.dom.client.Element element) Removes all script tags from the given element.- Parameters:
element
- the element to remove the script tags from- Returns:
- the resulting element
-
removeScriptTags
Removes all script tags from the given string.- Parameters:
source
- the source string- Returns:
- the resulting string
-
resizeAncestor
CallsI_CmsDescendantResizeHandler.onResizeDescendant()
on the closest resizable ancestor.- Parameters:
parent
- the parent widget
-
safeLoadStylesheets
public static void safeLoadStylesheets(String[] stylesheets, com.google.gwt.core.client.JavaScriptObject callback) Loads a list of stylesheets and invokes a Javascript callback after everything has been loaded.- Parameters:
stylesheets
- the array of stylesheet uriscallback
- the callback to call after everything is loaded
-
setAttribute
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject jso, String key, com.google.gwt.core.client.JavaScriptObject value) Sets an attribute on a Javascript object.- Parameters:
jso
- the Javascript objectkey
- the attribute namevalue
- the new attribute value
-
setAttribute
public static void setAttribute(com.google.gwt.core.client.JavaScriptObject jso, String key, String value) Sets an attribute on a Javascript object.- Parameters:
jso
- the Javascript objectkey
- the attribute namevalue
- the new attribute value
-
setStylesheetText
Sets the stylesheet text for the stylesheet with the given ID.If the stylesheet with the id does not already exist, it is created.
- Parameters:
id
- the stylesheet idstyleText
- the stylesheet text
-
showOverlay
Sets a CSS class to show or hide a given overlay. Will not add an overlay to the element.- Parameters:
element
- the parent element of the overlayshow
-true
to show the overlay
-
showPopupBlockerMessage
Shows a message that a popup was blocked. -
stripHtml
Returns the text content to any HTML.- Parameters:
html
- the HTML- Returns:
- the text content
-
updateStyle
public static Map<String,String> updateStyle(com.google.gwt.dom.client.Style style, Map<String, String> properties) Updates a set of style properties on the given style object, and returns a map with the previous values. If a value in the map is null, it is interpreted as clearing the style property with that name.- Parameters:
style
- the style object to updateproperties
- the map of properties to change- Returns:
- the map of previous values of the given properties
-
wrapScrollable
public static com.google.gwt.user.client.ui.FlowPanel wrapScrollable(com.google.gwt.user.client.ui.Widget widget) Wraps a widget in a scrollable FlowPanel.- Parameters:
widget
- the original widget- Returns:
- the wrapped widget
-