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


Java UIObject.getElement方法代碼示例

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


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

示例1: applyFont

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public static void applyFont(UIObject aWidget, final PublishedFont aFont) {
	Element aElement = aWidget.getElement();
	aElement.getStyle().setProperty("fontFamily", aFont != null ? aFont.getFamily() : "");
	if (aFont != null) {
		aElement.getStyle().setFontSize(aFont.getSize(), Style.Unit.PT);
		if (aFont.isBold())
			aElement.getStyle().setFontWeight(Style.FontWeight.BOLD);
		else
			aElement.getStyle().setFontWeight(Style.FontWeight.NORMAL);
		if (aFont.isItalic())
			aElement.getStyle().setFontStyle(Style.FontStyle.ITALIC);
		else
			aElement.getStyle().setFontStyle(Style.FontStyle.NORMAL);
	} else {
		aElement.getStyle().clearFontSize();
		aElement.getStyle().clearFontWeight();
		aElement.getStyle().clearFontStyle();
	}
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:20,代碼來源:WidgetsUtils.java

示例2: checkReadOnly

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
protected <W extends UIObject & HasReadOnly> void checkReadOnly(W widget, UIObject target, boolean checkElement) {
    // given
    Element widgetElement = widget.getElement();
    Element targetElement = target.getElement();

    // when / then
    widget.setReadOnly(true);
    if(checkElement) {
        assertTrue(targetElement.hasAttribute("disabled"));
        assertTrue(widgetElement.hasClassName(CssName.READ_ONLY));
    }
    assertTrue(widget.isReadOnly());
    widget.setReadOnly(false);
    if(checkElement) {
        assertFalse(targetElement.hasAttribute("disabled"));
        assertFalse(widgetElement.hasClassName(CssName.READ_ONLY));
    }
    assertFalse(widget.isReadOnly());

    widget.setToggleReadOnly(true);
    if(checkElement) {
        assertTrue(widgetElement.hasClassName(CssName.READ_ONLY_TOGGLE));
    }
    assertTrue(widget.isToggleReadOnly());
    widget.setToggleReadOnly(false);
    if(checkElement) {
        assertFalse(widgetElement.hasClassName(CssName.READ_ONLY_TOGGLE));
    }
    assertFalse(widget.isToggleReadOnly());
}
 
開發者ID:GwtMaterialDesign,項目名稱:gwt-material,代碼行數:31,代碼來源:MaterialWidgetTest.java

示例3: applyBackground

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public static void applyBackground(UIObject aWidget, final String aColorString) {
	Element aElement = aWidget.getElement();
	if (aElement != null) {
		if (aColorString != null && !aColorString.isEmpty()) {
			aElement.getStyle().setBackgroundColor(aColorString);
			aElement.getStyle().setBackgroundImage("none");
		} else {
			aElement.getStyle().clearBackgroundColor();
			aElement.getStyle().clearBackgroundImage();
		}
	}
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:13,代碼來源:WidgetsUtils.java

示例4: applyForeground

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public static void applyForeground(UIObject aWidget, final PublishedColor aColor) {
	Element aElement = aWidget.getElement();
	if (aColor != null)
		aElement.getStyle().setColor(aColor.toStyled());
	else
		aElement.getStyle().clearColor();
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:8,代碼來源:WidgetsUtils.java

示例5: getElement

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public static Element getElement(UIObject uiObject) {
	if(uiObject != null) {
		if(uiObject instanceof LabeledTextFieldWidget ) {
			UIObject textBox = ((LabeledTextFieldWidget) uiObject).getTextbox();
			if(textBox != null) {
				return ((LabeledTextFieldWidget) uiObject).getTextbox().getElement();
			}
		} else if(uiObject instanceof LabeledPasswordFieldWidget ) {
			return ((LabeledPasswordFieldWidget) uiObject).getDataComponent().getElement();
		}
		return uiObject.getElement();
	}
	return null;
}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:15,代碼來源:RendererHelper.java

示例6: changeStyle

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
private void changeStyle(ChangeStyleGVO changeStyleGVO, UIObject sender,
		String appId, String windowId, String eventSessionId) {
	List<BuiltInComponentGVO> components = changeStyleGVO.getComponents();
	if (components == null) {
		return;
	}
	
	for (BuiltInComponentGVO builtInComponentGVO : components) {
		List<UIObject> uiObjects = getUIObjects(builtInComponentGVO, appId, windowId, eventSessionId);
		
		if (uiObjects == null) { // Components within a window are not found. Check for SDI.
			uiObjects = checkSDIMode(uiObjects);
		}
		
		if (uiObjects == null) {
			continue;
		}
		
		for (UIObject object : uiObjects) {
               if (object == null) {
               	continue;
               }
			
               if (object instanceof QWindowPanel) {
                   object = ((QWindowPanel)object).getQRootPanel();
               }
               Element element = object.getElement();
               if (element == null) {
               	continue;
               }
               
               List<ChangeStyleActionGVO> actions = changeStyleGVO.getActions();
               if (actions == null) {
               	continue;
               }

               handleChangeStyle(object, element, actions);  
           }
	}
}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:41,代碼來源:ChangeStyleHandler.java

示例7: getElement

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public static Element getElement(UIObject uiObject) {
		if(uiObject != null) {
//			if(uiObject instanceof LabeledTextFieldWidget ) {
//				UIObject textBox = ((LabeledTextFieldWidget) uiObject).getTextbox();
//				if(textBox != null) {
//					return ((LabeledTextFieldWidget) uiObject).getTextbox().getElement();					
//				}
//			} else if(uiObject instanceof LabeledPasswordFieldWidget ) {
//				return ((LabeledPasswordFieldWidget) uiObject).getDataComponent().getElement();
//			} 
			return uiObject.getElement();
		}
		return null;
	}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:15,代碼來源:RendererHelper.java

示例8: handleConditonalStyle

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
protected void handleConditonalStyle(EditableComponentGVO component, UIObject widget, Object value) {
	ConditionalStyleRefGVO conditionalStyleRefGVO = component.getConditionalStyleRef();
	if (conditionalStyleRefGVO == null) {
		return;
	}
	List<UIObject> styleWidgets = ComponentHelper.getStyleWidgets(widget);
	for (UIObject styleWidget : styleWidgets) {
		Element element = styleWidget.getElement();
		handleConditonalStyle(component, element, value);
	}
}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:12,代碼來源:AbstractEditableComponentRenderer.java

示例9: isScrolledToBottom

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public static boolean isScrolledToBottom(UIObject source) {
	Element element = source.getElement();
	int pageClientHeight = element.getOwnerDocument().getClientHeight();
	int clientHeight = element.getClientHeight();
	if (clientHeight > pageClientHeight) {
		int delta = clientHeight - pageClientHeight;
		
		// When scrolling down the absoluteTop will be negative
		int absoluteTop = element.getAbsoluteTop() * -1;
		if (absoluteTop >= delta) {
			return true;
		}
	}
	return false;
}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:16,代碼來源:ComponentHelper.java

示例10: MaterialDropDown

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public MaterialDropDown(UIObject activator) {
    this(activator.getElement());
}
 
開發者ID:GwtMaterialDesign,項目名稱:gwt-material,代碼行數:4,代碼來源:MaterialDropDown.java

示例11: JuiQuery

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public static JuiQuery $(UIObject uiObject) {
    return new JuiQuery(uiObject.getElement());
}
 
開發者ID:BenDol,項目名稱:gwt-jui,代碼行數:4,代碼來源:JuiQuery.java

示例12: Containment

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public Containment(UIObject uiObject) {
    this(uiObject.getElement());
}
 
開發者ID:BenDol,項目名稱:gwt-jui,代碼行數:4,代碼來源:Containment.java

示例13: Handle

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public Handle(UIObject uiObject) {
    this(uiObject.getElement());
}
 
開發者ID:BenDol,項目名稱:gwt-jui,代碼行數:4,代碼來源:Handle.java

示例14: AlsoResize

import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public AlsoResize(UIObject uiObject) {
    this(uiObject.getElement());
}
 
開發者ID:BenDol,項目名稱:gwt-jui,代碼行數:4,代碼來源:AlsoResize.java


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