當前位置: 首頁>>代碼示例>>Java>>正文


Java UIObject.setHeight方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.ui.UIObject.setHeight方法的典型用法代碼示例。如果您正苦於以下問題:Java UIObject.setHeight方法的具體用法?Java UIObject.setHeight怎麽用?Java UIObject.setHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.ui.UIObject的用法示例。


在下文中一共展示了UIObject.setHeight方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initSize

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
protected void initSize(UIObject widget, String width, String height, String uuid, String parent, String context) {
    if (widget == null) {
        return;
    }
    if (!QAMLUtil.isEmpty(width)) {
        if (!width.startsWith("-")) {
            // Width is not negative
            if (QAMLUtil.isNumber(width)) {
                width = width + QAMLConstants.UNIT;
            }
            widget.setWidth(width);
        }
    }
    if (!QAMLUtil.isEmpty(height)) {
        if (!height.startsWith("-")) {
            // Height is not negative
            if (QAMLUtil.isNumber(height)) {
                height = height + QAMLConstants.UNIT;
            }
            widget.setHeight(height);
        }
    }
    if ("0".equals(width) && "0".equals(height)) {
        widget.setVisible(false);
    }
}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:27,代碼來源:AbstractComponentRenderer.java

示例2: handleHeight

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
private void handleHeight(UIObject uiObject, String value) {
    try {
        // uiObject.setWidth expects a css unit, so if no unit is available, we set it to the default
        // if no unit is specified, uiObject.setWidth() generates invalid css.
        String height = value;
        if (!QAMLUtil.containsUnitIdentifier(height)) {
            height += QAMLUtil.DEFAULT_UNIT;
        }
        uiObject.setHeight(height);
    } catch (Exception e) {
        log("Set Property on height failed", "please check value of height (" + value + ")", true);
    }
}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:14,代碼來源:SetPropertyHandler.java

示例3: addDimension

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public static void addDimension(ComponentGVO vo, UIObject ui, String uuid, String parent) {
    // Test if the component or the object are null
    if (vo != null && ui != null) {

        // The width of the component
        String strVoWidth = vo.getWidth();

        // The height of the component
        String strVoHeight = vo.getHeight();

        // Test if the width is null or the length <= 0
        if (strVoWidth != null && strVoWidth.length() > 0) {

            // Test if the width is negative
            if (strVoWidth.indexOf("-") != -1) {
                ClientApplicationContext.getInstance().log("The width should not be negative:" + strVoWidth);
            } else {
                ui.setWidth(strVoWidth);
            }
        }

        // Test if the height is null or the length <= 0
        if (strVoHeight != null && strVoHeight.length() > 0) {

            // Test if the height is negative
            if (strVoHeight.indexOf("-") != -1) {
                ClientApplicationContext.getInstance().log("The height should not be negative:" + strVoHeight);
            } else {
                ui.setHeight(strVoHeight);
            }
        }
        
        if (strVoWidth != null && strVoHeight != null && strVoWidth.equals("0") && strVoHeight.equals("0")){
            ui.setVisible(false);
        }
    }

}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:39,代碼來源:RendererHelper.java

示例4: applySize

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
private void applySize(UIObject uiObject, Size size) {
    uiObject.setWidth(size.getWidth() + "px");
    uiObject.setHeight(size.getHeight() + "px");
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:5,代碼來源:CanvasViewImpl.java

示例5: addDimension

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public static void addDimension(ComponentGVO vo, UIObject ui, String uuid, String parent) {
    // Test if the component or the object are null
    if (vo != null && ui != null) {

        // The width of the component
        String strVoWidth = vo.getWidth();

        // The height of the component
        String strVoHeight = vo.getHeight();

        // Test if the width is null or the length <= 0
        if (strVoWidth != null && strVoWidth.length() > 0) {

            // Test if the width is negative
            if (strVoWidth.indexOf("-") != -1) {
                ClientApplicationContext.getInstance().log("The width should not be negative:" + strVoWidth);
            } else {
                // Standard Mode (!DOCTYPE):
                // CSS requires most values to have a unit. If such a value doesn�t have a unit it�s ignored, so default pixels
                if (strVoWidth.matches("\\d+")) {
                    strVoWidth += Unit.PX;
                }
                ui.setWidth(strVoWidth);
            }
        }

        // Test if the height is null or the length <= 0
        if (strVoHeight != null && strVoHeight.length() > 0) {

            // Test if the height is negative
            if (strVoHeight.indexOf("-") != -1) {
                ClientApplicationContext.getInstance().log("The height should not be negative:" + strVoHeight);
            } else {
                // Standard Mode (!DOCTYPE):
                // CSS requires most values to have a unit. If such a value doesn�t have a unit it�s ignored, so default pixels
                if (strVoHeight.matches("\\d+")) {
                    strVoHeight += Unit.PX;
                }
                ui.setHeight(strVoHeight);
            }
        }

        if (strVoWidth != null && strVoHeight != null && strVoWidth.equals("0") && strVoHeight.equals("0")){
            ui.setVisible(false);
        }
    }

}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:49,代碼來源:RendererHelper.java


注:本文中的com.google.gwt.user.client.ui.UIObject.setHeight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。