本文整理匯總了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();
}
}
示例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());
}
示例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();
}
}
}
示例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();
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例10: MaterialDropDown
import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public MaterialDropDown(UIObject activator) {
this(activator.getElement());
}
示例11: JuiQuery
import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public static JuiQuery $(UIObject uiObject) {
return new JuiQuery(uiObject.getElement());
}
示例12: Containment
import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public Containment(UIObject uiObject) {
this(uiObject.getElement());
}
示例13: Handle
import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public Handle(UIObject uiObject) {
this(uiObject.getElement());
}
示例14: AlsoResize
import com.google.gwt.user.client.ui.UIObject; //導入方法依賴的package包/類
public AlsoResize(UIObject uiObject) {
this(uiObject.getElement());
}