Java Code Examples for com.google.gwt.dom.client.Element#setPropertyObject()

The following examples show how to use com.google.gwt.dom.client.Element#setPropertyObject() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BlipMetaDomImpl.java    From swellrt with Apache License 2.0 6 votes vote down vote up
public StringSequence getInlineLocators() {
  if (inlineLocators == null) {
    Element content = getContentContainer().getFirstChildElement();
    if (content != null) {
      inlineLocators = (StringSequence) content.getPropertyObject(INLINE_LOCATOR_PROPERTY);
      if (inlineLocators == null) {
        // Note: getAttribute() of a missing attribute does not return null on
        // all browsers.
        if (content.hasAttribute(INLINE_LOCATOR_ATTRIBUTE)) {
          String serial = content.getAttribute(INLINE_LOCATOR_ATTRIBUTE);
          inlineLocators = StringSequence.create(serial);
        } else {
          inlineLocators = StringSequence.create();
        }
        content.setPropertyObject(INLINE_LOCATOR_PROPERTY, inlineLocators);
      }
    } else {
      // Leave inlineLocators as null, since the document is not here yet.
    }
  }
  return inlineLocators;
}
 
Example 2
Source File: BlipMetaDomImpl.java    From incubator-retired-wave with Apache License 2.0 6 votes vote down vote up
public StringSequence getInlineLocators() {
  if (inlineLocators == null) {
    Element content = getContentContainer().getFirstChildElement();
    if (content != null) {
      inlineLocators = (StringSequence) content.getPropertyObject(INLINE_LOCATOR_PROPERTY);
      if (inlineLocators == null) {
        // Note: getAttribute() of a missing attribute does not return null on
        // all browsers.
        if (content.hasAttribute(INLINE_LOCATOR_ATTRIBUTE)) {
          String serial = content.getAttribute(INLINE_LOCATOR_ATTRIBUTE);
          inlineLocators = StringSequence.create(serial);
        } else {
          inlineLocators = StringSequence.create();
        }
        content.setPropertyObject(INLINE_LOCATOR_PROPERTY, inlineLocators);
      }
    } else {
      // Leave inlineLocators as null, since the document is not here yet.
    }
  }
  return inlineLocators;
}
 
Example 3
Source File: DiffManager.java    From swellrt with Apache License 2.0 5 votes vote down vote up
/**
 * Clear diffs from a document that is being discarded
 * (All it does is clean up backreferences to assist garbage collection)
 */
public void clearFast() {
  for (Element e : elements) {
    // Break circular references in browsers with poor gc
    e.setPropertyObject(DIFF_KEY, null);
  }

  elements.clear();
}
 
Example 4
Source File: DiffManager.java    From incubator-retired-wave with Apache License 2.0 5 votes vote down vote up
/**
 * Clear diffs from a document that is being discarded
 * (All it does is clean up backreferences to assist garbage collection)
 */
public void clearFast() {
  for (Element e : elements) {
    // Break circular references in browsers with poor gc
    e.setPropertyObject(DIFF_KEY, null);
  }

  elements.clear();
}
 
Example 5
Source File: EditorWebDriverUtil.java    From swellrt with Apache License 2.0 4 votes vote down vote up
public static void register(Editor editor, Element container) {
  container.setPropertyObject(EDITOR_WEBDRIVER_PROPERTY, editor);
}
 
Example 6
Source File: EditorWebDriverUtil.java    From incubator-retired-wave with Apache License 2.0 4 votes vote down vote up
public static void register(Editor editor, Element container) {
  container.setPropertyObject(EDITOR_WEBDRIVER_PROPERTY, editor);
}
 
Example 7
Source File: NodeManager.java    From swellrt with Apache License 2.0 2 votes vote down vote up
/**
 * NOTE(danilatos): This is preliminary
 * Mark the element as a transparent node with the given skip level
 * @param element
 * @param skipType
 */
public static void setTransparency(Element element, Skip skipType) {
  element.setPropertyObject(TRANSPARENCY, skipType);
}
 
Example 8
Source File: NodeManager.java    From swellrt with Apache License 2.0 2 votes vote down vote up
/**
 *
 * @param element
 * @param manager
 */
public static void setTransparentBackref(Element element,
    TransparentManager<?> manager) {
  element.setPropertyObject(TRANSPARENT_BACKREF, manager);
}
 
Example 9
Source File: NodeManager.java    From swellrt with Apache License 2.0 2 votes vote down vote up
/**
 * Puts a back reference to the element into the nodelet.
 * @param nodelet The element to store the back reference. Must not be null.
 * @param element The element to reference.
 */
public static void setBackReference(Element nodelet, ContentElement element) {
  nodelet.setPropertyObject(BACKREF_NAME, element);
}
 
Example 10
Source File: NodeManager.java    From incubator-retired-wave with Apache License 2.0 2 votes vote down vote up
/**
 * NOTE(danilatos): This is preliminary
 * Mark the element as a transparent node with the given skip level
 * @param element
 * @param skipType
 */
public static void setTransparency(Element element, Skip skipType) {
  element.setPropertyObject(TRANSPARENCY, skipType);
}
 
Example 11
Source File: NodeManager.java    From incubator-retired-wave with Apache License 2.0 2 votes vote down vote up
/**
 *
 * @param element
 * @param manager
 */
public static void setTransparentBackref(Element element,
    TransparentManager<?> manager) {
  element.setPropertyObject(TRANSPARENT_BACKREF, manager);
}
 
Example 12
Source File: NodeManager.java    From incubator-retired-wave with Apache License 2.0 2 votes vote down vote up
/**
 * Puts a back reference to the element into the nodelet.
 * @param nodelet The element to store the back reference. Must not be null.
 * @param element The element to reference.
 */
public static void setBackReference(Element nodelet, ContentElement element) {
  nodelet.setPropertyObject(BACKREF_NAME, element);
}