Example usage for com.google.gwt.user.client.ui UIObject getElement

List of usage examples for com.google.gwt.user.client.ui UIObject getElement

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui UIObject getElement.

Prototype

public Element getElement() 

Source Link

Document

Gets a handle to the object's underlying DOM element.

Usage

From source file:org.ednovo.gooru.client.mvp.gshelf.ShelfMainView.java

License:Open Source License

private static void correctStyle(final UIObject uiObject) {
    if (uiObject instanceof TreeItem) {
        if (uiObject.getElement() != null) {
            Element element = uiObject.getElement();
            element.getStyle().setPadding(0, Unit.PX);
            element.getStyle().setMarginLeft(0, Unit.PX);
        }/*from w  ww  .  j  a  va2  s . c o m*/
    } else {
        if (uiObject != null && uiObject.getElement() != null
                && uiObject.getElement().getParentElement() != null
                && uiObject.getElement().getParentElement().getParentElement() != null
                && uiObject.getElement().getParentElement().getParentElement().getStyle() != null) {
            Element element = uiObject.getElement().getParentElement().getParentElement();
            element.getStyle().setPadding(0, Unit.PX);
            element.getStyle().setMarginLeft(0, Unit.PX);
        }
    }
}

From source file:org.ednovo.gooru.client.mvp.search.AddResourceContainerView.java

License:Open Source License

private void adjustTreeItemStyle(final UIObject uiObject) {
    if (uiObject instanceof TreeItem) {
        if (uiObject != null && uiObject.getElement() != null) {
            Element element = uiObject.getElement();
            element.getStyle().setPadding(0, Unit.PX);
            element.getStyle().setMarginLeft(0, Unit.PX);
        }//from   w  ww  . ja  v a2s  .  co  m
    } else {
        if (uiObject != null && uiObject.getElement() != null
                && uiObject.getElement().getParentElement() != null
                && uiObject.getElement().getParentElement().getParentElement() != null
                && uiObject.getElement().getParentElement().getParentElement().getStyle() != null) {
            Element element = uiObject.getElement().getParentElement().getParentElement();
            element.getStyle().setPadding(0, Unit.PX);
            element.getStyle().setMarginLeft(0, Unit.PX);
        }
    }

}

From source file:org.ednovo.gooru.client.mvp.shelf.list.ShelfListView.java

License:Open Source License

private static void correctStyle(final UIObject uiObject) {
    if (uiObject instanceof TreeItem) {
        if (uiObject != null && uiObject.getElement() != null) {
            Element element = uiObject.getElement();
            element.getStyle().setPadding(0, Unit.PX);
            element.getStyle().setMarginLeft(0, Unit.PX);
        }//  ww  w . j  a  v  a 2s  .com
    } else {
        if (uiObject != null && uiObject.getElement() != null
                && uiObject.getElement().getParentElement() != null
                && uiObject.getElement().getParentElement().getParentElement() != null
                && uiObject.getElement().getParentElement().getParentElement().getStyle() != null) {
            Element element = uiObject.getElement().getParentElement().getParentElement();
            element.getStyle().setPadding(0, Unit.PX);
            element.getStyle().setMarginLeft(0, Unit.PX);
        }
    }
}

From source file:org.kie.workbench.common.screens.explorer.client.utils.IdHelper.java

License:Apache License

/**
 * Setting ID on gwt UIObjects for selenium tests.
 *
 * @param obj/*from   w  w w . ja  va  2s.  c o  m*/
 * @param prefix
 */
public static void setId(UIObject obj, String prefix) {
    obj.getElement().setId(prefix + Document.get().createUniqueId());
}

From source file:org.kuali.student.common.ui.client.util.Elements.java

License:Educational Community License

/**
 * Causes an element to "fade in" via opacity. Make sure that element to
 * fade is not visible before calling this method. When the callback is
 * invoked with onFadeStart, the element can be set to visible as it is
 * entirely transparent. When onFadeComplete is called, the element will be
 * entirely opaque.//from  w ww  . ja  v a 2s.  c  o  m
 * 
 * @param target
 *            the UIObject to be faded in
 * @param milliseconds
 *            how long the fade effect should take to process
 * @param maxOpacity
 *            final opacity
 * @param callback
 *            the callback to be invoked on fade progress
 */
public static void fadeIn(final UIObject target, final int milliseconds, final int maxOpacity,
        final FadeCallback callback) {
    fadeIn(target.getElement(), milliseconds, maxOpacity, callback);
}

From source file:org.kuali.student.common.ui.client.util.Elements.java

License:Educational Community License

/**
 * Causes an element to "fade out" via opacity. When onFadeComplete is
 * called, the element will be entirely transparent.
 * /*from w  w  w.  j  a v  a2 s . c  om*/
 * @param target
 *            the UIObject to be faded out
 * @param milliseconds
 *            how long the fade effect should take to process
 * @param minOpacity
 *            final opacity
 * @param callback
 *            the callback to be invoked on fade progress
 */
public static void fadeOut(final UIObject target, final int milliseconds, final int minOpacity,
        final FadeCallback callback) {
    fadeOut(target.getElement(), milliseconds, minOpacity, callback);
}

From source file:org.kuali.student.common.ui.client.util.Elements.java

License:Educational Community License

/**
  * Sets a UIObject's opacity//from  ww  w  .j a va  2s  .co m
  * 
  * @param u
  * @param percent
  */
public static void setOpacity(final UIObject u, final int percent) {
    setOpacity(u.getElement(), percent);
}

From source file:org.opencms.gwt.client.util.CmsPositionBean.java

License:Open Source License

/**
 * Collects the position information of the given UI object and returns a position info bean.<p> 
 * //  w w w .  j  a  v  a  2s . c  o m
 * @param uiObject the object to read the position data from
 * 
 * @return the position data
 */
public static CmsPositionBean generatePositionInfo(UIObject uiObject) {

    return generatePositionInfo(uiObject.getElement());
}

From source file:org.openremote.manager.client.widget.AbstractAppPanel.java

License:Open Source License

@Override
public void showRelativeTo(UIObject target) {
    popupPanel.showRelativeTo(target);//from w  w  w .j  a  v a  2 s  .co m
    popupPanel.addAutoHidePartner(target.getElement());
    this.target = target;
}

From source file:org.pentaho.mantle.client.dialogs.scheduling.ScheduleEditor.java

License:Open Source License

private void show(boolean applyToParent, UIObject... objs) {
    for (UIObject obj : objs) {
        Element ele = obj.getElement();
        if (applyToParent) {
            ele = ele.getParentElement();
        }//from   www .j a va2 s.c o m
        ele.getStyle().clearDisplay();
    }
}